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 $reply;
|
||||||
my $server;
|
my $server;
|
||||||
my $use_ssl = 0;
|
my $use_ssl = 0;
|
||||||
my $force_ssl = 0;
|
|
||||||
my $protocol;
|
my $protocol;
|
||||||
my $timeout = opt('timeout');
|
my $timeout = opt('timeout');
|
||||||
my @curlopt = ();
|
my @curlopt = ();
|
||||||
my @header_lines = ();
|
my @header_lines = ();
|
||||||
|
|
||||||
## canonify proxy and url
|
## canonify use_ssl, proxy and url
|
||||||
$force_ssl = 1 if ($url =~ /^https:/);
|
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);
|
$proxy =~ s%^https?://%%i if defined($proxy);
|
||||||
$url =~ s%^https?://%%i;
|
$url =~ s%^https?://%%i;
|
||||||
$server = $url;
|
$server = $url;
|
||||||
$server =~ s%[?/].*%%;
|
$server =~ s%[?/].*%%;
|
||||||
$url =~ s%^[^?/]*/?%%;
|
$url =~ s%^[^?/]*/?%%;
|
||||||
|
|
||||||
$use_ssl = 1 if ($force_ssl || ($globals{'ssl'} && !($params{ignore_ssl_option} // 0)));
|
|
||||||
|
|
||||||
$protocol = ($use_ssl ? "https" : "http");
|
$protocol = ($use_ssl ? "https" : "http");
|
||||||
|
|
||||||
debug("proxy = %s", $proxy // '<undefined>');
|
debug("proxy = %s", $proxy // '<undefined>');
|
||||||
|
|
Loading…
Reference in a new issue