Establishing SSL connection without server's identity verification is not recommended.
web專案連線資料庫出現以下錯誤:
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.
SSL
SSL(Secure Sockets Layer) 安全套接層,它主要用來保證網路通訊中陣列安全以及資料完整性的一種協議,工作在傳輸層與應用層之間。
SSL內部可以分為2層:SSL記錄協議和SSL握手協議。
SSL記錄協議
建立在可靠的傳輸層協議(比如TCP)上,一方面它會對應用層的訊息請求進行加密和壓縮,保證網路傳輸中資料的安全性和減少網路流量;另一方面它會對接受到傳輸層的報文資訊進行解密和解壓縮,以方便應用層更好的使用傳送方的訊息。
SSL握手協議
可以類比TCP三次握手進行學習,TCP三次握手是為了建立可靠的連線。而SSL握手則是為了認證使用者和伺服器,確保資料傳送到正確的接收方。主要進行身份驗證,協商加密演算法和交換加密密匙。
解決
因為SSL是為了保證通訊雙方的安全通訊,避免被第三方獲取或竊聽而存在的。鑑於本次開發資料庫伺服器是部署在本地,不存在網路中通訊,所以我們可以配置資料來源時對資料庫的url進行以下設定:
jdbc:mysql://localhost:3306/wenda?useSSL=false
正因為報之前那個錯誤是我們在配置url未指定是否採用SSL,而高版本的MySQL會採用預設的SSL策略。Spring檢測出當前應用並未配置SSL證書,所以給出警告要麼不採用SSL,要麼設定SSL併為應用提供SSL證書。
參考
相關文章
- Error establishing a database connection 的解決方法(發現黑客入侵)ErrorDatabase黑客
- SSL - SSLHandshakeException: Unrecognized SSL message, plaintext connection?ExceptionZedAI
- Identity Server 4 - Hybrid Flow - ClaimsIDEServerAI
- 寶塔:續簽SSL證書報錯Verification failed, domain name resolution error or verification URL cannot be accessed!AIError
- MySQL:Lost connection to MySQL server at 'readingMySqlServer
- ‘OpenSSL SSL_read: Connection was reset, errno 10054’
- Asp.Net Core: Swagger 與 Identity Server 4ASP.NETSwaggerIDEServer
- [network][easy case]troubleshoting the connection to a remote serverREMServer
- Lost connection to MySQL server at 'reading authorization packet'MySqlServer
- MySQL提示:The server quit without updating PID file(…)失敗MySqlServerUI
- Identity Server 4 - Hybrid Flow - 保護API資源IDEServerAPI
- MySQL啟動報錯:The server quit without updating PID fileMySqlServerUI
- error:14090086:SSL routines:ssl3_get_server_certificateErrorServer
- Identity Server 4 預備知識 -- OpenID Connect 簡介IDEServer
- Identity Server 4 預備知識 -- OAuth 2.0 簡介IDEServerOAuth
- Identity Server 4 從入門到落地(十一)—— Docker部署IDEServerDocker
- ASP.NET Core3.1使用Identity Server4建立Authorization Server-2ASP.NETIDEServer
- ASP.NET Core3.1使用Identity Server4建立Authorization Server-1ASP.NETIDEServer
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- MySQL異常刨析:ata source rejected establishment of connection, message from server: “Too many connectionMySqlServer
- 求助:移動端登入測試,報錯 RemoteDisconnected Remote end closed connection without response。REM
- Identity Server 4 - Hybrid Flow - MVC客戶端身份驗證IDEServerMVC客戶端
- 如何處理WordPress網站提示“建立資料庫連線時出錯”或“Error establishing a database connection”錯誤網站資料庫ErrorDatabase
- 【故障處理】ORA-28547: connection to server failed, probableServerAI
- 阿里雲站點升級提示:OpenSSL SSL_connect: Connection reset by peer in connection to www.pbootcms.com:443阿里boot
- mysqldump: Error 2013: Lost connection to MySQL server during query when dumpingMySqlErrorServer
- The connection to the server 10.10.0.2:6443 was refused - did you specify the right host or port?Server
- 學習Identity Server 4的預備知識 (誤刪, 重補)IDEServer
- Identity Server 4 從入門到落地(八)—— .Net Framework 客戶端IDEServerFramework客戶端
- Identity Server 4 從入門到落地(七)—— 控制檯客戶端IDEServer客戶端
- Identity Server 4使用OpenID Connect新增使用者身份驗證(三)IDEServer
- 使用PostMan Canary測試受Identity Server 4保護的Web ApiPostmanIDEServerWebAPI
- 免費SSL證書Let's Encrypt的替代:SSL.com
- ssh連線遠端伺服器出現Host key verification failed. lost connection問題的解決伺服器AI
- MySQL The server quit without updating PID file xx/var/DESKTOP-BHVUG0D.pidMySqlServerUI
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- Mysql mysql lost connection to server during query 問題解決方法MySqlServer
- .NET 雲原生架構師訓練營(Identity Server)--學習筆記架構IDEServer筆記