diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2018-12-06 17:18:43 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-12-07 11:38:22 +0100 |
commit | 2456152069a8f471c63fb2de07322bdd0c29e533 (patch) | |
tree | d448f6eadcceaf4d191dba3d8730bd85440472bb /lib | |
parent | 4db1874f88a0bfc1233cf9d881e33125c77a09ec (diff) |
curl_global_sslset(): id == -1 is not necessarily an error
It is allowed to call that function with id set to -1, specifying the
backend by the name instead. We should imitate what is done further down
in that function to allow for that.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Closes #3346
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vtls/vtls.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index fc4384b2f..5e75f92e9 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1313,7 +1313,14 @@ CURLsslset curl_global_sslset(curl_sslbackend id, const char *name, *avail = (const curl_ssl_backend **)&available_backends; if(Curl_ssl != &Curl_ssl_multi) - return id == Curl_ssl->info.id ? CURLSSLSET_OK : CURLSSLSET_TOO_LATE; + return id == Curl_ssl->info.id || + (name && strcasecompare(name, Curl_ssl->info.name)) ? + CURLSSLSET_OK : +#if defined(CURL_WITH_MULTI_SSL) + CURLSSLSET_TOO_LATE; +#else + CURLSSLSET_UNKNOWN_BACKEND; +#endif for(i = 0; available_backends[i]; i++) { if(available_backends[i]->info.id == id || |