驱动程序无法使用安全套接字层(SSL)加密建立与SQL Server的安全连接 [英] The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

查看:1682
本文介绍了驱动程序无法使用安全套接字层(SSL)加密建立与SQL Server的安全连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码创建了与SQL Server的连接。

I used this code to create a connection to SQL Server.

String connectionUrl = "jdbc:sqlserver://IP:1433;" +
        "databaseName=db;user=db;password=pwd";
    Connection con = null;
  try {
     // Establish the connection.
     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
     con = DriverManager.getConnection(connectionUrl);
        return "true";
  }

  // Handle any errors that may have occurred.
  catch (Exception e) {
     e.printStackTrace();
  }

但我收到此错误:


com.microsoft.sqlserver.jdbc.SQLServerException:驱动程序无法使用安全套接字层(SSL)加密与SQL Server建立安全连接。错误:套接字关闭。 ClientConnectionId:5975fad5-8f8d-496a-a2bb-bff3a8d1a755

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Socket closed". ClientConnectionId:5975fad5-8f8d-496a-a2bb-bff3a8d1a755

任何人都可以帮助我吗?
提前致谢

Can anybody help me? Thanks in advance

推荐答案

查看此 Microsoft JDBC博客帖子:

  • The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.

用于解决SQLServer的SSL问题(专门针对Android客户端:不幸的是,在Android操作系统中无法有效使用JDBC驱动程序)尝试使用 jDTS

for resolve SSL problems with SQLServer (specially for android clients:JDBC driver can not be used effectively in the Android OS on unfortunately) try to using jDTS:


jTDS 是一个操作用于Microsoft SQL Server的源代码100%纯Java(类型4)JDBC 3.0驱动程序(6.5,7,2000,2005,2008和2012)

jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, 2005, 2008 and 2012)

这篇关于驱动程序无法使用安全套接字层(SSL)加密建立与SQL Server的安全连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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