Docker中的Docker - SSL问题

phi*_*son 6 ssl curl jenkins docker docker-dind

我在CI管道中使用Docker In Docker for Jenkins Slaves.

我遇到过有关SSL的问题.问题是maven无法访问位于我们Nexus仓库中的工件,它只是挂起.

我尝试使用curl进行调试.

在DinD容器内,一切都很好:

$ curl -I https://www.google.com
HTTP/1.1 200 OK
Run Code Online (Sandbox Code Playgroud)

但是,如果我运行:

bash-4.3# curl -I --insecure  https://nexus.eng.myco.com/nexus
curl: (35) Unknown SSL protocol error in connection to nexus.eng.myco.com:443`
Run Code Online (Sandbox Code Playgroud)

它挂了很长时间然后我收到这个错误:

curl: (35) Unknown SSL protocol error in connection to nexus.eng.myco.com:443`
Run Code Online (Sandbox Code Playgroud)

我可以将问题curl语句运行一级(运行问题docker容器的docker容器),一切都很好.

我应该注意,如果我在我的笔记本电脑上运行有问题的DinD容器(不是在DinD中),它没有问题.

使用调试信息更新:

bash-4.3#  curl -v -I https://nexus.eng.myco.com/nexus/content/groups/this>
*   Trying 54.164.137.27...
* Connected to nexus.eng.my.com (44.164.137.27) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

小智 0

可能现在回答已经太晚了,但我会把它放在这里,以防其他陌生人遇到类似的问题。
我建议检查父容器和子容器中的 MTU。

ip addr | grep mtu
Run Code Online (Sandbox Code Playgroud)

如果您发现 MTU 存在差异,
例如

3: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1402 qdisc noqueue state UP group default
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
Run Code Online (Sandbox Code Playgroud)

需要将其更正为相同。
例如

ip link set dev eth0 mtu 1500
Run Code Online (Sandbox Code Playgroud)