From 0d12c8889ca50a412d2d09ae48a44061050213c3 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Wed, 18 Dec 2019 17:46:44 +0000 Subject: [PATCH] 98_update.pm: add -noSSL (Forum #105944) git-svn-id: https://svn.fhem.de/fhem/trunk@20778 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_update.pm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index 422a1433a..743d0711c 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -28,6 +28,7 @@ my $upd_running; eval "require IO::Socket::SSL"; # Forum #74387 my $upd_hasSSL = $@ ? 0 : 1; +my $upd_wantSSL; ######################################## sub @@ -35,8 +36,8 @@ update_Initialize($$) { my %hash = ( Fn => "CommandUpdate", - Hlp => "[|all|check|checktime|force] [http://.../controlfile],". - "update FHEM", + Hlp => "[-noSSL] [|all|check|checktime|force] ". + "[http://.../controlfile],update FHEM", ); $cmds{update} = \%hash; } @@ -51,6 +52,13 @@ CommandUpdate($$) my $err = upd_metainit(0); return $err if($err); + if($args[0] && $args[0] eq "-noSSL") { + shift @args; + $upd_wantSSL = 0; + } else { + $upd_wantSSL = 1; + } + if($args[0] && ($args[0] eq "list" || $args[0] eq "add" || @@ -240,6 +248,8 @@ doUpdate($$$$) my ($curr, $max, $src, $arg) = @_; my ($basePath, $ctrlFileName); $src =~ s'^http://fhem\.de'https://fhem.de' if($upd_hasSSL); + $src =~ s'^https://'http://' if(!$upd_wantSSL); + uLog 1, "Downloading $src"; if($src !~ m,^(.*)/([^/]*)$,) { uLog 1, "Cannot parse $src, probably not a valid http control file"; return; @@ -585,7 +595,7 @@ upd_writeFile($$$$)

update