<div dir="ltr"><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">I need to do a SSO authentication and do a HTTP GET request for a web service.<br>
<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">I get the below response content on doing a basic authentication using LWP.  I am trying to automate the testing of some of the web services. But the basic authentication using Mozilla(browser) REST client works properly and it is giving the expected response.<br>
<br>Do we need to do a different authentication mechanism in LWP for SSO?<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">
<br>"Can't verify SSL peers without knowning which Certificate Authorities to 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></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
<br><br>-------------------------------------------------------------------------------------------<br>my $method = 'GET';<br>my $uri    = '<a href="http://xxxx">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></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"><br></div><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">
<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>