Nir has asked for the wisdom of the Perl Monks concerning the following question:

Problem Statement : To successfully visit webpages through a proxy which accepts kerberos tickets using LWP
I have to visit a URL say www.perlmonks.org through a proxy.
Now the proxy authentication has to be done
through a Kerberos ticket.
I keep seeing the following error :

LWP::Authen::Negotiate::authenticate: authenticate() version 0.08 call +ed LWP::Authen::Negotiate::authenticate: target hostname www.perlmonks.or +g LWP::Authen::Negotiate::authenticate: GSSAPI servicename HTTP@www.chas +e.com LWP::Authen::Negotiate::authenticate: Unspecified GSS failure. Minor +code may provide more information LWP::Authen::Negotiate::authenticate: Server not found in Kerberos dat +abase

Following is the code :

use LWP::UserAgent; use LWP::Authen::Negotiate; use LWP::Debug qw(+); my $kut1Password = "password"; my $kut1User = "u1"; my $kut1Domain = "testdomain.com"; my $kut1KerbUser = "$kut1User\@$kut1Domain"; my $kut1Url = "http://www.perlmonks.org"; `echo $kut1Password | kinit $kut1KerbUser`; print (`klist`); my $kut1LwpAgent = LWP::UserAgent->new(keep_alive => 1); push @{$kut1LwpAgent->requests_redirectable}, 'POST'; $ENV{HTTP_PROXY} = "http://<proxy-ip>:<proxy-port>"; print ("PROXY IS " .$kut1LwpAgent->env_proxy."\n"); my $kut1LwpResponse = $kut1LwpAgent->get( $kut1Url ) ; print ("Response is :". $kut1LwpResponse->headers()->as_string); print(`klist`);

In curl , I can achieve this by doing the following after executing a system command for kinit -

"curl --insecure --verbose --proxy-negotiate --proxy-user : --proxy <p +roxy-ip>:<proxy-port> --url http://www.perlmonks.org"