Skip to content

Instantly share code, notes, and snippets.

@sporkmonger sporkmonger/curl (0.9.8a).txt Secret
Created Jan 13, 2011

Embed
What would you like to do?
curl
$ curl --verbose -i https://gmail.com/.well-known/host-meta
* About to connect() to gmail.com port 443 (#0)
* Trying 74.125.67.17... connected
* Connected to gmail.com (74.125.67.17) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* 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 RC4-SHA
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=mail.google.com
* start date: 2009-12-18 00:00:00 GMT
* expire date: 2011-12-18 23:59:59 GMT
* SSL: certificate subject name 'mail.google.com' does not match target host name 'gmail.com'
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
curl: (51) SSL: certificate subject name 'mail.google.com' does not match target host name 'gmail.com'
$ curl --version
curl 7.20.0 (x86_64-unknown-linux-gnu) libcurl/7.20.0 OpenSSL/0.9.8a zlib/1.2.3 libidn/0.6.9
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM SSL libz
# Note that this version of OpenSSL pre-dates the introduction of SNI support and thus
# exhibits the issue in curl. Post-0.9.8f should work correctly.
$ irb
Custom IRB Environment Loaded.
>> require 'open-uri'; open('https://gmail.com/.well-known/host-meta') { |f| f.read }
OpenSSL::SSL::SSLError: hostname not match
from /usr/local/lib/ruby/1.8/openssl/ssl.rb:91:in `post_connection_check'
from /usr/local/lib/ruby/1.8/open-uri.rb:251:in `open_http'
from /usr/local/lib/ruby/1.8/net/http.rb:543:in `start'
from /usr/local/lib/ruby/1.8/open-uri.rb:242:in `open_http'
from /usr/local/lib/ruby/1.8/open-uri.rb:626:in `buffer_open'
from /usr/local/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
from /usr/local/lib/ruby/1.8/open-uri.rb:162:in `catch'
from /usr/local/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
from /usr/local/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
from /usr/local/lib/ruby/1.8/open-uri.rb:528:in `open'
from /usr/local/lib/ruby/1.8/open-uri.rb:30:in `open'
from (irb):1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.