tls: added ability to store certs in config/ssl
was hard coded to ./ssl
This commit is contained in:
parent
c58404c3c4
commit
42296b950c
@ -63,9 +63,10 @@ use IO::Socket::SSL 0.98;
|
||||
|
||||
sub init {
|
||||
my ($self, $qp, $cert, $key, $ca) = @_;
|
||||
$cert ||= 'ssl/qpsmtpd-server.crt';
|
||||
$key ||= 'ssl/qpsmtpd-server.key';
|
||||
$ca ||= 'ssl/qpsmtpd-ca.crt';
|
||||
my $dir = -d 'ssl' ? 'ssl' : 'config/ssl';
|
||||
$cert ||= "$dir/qpsmtpd-server.crt";
|
||||
$key ||= "$dir/qpsmtpd-server.key";
|
||||
$ca ||= "$dir/qpsmtpd-ca.crt";
|
||||
unless ( -f $cert && -f $key && -f $ca ) {
|
||||
$self->log(LOGERROR, "Cannot locate cert/key! Run plugins/tls_cert to generate");
|
||||
return;
|
||||
@ -120,7 +121,7 @@ sub hook_ehlo {
|
||||
|
||||
sub hook_unrecognized_command {
|
||||
my ($self, $transaction, $cmd, @args) = @_;
|
||||
return DECLINED unless $cmd eq 'starttls';
|
||||
return DECLINED unless lc $cmd eq 'starttls';
|
||||
return DECLINED unless $transaction->notes('tls_enabled');
|
||||
return DENY, "Syntax error (no parameters allowed)" if @args;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user