调用Mailgun API时Curl遇SSL意外EOF错误求助(仅特定服务器)
服务器请求Mailgun API时持续遭遇SSL错误(仅当前Ubuntu 22.04服务器出现)
在当前Ubuntu 22.04服务器上,使用curl请求Mailgun的EU API时已持续数小时出现SSL错误,相同版本及配置的其他服务器无此问题,已排除curl版本问题,怀疑是证书相关问题。
curl请求命令及错误输出
执行命令:
curl -vvv 'https://api.eu.mailgun.net/'
返回错误:
* Connected to api.eu.mailgun.net (34.111.145.192) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * CAfile: /etc/ssl/certs/ca-certificates.crt * CApath: /etc/ssl/certs * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.0 (OUT), TLS header, Unknown (21): * TLSv1.3 (OUT), TLS alert, decode error (562): * error:0A000126:SSL routines::unexpected eof while reading * Closing connection 0 curl: (35) error:0A000126:SSL routines::unexpected eof while reading
curl版本信息
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.14 Release-Date: 2022-01-05 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
OpenSSL连接测试结果
执行证书检查命令:
openssl s_client -connect api.eu.mailgun.net:443 -CApath /etc/ssl/certs
返回结果:
CONNECTED(00000003) write:errno=104 --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 320 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) ---
内容的提问来源于stack exchange,提问作者Crack_David
相关产品推荐
相关产品推荐

