in reply to HTTP Request and Threads

I suspect the SSL library. Everything else should be Pure Perl.

I think there are two classes that Net::HTTPS can used for SSL; using the other might help?

Replies are listed 'Best First'.
Re^2: HTTP Request and Threads
by Corion (Patriarch) on Sep 13, 2018 at 11:00 UTC

    That's a good idea!

    I think that LWP::UserAgent will only load the SSL libraries once it encounters an https URL. To be really sure, you can try to load LWP::UserAgent only from within each thread. This has other drawbacks, but at least for diagnosis, maybe it helps:

    #use LWP::UserAgent; # don't load this in the outside program my $a = threads->create(sub () { require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->ssl_opts(verify_hostname => 0, SSL_verify_mode => 0x00); };

    Thinking more about this, I'm less confident that this approach changes much, at least if the C part of the ssl library still only gets initialized once, but as it's a small change, I think it's worth a try.

      Thanks for the response. Loading LWP::UserAgent from within the thread unfortunately doesn't help. But from your comment, I did try using an http URI and that seems to work just fine. So at least I think suspecting SSL library seems to be the right way to turn!