Debian Codegraph @

mysql-test/suite/auth_sec/t/tls.test

raw
1 # Want to skip this test from daily Valgrind execution
2 --source include/no_valgrind_without_big.inc
3
4
5 # Save the initial number of concurrent sessions
6 --source include/count_sessions.inc
7 --source include/allowed_ciphers.inc
8
9 --echo #
10 --echo # WL#8196 TLSv1.2 support
11 --echo #
12
13 --disable_query_log
14 call mtr.add_suppression("Failed to initialize TLS for channel: mysql_main");
15 call mtr.add_suppression("Failed to set up SSL because of");
16 call mtr.add_suppression("Plugin mysqlx reported: 'Failed at SSL configuration");
17 --enable_query_log
18
19 # We let our server restart attempts write to the file $error_log.
20 let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
21
22 --error 0,1
23 --remove_file $error_log
24
25 let $MYSQLD_DATADIR= `SELECT @@datadir`;
26 let $MYSQL_SOCKET= `SELECT @@socket`;
27 let $MYSQL_PORT= `SELECT @@port`;
28
29 --echo #T1: Default TLS connection
30 --replace_result TLSv1.2 TLS_VERSION TLSv1.3 TLS_VERSION
31 --exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_version'"
32
33 --echo #T2: Default SSL cipher
34 --replace_regex $ALLOWED_CIPHERS_REGEX
35 --exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_cipher'"
36
37 --echo #T3: Setting TLS version TLSv1.2 from the client
38 --exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT --tls-version=TLSv1.2 -e "SHOW STATUS like 'Ssl_version'"
39
40 --echo #T7: Setting invalid TLS version value from the client, it should give error.
41 --error 1
42 --exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT --tls-version=TLS_INVALID_VERSION -e "SHOW STATUS like 'Ssl_version'"
43
44 --echo #T9: Cipher which is not in the cipher list but not restricted permanently, setting the server cipher as well
45
46 --echo Restart server and provide ssl-cipher at server startup
47 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
48 --shutdown_server
49 --source include/wait_until_disconnected.inc
50
51 --exec echo "restart:--tls-version=TLSv1.2 --ssl-cipher=ECDHE-RSA-AES128-GCM-SHA256 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
52 --enable_reconnect
53 --source include/wait_until_connected_again.inc
54
55 --exec $MYSQL -h 127.0.0.1 -P $MYSQL_PORT --tls-version=TLSv1.2 --ssl-cipher=ECDHE-RSA-AES128-GCM-SHA256 -e "SHOW STATUS like 'Ssl_cipher'"
56
57 --echo #T10: Permanently restricted cipher, setting in the server as well
58 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
59 --shutdown_server
60 --source include/wait_until_disconnected.inc
61
62 --exec echo "restart:--tls-version=TLSv1.2 --ssl-cipher=DHE-DSS-DES-CBC3-SHA --tls-ciphersuites='' " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
63 --enable_reconnect
64 --source include/wait_until_connected_again.inc
65
66 --echo Connection will be possible, but server will not be enabled with ssl and connection is not ssl-enabled
67 --exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT --tls-version=TLSv1.2 --ssl-cipher=DHE-DSS-DES-CBC3-SHA -e "SHOW STATUS like 'Ssl_cipher'"
68
69 --echo # restart server using restart
70 --echo Restart server and provide ssl-cipher at server startup
71 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
72 --shutdown_server
73 --source include/wait_until_disconnected.inc
74
75 --exec echo "restart: " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
76 --enable_reconnect
77 --source include/wait_until_connected_again.inc
78