How to check if a user requires SSL in Mysql?

2019-07-28 14:30发布

I'am testing with an AWS RDS Mysql instance with Mysql verison 5.7.22.

After requiring ssl for a specific user, 'root' (GRANT USAGE ON . TO 'root'@'%' REQUIRE SSL;"), this is the result of SHOW GRANTS for root;

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@%                                                                                                                                                                                                                                                                                                              |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD,
  PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, 
 CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, 
 REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, 
ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'root'@'%' 
 WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Is there anyway I can check to see that ssl is required for a user? Show grants output doesn't mention ssl. I would think that Show grants is the right command to use because ssl was initially required on the user via GRANT USAGE.

1条回答
乱世女痞
2楼-- · 2019-07-28 14:51

One thing I found was that from the client, you can run status to determine if the current connection is using ssl. Not sure if there's a way to do it for a specific user though.

Edit

Chris White's solution(MySQL: REQUIRE SSL not shown in grants) works for a specific user

查看更多
登录 后发表回答