curl 命令在 Docker 容器内失败

curl 命令在 Docker 容器内失败

我尝试运行 curl 命令将文件上传到 docker 容器内的目标 B,但收到以下错误消息。当我在主机服务器上的容器外运行完全相同的命令时,它运行正常。显然,由于 curl 命令在主机服务器上有效,因此检查端口 443 已打开。

* Trying xx.xx.xx.xxx...
* TCP_NODELAY set
* Connected to dns.servername.com (xx.xx.xx.xxx) 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.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; O=WORK; OU=SSL Servers; CN=dns.servername.com
*  start date: Aug 11 19:21:18 2020 GMT
*  expire date: Aug 11 19:51:18 2022 GMT
*  subjectAltName: host "dns.servername.com" matched cert's "dns.servername.com"
*  issuer: C=US; O=WORK; OU=Certification Authorities; CN=WORK COMPANY Enterprise Issuing CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x561f6445d620)
> POST /service/rest/v1/components?repository=DevOps HTTP/2
> Host: dns.servername.com
> User-Agent: curl/7.58.0
> accept: application/json
> Authorization: Basic ZmFhZG1pbjotVXUzOEVKKlIhTGMjNXBe
> Content-Length: 368754896
> Content-Type: multipart/form-data; boundary=------------------------cc91de81e54e3bc2
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* SSL_write() returned SYSCALL, errno = 104
* Failed sending HTTP2 data
* Connection #0 to host dns.servername.com left intact
curl: (55) SSL_write() returned SYSCALL, errno = 104

我正在运行的命令。

curl -v 'https://dns.servername.com/service/rest/v1/components?repository=DevOps' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -H 'Authorization: Basic ZmFhZG1pbjotVXUzOEVKKlIhTGMjNXBe' -F 'raw.directory=Folder12345' -F '[email protected];type=application/x-zip-compressed' -F 'raw.asset1.filename=testfile.zip'

这很少奏效,大概 10 到 20 次尝试中才有一次有效。

相关内容