@@ -85,9 +85,13 @@ function test(dhparam, keylen, expectedCipher, expectedError) {
8585 } ;
8686
8787 const server = tls . createServer ( options , ( conn ) => conn . end ( ) ) ;
88- if ( typeof expectedError === 'string' ) {
88+ if ( typeof expectedError === 'string' || Array . isArray ( expectedError ) ) {
8989 server . once ( 'tlsClientError' , common . mustCall ( ( err ) => {
90- assert . strictEqual ( err . code , expectedError ) ;
90+ if ( Array . isArray ( expectedError ) ) {
91+ assert . ok ( expectedError . includes ( err . code ) , err ) ;
92+ } else {
93+ assert . strictEqual ( err . code , expectedError ) ;
94+ }
9195 } ) ) ;
9296 }
9397
@@ -160,7 +164,10 @@ function testCustomParam(keylen, expectedCipher, expectedError) {
160164 await testCustomParam ( 2048 , dheCipher ) ;
161165 } else {
162166 const errorCode = hasFIPS ( 3 , 5 ) ?
163- 'ERR_SSL_INVALID_KEY_LENGTH' : 'ERR_SSL_INTERNAL_ERROR' ;
167+ [
168+ 'ERR_SSL_INVALID_KEY_LENGTH' ,
169+ 'ERR_SSL_SSL/TLS_ALERT_ILLEGAL_PARAMETER' ,
170+ ] : 'ERR_SSL_INTERNAL_ERROR' ;
164171 await testCustomParam ( 3072 , null , errorCode ) ;
165172 await testCustomParam ( 2048 , null , errorCode ) ;
166173 }
0 commit comments