@@ -7,12 +7,13 @@ if (!common.hasCrypto)
77const assert = require ( 'assert' ) ;
88const tls = require ( 'tls' ) ;
99const fixtures = require ( '../common/fixtures' ) ;
10+ const { hasOpenSSL } = require ( '../common/crypto' ) ;
1011
1112{
1213 const options = {
1314 key : fixtures . readKey ( 'agent2-key.pem' ) ,
1415 cert : fixtures . readKey ( 'agent2-cert.pem' ) ,
15- ciphers : 'aes256-sha '
16+ ciphers : 'DES-CBC-SHA '
1617 } ;
1718 assert . throws ( ( ) => tls . createServer ( options , common . mustNotCall ( ) ) ,
1819 / n o [ _ ] c i p h e r [ _ ] m a t c h / i) ;
@@ -23,3 +24,19 @@ const fixtures = require('../common/fixtures');
2324 assert . throws ( ( ) => tls . createServer ( options , common . mustNotCall ( ) ) ,
2425 / n o [ _ ] c i p h e r [ _ ] m a t c h / i) ;
2526}
27+
28+ // Cipher name matching is case-sensitive prior to OpenSSL 4.0, and
29+ // case-insensitive starting with OpenSSL 4.0.
30+ {
31+ const options = {
32+ key : fixtures . readKey ( 'agent2-key.pem' ) ,
33+ cert : fixtures . readKey ( 'agent2-cert.pem' ) ,
34+ ciphers : 'aes256-sha' ,
35+ } ;
36+ if ( hasOpenSSL ( 4 , 0 ) ) {
37+ tls . createServer ( options ) . close ( ) ;
38+ } else {
39+ assert . throws ( ( ) => tls . createServer ( options , common . mustNotCall ( ) ) ,
40+ / n o [ _ ] c i p h e r [ _ ] m a t c h / i) ;
41+ }
42+ }
0 commit comments