File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ var common = require ( '../common' ) ;
2
+
3
+ if ( ! process . features . tls_ocsp ) {
4
+ console . error ( 'Skipping because node compiled without OpenSSL or ' +
5
+ 'with old OpenSSL version.' ) ;
6
+ process . exit ( 0 ) ;
7
+ }
8
+
9
+ var assert = require ( 'assert' ) ;
10
+ var tls = require ( 'tls' ) ;
11
+ var constants = require ( 'constants' ) ;
12
+ var fs = require ( 'fs' ) ;
13
+ var join = require ( 'path' ) . join ;
14
+
15
+ var keyFile = join ( common . fixturesDir , 'keys' , 'agent1-key.pem' ) ;
16
+ var certFile = join ( common . fixturesDir , 'keys' , 'agent1-cert.pem' ) ;
17
+ var caFile = join ( common . fixturesDir , 'keys' , 'ca1-cert.pem' ) ;
18
+ var key = fs . readFileSync ( keyFile ) ;
19
+ var cert = fs . readFileSync ( certFile ) ;
20
+
21
+ var server = tls . createServer ( {
22
+ cert : cert ,
23
+ key : key
24
+ } , function ( socket ) {
25
+ socket . destroySoon ( ) ;
26
+ } ) ;
27
+
28
+ // Should not be actually called
29
+ server . on ( 'resumeSession' , function ( id , callback ) {
30
+ assert ( false ) ;
31
+ } ) ;
32
+
33
+ server . listen ( common . PORT , function ( ) {
34
+ var client = tls . connect ( {
35
+ rejectUnauthorized : false ,
36
+ port : common . PORT ,
37
+
38
+ // Just to make sure that `newSession` is going to be called
39
+ secureOptions : constants . SSL_OP_NO_TICKET
40
+ } , function ( ) {
41
+ server . close ( ) ;
42
+ } ) ;
43
+ } ) ;
You can’t perform that action at this time.
0 commit comments