403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.70.208.163
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_ssl.test
--source include/not_group_replication_plugin.inc
source include/have_ssl_communication.inc;
source include/master-slave.inc;

# Default replication setup at master-slave.inc does not set MASTER_SSL
--connection slave
--let $current_master_ssl= query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1)
--let $assert_text= Master_SSL_Allowed should be NO by default
--let $assert_cond= "$current_master_ssl" = "NO"
--source include/assert.inc


# The slave should be initially connected to the master without SSL/TLS
--connection master
--let $connection_type= `SELECT CONNECTION_TYPE FROM performance_schema.threads WHERE PROCESSLIST_COMMAND LIKE "Binlog Dump%"`
--let $assert_text= Without MASTER_SSL, the slave should be connected to the master without SSL/TLS
--let $assert_cond= "$connection_type" <> "SSL/TLS" AND "$connection_type" <> ""
--source include/assert.inc

# create a user for replication that requires ssl encryption
connection master;
set @orig_sql_mode= @@sql_mode;
set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
grant replication slave on *.* to replssl@localhost require ssl;
set sql_mode= @orig_sql_mode;
create table t1 (t int auto_increment, KEY(t));

--source include/sync_slave_sql_with_master.inc

# Set slave to use SSL for connection to master
stop slave;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_column 2 ####
eval change master to
  master_user='replssl',
  master_password='',
  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';
start slave;

# Switch to master and insert one record, then sync it to slave
connection master;
insert into t1 values(1);
--source include/sync_slave_sql_with_master.inc

# The record should now be on slave
select * from t1;

# The slave is synced and waiting/reading from master
# SHOW SLAVE STATUS will show "Waiting for master to send event"
let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
source include/show_slave_status.inc;
source include/check_slave_is_running.inc;

# Stop the slave, as reported in bug#21871 it would hang
STOP SLAVE;

select * from t1;

# Do the same thing a number of times
disable_query_log;
disable_result_log;
# 2007-11-27 mats Bug #32756  	Starting and stopping the slave in a loop can lose rows
# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
# red trees.
disable_parsing;
let $i= 100;
while ($i)
{
  start slave;
  connection master;
  insert into t1 values (NULL);
  select * from t1; # Some variance
  connection slave;
  select * from t1; # Some variance
  stop slave;
  dec $i;
}
enable_parsing;
START SLAVE;
enable_query_log;
enable_result_log;
connection master;
# INSERT one more record to make sure
# the sync has something to do
insert into t1 values (NULL);
let $master_count= `select count(*) from t1`;

--source include/sync_slave_sql_with_master.inc
--source include/wait_for_slave_to_start.inc
source include/show_slave_status.inc;
source include/check_slave_is_running.inc;

let $slave_count= `select count(*) from t1`;

if ($slave_count != $master_count)
{
  echo master and slave differed in number of rows;
  echo master: $master_count;
  echo slave: $slave_count;

  connection master;
  echo === master ===;
  select count(*) t1;
  select * from t1;
  connection slave;
  echo === slave ===;
  select count(*) t1;
  select * from t1;
  query_vertical show slave status;
}

connection master;
drop user replssl@localhost;
drop table t1;
--source include/sync_slave_sql_with_master.inc

# ==== BUG#18165937: HITTING CRASH WHEN SETTING SSL OPTIONS THROUGH CHANGE MASTER COMMAND ====
#
# The server would crash when setting SSL_CRL options using CHANGE
# MASTER with YASSL enabled.

--source include/stop_slave.inc
--replace_column 2 ####
CHANGE MASTER TO
 master_user = 'root',
 master_ssl = 0,
 master_ssl_ca = '',
 master_ssl_cert = '',
 master_ssl_key = '',
 master_ssl_crl='',
 master_ssl_crlpath='';

--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval CHANGE MASTER TO MASTER_SSL= 1, MASTER_SSL_CRL='$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl', MASTER_SSL_CRLPATH='$MYSQL_TEST_DIR/std_data/crldir';
--source include/start_slave.inc


--source include/stop_slave.inc
--replace_column 2 ####
CHANGE MASTER TO
 master_user = 'root',
 master_ssl = 0,
 master_ssl_ca = '',
 master_ssl_cert = '',
 master_ssl_key = '',
 master_ssl_crl='',
 master_ssl_crlpath='';

--echo End of 5.0 tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit