~ubuntu-branches/ubuntu/trusty/nodejs/trusty-proposed

« back to all changes in this revision

Viewing changes to test/simple/test-tls-connect.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-12-12 23:04:07 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20131212230407-xfa6gka4c6oatsx1
Tags: 0.10.23~dfsg1-1
* Upstream update.
* Refresh patches, remove 1005 patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    errorEmitted = true;
51
51
  });
52
52
})();
 
53
 
 
54
// SSL_accept/SSL_connect error handling
 
55
(function() {
 
56
  var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
 
57
  var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
 
58
 
 
59
  var errorEmitted = false;
 
60
 
 
61
  process.on('exit', function() {
 
62
    assert.ok(errorEmitted);
 
63
  });
 
64
 
 
65
  var conn = tls.connect({
 
66
    cert: cert,
 
67
    key: key,
 
68
    port: common.PORT,
 
69
    ciphers: 'rick-128-roll'
 
70
  }, function() {
 
71
    assert.ok(false); // callback should never be executed
 
72
  });
 
73
 
 
74
  conn.on('error', function() {
 
75
    errorEmitted = true;
 
76
  });
 
77
})();