| 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 |
# Socket connection is not possible for user |
| 8 |
# created with REQUIRE SSL unless we pass SSL explicitly |
| 9 |
ERROR 28000: Access denied for user 'user_requiressl'@'localhost' (using password: NO) |
| 10 |
|
| 11 |
# Connection type testing for TCP/IP protocol |
| 12 |
|
| 13 |
1 |
| 14 |
1 |
| 15 |
# Testing TCP/IP connections over SSL/TLS |
| 16 |
2 |
| 17 |
2 |
| 18 |
|
| 19 |
# Testing TCP/IP connections over SSL/TLS having user with REQUIRE SSL clause |
| 20 |
2.5 |
| 21 |
2.5 |
| 22 |
|
| 23 |
SET @@global.require_secure_transport = ON; |
| 24 |
|
| 25 |
# Connection type testing for TCP/IP protocol, secure transport required. |
| 26 |
|
| 27 |
# Testing TCP/IP connections over SSL/TLS, secure transport required. |
| 28 |
4 |
| 29 |
4 |
| 30 |
|
| 31 |
# Testing TCP/IP connections over SSL/TLS with an user created with REQUIRE SSL |
| 32 |
4.5 |
| 33 |
4.5 |
| 34 |
|
| 35 |
# Rebooting to start without ssl and require-secure-transport=on |
| 36 |
# Insecure connection is not possible with TCP |
| 37 |
# Socket connection is possible as it is treated as secure |
| 38 |
# Even socket connection is not possible for users created with REQUIRE SSL clause |
| 39 |
ERROR 28000: Access denied for user 'user_requiressl'@'localhost' (using password: NO) |
| 40 |
ERROR HY000: SSL connection error: SSL is required but the server doesn't support it |
| 41 |
#Cleanup |
| 42 |
DROP USER 'user_tcp'@'127.0.0.1', 'user_ssl'@'127.0.0.1', 'user_requiressl'@'localhost'; |
| 43 |
SET @@global.require_secure_transport = OFF; |
| 44 |
# restart: |