# Wget fails for a valid URL

**URL:** <https://community.unix.com/t/wget-fails-for-a-valid-url/340060>\
**Category:** Shell Programming and Scripting\
**Created:** [February 24, 2014, 4:32am UTC](https://community.unix.com/t/wget-fails-for-a-valid-url/340060 "2014-02-24T04:32:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohtashims](https://community.unix.com/letter_avatar/mohtashims/32/5_5575768a8748004e209b776fc1b2916d.png) [@mohtashims](https://community.unix.com/u/mohtashims)\
**Post date:** [February 24, 2014, 4:32am UTC](https://community.unix.com/t/wget-fails-for-a-valid-url/340060/1 "2014-02-24T04:32:38Z")

</div>

Wget Error Codes:

```nohighlight
    0 No problems occurred.
    1 Generic error code.
    2 Parse error�for instance, when parsing command-line options, the .wgetrc or .netrc�
    3 File I/O error.
    4 Network failure.
    5 SSL verification failure.
    6 Username/password authentication failure.
    7 Protocol errors.
    8 Server issued an error response.

```

I get error code 8 instead of 0 with `wget -q --no-check-certificate $url ` and no output..

Without the `wget --no-check-certificate $url` option below is the output received.

```nohighlight
--2014-02-23 08:37:53-- https://cxyz:9443/Services/Account.jws
Resolving cxyz... 255.275.82.125
Connecting to cxyz|255.275.82.125|:9443... connected.
WARNING: cannot verify cxyz's certificate, issued by `/C=US/O=xxxx./OU=xxxx/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3':
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 500 Server Error
2014-02-23 08:37:53 ERROR 500: Server Error.

```

Please suggest a fix !!

Error code 8.

How can i get error code 0 to appear for a invalid certificate URL because all i need to bother is if the URL exists or not.

---

<div class="post-metadata">

**Author:** ![radoulov](https://community.unix.com/user_avatar/community.unix.com/radoulov/32/489_2.png) [@radoulov](https://community.unix.com/u/radoulov)\
**Post date:** [February 24, 2014, 4:54am UTC](https://community.unix.com/t/wget-fails-for-a-valid-url/340060/2 "2014-02-24T04:54:35Z")

</div>

It seems that the server replies with 500 to the URL you're calling. Try calling the URL via browser and if you still get 500, you'll need to check the web server.

---

<div class="post-metadata">

**Author:** ![mohtashims](https://community.unix.com/letter_avatar/mohtashims/32/5_5575768a8748004e209b776fc1b2916d.png) [@mohtashims](https://community.unix.com/u/mohtashims)\
**Post date:** [February 24, 2014, 6:49am UTC](https://community.unix.com/t/wget-fails-for-a-valid-url/340060/3 "2014-02-24T06:49:21Z")

</div>

The browser return is good. Here is the output from the browser.

```nohighlight
  <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cer="http://heloz.com/Types/Public/ErrorResponse.xsd" encodingStyle=""><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Unknown Error</faultstring><detail><soap1:CSIApplicationException xmlns:soap1="http://heloz.com/Types/Public/SoapFaultDetails.xsd" xmlns:cng="http://heloz.com/Types/Public/CingularDataModel.xsd" xmlns="http://heloz.com/Types/Public/SoapFault.xsd"><cer:Response> <cng:code>900</cng:code> <cng:description>Unknown Error</cng:description> </cer:Response> <cer:ServiceProviderEntity> <cer:reportingServiceEntity>CSI</cer:reportingServiceEntity> <cer:faultDate>2014-02-24T05:44:50.066-06:00</cer:faultDate> <cer:faultSequenceNumber>1</cer:faultSequenceNumber> <cer:faultLevel>ERROR</cer:faultLevel> <cer:faultCode>90000000001</cer:faultCode> <cer:faultDescription>Unknown Error</cer:faultDescription> <cer:ServiceProviderRawError> <cer:code>900</cer:code> <cer:description>Unknown Error</cer:description> </cer:ServiceProviderRawError> </cer:ServiceProviderEntity> </soap1:CSIApplicationException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
   
  

```

All that matters to me is if the URL exists (reachable) or not.

Kindly help find a solution !!

---

<div class="post-metadata">

**Author:** ![radoulov](https://community.unix.com/user_avatar/community.unix.com/radoulov/32/489_2.png) [@radoulov](https://community.unix.com/u/radoulov)\
**Post date:** [February 24, 2014, 6:53am UTC](https://community.unix.com/t/wget-fails-for-a-valid-url/340060/4 "2014-02-24T06:53:23Z")

</div>

It seems that it returns an error via browser too. It that's OK for you just handle error code 8 as a success ...
