@@ -26,8 +26,8 @@ function test(cmin, cmax, cprot, smin, smax, sprot, expect) {
2626 secureProtocol : sprot ,
2727 } ,
2828 } , 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 ) ;
3131 return cleanup ( ) ;
3232 }
3333
@@ -53,18 +53,22 @@ const U = undefined;
5353test ( U , U , U , U , U , U , 'TLSv1.2' ) ;
5454
5555// 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 ' ) ;
6262
6363// 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' ) ;
6872
6973// TLS_method means "any supported protocol".
7074test ( U , U , 'TLSv1_2_method' , U , U , 'TLS_method' , 'TLSv1.2' ) ;
0 commit comments