@@ -26,8 +26,8 @@ function test(cmin, cmax, cprot, smin, smax, sprot, expect) {
26
26
secureProtocol : sprot ,
27
27
} ,
28
28
} , common . mustCall ( ( err , pair , cleanup ) => {
29
- if ( expect && ! expect . match ( / ^ T L S / ) ) {
30
- assert ( err . message . match ( expect ) ) ;
29
+ if ( expect && expect . match ( / ^ E R R / ) ) {
30
+ assert . strictEqual ( err . code , expect ) ;
31
31
return cleanup ( ) ;
32
32
}
33
33
@@ -53,18 +53,22 @@ const U = undefined;
53
53
test ( U , U , U , U , U , U , 'TLSv1.2' ) ;
54
54
55
55
// Insecure or invalid protocols cannot be enabled.
56
- test ( U , U , U , U , U , 'SSLv2_method' , 'SSLv2 methods disabled ' ) ;
57
- test ( U , U , U , U , U , 'SSLv3_method' , 'SSLv3 methods disabled ' ) ;
58
- test ( U , U , 'SSLv2_method' , U , U , U , 'SSLv2 methods disabled ' ) ;
59
- test ( U , U , 'SSLv3_method' , U , U , U , 'SSLv3 methods disabled ' ) ;
60
- test ( U , U , 'hokey-pokey' , U , U , U , 'Unknown method ' ) ;
61
- test ( U , U , U , U , U , 'hokey-pokey' , 'Unknown method ' ) ;
56
+ test ( U , U , U , U , U , 'SSLv2_method' , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
57
+ test ( U , U , U , U , U , 'SSLv3_method' , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
58
+ test ( U , U , 'SSLv2_method' , U , U , U , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
59
+ test ( U , U , 'SSLv3_method' , U , U , U , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
60
+ test ( U , U , 'hokey-pokey' , U , U , U , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
61
+ test ( U , U , U , U , U , 'hokey-pokey' , 'ERR_TLS_INVALID_PROTOCOL_METHOD ' ) ;
62
62
63
63
// Cannot use secureProtocol and min/max versions simultaneously.
64
- test ( U , U , U , U , 'TLSv1.2' , 'TLS1_2_method' , 'conflicts with secureProtocol' ) ;
65
- test ( U , U , U , 'TLSv1.2' , U , 'TLS1_2_method' , 'conflicts with secureProtocol' ) ;
66
- test ( U , 'TLSv1.2' , 'TLS1_2_method' , U , U , U , 'conflicts with secureProtocol' ) ;
67
- test ( 'TLSv1.2' , U , 'TLS1_2_method' , U , U , U , 'conflicts with secureProtocol' ) ;
64
+ test ( U , U , U , U , 'TLSv1.2' , 'TLS1_2_method' ,
65
+ 'ERR_TLS_PROTOCOL_VERSION_CONFLICT' ) ;
66
+ test ( U , U , U , 'TLSv1.2' , U , 'TLS1_2_method' ,
67
+ 'ERR_TLS_PROTOCOL_VERSION_CONFLICT' ) ;
68
+ test ( U , 'TLSv1.2' , 'TLS1_2_method' , U , U , U ,
69
+ 'ERR_TLS_PROTOCOL_VERSION_CONFLICT' ) ;
70
+ test ( 'TLSv1.2' , U , 'TLS1_2_method' , U , U , U ,
71
+ 'ERR_TLS_PROTOCOL_VERSION_CONFLICT' ) ;
68
72
69
73
// TLS_method means "any supported protocol".
70
74
test ( U , U , 'TLSv1_2_method' , U , U , 'TLS_method' , 'TLSv1.2' ) ;
0 commit comments