From 92933594be8c248ddaaf6034e7fcee171ef5da8c Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 2 Feb 2016 18:36:14 +0000 Subject: [PATCH] HttpUtils.pm: Fix for SNI-Bug (Forum #48599) git-svn-id: https://svn.fhem.de/fhem/trunk@10698 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/HttpUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/HttpUtils.pm b/fhem/FHEM/HttpUtils.pm index 835ba3047..315fdf805 100644 --- a/fhem/FHEM/HttpUtils.pm +++ b/fhem/FHEM/HttpUtils.pm @@ -202,6 +202,7 @@ HttpUtils_Connect2($) { my ($hash) = @_; + $hash->{host} =~ s/:.*//; if($hash->{protocol} eq "https" && $hash->{conn} && !$hash->{hu_sslAdded}) { eval "use IO::Socket::SSL"; if($@) { @@ -213,6 +214,7 @@ HttpUtils_Connect2($) IO::Socket::SSL->start_SSL($hash->{conn}, { Timeout => $hash->{timeout}, SSL_version => $sslVersion, + SSL_hostname => $hash->{host}, %{$hash->{sslargs}} }) || undef $hash->{conn}; $hash->{hu_sslAdded} = 1 if($hash->{keepalive}); @@ -248,7 +250,6 @@ HttpUtils_Connect2($) } } - $hash->{host} =~ s/:.*//; my $method = $hash->{method}; $method = ($data ? "POST" : "GET") if( !$method );