美文网首页
[08S01]问题Communications link fai

[08S01]问题Communications link fai

作者: 戈壁堂 | 来源:发表于2021-06-15 10:45 被阅读0次

    Goland 链接数据库失败 以为是Goland IDE的问题,今天IDEA也出现相同问题。

    关键还是——“没有合适的协议”(No appropriate protocol)

    [08S01] Communications link failure
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the
    server.javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate).

    其实官方issue Can't connect to remote MySQL since last version of IntelliJ中已经给出了解决方案——

    MySql版本为8.0, 5.7.28, 5.6.46和以上版本,如果服务端启用了TLSv1.2配置,而客户端没进行对应配置时,就会出现上述问题。

    可以在数据库的链接属性data source properties的高级设置中设置enabledTLSprotocols的值为TLSv1,TLSv1.1,TLSv1.2,TLSv1.3(默认这个链接值为空)

    If you are running MySQL 8.0, 5.7.28, 5.6.46 and later and your server is configured with TLSv1.2 you can enabled it in driver:
    open up data source properties, switch to Advanced tab and set value for enabledTLSprotocols to TLSv1,TLSv1.1,TLSv1.2,TLSv1.3

    亲测有效——

    另外一个解决方法思路相同,只不过是通过配置文件的方式进行配置——

    Workaround #1

    We've updated java recently and we've moved to TLSv1 to the jdk.tls.disabledAlgorithms due to security reasons. So to get it back you need to do the following:

    1. Create a file custom.java.security with the following contents:
    jdk.tls.disabledAlgorithms=SSLv3, TLSv1.1, RC4, DES, MD5withRSA, \
        DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
        include jdk.disabled.namedCurves
    

    I removed TLSv1 from the list.

    1. Go to you data source Advanced tab and add to VM Options: -Djava.security.properties=${PATH_TO_FILE?}/custom.java.security. Don't forget to replace ${PATH_TO_FILE?}.

    2. You can connect.

    相关文章

      网友评论

          本文标题:[08S01]问题Communications link fai

          本文链接:https://www.haomeiwen.com/subject/hafzeltx.html