[英]curl error: "sslv3 alert unexpected message"
Curl gives me following error: Curl 给我以下错误:
error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message
What does this mean?这是什么意思?
It means bad SSL handshake.这意味着 SSL 握手失败。 You will need to specify the version of the protocol like this:
您将需要像这样指定协议的版本:
curl_setopt($curl_connection, CURLOPT_SSLVERSION, 3);
Change 3 to 2 if you still get the error.如果仍然出现错误,请将 3 更改为 2。
I got same error when I use macOS default curl
which is an old version that only support up to TLSv1.2.我在使用 macOS 默认
curl
时遇到了同样的错误,这是一个只支持最高 TLSv1.2 的旧版本。 But the endpoint I am trying to call is using TLSv1.3.但我尝试调用的端点使用的是 TLSv1.3。
On macOS, I succeed by installing a new curl version by brew install curl
.在 macOS 上,我成功地通过
brew install curl
安装了一个新的 curl 版本。
Then you can run something, for example然后你可以运行一些东西,例如
/usr/local/opt/curl/bin/curl --version
or要么
/usr/local/opt/curl/bin/curl --tlsv1.3 --request GET \
--url https://localhost:9200 \
--cacert ca.crt \
--key tls.key \
--cert tls.crt \
--header 'Content-Type: application/json' \
--verbose
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.