查看mysql是否ssl登陆,如何确定是否在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

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.

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.

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

--

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%';

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

解决方案

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

Prepare capture setup using this tutorial

Start sniffing network with wireshark and perform some queries to your database

Filter traffic by database IP-address and/or port using display filter, so irrelevant packets aren't shown

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值