如何确定在MySql连接中是否使用SSL? [英] How determine if using SSL in a MySql Connection?

查看:992
本文介绍了如何确定在MySql连接中是否使用SSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用.Net MySql Connector的v6.9.9,使用此连接字符串访问MySql,并指定需要SSL.

We are using v6.9.9 of the .Net MySql Connector to access MySql using this connection string, specifying that SSL is required.

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
SSL Mode=Required

我们的DBA已启用对SSL的支持,但是在测试期间,无论我的计算机上是否安装了证书,也无论我是否具有"SSL Mode = Required"或"SSL Mode = Required",我都可以连接到服务器.不是.

Our DBA has turned on support for SSL, but during my testing, I am able to connect to the server regardless of whether I have certificates installed on my machine, and also regardless of whether I have "SSL Mode=Required" or not.

但是,当我的DBA禁用SSL时,如果我使用上面的连接字符串,则会收到未启用SSL的错误消息.

However, when my DBA disabled SSL, if I use the above connection string, I got an error that SSL was not enabled.

因此,我真的只是不知道我的网络流量是否正在加密.如何验证?

Therefore, I really just don't know if my network traffic is being encrypted or not. How can I verify?

-

我的问题是这个问题的重复部分,没有被接受的答案.

My question is a bit of a duplicate to this one with no accepted answer.

如何检查MySQL连接是否为SSL加密了吗?

有些建议使用WireShark进行测试.是否有人有逐步指南说明如何使用此工具来验证我的SSL连接?

Some recommend using WireShark to test. Does anyone have step-by-step instructions on how to use this tool to verify my SSL connections?

-

此链接讨论有关从MySql客户端调用状态"的信息. https://dba.stackexchange. com/questions/36776/how-can-i-verify-im-im-using-ssl-to-connect-to-mysql

This link talks about calling "status" from the MySql client. https://dba.stackexchange.com/questions/36776/how-can-i-verify-im-using-ssl-to-connect-to-mysql

我要求我的DBA尝试-但是他无法针对我的连接调用该方法,只能针对他的本地连接调用.无论如何,例如在我的C#代码中是否可以调用它? 我试过了,但是我不认为返回的值会告诉我连接是否为SSL.

I asked my DBA to try it - but he isn't able to call that method against my connection, only against his local connection. Is there anyway to call this, for example, within my c# code? I tried this, but I don't think the returned values tell me if the connection is SSL or not.

SHOW SESSION STATUS LIKE '%Ssl%';

任何人如具有有关如何验证我的SSL连接的详细信息,将不胜感激!谢谢!

Anyone with detailed information on how to verify my SSL connections would be greatly appreciated! Thank you!

推荐答案

与数据库的协作并不多,但是网络/wireshark专业知识足以满足您的任务.那你该怎么办:

Didn't work a lot with databases, but network/wireshark expertise is enough for you task. So what should you do:

  1. 使用本教程
  2. 准备捕获设置
  3. 开始使用Wireshark嗅探网络并对数据库执行一些查询
  4. 使用显示过滤器,按数据库IP地址和/或端口过滤流量.没有显示
  5. 检查显示的数据包.将它们与基于TCP的MySQL示例
  1. Prepare capture setup using this tutorial
  2. Start sniffing network with wireshark and perform some queries to your database
  3. Filter traffic by database IP-address and/or port using display filter, so irrelevant packets aren't shown
  4. Examine displayed packets. Compare them to sample of MySQL over TCP and to sample of MySQL over SSL. Hint: you can see queries as a plain text in unprotected connection, while SSL makes packet payload look like bunch of random garbage.

这篇关于如何确定在MySql连接中是否使用SSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