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

Okay, I'll try not to get carried away here. I have come against an issue where I cannot POST to an https address without getting the following error (from the response object):
501 (Not Implemented) Protocol scheme 'https' is not supported
here is my code snippet:
use HTTP::Request; use LWP::UserAgent; $url = "https://some_web_site.com my $ua = new LWP::UserAgent; $ua->agent("Dell/0.1 ".$ua->agent); ### some things I was goofing with - didn't do much #$ua->protocols_allowed( ['http','https'] ); #if($ua->is_protocol_supported('https')) #{ print "HTTPS IS SUPPORTED!!!<br>"; } #else { print "HTTPS IS NOT SUPPORTED!!!<br>"; } #if($ua->is_protocol_supported('http')) #{ print "HTTP IS SUPPORTED!!!<br>"; } #else { print "HTTP IS NOT SUPPORTED!!!<br>"; } my $req = HTTP::Request->new('POST', $url); $req->content_type('text/xml'); $req->content("some content here"); my $res = $ua->request($req); if($res->is_success) { print "Ta da....successs!!!"; } else { # this usually returns: "501 'https' not implemented print $res->as_string()."<hr>"; }

Some items of interest are:

  • The request never makes it to the designated url, so this error message must be coming from the originating server.
  • I CAN post to the http address fine
  • I am using perl v5.6.0 on Red-Hat 7.0
    This is an abbreviated version of my situation. I'm trying to spare the lengthy gory details until last resort.
    Thanks in advance.
  • Replies are listed 'Best First'.
    Re: LWP::UserAgent https problems
    by blakem (Monsignor) on Aug 09, 2001 at 01:39 UTC
      Last time I checked, you needed some crypto packages on the local machine to get this to work. Do you have OpenSSL installed? What about Crypt::SSLeay, or Net::SSLeay?

      -Blake

        Yeah, I just read a README.SSL in the libwww-perl distribution that mentioned that.
        Okay, I couldn't avoid it so here's the entire situation: I wrote some custom software to be used by a 3rd party on the west coast. This software basically talks to another e-vendor over https - so I went out to Verisign and bought a x.509 certificate and installed it (to test with). Of course the cert would need to be taken off before I sent the finished computer to the west coast so they could install they're own. Oh, the system I configured for them was Windows2000 server so installing the cert was not difficult. It installed fine with no issues.

        Here's the kicker: I got the system working fine....tested it with the e-vendor...looked good - used the same previous code snippet to POST my stuff. No problems.
        Removed my cert - send the box to the west coast. They placed the box in a DMZ (but opened holes for Port 80 and 443). The software can connect to this e-vendor via http, but get's 501 invalid protocol 'https' when trying to connect to https. Now why did the same box work for me, but not when they put they're own cert on there??? A million dollar question.

        I'm trouble shooting locally on a linux box so I can understand the 'protocol not implemented' here since I have not messed with OPENSSL or any crypt packages yet, but surely it should work on the Windows box - it did before.

        Thanks again for any help.