連接mysql出現(xiàn)了:Establishing SSL connection without server's identity verification is not recommended
最近自己搭的一套代碼評(píng)審工具(Fisheye+Crucible)總是出問題,查看日志,發(fā)現(xiàn)有一個(gè)WARN總是肆無忌憚的出現(xiàn),黑壓壓的一片,對(duì)于有強(qiáng)迫癥的我來說看著很不爽,于是決定kill it
注意:出現(xiàn)這類提示也不會(huì)影響對(duì)數(shù)據(jù)庫的增刪改查操作,所以不用緊張。。
詳細(xì)的警告提示:
?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 server certificate verification.
?翻譯過來就是:不建議不使用服務(wù)器身份驗(yàn)證建立SSL連接,必須默認(rèn)建立SSL連接。
解決辦法如下,在與數(shù)據(jù)庫建立連接的url后加上下面這段
?autoReconnect=true&useSSL=false
我原來的url是
jdbc:mysql://181.137.128.32:3306/fecru
加上后變成
jdbc:mysql://181.137.128.32:3306/fecru?autoReconnect=true&useSSL=false
重啟工具,日志中黑壓壓的一堆,小事不見了,日志看著清爽多了...