search
HomeDatabaseMysql Tutorial不制作证书是否能加密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的加密阶段

一共有两个阶段

认证阶段,SQLSERVER会使用自生成的自签名证书加密客户端发过来的登陆用户名和密码

数据传输阶段,如果不使用证书,那么数据是使用明文在网络上进行传送的

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

大家可以看一下这篇文章:

SQL Server 连接加密 (1) -- SQL Server connection encyption

 

 

网上有很多制作证书的教程,但是制作证书都比较麻烦,客户端和服务器端都要弄很多东西。

 

详细制作证书的过程可以参考园子里的这篇文章:

在SQL Server 2005 中开启SSL(图文结合)


当然这篇文章不是讲解这个network monitor抓包工具的,所以轻轻带过就算了

那么,不制作证书怎么加密传输数据啊????

 

答案就是:同样使用在认证阶段的自生成的自签名证书

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

 

 

详细步骤:

步骤1:在SQLSERVER服务器端这边设置强行加密

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

步骤2:重启SQLSERVER,只有重启SQLSERVER设置才能生效

 

步骤3:打开network monitor,新建一个capture

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

步骤4:启动capture,开始捕获

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

 

步骤5:在客户端这边连上服务器端的SQLSERVER,然后你会在network monitor里的看到SSMS这个进程已经出现在Network Conversations窗口

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

步骤6:选中他,你会在Frame Summary窗口看到帧信息

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

 

 

步骤7:如果你在服务器端开启了“强行加密”,那么收到的数据包都会是加密

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 大家在Protocol Name这一栏看到的是TLS协议,而不会是TDS协议

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 

步骤8:查看帧数据

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

步骤9:如果没有加密的明文数据,network monitor就能够查看出来,并且Protocol Name这一栏显示的是TDS协议,因为数据包并没有使用TLS协议进行封装

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

TIPS:当关闭了SSMS的查询窗口之后,连接还是存在的

很多人会问,关闭了连接,怎么连接还存在,客户端为什么还会跟服务器端进行通信?????

实际上,这个是客户的连接池机制,客户端不断发送keep alive数据包给服务器,下次有同样的连接进行重用了,不需要再进行三次握手o(∩_∩)o 

不制作证书是否能加密SQLSERVER与客户端之间传输的数据?

 


总结

本人介绍了不使用制作证书的方式来对传输数据进行加密的方法,实际上设置客户端而不设置服务器端也是可以的

不过设置客户端比较麻烦,还需要在连接字符串里加上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 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor