1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-16266 - New command FLUSH SSL to reload server's SSL certificate(private key,CRL,etc)

This commit is contained in:
Vladislav Vaintroub
2018-12-11 18:23:54 +01:00
parent f570da5153
commit 19d3d3e861
13 changed files with 306 additions and 202 deletions

View File

@ -0,0 +1,26 @@
# Kill the server
connect ssl_con,localhost,root,,,,,SSL;
SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
# Use a different certificate ("Not after" certificate field changed)
FLUSH SSL;
# Check new certificate used by new connection
Result
OK
# Check that existing SSL connection still works, and uses old certificate, even if new one is loaded in FLUSH SSL
connection ssl_con;
SELECT IF(VARIABLE_VALUE=@ssl_not_after,'OK','FAIL') as Result FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
Result
OK
disconnect ssl_con;
connection default;
SELECT VARIABLE_NAME NAME, VARIABLE_VALUE VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME in ('Ssl_accepts', 'Ssl_finished_accepts');
NAME VALUE
SSL_ACCEPTS 1
SSL_FINISHED_ACCEPTS 1
FLUSH SSL;
SELECT VARIABLE_NAME NAME, VARIABLE_VALUE VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME in ('Ssl_accepts', 'Ssl_finished_accepts');
NAME VALUE
SSL_ACCEPTS 0
SSL_FINISHED_ACCEPTS 0
# Cleanup
# Kill the server