-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: Updated tls-getcipher test #9923
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
'use strict'; | ||
var common = require('../common'); | ||
var assert = require('assert'); | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
if (!common.hasCrypto) { | ||
common.skip('missing crypto'); | ||
return; | ||
} | ||
var tls = require('tls'); | ||
const tls = require('tls'); | ||
|
||
var fs = require('fs'); | ||
var cipher_list = ['AES128-SHA256', 'AES256-SHA256']; | ||
var cipher_version_pattern = /TLS|SSL/; | ||
var options = { | ||
const fs = require('fs'); | ||
const cipher_list = ['AES128-SHA256', 'AES256-SHA256']; | ||
const cipher_version_pattern = /TLS|SSL/; | ||
const options = { | ||
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), | ||
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'), | ||
ciphers: cipher_list.join(':'), | ||
honorCipherOrder: true | ||
}; | ||
|
||
var server = tls.createServer(options, | ||
const server = tls.createServer(options, | ||
common.mustCall(function(cleartextStream) {})); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be lined up now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by lined up? Sorry, still new to this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ethan-Arrowood The argument ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay I went ahead and fixed that issue and made another commit |
||
|
||
server.listen(0, '127.0.0.1', function() { | ||
var client = tls.connect({ | ||
server.listen(0, '127.0.0.1', common.mustCall(function() { | ||
const client = tls.connect({ | ||
host: '127.0.0.1', | ||
port: this.address().port, | ||
ciphers: cipher_list.join(':'), | ||
rejectUnauthorized: false | ||
}, function() { | ||
var cipher = client.getCipher(); | ||
assert.equal(cipher.name, cipher_list[0]); | ||
}, common.mustCall(function() { | ||
const cipher = client.getCipher(); | ||
assert.strictEqual(cipher.name, cipher_list[0]); | ||
assert(cipher_version_pattern.test(cipher.version)); | ||
client.end(); | ||
server.close(); | ||
}); | ||
}); | ||
})); | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you please move this require after the
hasCrypto
check?