0

我使用 curl 命令将文件上传到外部 api,

curl -iv  --cacert xxx.pem -u xx:xx -F "dataF=@/xx.csv" -F "confId=test" -x "http://xx.xx.xx.xxx:443" "https://xxxxx.com/testupload/"

在 curl 中出现以下错误

*   Trying xx.xxx.x.xx...
  • TCP_NODELAY 设置
  • 连接到 xx.xxx.x.xx (xx.xxx.x.xx) 端口 443 (#0)
  • 分配连接缓冲区!
  • 建立到 test.com:443 的 HTTP 代理隧道
  • 使用 Basic 和用户“testuser”的服务器身份验证

连接 test.com:443 HTTP/1.1 主机:test.com:443 用户代理:curl/7.61.1 代理连接:保持活动

< HTTP/1.1 200 连接已建立 HTTP/1.1 200 连接已建立 < 代理-代理:Zscaler/6.1 代理-代理:Zscaler/6.1 <

  • 代理向 CONNECT 请求回复 200
  • 连接阶段完成!
  • ALPN,提供 h2
  • ALPN,提供 http/1.1
  • 成功设置证书验证位置:
  • CAfile:xx.pem CApath:无
  • TLSv1.2(OUT)、TLS握手、客户端问候(1):
  • OpenSSL SSL_connect:连接到 test.com:443 的 SSL_ERROR_SYSCALL
  • 关闭连接 0 curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to test.com:443

在 RHEL 8 升级之前也是如此

我也尝试使用 java httpclient 进行连接,但最终遇到了同样的问题

javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
    at sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1570)
    at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1400)
    at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300 ...
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:167)
    at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
    at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)

无法找出根本原因,任何指针都会很有帮助。

提前致谢

4

0 回答 0