mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 06:36:04 +00:00
HttpUtils.pm: Fix for SNI-Bug (Forum #48599)
git-svn-id: https://svn.fhem.de/fhem/trunk@10698 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a78711bc11
commit
92933594be
@ -202,6 +202,7 @@ HttpUtils_Connect2($)
|
|||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
|
$hash->{host} =~ s/:.*//;
|
||||||
if($hash->{protocol} eq "https" && $hash->{conn} && !$hash->{hu_sslAdded}) {
|
if($hash->{protocol} eq "https" && $hash->{conn} && !$hash->{hu_sslAdded}) {
|
||||||
eval "use IO::Socket::SSL";
|
eval "use IO::Socket::SSL";
|
||||||
if($@) {
|
if($@) {
|
||||||
@ -213,6 +214,7 @@ HttpUtils_Connect2($)
|
|||||||
IO::Socket::SSL->start_SSL($hash->{conn}, {
|
IO::Socket::SSL->start_SSL($hash->{conn}, {
|
||||||
Timeout => $hash->{timeout},
|
Timeout => $hash->{timeout},
|
||||||
SSL_version => $sslVersion,
|
SSL_version => $sslVersion,
|
||||||
|
SSL_hostname => $hash->{host},
|
||||||
%{$hash->{sslargs}}
|
%{$hash->{sslargs}}
|
||||||
}) || undef $hash->{conn};
|
}) || undef $hash->{conn};
|
||||||
$hash->{hu_sslAdded} = 1 if($hash->{keepalive});
|
$hash->{hu_sslAdded} = 1 if($hash->{keepalive});
|
||||||
@ -248,7 +250,6 @@ HttpUtils_Connect2($)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash->{host} =~ s/:.*//;
|
|
||||||
my $method = $hash->{method};
|
my $method = $hash->{method};
|
||||||
$method = ($data ? "POST" : "GET") if( !$method );
|
$method = ($data ? "POST" : "GET") if( !$method );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user