解决 SQL Server 连接错误: 'No appropriate protocol (protocol is disabled or cip'
This error message typically occurs when the SQL Server is configured to use SSL (Secure Sockets Layer) encryption, but the client application is not configured to use SSL. Here are a few possible solutions:
- Enable SSL on the client side: Modify the connection string in your application to include the 'Encrypt=true' and 'TrustServerCertificate=true' properties. This will enable SSL encryption and allow the client to trust the server's SSL certificate without verification.
Example:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;Encrypt=true;TrustServerCertificate=true;
- Configure the SQL Server to allow non-encrypted connections: If SSL encryption is not necessary, you can disable it on the SQL Server side. This can be done by setting the 'ForceEncryption' option to 'off'.
Example:
USE master;
GO
ALTER SERVER CONFIGURATION SET FORCE_ENCRYPTION OFF;
GO
-
Ensure the SQL Server's SSL certificate is valid and trusted: If SSL encryption is required, make sure the SQL Server's SSL certificate is valid and trusted by the client. You may need to install the certificate on the client machine or configure the client to trust the certificate.
-
Check the SQL Server's network configuration: Verify that the SQL Server is listening on the appropriate network protocol (TCP/IP) and port. You can check this in the SQL Server Configuration Manager.
If none of the above solutions resolve the issue, please provide more details about your specific setup and any other error messages you may be encountering.
原文地址: https://www.cveoy.top/t/topic/cjhC 著作权归作者所有。请勿转载和采集!