Hi Monks,
In my current project, I have to interact with a https site. They have provided digital certificate in both ‘.pfx’ and ‘.pem’ format. I tried to connect using ‘Crypt::SSLeay’ module and getting the following response.
500 Connect failed: connect: Connection refused Connection refused
I tested with setting both HTTPS_CERT_FILE and HTTPS_PKCS12_FILE environment variables.
The following is the code used for testing the same.
#!/usr/bin/perl
use LWP;
use Data::Dumper;
$ENV{HTTPS_CERT_FILE} = '/tmp/34556_cert.pem';
# $ENV{HTTPS_PKCS12_FILE} = '/tmp/34556_pkcs.pfx';
# $ENV{HTTPS_PKCS12_PASSWORD} = '34556';
my $url = 'https://sitename.com’; # Yes, HTTPS!
my $browser = LWP::UserAgent->new;
my $response = $browser->get($url);
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
print "Whee, it worked! I got that ",
$response->content_type, " document!\n";
Any ideas will be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.