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 crypto = require('crypto'); | |
var tls = require('tls'); | |
var net = require('net'); | |
function starttls(socket, options, isServer, cb) { | |
var credentials = crypto.createCredentials(options); | |
var pair = tls.createSecurePair(credentials, isServer, false, !isServer); | |
var cleartext = pipe(pair, socket); |
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 countries = [{ | |
"name": "Afghanistan", | |
"code": "AF", | |
"isEu": false | |
}, { | |
"name": "Albania", | |
"code": "AL", | |
"isEu": false | |
}, { | |
"name": "Algeria", |
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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function (encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; | |
var config = { |
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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; |
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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; |
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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; |
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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; |
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
/* | |
After running this script, please run: | |
openssl s_client -reconnect -state -prexit -connect localhost:41443 2> /dev/null|grep -P "(New|Reused)" | |
Needs at least: | |
> openssl version | |
OpenSSL 1.0.1e 11 Feb 2013 | |
Expected behaviour: OpenSSL should report all new connections since resumeSession is | |
returning null session data. Both newSession and resumeSession should | |
work, although in this setup only newSession should be called. |
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
function sortObjectKeys(unsortedObject) { | |
if(typeof unsortedObject !== 'object') | |
return unsortedObject; | |
var sortedObject = {}; | |
Object.keys(unsortedObject).sort().forEach(function(k) { | |
sortedObject[k] = sortObjectKeys(unsortedObject[k]); | |
}); | |
return sortedObject; | |
} |
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
#!/usr/bin/env node | |
var tls = require('tls'); | |
var crypto = require('crypto'); | |
function b64decode(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; | |
var ciphers = "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS"; |
OlderNewer