| 1 |
CREATE USER 'user_tcp'@'127.0.0.1'; |
| 2 |
GRANT ALL PRIVILEGES ON *.* TO 'user_tcp'@'127.0.0.1'; |
| 3 |
CREATE USER 'user_ssl'@'127.0.0.1'; |
| 4 |
GRANT ALL PRIVILEGES ON *.* TO 'user_ssl'@'127.0.0.1'; |
| 5 |
CREATE USER 'user_requiressl'@'localhost' REQUIRE SSL; |
| 6 |
GRANT ALL PRIVILEGES ON *.* TO 'user_requiressl'@'localhost'; |
| 7 |
|
| 8 |
# Connection type testing for TCP/IP protocol |
| 9 |
|
| 10 |
1 |
| 11 |
1 |
| 12 |
# Testing TCP/IP connections over SSL/TLS |
| 13 |
2 |
| 14 |
2 |
| 15 |
|
| 16 |
# Testing TCP/IP connections over SSL/TLS having user with REQUIRE SSL clause |
| 17 |
2.5 |
| 18 |
2.5 |
| 19 |
|
| 20 |
SET @@global.require_secure_transport = ON; |
| 21 |
ERROR HY000: Connections using insecure transport are prohibited while --require_secure_transport=ON. |
| 22 |
|
| 23 |
# Connection type testing for TCP/IP protocol, secure transport required. |
| 24 |
|
| 25 |
# Testing TCP/IP connections over SSL/TLS, secure transport required. |
| 26 |
4 |
| 27 |
4 |
| 28 |
|
| 29 |
# Testing TCP/IP connections over SSL/TLS with an user created with REQUIRE SSL |
| 30 |
4.5 |
| 31 |
4.5 |
| 32 |
|
| 33 |
# Shutdown server |
| 34 |
# Ensure that server does not start and aborts when there is no |
| 35 |
# SHM support, --require-secure-transport=on and ssl is disabled |
| 36 |
Pattern "Server is started with --require-secure-transport=ON but no secure transports" found |
| 37 |
Pattern "Aborting" found |
| 38 |
# Now start server normally without ssl support, with MEM and require-secure-transport=on |
| 39 |
# Connection type testing for TCP/IP protocol, secure transport required, should fail |
| 40 |
ERROR HY000: Connections using insecure transport are prohibited while --require_secure_transport=ON. |
| 41 |
# Rebooting to start without ssl support and require-secure-transport=off, disabled SHM |
| 42 |
# Change the dynamic variable from OFF to ON. it should throw error |
| 43 |
SET @@global.require_secure_transport = ON; |
| 44 |
ERROR HY000: No secure transports (SSL or Shared Memory) are configured, unable to set --require_secure_transport=ON. |
| 45 |
# TCP/IP connection should succeed |
| 46 |
6 |
| 47 |
6 |
| 48 |
ERROR HY000: Can't open shared memory; client could not create request event (Errcode) |
| 49 |
# Rebooting to start ssl support and require-secure-transport=off, disabled with SHM |
| 50 |
# Change the dynamic variable from OFF to ON. it should not throw error |
| 51 |
SET @@global.require_secure_transport = ON; |
| 52 |
# Connection type testing for TCP/IP protocol, secure transport required, should fail. |
| 53 |
#Cleanup |
| 54 |
DROP USER 'user_tcp'@'127.0.0.1', 'user_ssl'@'127.0.0.1', 'user_requiressl'@'localhost'; |
| 55 |
SET @@global.require_secure_transport = OFF; |