mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 23:06:37 +00:00
TcpServerUtils.pm: add sslCertPrefix option (Forum #92030)
git-svn-id: https://svn.fhem.de/fhem/trunk@17529 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
567fea2a0c
commit
85dfd7d6ee
@ -36,11 +36,13 @@ MQTT2_SERVER_Initialize($)
|
|||||||
|
|
||||||
no warnings 'qw';
|
no warnings 'qw';
|
||||||
my @attrList = qw(
|
my @attrList = qw(
|
||||||
|
SSL:0,1
|
||||||
|
autocreate
|
||||||
disable:0,1
|
disable:0,1
|
||||||
disabledForIntervals
|
disabledForIntervals
|
||||||
autocreate
|
|
||||||
rawEvents
|
rawEvents
|
||||||
SSL:0,1
|
sslVersion
|
||||||
|
sslCertPrefix
|
||||||
);
|
);
|
||||||
use warnings 'qw';
|
use warnings 'qw';
|
||||||
$hash->{AttrList} = join(" ", @attrList);
|
$hash->{AttrList} = join(" ", @attrList);
|
||||||
@ -580,6 +582,15 @@ MQTT2_SERVER_getStr($$)
|
|||||||
Enable SSL (i.e. TLS)
|
Enable SSL (i.e. TLS)
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<li>sslVersion<br>
|
||||||
|
See the global attribute sslVersion.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<li>sslCertPrefix<br>
|
||||||
|
Set the prefix for the SSL certificate, default is certs/server-, see
|
||||||
|
also the SSL attribute.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="autocreate"></a>
|
<a name="autocreate"></a>
|
||||||
<li>autocreate<br>
|
<li>autocreate<br>
|
||||||
If set, MQTT2_DEVICES will be automatically created upon receiving an
|
If set, MQTT2_DEVICES will be automatically created upon receiving an
|
||||||
|
@ -187,9 +187,10 @@ FHEMWEB_Initialize($)
|
|||||||
refresh
|
refresh
|
||||||
reverseLogs:0,1
|
reverseLogs:0,1
|
||||||
roomIcons
|
roomIcons
|
||||||
sortRooms
|
|
||||||
showUsedFiles:0,1
|
showUsedFiles:0,1
|
||||||
|
sortRooms
|
||||||
sslVersion
|
sslVersion
|
||||||
|
sslCertPrefix
|
||||||
smallscreen:unused
|
smallscreen:unused
|
||||||
smallscreenCommands:0,1
|
smallscreenCommands:0,1
|
||||||
stylesheetPrefix
|
stylesheetPrefix
|
||||||
@ -3911,6 +3912,12 @@ FW_widgetOverride($$)
|
|||||||
See the global attribute sslVersion.
|
See the global attribute sslVersion.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="sslCertPrefix"></a>
|
||||||
|
<li>sslCertPrefix<br>
|
||||||
|
Set the prefix for the SSL certificate, default is certs/server-, see
|
||||||
|
also the HTTPS attribute.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="styleData"></a>
|
<a name="styleData"></a>
|
||||||
<li>styleData<br>
|
<li>styleData<br>
|
||||||
data-storage used by dynamic styles like f18
|
data-storage used by dynamic styles like f18
|
||||||
@ -4613,6 +4620,12 @@ FW_widgetOverride($$)
|
|||||||
Siehe das global Attribut sslVersion.
|
Siehe das global Attribut sslVersion.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="sslCertPrefix"></a>
|
||||||
|
<li>sslCertPrefix<br>
|
||||||
|
Setzt das Präfix der SSL-Zertifikate, die Voreinstellung ist
|
||||||
|
certs/server-, siehe auch das HTTP Attribut.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="styleData"></a>
|
<a name="styleData"></a>
|
||||||
<li>styleData<br>
|
<li>styleData<br>
|
||||||
wird von dynamischen styles wie f18 werwendet
|
wird von dynamischen styles wie f18 werwendet
|
||||||
|
@ -20,9 +20,22 @@ telnet_Initialize($)
|
|||||||
$hash->{AsyncOutputFn} = "telnet_Output";
|
$hash->{AsyncOutputFn} = "telnet_Output";
|
||||||
$hash->{UndefFn} = "telnet_Undef";
|
$hash->{UndefFn} = "telnet_Undef";
|
||||||
$hash->{AttrFn} = "telnet_Attr";
|
$hash->{AttrFn} = "telnet_Attr";
|
||||||
$hash->{AttrList} = "globalpassword password prompt allowedCommands ".
|
no warnings 'qw';
|
||||||
"allowfrom SSL connectTimeout connectInterval ".
|
my @attrList = qw(
|
||||||
"encoding:utf8,latin1 sslVersion";
|
SSL
|
||||||
|
allowedCommands
|
||||||
|
allowfrom
|
||||||
|
connectInterval
|
||||||
|
connectTimeout
|
||||||
|
encoding:utf8,latin1
|
||||||
|
globalpassword
|
||||||
|
password
|
||||||
|
prompt
|
||||||
|
sslCertPrefix
|
||||||
|
sslVersion
|
||||||
|
);
|
||||||
|
use warnings 'qw';
|
||||||
|
$hash->{AttrList} = join(" ", @attrList);
|
||||||
$hash->{ActivateInformFn} = "telnet_ActivateInform";
|
$hash->{ActivateInformFn} = "telnet_ActivateInform";
|
||||||
$hash->{CanAuthenticate} = 2;
|
$hash->{CanAuthenticate} = 2;
|
||||||
|
|
||||||
@ -514,6 +527,10 @@ telnet_ActivateInform($)
|
|||||||
<li>sslVersion<br>
|
<li>sslVersion<br>
|
||||||
See the global attribute sslVersion.
|
See the global attribute sslVersion.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
<li>sslCertPrefix<br>
|
||||||
|
Set the prefix for the SSL certificate, default is certs/server-, see
|
||||||
|
also the SSL attribute.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -656,6 +673,11 @@ telnet_ActivateInform($)
|
|||||||
Siehe das global Attribut sslVersion.
|
Siehe das global Attribut sslVersion.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<li>sslCertPrefix<br>
|
||||||
|
Setzt das Präfix der SSL-Zertifikate, die Voreinstellung ist
|
||||||
|
certs/server-, siehe auch das SSL Attribut.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -111,12 +111,13 @@ TcpServer_Accept($$)
|
|||||||
# Certs directory must be in the modpath, i.e. at the same level as the
|
# Certs directory must be in the modpath, i.e. at the same level as the
|
||||||
# FHEM directory
|
# FHEM directory
|
||||||
my $mp = AttrVal("global", "modpath", ".");
|
my $mp = AttrVal("global", "modpath", ".");
|
||||||
|
my $certPrefix = AttrVal($name, "sslCertPrefix", "certs/server-");
|
||||||
my $ret;
|
my $ret;
|
||||||
eval {
|
eval {
|
||||||
$ret = IO::Socket::SSL->start_SSL($clientinfo[0], {
|
$ret = IO::Socket::SSL->start_SSL($clientinfo[0], {
|
||||||
SSL_server => 1,
|
SSL_server => 1,
|
||||||
SSL_key_file => "$mp/certs/server-key.pem",
|
SSL_key_file => "$mp/${certPrefix}key.pem",
|
||||||
SSL_cert_file => "$mp/certs/server-cert.pem",
|
SSL_cert_file => "$mp/${certPrefix}cert.pem",
|
||||||
SSL_version => $sslVersion,
|
SSL_version => $sslVersion,
|
||||||
SSL_cipher_list => 'HIGH:!RC4:!eNULL:!aNULL',
|
SSL_cipher_list => 'HIGH:!RC4:!eNULL:!aNULL',
|
||||||
Timeout => 4,
|
Timeout => 4,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user