GET请求ssl_choose_client_version:不支持的协议

jmp7cifd  于 12个月前  发布在  其他
关注(0)|答案(2)|浏览(131)

我有一个问题处理升级的应用程序做GET请求到远程服务器。
第一件事:一个由版本完成的GET函数示例,正如预期的那样,它可以工作

curl -k -vvvvv https://mywebsite.com/mywonderfulwebsite/mypage.php

*   Trying 192.168.0.70...
* TCP_NODELAY set
* Connected to mywebsite.com (192.168.0.70) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / AES128-SHA
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=MYWEBSITE.COM
*  start date: Mar 24 10:20:51 2020 GMT
*  expire date: Mar 24 00:00:00 2021 GMT
*  issuer: CN=MYWEBSITE.COM
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> GET /mywonderfulwebsite/mypage.php HTTP/1.1
> Host: mywebsite.com
> User-Agent: curl/7.58.0
> Accept: */*
....... and here the content of the page.....

字符串
现在从新版本开始,它不起作用

curl -vvvvv https://mywebsite.com/mywonderfulwebsite/mypage.php
*   Trying 192.168.0.70:443...
* TCP_NODELAY set
* Connected to mywebsite.com (192.168.0.70) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS alert, protocol version (582):
* error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
* Closing connection 0
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol


所以我认为它来自TLS版本,没问题,让我们强制它:

curl --tlsv1.0 -vvvvv https://mywebsite.com/mywonderfulwebsite/mypage.php

*   Trying 192.168.0.70:443...
* TCP_NODELAY set
* Connected to mywebsite.com (192.168.0.70) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS alert, protocol version (582):
* error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
* Closing connection 0
curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol


结果失败了
我尝试从远程网站添加证书,得到的答案相同。
我看了一个使用openssl客户端的请求:

# openssl s_client -connect mywebsite.com:443 -tls1
CONNECTED(00000003)
139820362433856:error:141E70BF:SSL routines:tls_construct_client_hello:no protocols available:../ssl/statem/statem_clnt.c:1112:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 7 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---


现在我正在处理版本和请求,我不知道应该在哪里检查。你知道我如何解决我的问题吗?

vc9ivgsu

vc9ivgsu1#

解决方案:https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level
后期openssl包配置为禁止使用TLS < 1.2,但是,第一个curl请求显示使用TLS 1.0进行通信
所以在debian Buster中openssl包太新了

dpkg -l | grep openssl
ii  openssl                       1.1.1d-0+deb10u7

字符串

我不必降级OpenSSL

编辑/etc/ssl/openssl.cnf
在文件开头添加

openssl_conf = default_conf


这是文件的结尾

[ default_conf ]

ssl_conf = ssl_sect

[ssl_sect]

system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=1


更改配置允许使用最小版本的TSL从TSL 1.0和更高版本开始,所以从现在开始,我可以请求我的遗留合作伙伴。

bprjcwpo

bprjcwpo2#

针对centOS用户。

我的解决方案是将使用的协议降低到最低级别。

/etc/crypto-policies/back-ends/opensslcnf.config

MinProtocol = TLSv1.0

字符串
它起作用了,我希望它能帮助你。你好。

相关问题