问题描述
在我的公司,我在 https://gitlab.mycompany.com 有一个 gitlab。
在运行 Windows 10 的计算机上,我尝试通过 curl 使用 Gitlab api。
在 dos 终端中,它工作正常。
>curl -v https://gitlab.mycompany.com/api/v4/groups
* Trying 10.57.36.28...
* TCP_NODELAY set
* Connected to gitlab.mycompany.com (10.57.36.28) port 443 (#0)
* schannel: SSL/TLS connection with gitlab.mycompany.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 188 bytes...
* schannel: sent initial handshake data: sent 188 bytes
* schannel: SSL/TLS connection with gitlab.mycompany.com port 443 (step 2/3)
* schannel: Failed to receive handshake,need more data
* schannel: SSL/TLS connection with gitlab.mycompany.com port 443 (step 2/3)
* schannel: encrypted data got 2097
* schannel: encrypted data buffer: offset 2097 length 4096
* schannel: sending next handshake data: sending 93 bytes...
* schannel: SSL/TLS connection with gitlab.mycompany.com port 443 (step 2/3)
* schannel: encrypted data got 274
* schannel: encrypted data buffer: offset 274 length 4096
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with gitlab.mycompany.com port 443 (step 3/3)
* schannel: stored credential handle in session cache
> GET /api/v4/groups HTTP/1.1
> Host: gitlab.mycompany.com
> User-Agent: curl/7.55.1
> Accept: */*
...
现在我正在 wsl2 ubuntu 20.04 终端中尝试相同的方法
>curl -v https://gitlab.mycompany.com/api/v4/groups
* Trying 10.57.36.28:443...
* TCP_NODELAY set
* Connected to gitlab.mycompany.com (10.57.36.28) 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):
... hangs for 1 or 2 minutes ...
* OpenSSL SSL_connect: Connection reset by peer in connection to gitlab.mycompany.com:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to gitlab.mycompany.com:443
我也尝试添加 --insecure
选项以确保结果相同。
我在 linux 服务器上尝试过,它正在运行。
在我的 wsl2 ubuntu 终端中,我还尝试了其他 https 站点,内部和外部,并且它正在工作。
我不明白这是什么问题。服务器似乎没有响应客户端握手。但为什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)