Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Okay, while I may not be able to give you a complete solution with tested code, I should be able to help you out, having worked on a similar project previously.

The CONNECT method which you are receiving from HTTP clients is documented in RFC2616, as the means by which SSL connections are tunneled through HTTP connections. This method is sent by a HTTP client to a proxy server, followed by the destination host and destination port number - For example:

CONNECT ssl.webserver.com:443 HTTP/1.0

At this point, the HTTP proxy should initiate a connection to the designated port on the destination host and, if successful, return a 200 HTTP success code. The secure communication can then take place over the established connection.

With regard to making all this happen in your code, there is a patch available for the HTTP::Daemon module within the IO::Socket::SSL module which changes the inheritance of HTTP::Daemon to make use of IO::Socket::SSL in place of IO::Socket. Also too, if you have no luck with this, there are a couple of other patches for HTTP::Daemon which I can seen that are designed to achieve your goal and can also post these if required.

From IO-Socket-SSL-0.81\diffs\libwww-perl\HTTP_Daemon.pm.diff ...

*** /usr/local/perl5.005_03/lib/site_perl/5.005/HTTP/Daemon.pm.orig + Wed Jun 9 19:41:53 1999 --- /usr/local/perl5.005_03/lib/site_perl/5.005/HTTP/Daemon.pm Wed +Jun 9 19:42:43 1999 *************** *** 63,69 **** $VERSION = sprintf("%d.%02d", q$Revision: 1.21 $ =~ /(\d+)\.(\d+)/); use IO::Socket (); ! @ISA=qw(IO::Socket::INET); $PROTO = "HTTP/1.1"; --- 63,71 ---- $VERSION = sprintf("%d.%02d", q$Revision: 1.21 $ =~ /(\d+)\.(\d+)/); use IO::Socket (); ! use IO::Socket::SSL; ! #@ISA=qw(IO::Socket::INET); ! @ISA=qw(IO::Socket::SSL); $PROTO = "HTTP/1.1"; *************** *** 156,162 **** use vars qw(@ISA $DEBUG); use IO::Socket (); ! @ISA=qw(IO::Socket::INET); *DEBUG = \$HTTP::Daemon::DEBUG; use HTTP::Request (); --- 158,165 ---- use vars qw(@ISA $DEBUG); use IO::Socket (); ! #@ISA=qw(IO::Socket::INET); ! @ISA=qw(IO::Socket::SSL); *DEBUG = \$HTTP::Daemon::DEBUG; use HTTP::Request ();

Also see the demo file from the IO::Socket::SSL distribution, IO-Socket-SSL-0.81\demo\daemon.pl, which makes use of HTTP::Daemon in this fashion.

Good luck!

 


In reply to Re: HTTP::Daemon and SSL by rob_au
in thread HTTP::Daemon and SSL by steves

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (13)
    As of 2014-12-18 16:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (58 votes), past polls