Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL connect error #141

Closed
doktorbro opened this issue Jan 10, 2015 · 16 comments
Closed

SSL connect error #141

doktorbro opened this issue Jan 10, 2015 · 16 comments
Labels

Comments

@doktorbro
Copy link

I try to proof a Jekyll website from this repo.

HTML::Proofer.new("./site/_site", {
  :verbose => true,
  :ssl_verifypeer => false
}).run

If I run the test on Travis, all HTTPS links return a 200.

The same test on my local machine (Ubuntu 14.10) shows me errors for the WHATWG links. GitHub and Travis HTTPS links work as expected.

- ./site/_site/index.html
  *  External link https://html.spec.whatwg.org/ failed: 0 SSL connect error
  *  External link https://html.spec.whatwg.org/multipage/syntax.html failed: 0 SSL connect error
  *  External link https://html.spec.whatwg.org/multipage/semantics.html failed: 0 SSL connect error
  *  External link https://html.spec.whatwg.org/multipage/semantics.html failed: 0 SSL connect error
  *  External link https://html.spec.whatwg.org/multipage/semantics.html failed: 0 SSL connect error
  *  External link https://html.spec.whatwg.org/multipage/tables.html failed: 0 SSL connect error

What is wrong?

@doktorbro doktorbro added the bug label Feb 3, 2015
@doktorbro
Copy link
Author

Proofer 2.0.5 show me the same errors. If I pass the Typhoeus namespace nothing changes.

    HTML::Proofer.new("./site/_site", {
      :verbose => true,
      :typhoeus => {
        :ssl_verifypeer => false
      }
    }).run

I tried a wrong namespace too:

    HTML::Proofer.new("./site/_site", {
      :verbose => true,
      :wrong => {
        :ssl_verifypeer => false
      }
    }).run

Same result as above. Looks like the Typhoeus options are ignored.

@gjtorikian
Copy link
Owner

I do not think the Typhoeus options are being ignored:

it 'should follow redirects' do
linkWithRedirectFilepath = "#{FIXTURES_DIR}/links/linkWithRedirect.html"
proofer = run_proofer(linkWithRedirectFilepath)
expect(proofer.failed_tests).to eq []
end
it 'fails on redirects if not following' do
linkWithRedirectFilepath = "#{FIXTURES_DIR}/links/linkWithRedirect.html"
proofer = run_proofer(linkWithRedirectFilepath, :typhoeus => { :followlocation => false })
expect(proofer.failed_tests.first).to match(/failed: 301 No error/)
end

I also can't seem to reproduce the problem:

require 'html/proofer'

HTML::Proofer.new(["https://html.spec.whatwg.org/"]).run

Is it possibly a temporary connectivity issue on their end?

@doktorbro
Copy link
Author

Is it possibly a temporary connectivity issue on their end?

I do not think so. I see the issue since 4 weeks now.

@gjtorikian
Copy link
Owner

Could something have changed in Ubuntu 14.10? Here seem to me the facts:

  • Travis runs Ubuntu 12.04
  • I run OS X
  • Both myself and Travis yield 200s
  • You are on Ubuntu 14.10, and it fails

I am not sure what can be done here. I guess I can check to see if ssl_verifypeer is correctly passed along to Proofer.

@doktorbro
Copy link
Author

$ curl -V
curl 7.37.1 (i686-pc-linux-gnu) libcurl/7.37.1 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP

@doktorbro
Copy link
Author

I will try to reproduce the issue with Typhoeus only.

@gjtorikian
Copy link
Owner

I have the exact same version of curl. Odd. Does curl alone work?

@doktorbro
Copy link
Author

Curling the specs fails.

curl --url https://html.spec.whatwg.org/multipage/ --verbose
* Hostname was NOT found in DNS cache
*   Trying 208.113.236.128...
* Connected to html.spec.whatwg.org (208.113.236.128) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Curling my user here works.

