If present, give URL protocol precedence over other SSL settings
This commit is contained in:
parent
e0611ab192
commit
d195bcc4b8
1 changed files with 11 additions and 5 deletions
16
ddclient.in
16
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 // '<undefined>');
|
||||
|
|
Loading…
Reference in a new issue