| 1 |
# |
| 2 |
# Test reloading of Galera SSL certificate without shutting down node |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_openssl.inc |
| 7 |
--source include/have_ssl_communication.inc |
| 8 |
--source include/force_restart.inc |
| 9 |
|
| 10 |
--let $galera_version=26.4.8 |
| 11 |
source ../../wsrep/include/check_galera_version.inc; |
| 12 |
|
| 13 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 14 |
|
| 15 |
# Save original auto_increment_offset values. |
| 16 |
--let $node_1=node_1 |
| 17 |
--let $node_2=node_2 |
| 18 |
--let $node_3=node_3 |
| 19 |
--source ../galera/include/auto_increment_offset_save.inc |
| 20 |
|
| 21 |
# Setup galera ports |
| 22 |
--connection node_1 |
| 23 |
--source suite/galera/include/galera_base_port.inc |
| 24 |
--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT |
| 25 |
|
| 26 |
--connection node_2 |
| 27 |
--source suite/galera/include/galera_base_port.inc |
| 28 |
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT |
| 29 |
|
| 30 |
# Setup temporary file for SSL reloading |
| 31 |
let $ssl_cert = $MYSQLTEST_VARDIR/tmp/ssl_cert.pem; |
| 32 |
let $ssl_key = $MYSQLTEST_VARDIR/tmp/ssl_key.pem; |
| 33 |
let $ssl_ca = $MYSQLTEST_VARDIR/tmp/ssl_ca.pem; |
| 34 |
|
| 35 |
copy_file std_data/cacert.pem $ssl_ca; |
| 36 |
copy_file std_data/client-cert.pem $ssl_cert; |
| 37 |
copy_file std_data/client-key.pem $ssl_key; |
| 38 |
|
| 39 |
--connection node_2 |
| 40 |
--source include/shutdown_mysqld.inc |
| 41 |
--let $restart_noprint=1 |
| 42 |
--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1 --wsrep_provider_options=base_port=$NODE_GALERAPORT_2;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=$MYSQLTEST_VARDIR/tmp/ssl_cert.pem;socket.ssl_key=$MYSQLTEST_VARDIR/tmp/ssl_key.pem |
| 43 |
--source include/start_mysqld.inc |
| 44 |
--source include/galera_wait_ready.inc |
| 45 |
|
| 46 |
# Set certificate and key and reload by setting directly `wsrep_provider_options` |
| 47 |
remove_file $ssl_cert; |
| 48 |
remove_file $ssl_key; |
| 49 |
copy_file std_data/client-cert.pem $ssl_cert; |
| 50 |
copy_file std_data/client-key.pem $ssl_key; |
| 51 |
SET GLOBAL wsrep_provider_options = 'socket.ssl_reload=1'; |
| 52 |
|
| 53 |
--connection node_3 |
| 54 |
--source include/shutdown_mysqld.inc |
| 55 |
--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 |
| 56 |
--source include/start_mysqld.inc |
| 57 |
|
| 58 |
# Set certificate and key and reload by executing `FLUSH SSL` |
| 59 |
--connection node_2 |
| 60 |
remove_file $ssl_cert; |
| 61 |
remove_file $ssl_key; |
| 62 |
copy_file std_data/galera_certs/galera.1.crt $ssl_cert; |
| 63 |
copy_file std_data/galera_certs/galera.1.key $ssl_key; |
| 64 |
FLUSH SSL; |
| 65 |
|
| 66 |
# Cleanup |
| 67 |
remove_file $ssl_ca; |
| 68 |
remove_file $ssl_cert; |
| 69 |
remove_file $ssl_key; |
| 70 |
|
| 71 |
--connection node_3 |
| 72 |
call mtr.add_suppression("WSREP: Handshake failed: unexpected eof while reading"); |
| 73 |
--connection node_2 |
| 74 |
call mtr.add_suppression("WSREP: Handshake failed: unexpected eof while reading"); |
| 75 |
--connection node_1 |
| 76 |
call mtr.add_suppression("WSREP: Handshake failed: unexpected eof while reading"); |
| 77 |
|
| 78 |
# Restore original auto_increment_offset values. |
| 79 |
--source ../galera/include/auto_increment_offset_restore.inc |