Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have a background in python but I am new at working with perl. Any help would be appreciated! I have been passed a piece of code to essentially go into the website: Service Now and pull out records in a key: value format by interacting with JSON. A colleague of mine has identical access to me and he is able to run everything fine. We both use the same network location of Perl 5.12.2 as well. He will get the desired output, but I will not. The only difference I could think of is that he is running windows XP whereas I am running windows 7. Is there any known issue with running perl 5.12.2, windows 7 and connecting to https websites? I have included the modules we are using below (and some we tried), but please let me know and I will post the full code if you are interested in this problem.

use strict; use warnings; use JSON; use LWP::UserAgent; use HTTP::Request::Common; #use LWP::Protocol::https; #use Net::SSL (); use URI::Escape; use Term::ReadKey; use Data::Dumper; #this is my error message 500 Can't connect to xxxxxx.service-now.com:443 (An invalid argument w +as supplied.)

Replies are listed 'Best First'.
Re: Perl issue with Windows 7 vs XP
by kennethk (Abbot) on Jul 24, 2013 at 18:11 UTC
    By my read, this is probably a module install issue. From the LWP::UserAgent documentation:
    The libwww-perl core no longer bundles protocol plugins for SSL. You will need to install LWP::Protocol::https separately to enable support for processing https-URLs.
    Which essentially means you need to install Crypt::SSLeay on your machine to deal with encrypt/decrypt.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      Hello Kenneth, thank you very much for your quick reply. I will most definitely take your advice and explore your route of installing Crypt::SSLeay. I have tried using LWP::Protocol::https, but it did not work and so I have commented it out in the above section. Could you help me understand what went wrong between the Windows XP and 7 systems, and as to why installing Crypt::SSLeay would be a viable solution?

        The issue is that LWP::UserAgent fails quietly on https requests when you don't have the necessary modules installed. I got bit by it a few years ago. LWP::Protocol::https is not actually a module, but rather an installation construct for the modules required for https access. Also make sure you explicitly include the https protocol in your URL.

        If you are using ActiveState Perl, PPM should give you an easy method to quickly check if you've installed the LWP::Protocol::https package.


        #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.