Current Path : /usr/opt/mysql57/mysql-test/suite/auth_sec/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/auth_sec/t/ssl_auto_detect.test |
--source include/not_embedded.inc --source include/allowed_ciphers.inc # Save the initial number of concurrent sessions --source include/count_sessions.inc #------------------------------------------------------------------------------ --echo # Global Setup call mtr.add_suppression("Failed to setup SSL"); call mtr.add_suppression("SSL error: SSL_CTX_set_default_verify_paths failed"); let DATADIR_LOCATION=$MYSQLTEST_VARDIR/mysqld.1/data; let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err; let SEARCH_FILE= $server_log; #------------------------------------------------------------------------------ --echo # Case 1 : Enable SSL automatically if ca.pem, server-cert.pem and --echo # sever-key.pem are present in data directory let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; --exec echo "wait" > $restart_file --shutdown_server 10 --source include/wait_until_disconnected.inc perl; my $filetodelete = "$ENV{'MYSQLTEST_VARDIR'}/log/mysqld.1.err"; while (-e $filetodelete) { unlink $filetodelete; sleep 1; } EOF --echo # Copy SSL certificates before restarting. --echo # They should be picked up automatically by server. --copy_file std_data/cacert.pem $DATADIR_LOCATION/ca.pem --copy_file std_data/server-cert.pem $DATADIR_LOCATION/server-cert.pem --copy_file std_data/server-key.pem $DATADIR_LOCATION/server-key.pem --exec echo "restart" > $restart_file --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect --echo # Restart completed. --echo # Search for : Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. let SEARCH_PATTERN= Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.; --source include/search_pattern_in_file.inc --echo # Search for : CA certificate is self signed.; let SEARCH_PATTERN= CA certificate .* is self signed.; --source include/search_pattern_in_file.inc --echo # Try to establish SSL connection : This must succeed. connect (ssl_root_1,localhost,root,,,,,SSL); --replace_regex $ALLOWED_CIPHERS_REGEX SHOW STATUS LIKE 'Ssl_cipher'; SHOW VARIABLES LIKE 'have_ssl'; --echo # Check values of ssl_ca, ssl_cert and ssl_key. --echo # They should refer to certificate/key files in data directory. SHOW VARIABLES LIKE 'ssl_ca'; SHOW VARIABLES LIKE 'ssl_cert'; SHOW VARIABLES LIKE 'ssl_key'; connection default; disconnect ssl_root_1; --echo # Connect using mysql client : This must succeed. --replace_regex $ALLOWED_CIPHERS_REGEX --exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';" #------------------------------------------------------------------------------ --echo # Case 2 : Remove server-key.pem and observe that server starts --echo # without SSL capability let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; --exec echo "wait" > $restart_file --shutdown_server 10 --source include/wait_until_disconnected.inc perl; my $filetodelete = "$ENV{'MYSQLTEST_VARDIR'}/log/mysqld.1.err"; while (-e $filetodelete) { unlink $filetodelete; sleep 1; } EOF --echo # Remove one of the certificates/keys. --remove_file $DATADIR_LOCATION/server-key.pem --exec echo "restart" > $restart_file --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect --echo # Restart completed. --echo # Check value of have_ssl. It must be DISABLED. connect (root_2,localhost,root,,,,,); SHOW VARIABLES LIKE 'have_ssl'; connection default; disconnect root_2; --echo # Try creating SSL connection using mysql connection. It should fail. --error 1 --exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';" #------------------------------------------------------------------------------ --echo # --echo # Bug#21108296 : --SSL-CIPHER OPTION CAUSES SSL INITIALIZATION FAILURE --echo # let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; --exec echo "wait" > $restart_file --shutdown_server 10 --source include/wait_until_disconnected.inc --copy_file std_data/server-key.pem $DATADIR_LOCATION/server-key.pem --exec echo "restart: --ssl-cipher=DHE-RSA-AES256-SHA" > $restart_file --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect --echo # Restart completed. --echo # Search for : Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. let SEARCH_PATTERN= Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.; --source include/search_pattern_in_file.inc --echo # Search for : CA certificate is self signed.; let SEARCH_PATTERN= CA certificate .* is self signed.; --source include/search_pattern_in_file.inc --echo # Try creating SSL connection --replace_regex $ALLOWED_CIPHERS_REGEX --exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';" #------------------------------------------------------------------------------ --echo # Global Cleanup --remove_file $DATADIR_LOCATION/ca.pem --remove_file $DATADIR_LOCATION/server-cert.pem --remove_file $DATADIR_LOCATION/server-key.pem # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc --source include/force_restart.inc #------------------------------------------------------------------------------