如何解决使用 wsl-2 ubuntu 时 Gitlab api 挂起
在我的公司,我在 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 举报,一经查实,本站将立刻删除。