快速解决linux服务器curl报curl: (35) Peer reports incompatible or unsupported protocol version.

有时候在linux服务器上想快速curl一个某个网址,但却出现了报错,


curl: (35) Peer reports incompatible or unsupported protocol version.
[root@localhost ~]# curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "https://www.isres.com/"
curl: (35) Peer reports incompatible or unsupported protocol version.
网上很多的建议是升级openssl ,有时候也能解决问题,但对于需要快速处理问题的情况,这费事一些,而且还有可能遇到问题。


这个错误通常表示你正在尝试使用的协议版本不被服务器所支持,或者服务器无法识别你发送的协议版本。
如果在使用 HTTPS 连接时出现此错误,可能是由于本地的 OpenSSL 版本较旧,不支持服务器使用的加密套件或协议版本。
以下是curl: (35) Peer reports incompatible or unsupported protocol version.两个解决思路

1、猜如果自己高于对方网站的ssl,则降低版本访问【一般很多】


curl --tlsv1.2 https://example.com


2、禁用ssl验证


curl -k https://example.com【用得最多】


3、有时候使用--tlsv1.2后会遇到以下报错


curl: (60) The certificate issuer's certificate has expired.  Check your system date and time.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

解决方式就是二者同时使用

curl -k --tlsv1.2 https://example.com




相关推荐

猜你喜欢

u盘安装Centos7报starting timeout scripts错误

这个问题出现两次,有必要记录一下了。 就是需要在显示 安装界面 。 install centos 和 test mdeia 的界面上。 按一下tab,修改一个路径 按网上说的,就是WIN10刻录才这样...

解决autodl的GPU服务器Ubuntu vim中文乱码

解决autodl的GPU服务器Ubuntu vim中文乱码

为了微调chatbml3 6b,租了台3090的服务器,而且直接使用的社区镜像。 本次出现汉字乱码的系统版本如下 cat /proc/version Linux version 5.15.0-57-...

alphaTab.js在播放gp5格式曲谱乱码的解决

alphaTab.js在播放gp5格式曲谱乱码的解决

alphaTab.js是一个用来实现在网页播放guitar pro曲谱的js框架,能够兼容甩有gp格式的在线播放,但是alphaTab.js在播放一年老曲谱的时候会出现汉字乱码。 这里的原因就是这个...

PHP CURL POST请求返回 400 Bad Request的处理

某套代码,都是linux,只是换了一台,换了php环境。 运行CURL POST请求返回 400 Bad Request。 经过验证排查,原因虽然使用POST,但我们的参数是在URL后边拼接的。 解决...