98_update.pm: force using HTTPS ist SSL is installed. (Forum #74387)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14768 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-07-23 07:40:10 +00:00
parent 1502a65502
commit 4256f3690d

View File

@ -29,6 +29,8 @@ my $upd_needJoin;
my $upd_nChanged; my $upd_nChanged;
my $upd_running; my $upd_running;
eval "require IO::Socket::SSL"; # Forum #74387
my $upd_hasSSL = $@ ? 0 : 1;
######################################## ########################################
sub sub
@ -239,6 +241,7 @@ doUpdate($$$$)
{ {
my ($curr, $max, $src, $arg) = @_; my ($curr, $max, $src, $arg) = @_;
my ($basePath, $ctrlFileName); my ($basePath, $ctrlFileName);
$src =~ s'^http://fhem\.de'https://fhem.de' if($upd_hasSSL);
if($src !~ m,^(.*)/([^/]*)$,) { if($src !~ m,^(.*)/([^/]*)$,) {
uLog 1, "Cannot parse $src, probably not a valid http control file"; uLog 1, "Cannot parse $src, probably not a valid http control file";
return; return;