Re: How to ensure I'm doing lwp with https correctly?



On Jun 23, 4:22 pm, "comp.llang.perl.moderated" <c...@blv-
sam-01.ca.boeing.com> wrote:
On Jun 23, 11:29 am, PugetSoundSyl...@xxxxxxxxx wrote:



I'm usingLWPfor programatic access to a website.  I'm using https,
and have installed Crypt::SSLeay (hopefully correctly).

What I'd like to do is make sure that my https access is actually
correctly set up, and that I am accessing everything securely.  Any
ideas on how I can double-check that everything is happening
correctly?  Or is there something I can use to audit my connection?
If I didn't do the Crypt::SSLeay install correctly, would https access
just not work, or would it just default to http?

If Crypt::SSLeay installed successfully
and passed its test suite, you can be
reasonably assured that SSL transactions
occur. You can confirm actual details of the exchange by setting:

    $ENV{HTTPS_DEBUG} = 1

before initiating the connection. See:
perldoc Crypt::SSLeay.

Also, if usingPerl'sLWPmodule, you
can add:

    useLWP::Debug qw/+/

for other details of the exchange>
See perldocLWP::Debug for less
verbose settings.

Here's an example with HTTPS_DEBUG andLWP::Debug set:

SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A

LWP::UserAgent::new: ()
HTTP::Cookies::add_cookie_header: Checking ... for cookies

LWP::UserAgent::send_request: GET https://....LWP::UserAgent::_need_proxy: Not proxied
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A

--
Charles DeRykus

Thanks Charles - your debug hints were very helpful. It looks like
the certificate isn't even checked when doing https UNLESS you have
the HTTPS_CA_DIR environment variable set. Then it checks (and in my
case it's failing with a bad certificate error as below)

LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://xxxxxxxxxx.org/api/login.php?name=xxxxxx&pass=xxxxxx
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL3 alert write:fatal:unknown CA
SSL_connect:error in SSLv3 read server certificate B
SSL_connect:error in SSLv3 read server certificate B
SSL_connect:before/connect initialization
SSL_connect:SSLv3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL3 alert write:fatal:bad certificate
SSL_connect:error in SSLv3 read server certificate B
SSL_connect:before/connect initialization
SSL_connect:SSLv2 write client hello A
SSL_connect:error in SSLv2 read server hello A
LWP::UserAgent::request: Simple response: Internal Server Error
Error: 500 SSL negotiation failed:

Now I'm trying to fill the the gaps in my understanding of
certificates, which are pretty gaping.

Thanks again for your help.

Sylvia




.



Relevant Pages

  • OpenVPN on FC4 - client and server cannot ping each other
    ... I could connect from the client to the server but could not ping. ... Fri Mar 3 10:28:50 2006 Initialization Sequence Completed ...
    (Fedora)
  • RE: Client based Certificates
    ... | a server certificate why would you have to go and buy ... certificate is to security context like a user account. ...
    (microsoft.public.inetserver.iis.security)
  • Re: SSL Query
    ... both the client and server in situation ... Server will have Server Certificate and Client ... public key and Client will encrypt a message using Server's public key. ...
    (microsoft.public.security)
  • Re: NPS RADIUS with Cisco wlc
    ... Server Status Enabled ... PEAP-MS-CHAP v2 does require a server certificate on the NPS server. ... Foundation Network Companion Guide: Deploying 802.1X Authenticated Wireless ...
    (microsoft.public.internet.radius)
  • RE: 802.1X configuration for IAS and Cisco WLC 4402
    ... these docs are describing several configurations and when you start ... addition to the server authenticating the client/user, ... server must have a server certificate that meets the minimum server ... client computers must be configured to ...
    (microsoft.public.internet.radius)