Skip to content

Instantly share code, notes, and snippets.

@blakmatrix
Created May 31, 2012 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blakmatrix/2842259 to your computer and use it in GitHub Desktop.
Save blakmatrix/2842259 to your computer and use it in GitHub Desktop.
nodejitsu HTTPS test
Bad:
blakmatrix:blakmatrix_http_https_test/ $ curl -k https://blakmatrix-test-http-https.jitsu.com:80 -v [2:27:03]
* About to connect() to blakmatrix-test-http-https.jitsu.com port 80 (#0)
* Trying 108.166.87.26... connected
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to blakmatrix-test-http-https.jitsu.com:80
* Closing connection #0
curl: (35) Unknown SSL protocol error in connection to blakmatrix-test-http-https.jitsu.com:80
Good:
blakmatrix:blakmatrix_http_https_test/ $ curl -k https://localhost:80 -v [2:29:11]
* About to connect() to localhost port 80 (#0)
* Trying 127.0.0.1... connected
* 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 AES256-SHA
* Server certificate:
* subject: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; CN=https://blakmatrix-test-http-https.jitsu.com/
* start date: 2012-05-31 09:02:58 GMT
* expire date: 2039-10-16 09:02:58 GMT
* common name: https://blakmatrix-test-http-https.jitsu.com/ (does not match 'localhost')
* issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; CN=https://blakmatrix-test-http-https.jitsu.com/
* SSL certificate verify result: self signed certificate (18), continuing anyway.
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: keep-alive
< Transfer-Encoding: chunked
<
hello world https
* Connection #0 to host localhost left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
@blakmatrix
Copy link
Author

var https = require('https');
var fs = require('fs');

// Setup some https server options
var options = {
  key: fs.readFileSync('key.pem'),
  cert: fs.readFileSync('cert.pem')
};


var b = https.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world https\n");
  console.log("HTTPS: served https");
}).listen(80);

@blakmatrix
Copy link
Author

blakmatrix:blakmatrix_http_https_test/ $ curl -k https://blakmatrix-test-http-https.jitsu.com -v                                                                                                     [2:48:01]
* About to connect() to blakmatrix-test-http-https.jitsu.com port 443 (#0)
*   Trying 108.166.87.23... connected
* 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 AES256-SHA
* Server certificate:
*    subject: O=*.nodejitsu.com; OU=Domain Control Validated; CN=*.nodejitsu.com
*    start date: 2011-10-16 16:22:26 GMT
*    expire date: 2012-10-27 18:01:08 GMT
*    subjectAltName does not match blakmatrix-test-http-https.jitsu.com
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: blakmatrix-test-http-https.jitsu.com
> Accept: */*
> 

And ... it times out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment