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
    Hi there,
    UPDATE:Maybe try using HTTP Live Headers on firefox to see what exactly it is doing when you navigate to there? I would also consider using WWW::Mechanize::Firefox if you can't get further. It may be a javascript related issue - which plain WWW::Mechanize doesn't always deal with very well

      Thank you for your Effort, but I think its not a JavaScript related Issue :)

      Please see the Question and the log I pasted there. Everything I have copied in the question.

      My Question is, how Can 2 systems behave different in same scenarios?

      I expect a more convincing and technical answer for my Question.

      Thank You!

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

    Can't seem to find a working crystal ball these days, so:

    • What's the main difference between systems one and two?
    • You name something like an uplink speed. Is that a matter of hardware restrictions?
    • Are the two hosts...
      • set up alike?
      • in the same location?
      • using the same network router?
      • in the same network segment using the same network switch?
      • set up to use some kind of web or tcp service proxy?
      • using the same set of firewalls using the same set of fw rules for both hosts?
      • what else...?

    Cheers, Sören

    (hooked on the Perl Programming language)

      Mentioned is the data download speed.

      both the systems on different locations & different service providers. No proxy. Both are firewall disabled!

        both the systems on different locations & different service providers. No proxy. Both are firewall disabled!

        • What's the main difference between systems one and two?
        • You name something like an uplink speed. Is that a matter of hardware restrictions?
        • Are the two hosts...
          • set up alike?
          • in the same location?
          • using the same network router?
          • in the same network segment using the same network switch?
          • set up to use some kind of web or tcp service proxy?
          • using the same set of firewalls using the same set of fw rules for both hosts?
          • what else...?

        If your Perl programme is using the same perl executable, the same set of modules and generally the same environment in both locations, then there are probably no issues related to Perl here. That explains the lack of interest of the Monks.

        Issues may still be one of the following:

        1. The network on your second site contains some firewall or proxy at your internet provider's site.
        2. There may be some hidden proxy setting somewhere in the guts of your windows network configuration.
        3. Both 1) and 2).

        Depending of (no?) time and material available, I'd suggest to either

        • ask your internet provider to tell you what you might be doing wrong.
        • swap the machines and test.
          The result should be quite promising to tell us what's up.
        • or better set up a copy of the machine that's working fine, put it in place of the one causing trouble. See what happens:
          • If that one works, compare differences in the set-up.
          • If it doesn't, start asking your internet provider.

        Cheers, Sören

        (hooked on the Perl Programming language)