不制作证书是否能加密SQLSERVER与客户端之间传输的数据?
不 制作 证书 是否 能 加密 SQLSERVER与 客户 端 之间 传输 的 数据 ? 在做实验之前请先下载network monitor抓包工具 微软官网下载: http://www.microsoft.com/en-us/download/details.aspx?id=4865 Microsoft Network Monitor 这是微软提供的网络抓包工具
不制作证书是否能加密SQLSERVER与客户端之间传输的数据?
在做实验之前请先下载network monitor抓包工具
微软官网下载:http://www.microsoft.com/en-us/download/details.aspx?id=4865
Microsoft Network Monitor
这是微软提供的网络抓包工具
虽然它是微软提供的,但所有的协议parser解析代码全部都是开源的,采用其支持的特有脚本语言编写,易理解、易扩展;
它自带协议parser比较全面,同时有一个开源社区提供持续支持;
另外,它也提供API帮助我们开发自己的网络抓包、协议分析工具。
针对TDS协议解析需求:
Network Monitor自带TDS协议解析器和UI比较友好
Network Monitor自带TDS协议解析器在解析和结果展示方面更全面,以下是一个画面片段,显示了一个SQL Batch包。
先了解一下SQLSERVER的加密阶段
一共有两个阶段
在认证阶段,SQLSERVER会使用自生成的自签名证书,加密客户端发过来的登陆用户名和密码
在数据传输阶段,如果不使用证书,那么数据是使用明文在网络上进行传送的
大家可以看一下这篇文章:
SQL Server 连接加密 (1) -- SQL Server connection encyption
网上有很多制作证书的教程,但是制作证书都比较麻烦,客户端和服务器端都要弄很多东西。
详细制作证书的过程可以参考园子里的这篇文章:
在SQL Server 2005 中开启SSL(图文结合)
当然这篇文章不是讲解这个network monitor抓包工具的,所以轻轻带过就算了
那么,不制作证书怎么加密传输的数据啊????
答案就是:同样使用在认证阶段的自生成的自签名证书
详细步骤:
步骤1:在SQLSERVER服务器端这边设置强行加密
步骤2:重启SQLSERVER,只有重启SQLSERVER设置才能生效
步骤3:打开network monitor,新建一个capture
步骤4:启动capture,开始捕获
步骤5:在客户端这边连上服务器端的SQLSERVER,然后你会在network monitor里的看到SSMS这个进程已经出现在Network Conversations窗口
步骤6:选中他,你会在Frame Summary窗口看到帧信息
步骤7:如果你在服务器端开启了“强行加密”,那么收到的数据包都会是加密的
大家在Protocol Name这一栏看到的是TLS协议,而不会是TDS协议
步骤8:查看帧数据
步骤9:如果没有加密的明文数据,network monitor就能够查看出来,并且Protocol Name这一栏显示的是TDS协议,因为数据包并没有使用TLS协议进行封装
TIPS:当关闭了SSMS的查询窗口之后,连接还是存在的
很多人会问,关闭了连接,怎么连接还存在,客户端为什么还会跟服务器端进行通信?????
实际上,这个是客户端的连接池机制,客户端不断发送keep alive数据包给服务器,下次有同样的连接进行重用了,不需要再进行三次握手o(∩_∩)o
总结
本人介绍了不使用制作证书的方式来对传输的数据进行加密的方法,实际上设置客户端而不设置服务器端也是可以的
不过设置客户端比较麻烦,还需要在连接字符串里加上encrypt属性设置为Yes
设置服务器端和设置客户端的加密的区别
服务器端:所有的连接都是加密的
客户端:只是设置了加密的那个连接是加密的,其他没有设置加密的连接依然是明文传输数据
当然,使用SQLSERVER自生成的证书安全性是不及自己制作的证书的安全性高!!
相关连接:
加密与 SQL Server 的连接
使用自签名证书加密的 SSL 连接不提供强安全性。它们容易在传输中途受到攻击。在生产环境中或在连接到 Internet 的服务器上,不应依赖使用自签名证书的 SSL。
始终要对客户端应用程序与 SQL Server 连接时传输的凭据(在登录数据包中)进行加密。SQL Server 将使用可信证书颁发机构颁发的证书(如果可用)。如果未安装可信证书,则在启动实例时 SQL Server 将生成自签名证书,并使用自签名证书对凭据进行加密。自签名证书有助于提高安全性,但它不提供针对通过服务器进行的身份欺骗的保护。如果使用自签名证书,并且 ForceEncryption 选项的值设置为“是”,则将使用自签名证书对通过网络在 SQL Server 和客户端应用程序之间传输的所有数据进行加密
有关SQL server connection Keep Alive 的FAQ(3)
有关SQL server connection Keep Alive 的FAQ(2)
有关SQL server connection Keep Alive 的FAQ(1)
SQL Server 连接加密 (1) -- SQL Server connection encyption
SQL Server 连接加密 (2) -- SQL Server connection encyption
如有不对的地方,欢迎大家拍砖o(∩_∩)o

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The import steps are as follows: Copy the MDF file to SQL Server's data directory (usually C:\Program Files\Microsoft SQL Server\MSSQL\DATA). In SQL Server Management Studio (SSMS), open the database and select Attach. Click the Add button and select the MDF file. Confirm the database name and click the OK button.

For objects with the same name that already exist in the SQL Server database, the following steps need to be taken: Confirm the object type (table, view, stored procedure). IF NOT EXISTS can be used to skip creation if the object is empty. If the object has data, use a different name or modify the structure. Use DROP to delete existing objects (use caution, backup recommended). Check for schema changes to make sure there are no references to deleted or renamed objects.

When the SQL Server service fails to start, here are some steps to resolve: Check the error log to determine the root cause. Make sure the service account has permission to start the service. Check whether dependency services are running. Disable antivirus software. Repair SQL Server installation. If the repair does not work, reinstall SQL Server.

To view the SQL Server port number: Open SSMS and connect to the server. Find the server name in Object Explorer, right-click it and select Properties. In the Connection tab, view the TCP Port field.

If you accidentally delete a SQL Server database, you can take the following steps to recover: stop database activity; back up log files; check database logs; recovery options: restore from backup; restore from transaction log; use DBCC CHECKDB; use third-party tools. Please back up your database regularly and enable transaction logging to prevent data loss.

SQL Server database files are usually stored in the following default location: Windows: C:\Program Files\Microsoft SQL Server\MSSQL\DATALinux: /var/opt/mssql/data The database file location can be customized by modifying the database file path setting.

If the SQL Server installation fails, you can clean it up by following these steps: Uninstall SQL Server Delete registry keys Delete files and folders Restart the computer

SQL Server English installation can be changed to Chinese by following the following steps: download the corresponding language pack; stop the SQL Server service; install the language pack; change the instance language; change the user interface language; restart the application.
