Craig Idler <[EMAIL PROTECTED]> writes:

> Hi -
> 
>  I would like to use the OpenSSL library with an application to send
> http method requests to a ssl enabled web server. In addition, I must
> be able to interact with the server to provide user:password
> information.
> 
>  Has someone done something like this in the past? It seems an ssl
> enabled
>  telnet program could do this. It's so easy to use basic telnet talking
> to port
>  80, but using something that communicates with port 443 is a different
> story.
>  If someone could just point me to a tool they actually have see do this
> I'd
>   much appreciate it.

With Net::SSLeay perl module you would do this like this

  #!/usr/bin/perl
  use Net::SSLeay  qw(get_https make_headers);
  use MIME::Base64;
  
  ($user, $pass, $site, $port, $path) = @ARGV;
  die "Usage: ./get_authenticated_page.pl user pass www.bacus.com 443 /\n"
    unless $path;
  
  ($page, $result, %headers) =
    get_https($site, $port, $path,
              make_headers('Authorization' =>
                           'Basic ' . MIME::Base64::encode("$user:$pass"))
              );

  print "Result was `$result'\n";
  foreach $h (sort keys %headers) {
      print "Header `$h'\tvalue `$headers{$h}'\n";
  }
  print $page;

--Sampo

> 
>  My platform is solaris.
> 
> Thanks,
> Craig
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to