SSL:没有匹配的替代证书主体名称 | CURL(USN-6237-1)的新版本带来痛苦

SSL:没有匹配的替代证书主体名称 | CURL(USN-6237-1)的新版本带来痛苦

自 CURL 新版本发布以来https://ubuntu.com/security/notices/USN-6237-1我们在 Ubuntu 上使用 curl 命令时遇到了问题:

sudo apt update -y && sudo apt install --no-install-recommends -y curl
curl -vvv https://downloads.apache.org/maven/maven-3/3.8.8/binaries/

错误:

*   Trying 88.99.95.219:443...
99
* Connected to downloads.apache.org (88.99.95.219) port 443 (#0)
100
* ALPN, offering h2
101
* ALPN, offering http/1.1
102
*  CAfile: /etc/ssl/certs/ca-certificates.crt
103
*  CApath: /etc/ssl/certs
104
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
105
} [5 bytes data]
106
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
107
} [512 bytes data]
108
* TLSv1.2 (IN), TLS header, Certificate Status (22):
109
{ [5 bytes data]
110
* TLSv1.3 (IN), TLS handshake, Server hello (2):
111
{ [122 bytes data]
112
* TLSv1.2 (IN), TLS header, Finished (20):
113
{ [5 bytes data]
114
* TLSv1.2 (IN), TLS header, Supplemental data (23):
115
{ [5 bytes data]
116
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
117
{ [25 bytes data]
118
* TLSv1.2 (IN), TLS header, Supplemental data (23):
119
{ [5 bytes data]
120
* TLSv1.3 (IN), TLS handshake, Certificate (11):
121
{ [4583 bytes data]
122
* TLSv1.2 (IN), TLS header, Supplemental data (23):
123
{ [5 bytes data]
124
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
125
{ [264 bytes data]
126
* TLSv1.2 (IN), TLS header, Supplemental data (23):
127
{ [5 bytes data]
128
* TLSv1.3 (IN), TLS handshake, Finished (20):
129
{ [52 bytes data]
130
* TLSv1.2 (OUT), TLS header, Finished (20):
131
} [5 bytes data]
132
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
133
} [1 bytes data]
134
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
135
} [5 bytes data]
136
* TLSv1.3 (OUT), TLS handshake, Finished (20):
137
} [52 bytes data]
138
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
139
* ALPN, server accepted to use http/1.1
140
* Server certificate:
141
*  subject: CN=*.apache.org
142
*  start date: Jun 29 00:00:00 2022 GMT
143
*  expire date: Jul 30 23:59:59 2023 GMT
144
*  subjectAltName does not match downloads.apache.org
145
* SSL: no alternative certificate subject name matches target host name 'downloads.apache.org'
146
* Closing connection 0
147
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
148
} [5 bytes data]
149
* TLSv1.3 (OUT), TLS alert, close notify (256):
150
} [2 bytes data]
151
curl: (60) SSL: no alternative certificate subject name matches target host name 'downloads.apache.org'
152
More details here: https://curl.se/docs/sslcerts.html

如何修复?我们现在应该以某种方式控制第三方证书吗?昨天解决了。提前致谢

答案1

看起来安全修复的反向移植有问题。应该在 7.81.0-1ubuntu1.13 中修复,该版本修复了 7.81.0-1ubuntu1.11。来自https://launchpad.net/ubuntu/jammy/+source/curl/+changelog

curl (7.81.0-1ubuntu1.13) jammy-security; urgency=medium

  * SECURITY REGRESSION: broken ssl cert wildcard handling (LP: #2028170)
    - debian/patches/CVE-2023-28321.patch: fix missing line in backport.

 -- Marc Deslauriers <email address hidden>  Wed, 19 Jul 2023 12:23:36 -0400
curl (7.81.0-1ubuntu1.11) jammy-security; urgency=medium

  * SECURITY UPDATE: improper certificate validation vulnerability
    - debian/patches/CVE-2023-28321.patch: fix host name wildcard checking
      in lib/hostcheck.c, tests/data/test1397, tests/unit/unit1397.c.
    - CVE-2023-28321

答案2

获取旧版本的方法:

删除它并使用它apt安装以前的版本。这是 AU 上关于此问题最活跃的主题:如何通过 apt-get 降级软件包?也可以从源代码安装。这可能是一个更好的方法:您可以保留原有的 apt 版本,等待更新/错误修复,然后与源安装版本一起尝试新版本。

检查这些是否能解决你的问题。如果能,请提交错误报告。如果你想坚持使用较旧的 apt 版本别针包裹

答案3

这是一个已确认的错误:https://bugs.launchpad.net/ubuntu/+source/curl/+bug/2028170

他们已经通过恢复更改来修复该问题,新的软件包版本将很快上线。

相关内容