- Timestamp:
- 2017-08-11T17:07:44+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
r31874 r31877 165 165 } 166 166 167 sub getWgetOptions 168 { 169 my ($self) = @_; 170 my $strOptions = ""; 171 172 # If http_proxy ENV VARS are not set, but proxy Perl vars are set, then we're on Windows 173 # and need to use the proxy vars as flags to wget 174 # If http_proxy Env Vars are set, then we're on Linux, wget will use the http(s) proxy 175 # env vars and we shouldn't be passing any proxy perl vars as flags 176 177 # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html 178 # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F 179 180 if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) { 167 # Not using this. On Windows, we used to pass proxying settings as flags to wget. But, as that can be 168 # seen with Task Manager, we now have the proxy settings set in the environment and are no longer passing it 169 sub addProxySettingsAsWgetFlags 170 { 171 my ($self) = @_; 172 my $strOptions = ""; 173 181 174 if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) 182 175 { … … 193 186 $strOptions .= " --proxy "; 194 187 } 195 } 196 197 if($self->{'no_check_certificate'}) { #&& $self->{'url'} =~ m/^https\:/) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http 188 189 return $strOptions; 190 } 191 192 sub getWgetOptions 193 { 194 my ($self) = @_; 195 my $strOptions = ""; 196 197 # If proxy settings are set up in the environment, wget is ready to use them. More secure. 198 # But if proxy settings are not set up in the environment, pass them as flags to wget 199 # This is less secure, as pwd etc visible in task manager, but it was the original way in 200 # which wget was run on windows. 201 # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html 202 # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F 203 204 if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) { 205 $strOptions .= $self->addProxySettingsAsWgetFlags(); 206 } # else wget will use proxy settings in environment, assume enough settings have been provided 207 208 if($self->{'no_check_certificate'}) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http 198 209 199 210 $strOptions .= " --no-check-certificate ";
Note:
See TracChangeset
for help on using the changeset viewer.