@@ -432,7 +432,7 @@ TEST_F(Sess, ssl_session)
432
432
}
433
433
434
434
435
- // using wrong ssl-ca and ssl-ca-path as SessionSettings
435
+ // using wrong ssl-ca as SessionSettings
436
436
{
437
437
EXPECT_THROW (
438
438
mysqlx::XSession sess (SessionSettings::PORT, get_port (),
@@ -497,6 +497,62 @@ TEST_F(Sess, ssl_session)
497
497
EXPECT_FALSE (cipher.empty ());
498
498
}
499
499
500
+ // using ssl-enable and ssl-ca as SessionSettings
501
+ {
502
+ mysqlx::XSession sess (SessionSettings::PORT, get_port (),
503
+ SessionSettings::USER,get_user (),
504
+ SessionSettings::PWD, get_password () ? get_password () : NULL ,
505
+ SessionSettings::SSL_ENABLE, true ,
506
+ SessionSettings::SSL_CA, ssl_ca);
507
+
508
+ SqlResult res = sess.bindToDefaultShard ().sql (" SHOW STATUS LIKE 'mysqlx_ssl_cipher'" ).execute ();
509
+
510
+ auto row = res.fetchOne ();
511
+ cout << row[0 ] << " :" << row[1 ] << endl;
512
+
513
+ string cipher = row[1 ];
514
+
515
+ EXPECT_FALSE (cipher.empty ());
516
+
517
+ }
518
+
519
+ // using ssl-ca as SessionSettings
520
+ {
521
+ mysqlx::XSession sess (SessionSettings::PORT, get_port (),
522
+ SessionSettings::USER,get_user (),
523
+ SessionSettings::PWD, get_password () ? get_password () : NULL ,
524
+ SessionSettings::SSL_CA, ssl_ca);
525
+
526
+ SqlResult res = sess.bindToDefaultShard ().sql (" SHOW STATUS LIKE 'mysqlx_ssl_cipher'" ).execute ();
527
+
528
+ auto row = res.fetchOne ();
529
+ cout << row[0 ] << " :" << row[1 ] << endl;
530
+
531
+ string cipher = row[1 ];
532
+
533
+ EXPECT_FALSE (cipher.empty ());
534
+
535
+ }
536
+
537
+ // using ssl-ca but ssl-enable = false on SessionSettings
538
+ {
539
+ mysqlx::XSession sess (SessionSettings::PORT, get_port (),
540
+ SessionSettings::USER,get_user (),
541
+ SessionSettings::PWD, get_password () ? get_password () : NULL ,
542
+ SessionSettings::SSL_ENABLE, false ,
543
+ SessionSettings::SSL_CA, ssl_ca);
544
+
545
+ SqlResult res = sess.bindToDefaultShard ().sql (" SHOW STATUS LIKE 'mysqlx_ssl_cipher'" ).execute ();
546
+
547
+ auto row = res.fetchOne ();
548
+ cout << row[0 ] << " :" << row[1 ] << endl;
549
+
550
+ string cipher = row[1 ];
551
+
552
+ EXPECT_TRUE (cipher.empty ());
553
+
554
+ }
555
+
500
556
}
501
557
502
558
TEST_F (Sess, ipv6)
0 commit comments