@@ -12,7 +12,6 @@ describe('ssl', function() {
1212
1313 before ( function ( done ) {
1414 if ( process . env . MAXSCALE_VERSION ) this . skip ( ) ;
15- console . log ( tls . DEFAULT_MIN_VERSION ) ;
1615 if (
1716 process . platform === 'win32' &&
1817 tls . DEFAULT_MIN_VERSION === 'TLSv1.2' &&
@@ -392,7 +391,7 @@ describe('ssl', function() {
392391 . createConnection ( { host : 'mariadb.example.com' , ssl : { ca : ca } } )
393392 . then ( conn => {
394393 const isWin = process . platform === 'win32' ;
395- let expectedProtocol = 'TLSv1.2' ;
394+ let expectedProtocol = [ 'TLSv1.2' , 'TLSv1.3' ] ;
396395 if ( shareConn . info . isMariaDB ( ) ) {
397396 if ( isWin && ! shareConn . info . hasMinVersion ( 10 , 4 , 0 ) ) {
398397 expectedProtocol = 'TLSv1.1' ;
@@ -527,7 +526,17 @@ describe('ssl', function() {
527526
528527function checkProtocol ( conn , protocol ) {
529528 const ver = process . version . substring ( 1 ) . split ( '.' ) ;
530- if ( ver [ 0 ] > 5 || ( ver [ 0 ] === 5 && ver [ 1 ] === 7 ) ) {
531- assert . equal ( conn . __tests . getSocket ( ) . getProtocol ( ) , protocol ) ;
529+ const currentProtocol = conn . __tests . getSocket ( ) . getProtocol ( ) ;
530+
531+ if ( ver [ 0 ] > 5 || ( ver [ 0 ] == 5 && ver [ 1 ] == 7 ) ) {
532+ if ( Array . isArray ( protocol ) ) {
533+ for ( let i = 0 ; i < protocol . length ; i ++ ) {
534+ if ( currentProtocol === protocol [ i ] ) return ;
535+ }
536+ //throw error
537+ assert . equal ( currentProtocol , protocol ) ;
538+ return ;
539+ }
540+ assert . equal ( currentProtocol , protocol ) ;
532541 }
533542}
0 commit comments