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證書。
參考
相關文章
- CocoaPods安裝出現SSL verification errorError
- SSL - SSLHandshakeException: Unrecognized SSL message, plaintext connection?ExceptionZedAI
- Duplicating a Database Without Recovery Catalog or Target ConnectionDatabase
- 寶塔:續簽SSL證書報錯Verification failed, domain name resolution error or verification URL cannot be accessed!AIError
- Error establishing a database connection 的解決方法(發現黑客入侵)ErrorDatabase黑客
- 使用Identity Server 4建立Authorization Server (3)IDEServer
- 使用Identity Server 4建立Authorization Server (2)IDEServer
- 使用Identity Server 4建立Authorization Server (1)IDEServer
- 使用Identity Server 4建立Authorization Server (5)IDEServer
- 使用Identity Server 4建立Authorization Server (4)IDEServer
- Connection/Session/Server ProcessesSessionServer
- Identity Server 4 - Hybrid Flow - ClaimsIDEServerAI
- The server quit without updating PID fileServerUI
- A bold young woman's identity exposed Pornographic WhyIDE
- SQL SERVER – Attach mdf file without ldf file in DatabaseSQLServerDatabase
- Unknown SSL protocol error in connection to xxx:443ProtocolError
- 怎樣在SQL Server中檢查 IDENTITY 列SQLServerIDE
- MongoDB mongoimport 報錯:lost connection to serverMongoDBImportServer
- Xlib: connection to ":0.0" refused by server(openSUSE)Server
- RMAN 11GR2 : DUPLICATE Without Target And Recovery Catalog Connection_874352.1
- 使用Identity Server 4建立Authorization Server (6) - js(angular5) 客戶端IDEServerJSAngular客戶端
- MySQL:Lost connection to MySQL server at 'readingMySqlServer
- Xlib: connection to ":0.0" refused by server 問題Server
- 免費SSL證書Let's Encrypt的替代:SSL.com
- error:14090086:SSL routines:ssl3_get_server_certificateErrorServer
- MySQL提示:The server quit without updating PID file(…)失敗MySqlServerUI
- Identity Server 4 從入門到落地(十一)—— Docker部署IDEServerDocker
- Asp.Net Core: Swagger 與 Identity Server 4ASP.NETSwaggerIDEServer
- Identity Server 4 預備知識 -- OAuth 2.0 簡介IDEServerOAuth
- Identity Server 4 - Hybrid Flow - 保護API資源IDEServerAPI
- Starting MySQL.The server quit without updating PID fileMySqlServerUI
- ASP.NET Core3.1使用Identity Server4建立Authorization Server-1ASP.NETIDEServer
- ASP.NET Core3.1使用Identity Server4建立Authorization Server-2ASP.NETIDEServer
- Lost connection to MySQL server at 'reading authorization packet'MySqlServer
- [network][easy case]troubleshoting the connection to a remote serverREMServer
- MySQL啟動報錯:The server quit without updating PID fileMySqlServerUI
- @@IDENTITY與SCOPE_IDENTITY()IDE
- 如何處理WordPress網站提示“建立資料庫連線時出錯”或“Error establishing a database connection”錯誤網站資料庫ErrorDatabase