| 1 |
################################################################################ |
| 2 |
# Validate Group Replication behavior when members have empty TLS ciphersuites. |
| 3 |
# |
| 4 |
# Test: |
| 5 |
# 0. The test requires two servers: M1 and M2. |
| 6 |
# 1. Setup the first member (M1) with a recovery user that requires TLS 1.3 |
| 7 |
# with default ciphersuites. |
| 8 |
# 2. Add some data and bootstrap start a group on M1. |
| 9 |
# 3. Configure a joining member (M2) to use SSL options and a empty TLS |
| 10 |
# ciphersuite on recovery. Member will not be able to join. |
| 11 |
# 4. Configure a joining member (M2) to use SSL options and a default TLS |
| 12 |
# ciphersuite on recovery. Member will be able to join. |
| 13 |
# 5. Clean up. |
| 14 |
################################################################################ |
| 15 |
|
| 16 |
--source include/have_tlsv13.inc |
| 17 |
--source include/have_group_replication_xcom_communication_stack.inc |
| 18 |
--source include/have_group_replication_plugin.inc |
| 19 |
--let $rpl_skip_group_replication_start= 1 |
| 20 |
--source include/group_replication.inc |
| 21 |
|
| 22 |
--echo # |
| 23 |
--echo # Setup the first member with a recovery user that requires TLS 1.3 |
| 24 |
--echo # |
| 25 |
|
| 26 |
--let $rpl_connection_name= server1 |
| 27 |
--source include/rpl_connection.inc |
| 28 |
|
| 29 |
# create a user for replication that requires ssl encryption |
| 30 |
SET SESSION sql_log_bin=0; |
| 31 |
CREATE USER 'rec_ssl_user'@'%' REQUIRE SSL; |
| 32 |
GRANT replication slave ON *.* TO 'rec_ssl_user'@'%'; |
| 33 |
SET SESSION sql_log_bin=1; |
| 34 |
|
| 35 |
SET @tls_version_saved= @@GLOBAL.tls_version; |
| 36 |
SET GLOBAL tls_version='TLSv1.3'; |
| 37 |
ALTER INSTANCE RELOAD TLS; |
| 38 |
|
| 39 |
--echo # |
| 40 |
--echo # Add some data and start the member |
| 41 |
--echo # |
| 42 |
|
| 43 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 44 |
INSERT INTO t1 VALUES (1); |
| 45 |
|
| 46 |
--source include/start_and_bootstrap_group_replication.inc |
| 47 |
|
| 48 |
--echo # |
| 49 |
--echo # Configure a joining member to use SSL options and a empty TLS |
| 50 |
--echo # ciphersuite on recovery. Member will not be able to join. |
| 51 |
--echo # |
| 52 |
|
| 53 |
--let $rpl_connection_name= server2 |
| 54 |
--source include/rpl_connection.inc |
| 55 |
|
| 56 |
SET SESSION sql_log_bin= 0; |
| 57 |
call mtr.add_suppression("There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials and all MEMBER_HOST column values of performance_schema.replication_group_members table are correct and DNS resolvable."); |
| 58 |
call mtr.add_suppression("Plugin group_replication reported: 'For details please check performance_schema.replication_connection_status table and error log messages of Replica I/O for channel group_replication_recovery."); |
| 59 |
call mtr.add_suppression("Plugin group_replication reported: 'Maximum number of retries when trying to connect to a donor reached. Aborting group replication incremental recovery."); |
| 60 |
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group."); |
| 61 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 62 |
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); |
| 63 |
SET SESSION sql_log_bin= 1; |
| 64 |
|
| 65 |
--disable_warnings |
| 66 |
CHANGE REPLICATION SOURCE TO SOURCE_USER="rec_ssl_user" FOR CHANNEL "group_replication_recovery"; |
| 67 |
--enable_warnings |
| 68 |
|
| 69 |
SET @group_replication_recovery_use_ssl_saved= @@GLOBAL.group_replication_recovery_use_ssl; |
| 70 |
SET GLOBAL group_replication_recovery_use_ssl= 1; |
| 71 |
SET @group_replication_recovery_tls_ciphersuites_saved= @@GLOBAL.group_replication_recovery_tls_ciphersuites; |
| 72 |
SET GLOBAL group_replication_recovery_tls_ciphersuites= ''; |
| 73 |
|
| 74 |
SET @group_replication_recovery_retry_count_saved= @@GLOBAL.group_replication_recovery_retry_count; |
| 75 |
SET GLOBAL group_replication_recovery_retry_count= 1; |
| 76 |
|
| 77 |
--let $group_replication_start_member_state= ERROR |
| 78 |
--source include/start_group_replication.inc |
| 79 |
|
| 80 |
--let $assert_text = incremental recovery connection failed with error CR_SSL_CONNECTION_ERROR |
| 81 |
--let $assert_cond = "[SELECT LAST_ERROR_NUMBER FROM performance_schema.replication_connection_status where CHANNEL_NAME = \'group_replication_recovery\']" = "2026" |
| 82 |
--source include/assert.inc |
| 83 |
|
| 84 |
--source include/stop_group_replication.inc |
| 85 |
|
| 86 |
--echo # |
| 87 |
--echo # Configure a joining member to use SSL options and default TLS |
| 88 |
--echo # ciphersuites on recovery. Member will be able to join. |
| 89 |
--echo # |
| 90 |
|
| 91 |
SET GLOBAL group_replication_recovery_tls_ciphersuites= DEFAULT; |
| 92 |
|
| 93 |
--source include/start_group_replication.inc |
| 94 |
|
| 95 |
--echo # |
| 96 |
--echo # Clean up |
| 97 |
--echo # |
| 98 |
--let $rpl_connection_name= server2 |
| 99 |
--source include/rpl_connection.inc |
| 100 |
SET @@GLOBAL.group_replication_recovery_use_ssl= @group_replication_recovery_use_ssl_saved; |
| 101 |
SET @@GLOBAL.group_replication_recovery_tls_ciphersuites= @group_replication_recovery_tls_ciphersuites_saved; |
| 102 |
SET @@GLOBAL.group_replication_recovery_retry_count= @group_replication_recovery_retry_count_saved; |
| 103 |
|
| 104 |
--let $rpl_connection_name= server1 |
| 105 |
--source include/rpl_connection.inc |
| 106 |
SET @@GLOBAL.tls_version= @tls_version_saved; |
| 107 |
ALTER INSTANCE RELOAD TLS; |
| 108 |
|
| 109 |
SET SESSION sql_log_bin=0; |
| 110 |
DROP USER 'rec_ssl_user'; |
| 111 |
SET SESSION sql_log_bin=1; |
| 112 |
|
| 113 |
DROP TABLE t1; |
| 114 |
|
| 115 |
--source include/group_replication_end.inc |