multissl: curl_global_cleanup doesn't restore Curl_ssl as its default (Curl_ssl_multi) #5255
Comments
The documentation says it can only be set once, but I would think it could be set after cleanup, in other words once each time it's uninitialized. @dscho |
Makes sense. I think it should be as easy as adding the lines #ifdef CURL_SSL_MULTI
Curl_ssl = &Curl_ssl_multi;
#endif to Lines 179 to 186 in 9c703ea @davidedec could you test that? |
@dscho thanks for your prompt reply. Thanks again |
Actually, I think those three lines should go into |
Ah! And of course it should call |
Right. Tomorrow I will tell you if it works and pass tests |
If it works can one of you turn it into a PR for review please |
I actually pulled out the computer and am doing precisely that. |
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. This addresses curl#5255 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Phew, that took longer than I hoped for. I'm glad I tried to verify that my patch works, as my initial version (the one modifying @davidedec would you mind testing #5257? |
Just tested #5257 and worked as expected for me |
I noticed that after a
curl_global_cleanup
it's not possible tocurl_global_sslset
andcurl_global_init
again in order to change the ssl backend.This can be achieved in vtls.c by setting back the
Curl_ssl = &Curl_ssl_multi
after theCurl_ssl_cleanup
The idea is to be able to change the backend in this sequence:
Thanks
The text was updated successfully, but these errors were encountered: