bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] wget ignores --no-check-certificate if started by Powersh


From: gooly
Subject: Re: [Bug-wget] wget ignores --no-check-certificate if started by Powershell Script
Date: Mon, 15 Feb 2016 10:04:48 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Am 15.02.2016 um 09:24 schrieb Tim Ruehsen:
Hi gooly,

it is not wget that have to be blamed.

The server says "permission denied" included in the 403 response.
You can check that by adding --content-on-error.

That means --no-check-certificate works correctly. Wget connects to the
server, sends a request and gets a response (403 Forbidden).

You'll need some credentials (Username/Password) to connect to the server for
sure. The reason why it sometimes works and sometimes not might be a IP
address caching on the server. If you login on the server with a browser and
after that use wget from the same IP address, the server might let you in (for
a while, e.g. 10 or 30 minutes).

Tim

On Sunday 14 February 2016 21:51:18 gooly wrote:
Hi,
I have no idea what can I do. It has been working last Sunday but now it
fails again - the same script!!

I want to download a https-page every Sunday evening and I want wget to
ignore the certificate of the https-page!

PS-So my script has:

   $urlDFx  = "https://www.dailyfx.com/calendar/";
   $argList = " $urlDFx -O $rawDFx -o $logDFx --no-check-certificate "
   $wg = Start-Process wget -wait -NoNewWindow -PassThru -ArgumentList
$argList

The other variables are names of my local files - if you know wget you
will know.

Last Sunday this worked perfect if I run it in the ps-cmd and in
Powershell's ISE but it fails regularly if the script was called by the
task scheduler.

Finally I got the task-scheduler-call to work by adding --verbose:
   $argList = "$urlDFx -O $rawDFx -o $logDFx --no-check-certificate
--verbose "

But today (Sunday again) the task-scheduler call failed and now even the
call in the ISE failed???

The error is always the same:
  > --2016-02-14 21:23:26--  https://www.dailyfx.com/calendar/
  > Resolving www.dailyfx.com... 104.87.22.147
  > Connecting to www.dailyfx.com|104.87.22.147|:443... connected.
  > WARNING: cannot verify www.dailyfx.com's certificate, issued by

`/C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3':
  >   Unable to locally verify the issuer's authority.
  >
  > WARNING: certificate common name `fxcm.com' doesn't match requested

host name `www.dailyfx.com'.

  > HTTP request sent, awaiting response... 403 Forbidden
  > 2016-02-14 21:23:26 ERROR 403: Forbidden.

So:
1) wget accesses the url but
2) ignores the option --no-check-certificate
3) stops the dld of the https-page but
4) tries the http-page and fails with a 403-error

What do I have to do that wget called by my Powershell script
=>  _FOR SURE_  (!!)
loads this https _IGNORING_ the certificate!!

Thanks in advance!
Gooly
I found the problem!
It seems that the url is resolved to two ip-addresses: 104.87.22.147 and 104.16.32.34. 104.87.22.147 causes the 403 Forbidden error but 104.16.32.34 answers with 200 Ok.
Now I changed the script 'begging' the server 20 times until I get 200 ok.
Anyway thanks
Gooly




reply via email to

[Prev in Thread] Current Thread [Next in Thread]