From d195bcc4b824226c3176eb73f579c7efd9a77010 Mon Sep 17 00:00:00 2001 From: Matthew Ogilvie Date: Fri, 15 Dec 2023 22:01:31 -0700 Subject: [PATCH] If present, give URL protocol precedence over other SSL settings --- ddclient.in | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ddclient.in b/ddclient.in index 715f201..dcefdba 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2581,22 +2581,28 @@ sub geturl { my $reply; my $server; my $use_ssl = 0; - my $force_ssl = 0; my $protocol; my $timeout = opt('timeout'); my @curlopt = (); my @header_lines = (); - ## canonify proxy and url - $force_ssl = 1 if ($url =~ /^https:/); + ## canonify use_ssl, proxy and url + if ($url =~ /^https:/) { + $use_ssl = 1; + } elsif ($url =~ /^http:/) { + $use_ssl = 0; + } elsif ($globals{'ssl'} && !($params{ignore_ssl_option} // 0)) { + $use_ssl = 1; + } else { + $use_ssl = 0; + } + $proxy =~ s%^https?://%%i if defined($proxy); $url =~ s%^https?://%%i; $server = $url; $server =~ s%[?/].*%%; $url =~ s%^[^?/]*/?%%; - $use_ssl = 1 if ($force_ssl || ($globals{'ssl'} && !($params{ignore_ssl_option} // 0))); - $protocol = ($use_ssl ? "https" : "http"); debug("proxy = %s", $proxy // '');