Hi Monks,
I encountered a LWP::UserAgent problem in Windows, the perl is running version 5.14.2. Running the following code on Ubuntu 12.04 and ReadHat machine both have no problem. Running it on Win7, 64bit encountering issues. Could you please shed some light here.
Appreciate!

#!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; $ENV{HTTPS_DEBUG} = 1; my @requestHeaders = ( 'Content-type' => 'text/json', 'username' => 'xxx', 'password' => 'yyy' ); my $url = "https://ipaddr:443/dir/dir"; my $ua = LWP::UserAgent->new; $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodab +le()); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); my $response = $ua->get($url, @requestHeaders); die "Error $url\n".$response->status_line."\n" unless $response->is_su +ccess; print "Success ".$response->content_type. " document!\n";

Windows dump:
GET https://ipaddr:443/dir/file
Accept-Encoding: gzip, x-gzip, deflate, x-bzip2
User-Agent: libwww-perl/6.02
Content-Type: text/json
Password: yyy
Username: xxx

(no content)
500 Can't connect to ipaddr:443
Content-Type: text/plain
Client-Date: Wed, 06 Jun 2012 04:04:37 GMT
Client-Warning: Internal response

Can't connect to ipaddr:443\n
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror:140773F2:SSL
routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected m essage at C:/Perl64/lib/LWP/Protocol/http.pm line 51.\n Error https://ipaddr:443/dir/file
500 Can't connect to ipaddr:443

Linux dump:
GET https://ipaddr:443/dir/file
Accept-Encoding: gzip, x-gzip, deflate, x-bzip2
User-Agent: libwww-perl/6.02
Content-Type: text/json
Password: yyy
Username: xxx

(no content)
HTTP/1.1 200 OK Connection: close
Date: Wed, 06 Jun 2012 04:40:30 GMT
Server: Apache-Coyote/1.1
Content-Type: text/json
Client-Date: Tue, 05 Jun 2012 23:52:26 GMT
Client-Peer: 10.241.164.103:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/ST=Massachusetts/L=Hopkinton/O=EEE/OU=EEE/CN=FNM00105100389/emailAddress=support@EEE.com Client-SSL-Cert-Subject: /C=US/ST=Massachusetts/O=EEE/OU=EEE/CN=VPlex Web Server:
FNM00105100389/emailAddress=support@EEE.com
Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified
...


In reply to LWP::UserAgent failed to function on Win7 by Ziliang

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.