I think the best thing to do here would be to:
The following modules all allow you to easily construct an HTTPS server:
use HTTP::Daemon::SSL; use HTTP::Status; # Make sure you have a certs/ directory with "server-cert.pem" # and "server-key.pem" in it before running this! my $d = HTTP::Daemon::SSL->new || die; print "Please contact me at: <URL:", $d->url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET' and $r->url->path eq "/xyzzy") { # remember, this is *not* recommened practice :-) $c->send_file_response("/etc/passwd"); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }
use Net::Daemon::SSL; package MyDaemon; @MyDaemon::ISA = qw (Net::Daemon::SSL); sub Run { my $this = shift; my $buffer; $this->{socket}->print ( "vasja was here\n" ); $this->{socket}->sysread ( $buffer, 100 ); # Attention! getline() method # do not work with IO::Socket::SSL # version 0.73 # see perldoc IO::Socket::SSL # for more details } package main; my $daemon = new MyDaemon ( {}, \ @ARGV ); # you can use --help command line key $daemon || die "error create daemon instance: $!\n"; $daemon->Bind();
(Please test with just an SSL-capable webbrowser - ie: Firefox - to rule out the client-side as a problem.)
If you're on windows (not cygwin) and you need to service more than one request simultaneously, you'll need to work around the problems caused by the partial lack of thread-safety in Net::SSLeay. It can be done, but I found it involved writing a much more complicated webserver.
-David
PS: are you definately prohibited from using Apache as your HTTPS/CGI server ? I could not use it in my situation, but it's a much easier solution than writing your own.
In reply to Re^7: Soap::lite - https ?
by erroneousBollock
in thread Soap::lite - https ?
by ethrbunny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |