天天看點

阿裡雲RDS使用報Establishing SSL connection without server's identity verification is not recommed

今天測試阿裡雲的RDS伺服器,mysql連接配接,日志報出了這個錯誤

Tue Jul 10 16:50:33 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for      

大概的翻譯是:

Tue Jul 10 16:50:33 CST 2018警告:不建議在沒有伺服器身份驗證的情況下建立SSL連接配接。根據MySQL 5.5.45 +,5.6.26 +和5.7.6+要求如果未設定顯式選項,則必須預設建立SSL連接配接。為了符合不使用SSL的現有應用程式,verifyServerCertificate屬性設定為“false”。您需要通過設定useSSL = false顯式禁用SSL,或者設定useSSL = true并為伺服器證書驗證提供信任庫。

我們的mysql的配置參數如下:

jdbc.param=useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&zeroDateTimeBehavior=round      
jdbc.param  =  useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&zeroDateTimeBehavior=round&useSSL=false      
<dependency>  
         <groupId>mysql</groupId>  
         <artifactId>mysql-connector-java</artifactId>  
         <version>5.1.39</version>  
 </dependency>