cURL / Mailing Lists / curl-library / Single Mail


HTTP > HTTPS redirect with curl_global_init(CURL_GLOBAL_NOTHING) crashes

From: Richard Gray <>
Date: Tue, 28 Jun 2016 18:13:19 -0400

Yeah, I know, don't do that!

However, I am curious as to why libcurl doesn't just refuse to attempt the
operation instead of crashing in curl_multi_perform().

I got into this because up till now, the application has only been doing
simple HTTP. I recently updated to a build which had SSL support
(libcurl/7.47.0 WinSSL WinIDN) and I hit a device which redirected from HTTP
to HTTPS. So I hadn't really configured for HTTPS - I was just starting to
allow redirects to be followed.

I know that an automatic curl_global_init() happens on the first
curl_easy_setopt() if one has not previously called curl_global_init(). Does
SSL auto-initialize late too if not done via curl_global_init()?? (Our
program has already gone multi-threaded at this point.) I don't see anything
in the documentation pages for curl_global_init() or libcurl that suggest a
danger from late SSL auto-initialization or not explicitly initializing. Or
could this be a legitimate error condition that should be caught?

I see that, somehow, I've also been skating without the CURL_GLOBAL_WIN32 bit.
  Hasn't hurt me (yet!), but I'm now using CURL_GLOBAL_DEFAULT.


List admin:
Received on 2016-06-29