mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05:00
multi-ssl: reset the SSL backend on Curl_global_cleanup()
When cURL is compiled with support for multiple SSL backends, it is possible to configure an SSL backend via `curl_global_sslset()`, but only *before* `curl_global_init()` was called. If another SSL backend should be used after that, a user might be tempted to call `curl_global_cleanup()` to start over. However, we did not foresee that use case and forgot to reset the SSL backend in that cleanup. Let's allow that use case. Fixes #5255 Closes #5257 Reported-by: davidedec on github Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
369ce38ac1
commit
ff7a3107ed
@ -174,6 +174,9 @@ int Curl_ssl_init(void)
|
|||||||
return Curl_ssl->init();
|
return Curl_ssl->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CURL_WITH_MULTI_SSL)
|
||||||
|
static const struct Curl_ssl Curl_ssl_multi;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Global cleanup */
|
/* Global cleanup */
|
||||||
void Curl_ssl_cleanup(void)
|
void Curl_ssl_cleanup(void)
|
||||||
@ -181,6 +184,9 @@ void Curl_ssl_cleanup(void)
|
|||||||
if(init_ssl) {
|
if(init_ssl) {
|
||||||
/* only cleanup if we did a previous init */
|
/* only cleanup if we did a previous init */
|
||||||
Curl_ssl->cleanup();
|
Curl_ssl->cleanup();
|
||||||
|
#if defined(CURL_WITH_MULTI_SSL)
|
||||||
|
Curl_ssl = &Curl_ssl_multi;
|
||||||
|
#endif
|
||||||
init_ssl = FALSE;
|
init_ssl = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user