Problems with HTTPS and LWP and Perl

I am attempting to use LWP in perl to connect to HTTPS sites. Everytime I attempt it I receive

$ lwp-request -x https://www.paypal.com
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://www.paypal.com
LWP::UserAgent:: needproxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
500 Can't connect to www.paypal.com:443 (Invalid argument)

I get this regardless of the site I attempt to connect to. I have already installed p5-crypt-ssleay. When I run the command again, I still get the same error.

I have attempted to google this error all over, and I can't get an answer. Any help?

Macbook Pro, Mac OS X (10.5.2)

Posted on Apr 14, 2008 5:28 PM

Reply
2 replies

Apr 22, 2008 8:49 PM in response to logicalgambit

Basically, Leopard doesn't come with Crypt::SSLeay, so you can't use HTTPS until you install it. There are a few steps involved in doing getting things running:

1. You'll need to build Crypt::SSLeay, so install XCode from your Leopard DVD.
2. Download Crypt::SSLeay from CPAN -- http://search.cpan.org/~dland/Crypt-SSLeay-0.57/SSLeay.pm
3. Copy it into a temp/downloads directory
4. Open a terminal and switch into the directory where you put the file
5. Untar/zip it like this tar -fxz Crypt-SSLeay-0.57.tar.gz
(your filename might differ here depending which version you get)
6. Switch into the Crypt-SSLeay-0.57 directory
7. Run the following commands, accepting any defaults along the way
i. perl Makefile.PL
ii. make
iii. make test
iv. sudo make install

You have to run the finally "make install" command using sudo because the installer needs to create a several directories in /System and /Library, and typical user accounts lack the required permissions.

Anyway, after you run all that, it should work. I just tried it out and lwp-request -x https://www.paypal.com runs perfectly fine.

If you don't feel like going through all the trouble of installing XCode and then downloading and building Crypt::SSLeay, you could always use curl ($ curl https://www.paypal.com/), or just make a system call from within Perl to have curl take care of the HTTPS for you.

Cheers,

/hsy

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problems with HTTPS and LWP and Perl

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.