Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用docker注意加驱动程序mssql可能会连接错误,需要到容器中修改java.security屏蔽3DES_EDE_CBC #50

Open
hotpiglongshen opened this issue Nov 22, 2019 · 1 comment

Comments

@hotpiglongshen
Copy link

使用docker注意加驱动程序mssql可能会连接错误,需要到容器中修改java.security屏蔽3DES_EDE_CBC
提示如下
ERROR: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error:
"SQL Server did not return a response. The connection has been closed.
打开文件夹(JAVA_HOME)/jre/lib/security中的安全策略文件:Java.security
修改jdk.tls.disabledAlgorithms选项。
Java 8的jdk.tls.disabledAlgorithms默认值:
jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40,3DES_EDE_CBC

为了开启SSL_RSA_WITH_3DES_EDE_CBC_SHA,将3DES_EDE_CBC注释掉:

Java 8的jdk.tls.disabledAlgorithms默认值:
jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40
#,3DES_EDE_CBC

@kellysupeng
Copy link

使用docker注意加驱动程序mssql可能会连接错误,需要到容器中修改java.security屏蔽3DES_EDE_CBC
提示如下
ERROR: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error:
"SQL Server did not return a response. The connection has been closed.
打开文件夹(JAVA_HOME)/jre/lib/security中的安全策略文件:Java.security
修改jdk.tls.disabledAlgorithms选项。
Java 8的jdk.tls.disabledAlgorithms默认值:
jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40,3DES_EDE_CBC

为了开启SSL_RSA_WITH_3DES_EDE_CBC_SHA,将3DES_EDE_CBC注释掉:

Java 8的jdk.tls.disabledAlgorithms默认值:
jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40
#,3DES_EDE_CBC

如果需要频繁的通过Dockerfile文件来构建镜像并启动新的容器,通过修改容器内java.sercurity文件好像不是很合适,每构建一次都需要去修改容器。有没有办法通过Dockerfile配置来完成?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants