2012-01-30 3 views
0

J'ai téléchargé HTTP::Daemon::SSL Strawberry Perl 5.10 CPAN et couru cet exemple:Comment faire pour que HTTP :: Daemon :: SSL fonctionne sans certificats?

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 "/dir") { 
      # remember, this is *not* recommened practice :-) 
      $c->send_file_response("f.html"); 
     } else { 
      $c->send_error(RC_FORBIDDEN); 
     } 
    } 
    $c->close; 
    undef($c); 
} 

L'application est mort sur cette ligne:

my $d = HTTP::Daemon::SSL->new || die; 

Je n'ai pas de certificats. Y at-il une option pour personnaliser ce code pour l'exécuter sans avoir besoin de certificats? Si oui, quelqu'un pourrait-il m'aider?

J'ai essayé aussi de remplacer

my $d = HTTP::Daemon::SSL->new || die 

avec

my $d = HTTP::Daemon::SSL->new(SSL_use_cert => 0) || die; 

et a obtenu le même résultat.

Répondre

Questions connexes