【问题标题】:SSLv3 Related Errors - Spring + Hibernate + SQL Server on TomcatSSLv3 相关错误 - Tomcat 上的 Spring + Hibernate + SQL Server
【发布时间】:2016-04-18 21:57:52
【问题描述】:

我从托管在 tomcat (RHEL) 上的 Spring Hibernate 应用程序连接到 SQL Server 2008 时遇到问题

我的豆子:

<beans:bean id="sDataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <beans:property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
        <beans:property name="url" value="jdbc:sqlserver://abc.com:1433;databaseName=ABC;" />
        <beans:property name="username" value="AAAAAAA" />
        <beans:property name="password" value="XXXXXXXX" />
    </beans:bean>

最初我得到了这个错误:

[04-18-2016 17:45:01,837-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method getSession()]
[04-18-2016 17:45:01,882-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method getSession()]
[04-18-2016 17:45:01,901-0400] [Line:   ?] ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SSLv3 SSLContext not available".]
[04-18-2016 17:45:01,902-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method returnSession()]
[04-18-2016 17:45:01,903-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method returnSession()]

然后我遇到了这个question,并将其更改为-Dcom.ibm.jsse2.disableSSLv3=false

然后我得到了这个错误:

[04-18-2016 17:47:45,728-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method getSession()]
[04-18-2016 17:47:45,815-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method getSession()]
[04-18-2016 17:47:45,845-0400] [Line:   ?] ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "No appropriate protocol (protocol is disabled or cipher suites are inappropriate)".]
[04-18-2016 17:47:45,847-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method returnSession()]
[04-18-2016 17:47:45,848-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method returnSession()]

代码完全正常,因为它在我的本地环境中返回结果,但是当我将它部署到云 (RHEL V6) 中时,我遇到了这些错误。

请帮帮我。我完全被困在这一点上。

我需要在 Linux 服务器上安装一些东西吗?

【问题讨论】:

    标签: java sql-server spring hibernate sslv3


    【解决方案1】:

    比较 Java 的版本。我在 Java8 build 50 中遇到了一个问题,其中某些密码已被弃用和删除,因此我们的应用程序突然无法建立 SSL 连接,因为双方无法就要使用的密码达成一致。在我看来,这看起来很相似。

    还可能值得检查一下是否在您的桌面上安装了无限强度加密,而不是在服务器上。

    出于绝望,您可以尝试使用 -Djavax.net.debug=ALL 或其他方式运行应用程序(取决于您需要多少详细信息),this 是使用的起点。您必须将其添加到 tomcat.conf(或任何环境变量在您的版本中)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-11
      • 2021-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-20
      相关资源
      最近更新 更多