1 var common = require('../common');
2 var assert = require('assert');
4 if (!common.hasCrypto) {
5 console.log('1..0 # Skipped: missing crypto');
8 var tls = require('tls');
10 var fs = require('fs');
11 var path = require('path');
13 var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
14 var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
16 var errorEmitted = false;
18 var server = tls.createServer({
23 setTimeout(function() {
27 }).listen(common.PORT, function() {
28 var conn = tls.connect({
31 rejectUnauthorized: false,
34 setTimeout(function() {
39 // SSL_write() call's return value, when called 0 bytes, should not be
43 conn.on('error', function(err) {
49 process.on('exit', function() {
50 assert.ok(!errorEmitted);