html-proofer: SSL link check fails, while curl succeeds
I’m getting the following error when running html-proofer in a Travis job:
- /home/travis/out/gnuarmeclipse/gnuarmeclipse.github.io/qemu/build-procedure/index.html
* External link https://developer.apple.com/xcode/downloads/ failed: 302 SSL connect error
- /home/travis/out/gnuarmeclipse/gnuarmeclipse.github.io/windows-build-tools/build-procedure/index.html
* External link http://developer.apple.com/xcode/downloads/ failed: 302 SSL connect error
htmlproofer 3.4.0 | Error: HTML-Proofer found 2 failures!
However, in exactly the same environment, a curl to that address was ok:
$ curl -L --url http://developer.apple.com/xcode/downloads/ --verbose
* Hostname was NOT found in DNS cache
* Trying 17.146.1.14...
* Connected to developer.apple.com (17.146.1.14) port 80 (#0)
> GET /xcode/downloads/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: developer.apple.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Sat, 04 Feb 2017 14:43:25 GMT
< Content-Type: text/html
< Content-Length: 179
< Connection: keep-alive
< Location: https://developer.apple.com/xcode/downloads/
* Server Shield is not blacklisted
...
<
* Ignoring the response-body
* Connection #1 to host developer.apple.com left intact
* Issue another request to this URL: 'https://idmsa.apple.com/IDMSWebAuth/login?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757&path=%2Fdownload%2F&rv=1'
* Hostname was NOT found in DNS cache
* Trying 17.171.11.86...
* Connected to idmsa.apple.com (17.171.11.86) port 443 (#2)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES128-GCM-SHA256
* Server certificate:
* subject: 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=California; businessCategory=Private Organization; serialNumber=C0806592; C=US; postalCode=95014; ST=California; L=Cupertino; street=1 Infinite Loop; O=Apple Inc.; OU=GNCS Traffic Management; CN=idmsa.apple.com
* start date: 2017-01-20 00:00:00 GMT
* expire date: 2019-01-20 23:59:59 GMT
* subjectAltName: idmsa.apple.com matched
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 EV SSL CA - G3
* SSL certificate verify ok.
> GET /IDMSWebAuth/login?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757&path=%2Fdownload%2F&rv=1 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: idmsa.apple.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Set-Cookie: JSESSIONID=E374FE13E2A29D92D8B47263B64ACFD7; Path=/; Secure; HttpOnly
< Set-Cookie: dslang=US-EN; Domain=.apple.com; Expires=Thu, 03-Aug-2017 14:43:26 GMT; Path=/; Secure; HttpOnly
< Set-Cookie: dslang=US-EN; Domain=.apple.com; Expires=Thu, 03-Aug-2017 14:43:26 GMT; Path=/; Secure; HttpOnly
< TOTAL_TIME: 105
< DS_TIME: default
< X-FRAME-OPTIONS: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0, post-check=0, pre-check=0
< Pragma: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: text/html;charset=UTF-8
< Content-Language: en-US
< Transfer-Encoding: chunked
< Vary: Accept-Encoding
< Date: Sat, 04 Feb 2017 14:43:26 GMT
* Server APPSRV is not blacklisted
< Server: APPSRV
< Set-Cookie: X-SESS=28d4a3da9fb70633345a49ca2d42db4197df95593ba62c62d7c0d5cc6198624c97df0a3f;Version=1;Max-Age=1800;path=/;secure;httponly
<
<!DOCTYPE html>
...
The entire log is available at: https://travis-ci.org/gnuarmeclipse/gnuarmeclipse.github.io-source/builds/198333357
For the moment I added the offending URLs to the --url-ignore list, but perhaps there is something you can do to accept these URLs too.
Any thoughts?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 44 (21 by maintainers)
Commits related to this issue
- Try to fix HTML Proofer SSL error Installing libcurl3-dev seems to fix SSL error HTML Proofer gets when trying to get https://mochajs.org/ . See https://github.com/gjtorikian/html-proofer/issues/141... — committed to atomisthq/docs by deleted user 7 years ago
- Integrate handler testing with test doc Give the entire rug test doc the once-over, integrating the content on handler testing and adding as much missing stuff as I could think of. Install libcurl3-... — committed to atomisthq/docs by deleted user 7 years ago
- ssl issues see if this fixes response code 0 errors https://github.com/gjtorikian/html-proofer/issues/376 — committed to earthlab/earthlab.github.io by deleted user 7 years ago
- libcurl4-openssl-dev to maybe avoid SSL errors in tests? errors like https://github.com/github/choosealicense.com/pull/539#issuecomment-333402497 possible fix found at https://github.com/gjtorikia... — committed to github/choosealicense.com by mlinksva 7 years ago
- Add wiki links to the readme closes https://github.com/gjtorikian/html-proofer/issues/376 — committed to gjtorikian/html-proofer by gjtorikian 7 years ago
- Get libcurl to use openssl instead of gnutls on Travis After updating all the spaconference.org links to use https, we're still getting errors in the build, for example: * External link https://[se... — committed to spaconference/spa-website by jennyd 7 years ago
- Get libcurl to use openssl instead of gnutls on Travis After updating all the spaconference.org links to use https, we're still getting errors in the build, for example: * External link https://[se... — committed to spaconference/spa-website by jennyd 7 years ago
- Get libcurl to use openssl instead of gnutls on Travis We've moved the site to HTTPS today and now the build is failing, for example: * External link http://[secure]rence.org/spa2016 failed: 30... — committed to spaconference/spa-website by jennyd 7 years ago
- Fix SSL connect error on travis https://github.com/gjtorikian/html-proofer/issues/376 — committed to tofuconf/tofuconf.club by Tiryoh 6 years ago
- Add HTMLProofer with custom options for Travis * Use more modern APT installation on Travis not requiring `sudo` * Install `libcurl4-openssl-dev` to prevent HTMLProofer OpenSSL issues (gjtorikian/h... — committed to dberzano/alibuild by deleted user 6 years ago
- Add HTMLProofer with custom options for Travis * Use more modern APT installation on Travis not requiring `sudo` * Install `libcurl4-openssl-dev` to prevent HTMLProofer OpenSSL issues (gjtorikian/h... — committed to alisw/alibuild by deleted user 6 years ago
- Bump travis version and bundle upate. (...) Trying solution: https://github.com/gjtorikian/html-proofer/issues/376#issuecomment-284475461 — committed to urda/website by urda 6 years ago
- Bump travis version and bundle upate. (...) Solution: https://github.com/gjtorikian/html-proofer/issues/376#issuecomment-332770021 Tried: https://github.com/gjtorikian/html-proofer/issues/376#issuec... — committed to urda/website by urda 6 years ago
- Install `libcurl4-openssl-dev` solution via gjtorikian/html-proofer#376 Solution: https://github.com/gjtorikian/html-proofer/issues/376#issuecomment-332770021 — committed to urda/website by urda 6 years ago
- Fix SSL errors with htmlproofer See gjtorikian/html-proofer#376 — committed to pdil/website-generator by pdil 6 years ago
- Fix SSL issues, Fix pagination issues, Improve Rakefile * Fix SSL issues in TravisCI: https://github.com/gjtorikian/html-proofer/issues/376#issuecomment-332770021 * Update html-proofer version * Upda... — committed to joshmfrankel/joshmfrankel.github.io by joshmfrankel 6 years ago
- Add libcurl4-openssl-dev for html-proofer See https://github.com/gjtorikian/html-proofer/issues/376. — committed to yous/yous.be by yous 5 years ago
- update travis ssl libraries Fix from https://github.com/gjtorikian/html-proofer/issues/376 — committed to tock/tock-www by ppannuto 5 years ago
YES. Adding this to my
.travis.ymlfixed the SSL problems:I’ll add this to the
jekyll-testgem, and we should document it on the wiki somewhere too.Try adding to your travis.yml;
The default CAs shipped with Ubuntu 12.04 are somewhat out of date now. Running
update-ca-certificateswill get the latest certs (but you need sudo to run it).AHA! Got it!
Changing the libcurl to use openssl instead of gnutls fixes it. On the travis environment, if I do
sudo apt-get install libcurl4-openssl-dev, it removes the gnutls version, then all the links work with 200 responses.I’ve reported this upstream to typhoeus in the linked issue, but we can resolve it here with some instructions and suggested travis config. I’ll work out how to get travis to do that itself and report back.
@Floppy did an amazing job documenting the fix in the wiki, so I just provided links in the README to that document.
Thanks, yes, it is a parsing problem of the travis file, which is why travis does not even start (so there is no log). I found out that removing the space after the “:” works:
script: bundle exec jekyll build && bundle exec htmlproofer ./_site --check_html --typhoeus_config '{ "timeout":30 }'Then travis runs and calls the htmlproofer. I still get several:
External link <!deleted!> failed: response code 0 means something’s wrong. It’s possible libcurl couldn’t connect to the server or perhaps the request timed out. Sometimes, making too many requests at once also breaks things. Either way, the return message (if any) from the server is: Server returned nothing (no headers, no data)
And it definitely does not wait 30 sec (command finishes in 5 sec). So either it does not take the timeout , or does not wait for some other reason. Passing additionally the verbose: true did have an effect.
Added to .travis.yml samples in https://github.com/gjtorikian/html-proofer/wiki/Using-HTMLProofer-From-Ruby-and-Travis.
I wonder if anyone would try Travis’ instructions for Troubleshooting Locally in a Docker Image?
That’s a really great idea @Floppy. Wonder if I can convince @parkr to pull it in as an optional gem once it’s completed. 🙂
On the issue of getting SSL failures on travis specifically, I’m working on https://github.com/Floppy/jekyll-test which plans to automate all the required setup to make it work reliably, once I’ve found out how 😃
Here’s the error I get:
I’ve tried
sudo update-ca-certificates, but it didn’t work: https://travis-ci.org/cloud-tv/cloud-tv.github.io/builds/268911228There is no error on CircleCI and on my local machine. Maybe the solution is just to abandon Travis in favour of CircleCI.