Skip to content

Commit 2ba1740

Browse files
committed
test: add missing crypto checks
Add a check for crypto before using it, similar to how other tests work. PR-URL: #2129 Reviewed-By: Shigeki Ohtsu <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent ee3ce2e commit 2ba1740

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/internet/test-tls-connnect-cnnic.js

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
// 0x44, 0xB5, 0x00, 0x76, 0x48, 0x11, 0x41, 0xED },
88
// },
99
// in src/CNNICHashWhitelist.inc
10+
11+
var common = require('../common');
12+
if (!common.hasCrypto) {
13+
console.log('1..0 # Skipped: missing crypto');
14+
process.exit();
15+
}
16+
1017
var tls = require('tls');
1118
var socket = tls.connect(443, 'www1.cnnic.cn', function() {
1219
socket.resume();

test/internet/test-tls-connnect-melissadata.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
'use strict';
22
// Test for authorized access to the server which has a cross root
33
// certification between Starfield Class 2 and ValiCert Class 2
4+
5+
var common = require('../common');
6+
if (!common.hasCrypto) {
7+
console.log('1..0 # Skipped: missing crypto');
8+
process.exit();
9+
}
10+
411
var tls = require('tls');
512
var socket = tls.connect(443, 'address.melissadata.net', function() {
613
socket.resume();

0 commit comments

Comments
 (0)