Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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:


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\ ...

*** /usr/local/perl5.005_03/lib/site_perl/5.005/HTTP/ + Wed Jun 9 19:41:53 1999 --- /usr/local/perl5.005_03/lib/site_perl/5.005/HTTP/ 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\, 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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2022-05-25 14:31 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (90 votes). Check out past polls.