Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: HTTP Request and Threads

by ikegami (Patriarch)
on Sep 13, 2018 at 10:50 UTC ( [id://1222277]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2024-04-18 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found