<p dir="ltr">The hint is present in the output - where it says unsupported auth type, NTLM.<br>
That's not "basic" auth, that's a proprietary Microsoft method.<br>
Searching metacpan for ntlm brings up at least three modules that look like they handle it. Look into those further?</p>
<div class="gmail_quote">On 23/05/2014 8:09 pm, "Mithun Radhakrishnan" <<a href="mailto:mithunr2003@gmail.com">mithunr2003@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Thanks Jarrod and Toby for your comments.<br>

</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br>I installed Mozilla::CA module from cpan and that error went away. But then I get below authentication error when I ran the same script with same credentials.<br>

<br>HTTP/1.1 401 Unauthorized<br>Date: Fri, 23 May 2014 09:03:40 GMT<br>Server: Microsoft-IIS/7.5<br>WWW-Authenticate: Negotiate<br>WWW-Authenticate: NTLM<br>Content-Length: 1293<br>Content-Type: text/html<br>Client-Date: Fri, 23 May 2014 09:03:40 GMT<br>


Client-Peer: <a href="http://173.38.9.38:443" target="_blank">173.38.9.38:443</a><br>Client-Response-Num: 1<br>Client-SSL-Cert-Issuer: /O=Company Systems/CN=Company SSCA2<br>Client-SSL-Cert-Subject: /C=US/ST=California/L=San Jose/O=Company Technology, Inc./CN=<a href="http://server.domain.com" target="_blank">server.domain.com</a><br>


Client-SSL-Cipher: RC4-SHA<br>Client-SSL-Socket-Class: IO::Socket::SSL<br>Client-Warning: Unsupported authentication scheme 'ntlm'<br>Title: 401 - Unauthorized: Access is denied due to invalid credentials.<br></div>


<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">URL that I am using is not available in internet. It is an intranet one.  When I use the same URL from browser, it redirects to a SSL server and then prompts for password and once authenticated it redirects to the URL which I requested actually and gives me the proper XML response.<br>

<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">I don't know how to automate these kind of  authentication mechanism. Can you suggest some other way of authentication in LWP<br>

</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Regards<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">


Mithun<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 2:16 PM, Toby Wintermute <span dir="ltr"><<a href="mailto:tjc@wintrmute.net" target="_blank">tjc@wintrmute.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You've blanked out the actual URL you're trying to GET, so we can't<br>
check.. but are you sure that it's not redirecting to an HTTPS URL,<br>
and thus triggering the SSL-related comments from LWP?<br>
<br>
I don't suppose you've tried following the hints given to you by LWP,<br>
that you quoted in your post?<br>
ie. Either installing the Mozilla CA package, or pointing to an<br>
existing CA package, or disabling CA verification altogether.<br>
<div><div><br>
On 23 May 2014 00:09, Mithun Radhakrishnan <<a href="mailto:mithunr2003@gmail.com" target="_blank">mithunr2003@gmail.com</a>> wrote:<br>
><br>
> I need to do a SSO authentication and do a HTTP GET request for a web<br>
> service.<br>
><br>
> I get the below response content on doing a basic authentication using LWP.<br>
> I am trying to automate the testing of some of the web services. But the<br>
> basic authentication using Mozilla(browser) REST client works properly and<br>
> it is giving the expected response.<br>
><br>
> Do we need to do a different authentication mechanism in LWP for SSO?<br>
><br>
><br>
> "Can't verify SSL peers without knowning which Certificate Authorities to<br>
> trust<br>
><br>
> This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE<br>
> envirionment variable or by installing the Mozilla::CA module.<br>
><br>
> To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME<br>
> envirionment variable to 0.  If you do this you can't be sure that you<br>
> communicate with the expected peer.<br>
> "<br>
><br>
><br>
> -------------------------------------------------------------------------------------------<br>
> my $method = 'GET';<br>
> my $uri    = '<a href="http://xxxx" target="_blank">http://xxxx</a>';<br>
> my $username = 'xxx';<br>
> my $password = 'xxxx';<br>
><br>
> my $cookie_location = "/tmp/cookie";    # This must be read/write<br>
> my $ua = LWP::UserAgent->new(keep_alive => 1);<br>
> $ua->default_header( 'Accept' => '*/*' );<br>
> $ua->cookie_jar(<br>
>     {<br>
>         file           => $cookie_location,<br>
>         autosave       => 1,<br>
>         ignore_discard => 1<br>
>     }<br>
> );<br>
><br>
> my $request = HTTP::Request->new( $method, $uri );<br>
> $request->authorization_basic( $username, $password );<br>
> my $response = $ua->request($request);<br>
><br>
> ---------------------------------------------------------------------------------<br>
><br>
><br>
> Regards<br>
> Mithun<br>
><br>
</div></div><div>> _______________________________________________<br>
> Melbourne-pm mailing list<br>
> <a href="mailto:Melbourne-pm@pm.org" target="_blank">Melbourne-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/melbourne-pm" target="_blank">http://mail.pm.org/mailman/listinfo/melbourne-pm</a><br>
<br>
<br>
<br>
</div><span><font color="#888888">--<br>
Turning and turning in the widening gyre<br>
The falcon cannot hear the falconer<br>
Things fall apart; the center cannot hold<br>
Mere anarchy is loosed upon the world<br>
</font></span><div><div>_______________________________________________<br>
Melbourne-pm mailing list<br>
<a href="mailto:Melbourne-pm@pm.org" target="_blank">Melbourne-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/melbourne-pm" target="_blank">http://mail.pm.org/mailman/listinfo/melbourne-pm</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div>