Created
April 3, 2012 02:01
-
-
Save coderarity/2288760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'), | |
http = require('http'), | |
util = require('util'), | |
colors = require('colors'), | |
httpProxy = require('../node-http-proxy/lib/node-http-proxy'), | |
helpers = require('../node-http-proxy/test/helpers'); | |
//just uses readFileSync to load keys | |
var opts = helpers.loadHttps(); | |
// | |
// Create the proxy server listening on port 8080 | |
// | |
https.createServer(opts, function (req, res) { | |
res.end('yo'); | |
}).listen(8080); | |
/* | |
~/projects/node-http-proxy -bash$ curl 127.0.0.1:8080 -v | |
* About to connect() to 127.0.0.1 port 8080 (#0) | |
* Trying 127.0.0.1... connected | |
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: 127.0.0.1:8080 | |
> Accept: *//* | |
> | |
* Empty reply from server | |
* Connection #0 to host 127.0.0.1 left intact | |
curl: (52) Empty reply from server | |
* Closing connection #0 | |
~/projects/node-http-proxy -bash$ openssl s_client -connect 127.0.0.1:8080 | |
CONNECTED(00000003) | |
depth=0 /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
verify error:num=18:self signed certificate | |
verify return:1 | |
depth=0 /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
verify return:1 | |
--- | |
Certificate chain | |
0 s:/C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
i:/C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
--- | |
Server certificate | |
-----BEGIN CERTIFICATE----- | |
MIIB7DCCAZYCCQC7gs0MDNn6MTANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV | |
UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO | |
BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR | |
cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEy | |
WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD | |
VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg | |
MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEF | |
AANLADBIAkEAyXb8FrRdKbhrKLgLSsn61i1C7w7fVVVd7OQsmV/7p9WB2lWFiDlC | |
WKGU9SiIz/A6wNZDUAuc2E+VwtpCT561AQIDAQABMA0GCSqGSIb3DQEBBQUAA0EA | |
C8HzpuNhFLCI3A5KkBS5zHAQax6TFUOhbpBCR0aTDbJ6F1liDTK1lmU/BjvPoj+9 | |
1LHwrmh29rK8kBPEjmymCQ== | |
-----END CERTIFICATE----- | |
subject=/C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
issuer=/C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent2/emailAddress=ry@tinyclouds.org | |
--- | |
No client certificate CA names sent | |
--- | |
SSL handshake has read 665 bytes and written 264 bytes | |
--- | |
New, TLSv1/SSLv3, Cipher is AES256-SHA | |
Server public key is 512 bit | |
Secure Renegotiation IS supported | |
Compression: NONE | |
Expansion: NONE | |
SSL-Session: | |
Protocol : TLSv1 | |
Cipher : AES256-SHA | |
Session-ID: 5DAEA99F390718575EDA3CB6537540AA8BDCCC2E8A69588F3101C823CFD8D2B5 | |
Session-ID-ctx: | |
Master-Key: B2659CC2BA6AD79C62686173945FBA12EE89F5815EA377948DAC91C8B49B8E157995014C1A737FE5EE535F6B851CFC08 | |
Key-Arg : None | |
Start Time: 1333418164 | |
Timeout : 300 (sec) | |
Verify return code: 18 (self signed certificate) | |
--- | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment