node/test/simple/test-tls-ssl2-methods.js
Ben Noordhuis dbfc9d9241 crypto,tls: remove SSLv2 support
Remove support for SSLv2 because of DROWN (CVE-2016-0800).

Use of the `--enable-ssl2` flag is now an error; node will print an
error message and exit.

PR-URL: https://github.com/nodejs/node/pull/5536
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-03-03 16:32:38 -06:00

20 lines
436 B
JavaScript

'use strict';
var common = require('../common');
var assert = require('assert');
try {
var crypto = require('crypto');
} catch (e) {
console.log('1..0 # Skipped: missing crypto');
return;
}
var methods = ['SSLv2_method', 'SSLv2_client_method', 'SSLv2_server_method'];
methods.forEach(function(method) {
assert.throws(function() {
crypto.createCredentials({ secureProtocol: method });
}, /SSLv2 methods disabled/);
});