Issue
When attempting to connect to a server or service, if you encounter an ERR_SSL_PROTOCOL_ERROR.
Error Code
ERR_SSL_PROTOCOL_ERROR: Unable to establish a secure connection.
Cause
This error typically occurs when there are issues with the SSL/TLS protocol version compatibility between the client and server, or if the SSL/TLS handshake fails due to incorrect configuration or outdated protocols.
Solution
To resolve the SSL Protocol Error, follow these troubleshooting steps:
-
Ensure Supported SSL/TLS Protocol Versions
Ensure that both the client and the server are configured to support compatible SSL/TLS protocol versions (e.g., TLS 1.2 or TLS 1.3). Older versions such as SSL 3.0 or TLS 1.0 are considered insecure and should be disabled. -
Update OpenSSL or Relevant Libraries
If you’re using libraries like OpenSSL, ensure they are up to date to support modern protocols. Run the following command to update OpenSSL on Linux:
sudo apt-get update && sudo apt-get install openssl
-
Check Server SSL/TLS Configuration
Verify the server’s SSL/TLS configuration and ensure it is using a valid certificate with proper protocols enabled. Use an SSL checker tool to ensure the server is configured correctly. -
Set Correct SSL Protocol in Git or Curl
If using Git or Curl, explicitly specify the SSL/TLS protocol version. For example, you can instruct Curl to use TLS 1.2 with:
curl --tlsv1.2 https://yourserver.com
For Git, configure SSL settings to ensure compatibility:
git config --global http.sslVersion tlsv1.2
-
Disable SSL Verification (Temporary Workaround)
If the SSL protocol error persists and you trust the connection, you can disable SSL verification temporarily (use with caution). For Git, execute:
git config --global http.sslVerify false
Reference