1
source include/have_ssl_communication.inc;
2
source include/master-slave.inc;
4
# We don't test all types of ssl auth params here since it's a bit hard
5
# until problems with OpenSSL 0.9.7 are unresolved
7
# creating replication user for whom ssl auth is required
10
grant replication slave on *.* to replssl@localhost require ssl;
11
create table t1 (t int);
18
#trying to use this user without ssl
20
change master to master_user='replssl',master_password='';
23
#showing that replication don't work
25
insert into t1 values (1);
26
#reasonable timeout for changes to propagate to slave
27
let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
28
source include/wait_condition.inc;
32
#showing that replication could work with ssl params
34
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
35
eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
38
#avoiding unneeded sleeps
44
#checking that replication is ok
47
#checking show slave status
48
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
49
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
50
query_vertical show slave status;
52
#checking if replication works without ssl also performing clean up
54
change master to master_user='root',master_password='', master_ssl=0;
57
drop user replssl@localhost;
62
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
63
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
64
query_vertical show slave status;
68
# Start replication with ssl_verify_server_cert turned on
71
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
73
master_host="localhost",
75
master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
76
master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
77
master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem',
78
master_ssl_verify_server_cert=1;
82
create table t1 (t int);
83
insert into t1 values (1);
85
sync_slave_with_master;
88
#checking that replication is ok
91
#checking show slave status
92
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
93
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
94
query_vertical show slave status;
98
sync_slave_with_master;