403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.147.2
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/auth_sec/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/auth_sec/t/ssl_auto_detect.test
--source include/not_embedded.inc
--source include/allowed_ciphers.inc

# Save the initial number of concurrent sessions
--source include/count_sessions.inc


#------------------------------------------------------------------------------


--echo # Global Setup
call mtr.add_suppression("Failed to setup SSL");
call mtr.add_suppression("SSL error: SSL_CTX_set_default_verify_paths failed");
let DATADIR_LOCATION=$MYSQLTEST_VARDIR/mysqld.1/data;
let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_FILE= $server_log;


#------------------------------------------------------------------------------


--echo # Case 1 : Enable SSL automatically if ca.pem, server-cert.pem and
--echo #          sever-key.pem are present in data directory

let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server 10
--source include/wait_until_disconnected.inc

perl;
my $filetodelete = "$ENV{'MYSQLTEST_VARDIR'}/log/mysqld.1.err";
while (-e $filetodelete) {
  unlink $filetodelete;
  sleep 1;
}
EOF

--echo # Copy SSL certificates before restarting.
--echo # They should be picked up automatically by server.
--copy_file std_data/cacert.pem $DATADIR_LOCATION/ca.pem
--copy_file std_data/server-cert.pem $DATADIR_LOCATION/server-cert.pem
--copy_file std_data/server-key.pem $DATADIR_LOCATION/server-key.pem

--exec echo "restart" > $restart_file
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
--echo # Restart completed.

--echo # Search for : Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
let SEARCH_PATTERN= Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.;
--source include/search_pattern_in_file.inc
--echo # Search for : CA certificate is self signed.;
let SEARCH_PATTERN= CA certificate .* is self signed.;
--source include/search_pattern_in_file.inc

--echo # Try to establish SSL connection : This must succeed.
connect (ssl_root_1,localhost,root,,,,,SSL);
--replace_regex $ALLOWED_CIPHERS_REGEX
SHOW STATUS LIKE 'Ssl_cipher';
SHOW VARIABLES LIKE 'have_ssl';

--echo # Check values of ssl_ca, ssl_cert and ssl_key.
--echo # They should refer to certificate/key files in data directory.
SHOW VARIABLES LIKE 'ssl_ca';
SHOW VARIABLES LIKE 'ssl_cert';
SHOW VARIABLES LIKE 'ssl_key';

connection default;
disconnect ssl_root_1;

--echo # Connect using mysql client : This must succeed.
--replace_regex $ALLOWED_CIPHERS_REGEX
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';"


#------------------------------------------------------------------------------


--echo # Case 2 : Remove server-key.pem and observe that server starts
--echo #          without SSL capability

let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server 10
--source include/wait_until_disconnected.inc

perl;
my $filetodelete = "$ENV{'MYSQLTEST_VARDIR'}/log/mysqld.1.err";
while (-e $filetodelete) {
  unlink $filetodelete;
  sleep 1;
}
EOF

--echo # Remove one of the certificates/keys.
--remove_file $DATADIR_LOCATION/server-key.pem

--exec echo "restart" > $restart_file
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
--echo # Restart completed.

--echo # Check value of have_ssl. It must be DISABLED.
connect (root_2,localhost,root,,,,,);
SHOW VARIABLES LIKE 'have_ssl';

connection default;
disconnect root_2;

--echo # Try creating SSL connection using mysql connection. It should fail.
--error 1
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';"


#------------------------------------------------------------------------------


--echo #
--echo # Bug#21108296 : --SSL-CIPHER OPTION CAUSES SSL INITIALIZATION FAILURE
--echo #

let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server 10
--source include/wait_until_disconnected.inc

--copy_file std_data/server-key.pem $DATADIR_LOCATION/server-key.pem

--exec echo "restart: --ssl-cipher=DHE-RSA-AES256-SHA" > $restart_file
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
--echo # Restart completed.

--echo # Search for : Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
let SEARCH_PATTERN= Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.;
--source include/search_pattern_in_file.inc
--echo # Search for : CA certificate is self signed.;
let SEARCH_PATTERN= CA certificate .* is self signed.;
--source include/search_pattern_in_file.inc

--echo # Try creating SSL connection
--replace_regex $ALLOWED_CIPHERS_REGEX
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';"


#------------------------------------------------------------------------------


--echo # Global Cleanup
--remove_file $DATADIR_LOCATION/ca.pem
--remove_file $DATADIR_LOCATION/server-cert.pem
--remove_file $DATADIR_LOCATION/server-key.pem

# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc

--source include/force_restart.inc

#------------------------------------------------------------------------------

Youez - 2016 - github.com/yon3zu
LinuXploit