allow protocol to always override ssl in geturl()
Signed-off-by: Matthew Ogilvie <mmogilvi+ddc@zoho.com>
This commit is contained in:
parent
1a6e4431ab
commit
563dc2de68
1 changed files with 12 additions and 6 deletions
18
ddclient.in
18
ddclient.in
|
|
@ -2432,20 +2432,26 @@ sub fetch_via_socket_io {
|
|||
my ($peer, $server, $port, $default_port, $use_ssl);
|
||||
my ($sd, $request, $reply);
|
||||
|
||||
## canonify proxy and url
|
||||
my $force_ssl;
|
||||
$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%^[^?/]*/?%%;
|
||||
|
||||
if ($force_ssl || ($globals{'ssl'} && !($params{ignore_ssl_option} // 0))) {
|
||||
$use_ssl = 1;
|
||||
if ($use_ssl) {
|
||||
$default_port = '443';
|
||||
} else {
|
||||
$use_ssl = 0;
|
||||
$default_port = '80';
|
||||
}
|
||||
debug("proxy = %s", $proxy // '<undefined>');
|
||||
|
|
|
|||
Loading…
Reference in a new issue