mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
TcpServerUtils.pm: certificate generation: handle pwd!=modpath (Forum #108789)
git-svn-id: https://svn.fhem.de/fhem/trunk@21319 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
50d5f3fd6e
commit
d1e7581207
@ -179,7 +179,8 @@ TcpServer_SetSSL($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $cp = AttrVal($name, "sslCertPrefix", "certs/server-");
|
my $cp = AttrVal("global", "modpath", ".")."/".
|
||||||
|
AttrVal($name, "sslCertPrefix", "certs/server-");
|
||||||
if(! -r "${cp}key.pem") {
|
if(! -r "${cp}key.pem") {
|
||||||
|
|
||||||
Log 1, "$name: Server certificate missing, trying to create one";
|
Log 1, "$name: Server certificate missing, trying to create one";
|
||||||
@ -197,7 +198,7 @@ TcpServer_SetSSL($)
|
|||||||
close(FH);
|
close(FH);
|
||||||
|
|
||||||
my $cmd = "openssl req -new -x509 -days 3650 -nodes -newkey rsa:2048 ".
|
my $cmd = "openssl req -new -x509 -days 3650 -nodes -newkey rsa:2048 ".
|
||||||
"-config certreq.txt -out ${cp}cert.pm -keyout ${cp}key.pem";
|
"-config certreq.txt -out ${cp}cert.pem -keyout ${cp}key.pem";
|
||||||
Log 1, "Executing $cmd";
|
Log 1, "Executing $cmd";
|
||||||
`$cmd`;
|
`$cmd`;
|
||||||
unlink("certreq.txt");
|
unlink("certreq.txt");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user