2014-11-18 17:57:06 +01:00
#
# MDEV-6975 Implement TLS protocol
#
# test SSLv3 and TLSv1.2 ciphers when OpenSSL is restricted to SSLv3 or TLSv1.2
#
source include/have_ssl_communication.inc;
2017-03-08 17:39:47 +01:00
source include/require_openssl_client.inc;
2014-11-18 17:57:06 +01:00
# this is OpenSSL test.
2015-08-11 18:45:38 +02:00
create user ssl_sslv3@localhost;
2017-03-08 17:39:47 +01:00
# grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
2015-08-11 18:45:38 +02:00
create user ssl_tls12@localhost;
2014-11-18 17:57:06 +01:00
grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256";
let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1;
disable_abort_on_error;
echo TLS1.2 ciphers: user is ok with any cipher;
exec $mysql --ssl-cipher=AES128-SHA256;
2016-04-25 15:37:24 +03:00
--replace_result DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-GCM-SHA384
2017-03-08 17:39:47 +01:00
--replace_result ECDHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-GCM-SHA384
exec $mysql --ssl-cipher=TLSv1.2
echo TLS1.2 ciphers: user requires SSLv3 cipher AES128-SHA;
2014-11-18 17:57:06 +01:00
exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA256;
exec $mysql --user ssl_sslv3 --ssl-cipher=TLSv1.2;
echo TLS1.2 ciphers: user requires TLSv1.2 cipher AES128-SHA256;
exec $mysql --user ssl_tls12 --ssl-cipher=AES128-SHA256;
exec $mysql --user ssl_tls12 --ssl-cipher=TLSv1.2;
echo SSLv3 ciphers: user is ok with any cipher;
2017-03-08 17:39:47 +01:00
exec $mysql --ssl-cipher=AES256-SHA;
exec $mysql --ssl-cipher=DHE-RSA-AES256-SHA
echo SSLv3 ciphers: user requires SSLv3 cipher AES128-SHA;
exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA;
2014-11-18 17:57:06 +01:00
exec $mysql --user ssl_sslv3 --ssl-cipher=SSLv3;
echo SSLv3 ciphers: user requires TLSv1.2 cipher AES128-SHA256;
2017-03-08 17:39:47 +01:00
exec $mysql --user ssl_tls12 --ssl-cipher=AES128-SHA;
2014-11-18 17:57:06 +01:00
exec $mysql --user ssl_tls12 --ssl-cipher=SSLv3;
drop user ssl_sslv3@localhost;
drop user ssl_tls12@localhost;