mirror of
https://github.com/webmin/webmin.git
synced 2026-08-04 15:10:41 +01:00
Use correct cert and key file when there is a hostname-specific cert
This commit is contained in:
10
miniserv.pl
10
miniserv.pl
@@ -4698,6 +4698,15 @@ Net::SSLeay::set_fd($ssl_con, fileno($sock));
|
||||
if (!Net::SSLeay::accept($ssl_con)) {
|
||||
return undef;
|
||||
}
|
||||
# Check for a per-hostname SSL context and use that instead
|
||||
my $h = Net::SSLeay::get_servername($ssl_con);
|
||||
if ($h) {
|
||||
my $c = $ssl_contexts{$h} ||
|
||||
$h =~ /^[^\.]+\.(.*)$/ && $ssl_contexts{"*.$1"};
|
||||
if ($c) {
|
||||
$ssl_ctx = $c;
|
||||
}
|
||||
}
|
||||
return ($ssl_con, $ssl_ctx->{'certfile'}, $ssl_ctx->{'keyfile'});
|
||||
}
|
||||
|
||||
@@ -5642,6 +5651,7 @@ elsif ($ws->{'cmd'}) {
|
||||
my $pid = fork();
|
||||
if (!$pid) {
|
||||
# Run command in a forked process
|
||||
# XXX todo here
|
||||
exit(1);
|
||||
}
|
||||
$ptyfh->close_slave();
|
||||
|
||||
Reference in New Issue
Block a user