# server certificate signing request and private key. Note the very long subject (for MDEV-7859)
openssl req -newkey rsa:1024-keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes-subj'/CN=localhost/C=FI/ST=state or province within country, in other certificates in this file it is the same as L/L=location, usually an address but often ambiguously used/OU=organizational unit name, a division name within an organization/O=organization name, typically a company name'
openssl req -newkey rsa:2048-keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes-subj'/CN=localhost/C=FI/ST=state or province within country, in other certificates in this file it is the same as L/L=location, usually an address but often ambiguously used/OU=organizational unit name, a division name within an organization/O=organization name, typically a company name'
--echo# test --crl for the client : should connect
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pemtest--ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl-e"SHOW VARIABLES like '%ssl%';"
--echo# test --crlpath for the client : should connect
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem--ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldirtest-e"SHOW VARIABLES like '%ssl%';"
--echo# try logging in with a certificate not in the server's --ssl-crl : should succeed
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/server-new-cert.pemtest-e"SHOW STATUS LIKE 'Ssl_version'"
--echo# try logging in with a certificate in the server's --ssl-crl : should fail
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is wrong
--replace_result"ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0""ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked"
--error1
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pemtest-e"SHOW VARIABLES like '%ssl%';"
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pemtest-e"SHOW STATUS LIKE 'Ssl_version'"2>&1
# This test should work in embedded server after we fix mysqltest
--sourceinclude/not_embedded.inc
--sourceinclude/have_openssl.inc
--echo# test --crl for the client : should connect
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pemtest--ssl-crl=$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl-e"SHOW VARIABLES like '%ssl%';"
--echo# test --crlpath for the client : should connect
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem--ssl-crlpath=$MYSQL_TEST_DIR/std_data/crldirtest-e"SHOW VARIABLES like '%ssl%';"
--echo# try logging in with a certificate in the server's --ssl-crlpath : should fail
--replace_result$MYSQL_TEST_DIRMYSQL_TEST_DIR
--error1
--exec$MYSQL--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem--ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pemtest-e"SHOW VARIABLES like '%ssl%';"
Subject: C=FI, ST=state or province within country, in other certificates in this file it is the same as L, L=location, usually an address but often ambiguously used, O=organization name, typically a company name, OU=organizational unit name, a division name within an organization, CN=localhost