Subject: | Old Bug, Revisited: Peer certificate not verified |
Date: | Tue, 14 Sep 2010 19:50:24 -0400 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | Steven Kneizys <skneizys [...] figsolutions.com> |
I am using LWP with https protocol. The message "Peer certificate not
verified" appears for me even with the patch from 2003 below. However, with
a little tweak, the intent of the original bug fix can be extended to cover
Net::SSLeay ... works for me anyway. With Net::SSLeay configured to do peer
verification and a successful verification the message is turned off
analogous to Crypt::SSLeay.
The original code in LWP/Protocol/https.pm is:
if(! eval { $sock->get_peer_verify }) {
$res->header("Client-SSL-Warning" => "Peer certificate not verified");
}
Revised code:
if ((! eval { $sock->get_peer_verify }) && (! eval
{Net::SSLeay::get_verify_mode($sock)})) {
$res->header("Client-SSL-Warning" => "Peer certificate not verified");
}
Original fix:
Re: PATCH: Peer certificate not verified for https Crypt::SSLeay
Gisle Aas
Wed, 15 Oct 2003 03:37:04 -0700
Another year old patch eventually applied.
Regards,
Gisle
Joshua Chamas <[EMAIL PROTECTED]> writes:
Show quoted text
> Hey,
>
> Here is a patch against libwww-perl-5.64 that turns off the
> "Client-SSL-Warning" => "Peer certificate not verified"
> when Crypt::SSLeay has been configured to do peer certificate
> verification. By wrapping the call in an eval {}, this patch
> should also be compatible with other SSL implementations that
> do not support this sock->get_peer_verify API.
>
> [EMAIL PROTECTED] libwww-perl-5.64]# diff -u lib/LWP/Protocol/https.pm.old
Show quoted text> lib/LWP/Protocol/https.pm
> --- lib/LWP/Protocol/https.pm.old Fri Nov 16 18:10:28 2001
> +++ lib/LWP/Protocol/https.pm Mon Mar 18 12:38:37 2002
> @@ -34,7 +34,9 @@
> $res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
> $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
> }
> - $res->header("Client-SSL-Warning" => "Peer certificate not
verified");
Show quoted text> + if(! eval { $sock->get_peer_verify }) {
> + $res->header("Client-SSL-Warning" => "Peer certificate not
verified");
Show quoted text> + }
> }
>
> Thanks,
>
> Josh
One thing I notices is there is a LWP/Protocol/https10.pm that is also
installed on my system and it does not have this conditional in it, but
perhaps it should.
Thanks,
Steve...
--
Steve Kneizys
Senior Business Process Engineer
Ferrilli Information Group
Voice: (610) 256-1396
web: http://www.figsolutions.com/
For Emergency Service (888)864-3282