Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a doubt regarding a Warning and an Error. The below Script is being run in 2 separate systems, System 1 does not shows the warning or Error, it downloads the page correctly and have No problem, but on System 2, it shows the Warning + Error!!!
Both the Systems operate on Windows 7, System 1 have a 4 Mbps speed but System 2 have 200 kbps speed. Is it related to the internet speed or something??? (but manually the chrome browser is getting the page correctly, No problem in loading the page fully on the same system(System 2).)
The Script I used is below,
use strict; use WWW::Mechanize; use HTML::TreeBuilder; my $search_url = "https://careers-ketchum.icims.com/jobs/search?ss=1&s +earchKeyword=&searchLocation=&searchCategory"; my $mech = WWW::Mechanize->new( autocheck => 1, ssl_opts => {verify_ho +stname => 0} ); print "\nChecking: $search_url ...\n"; eval{ $mech->agent_alias('Mac Safari'); $mech->get($search_url); }; if ($@) { print "Error connecting to URL $search_url. Restart script require +d...\n($@)\n"; exit(1); } my $filename = 'OUTPUT.html'; $mech->save_content( $filename ); exit(0);
The warning + Error I am getting on System 2 (Pls note System 1 is fine in all these cases) is like this,
Checking: https://careers-ketchum.icims.com/jobs/search?ss=1&searchKey +word=&sear chLocation=&searchCategory ... ******************************************************************* Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application. ******************************************************************* at C:/Perl/lib/LWP/Protocol/http.pm line 31. Error connecting to URL https://careers-ketchum.icims.com/jobs/search? +ss=1&searc hKeyword=&searchLocation=&searchCategory. Restart script required... (Error GETing https://careers-ketchum.icims.com/jobs/search?ss=1&searc +hKeyword=& searchLocation=&searchCategory: Can't connect to careers-ketchum.icims +.com:443 a t C:\Users\Jingu\AppData\Local\Temp\dir8CA9.tmp\Save_content_test.pl l +ine 31. )
So I tried a code like this,
use strict; use WWW::Mechanize; use HTML::TreeBuilder; use IO::Socket::SSL qw( SSL_VERIFY_NONE ); my $search_url = "https://careers-ketchum.icims.com/jobs/search?ss=1&s +earchKeyword=&searchLocation=&searchCategory"; my $mech = WWW::Mechanize->new( autocheck => 1, ssl_opts => { SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE, verify_hostname => 0, }); print "\nChecking: $search_url ...\n"; eval{ $mech->agent_alias('Mac Safari'); $mech->get($search_url); }; if ($@) { print "Error connecting to URL $search_url. Restart script require +d...\n($@)\n"; exit(1); } my $filename = 'OUTPUT.html'; $mech->save_content( $filename ); exit(0);
This code gets rid of the SSL warning but it still shows the Same Error like this,
Error connecting to URL https://careers-ketchum.icims.com/jobs/search? +ss=1&searc hKeyword=&searchLocation=&searchCategory. Restart script required... (Error GETing https://careers-ketchum.icims.com/jobs/search?ss=1&searc +hKeyword=& searchLocation=&searchCategory: Can't connect to careers-ketchum.icims +.com:443 a t C:\Users\Jingu\AppData\Local\Temp\dir8CA9.tmp\Save_content_test.pl l +ine 31. )
Means it is still not connecting(Only System 2 have problem, System 1 is okay with the above 2 scripts!). Kindly tell me what could be the problem! i didnt undrstand it!
Thanks to all Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SSL VERIFY NONE ERROR + Error Connecting Warning in a www:mechanize script!
by PerlSufi (Friar) on Jul 03, 2013 at 15:24 UTC | |
by Anonymous Monk on Jul 03, 2013 at 17:44 UTC | |
|
Re: SSL VERIFY NONE ERROR + Error Connecting Warning in a www:mechanize script!
by Happy-the-monk (Canon) on Jul 03, 2013 at 19:12 UTC | |
by Anonymous Monk on Jul 04, 2013 at 06:26 UTC | |
by Happy-the-monk (Canon) on Jul 04, 2013 at 10:15 UTC | |
by Anonymous Monk on Jul 08, 2013 at 06:22 UTC |