curl --url https://api.github.com/users/penibelst --verbose
* Hostname was NOT found in DNS cache
*   Trying 192.30.252.136...
* Connected to api.github.com (192.30.252.136) port 443 (#0)
* 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 key exchange (12):
* 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 TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
*    subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.github.com
*    start date: 2014-04-08 00:00:00 GMT
*    expire date: 2017-04-12 12:00:00 GMT
*    subjectAltName: api.github.com matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
*    SSL certificate verify ok.
# header and content

@doktorbro
Copy link
Author

Typhoeus itself returns an error ssl_connect_error

Typhoeus::VERSION
=> "0.6.9"

Typhoeus.get("https://html.spec.whatwg.org/multipage/", { :ssl_verifypeer => false})
=> #<Typhoeus::Response:0x9296cc0 @options={:httpauth_avail=>0, :total_time=>1.230575, :starttransfer_time=>0.0, :appconnect_time=>0.0, :pretransfer_time=>0.0, :connect_time=>0.200696, :namelookup_time=>0.028447, :effective_url=>"https://html.spec.whatwg.org/multipage/", :primary_ip=>"208.113.236.128", :response_code=>0, :request_size=>0, :redirect_count=>0, :return_code=>:ssl_connect_error, :response_headers=>"", :response_body=>"", :debug_info=>#<Ethon::Easy::DebugInfo:0x92b46a8 @messages=[]>}, @request=#<Typhoeus::Request:0x929c10c @base_url="https://html.spec.whatwg.org/multipage/", @original_options={:ssl_verifypeer=>false, :method=>:get}, @options={:ssl_verifypeer=>false, :method=>:get, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus"}, :maxredirs=>50}, @response=#<Typhoeus::Response:0x9296cc0 ...>, @on_complete=[], @on_failure=[]>>

@i0rek Any thoughts? Should I open an issue in @typhoeus?

@annevk Any known issues with the certificates at https://html.spec.whatwg.org/ ?

@annevk
Copy link

annevk commented Feb 4, 2015

Not with the certificate, but the RC4 cipher DreamHost uses is way old. We are told they will fix it this quarter. See https://www.ssllabs.com/ssltest/analyze.html?d=html.spec.whatwg.org for more information.

@hanshasselberg
Copy link

@penibelst Thats not a Typhoeus problem. A workaround would be to set that option: ssl_verifyhost: false, but while playing around with it the problem seems to be solved by whatwg.org.

@doktorbro
Copy link
Author

@i0rek ssl_verifyhost: false gives me an error:

NoMethodError: undefined method `to_i' for false:FalseClass

ssl_verifyhost: 0 works.

but while playing around with it the problem seems to be solved

Indeed.

@hanshasselberg
Copy link

@penibelst of course you are right regarding the correct value of the ssl_verifyhost option. I am sorry :(.

@gjtorikian
Copy link
Owner

@penibelst Out of curiosity, how does the https://www.backblaze.com URL work for you? I'm seeing it fail in our company CI, but no one can reproduce it locally. And passing ssl_verifyhost: 0 does not silence the error, even with the recent Typhoeus bump. It's starting to drive me mad!

@doktorbro
Copy link
Author

@gjtorikian I can reproduce it locally. Curl only:

curl --url https://www.backblaze.com/ --verbose
* Hostname was NOT found in DNS cache
*   Trying 162.244.56.106...
* Connected to www.backblaze.com (162.244.56.106) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Typhoeus 0.7.1:

Typhoeus.get("https://www.backblaze.com/", { :ssl_verifyhost => 0})
=> #<Typhoeus::Response:0x9229800 @options={:httpauth_avail=>0, :total_time=>0.201073, :starttransfer_time=>0.0, :appconnect_time=>0.0, :pretransfer_time=>0.0, :connect_time=>0.180304, :namelookup_time=>4.3e-05, :effective_url=>"https://www.backblaze.com/", :primary_ip=>"162.244.56.106",:response_code=>0, :request_size=>0, :redirect_count=>0, :return_code=>:ssl_connect_error, :response_headers=>"", :response_body=>"", :debug_info=>#<Ethon::Easy::DebugInfo:0x923a510 @messages=[]>}, @request=#<Typhoeus::Request:0x922a9f8 @base_url="https://www.backblaze.com/", @original_options={:ssl_verifyhost=>0, :method=>:get}, @options={:ssl_verifyhost=>0, :method=>:get, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus"}, :maxredirs=>50}, @response=#<Typhoeus::Response:0x9229800 ...>, @on_complete=[], @on_failure=[]>>

@gjtorikian
Copy link
Owner

@i0rek Sorry to ping you once more! Do you have any insight here as to why ssl_verifyhost: 0 would still cause these misconfigured servers to fail?

ddgenome pushed a commit to atomisthq/docs that referenced this issue May 25, 2017
Installing libcurl3-dev seems to fix SSL error HTML Proofer gets when
trying to get https://mochajs.org/ .  See
gjtorikian/html-proofer#141
gjtorikian/html-proofer#194
gjtorikian/html-proofer#376
ddgenome pushed a commit to atomisthq/docs that referenced this issue May 25, 2017
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-dev to fix HTML Proofer SSL error when it tests
https://mochajs.org/ see
gjtorikian/html-proofer#141
gjtorikian/html-proofer#194
gjtorikian/html-proofer#376

Add retry to HTML Proofer.

Address review comments.
phansch added a commit to phansch/philhansch.net that referenced this issue Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants