目录

  • 问题
  • 解决
  • 结尾

问题

今天以容器的形式在公网上一个部署了一个云服务,在测试环境是没有问题的,不知道为什么部署到 beta 环境就出现了问题,导致 https 协议文件访问失败。

具体报错信息如下:

2021/11/09 07:15:58 http: TLS handshake error from 125.64.94.138:34428: remote error: tls: bad certificate\
2021/11/09 07:15:58 http: TLS handshake error from 125.64.94.138:36510: EOF\
2021/11/09 07:15:58 http: TLS handshake error from 125.64.94.138:39042: read tcp 172.17.0.79:9443->125.64.94.138:39042: read: connection reset by peer\
2021/11/09 07:15:58 http: TLS handshake error from 125.64.94.138:41490: EOF\
2021/11/09 07:15:58 http: TLS handshake error from 125.64.94.138:42006: read tcp 172.17.0.79:9443->125.64.94.138:42006: read: connection reset by peer\
2021/11/09 07:16:00 http: TLS handshake error from 125.64.94.138:42738: read tcp 172.17.0.79:9443->125.64.94.138:42738: read: connection reset by peer\
2021/11/09 07:16:01 http: TLS handshake error from 125.64.94.138:51154: read tcp 172.17.0.79:9443->125.64.94.138:51154: read: connection reset by peer\
2021/11/09 07:16:01 http: TLS handshake error from 125.64.94.138:33806: read tcp 172.17.0.79:9443->125.64.94.138:33806: read: connection reset by peer\
2021/11/09 07:16:01 http: TLS handshake error from 125.64.94.138:34836: read tcp 172.17.0.79:9443->125.64.94.138:34836: read: connection reset by peer\
2021/11/09 07:16:01 http: TLS handshake error from 125.64.94.138:35318: read tcp 172.17.0.79:9443->125.64.94.138:35318: read: connection reset by peer\
2021/11/09 07:16:16 http: TLS handshake error from 125.64.94.138:34338: read tcp 172.17.0.79:9443->125.64.94.138:34338: read: connection reset by peer\
2021/11/09 11:24:42 http: TLS handshake error from 209.17.97.114:65306: EOF\
2021/11/09 13:46:06 http: TLS handshake error from 89.248.174.193:39762: EOF\
2021/11/09 15:51:50 http: TLS handshake error from 165.227.163.245:38494: EOF

通过报错信息,大致猜测可能是证书原因导致的握手失败,具体原因还不是很清楚,至少是一个分析和思考的方向。

进一步分析报错日志,可以发现握手过程中,IP 地址为 125.64.94.138 的机器不断尝试切换其他端口,但是每次都被重置连接,最终导致连接失败。

解决

网上搜索了很多资料,但是介绍的方法都没有解决自己遇到的问题,后来在梳理整体流程的时候发现了原因。因为容器服务本身同时支持 http 协议和 https 协议,有一层 https 证书,在测试环境中没有问题,但是 beta 环境中所有服务访问的入口都要经过 Nginx 代理服务转发请求,而 Nginx 服务本身又设置了一层 https 证书,二层证书不一致导致了错误的发生。

因此,解决方法有两种,一是仅使用一层 https 证书;二是统一两层证书,使用相同的签名证书。

结尾

有时候,很多问题在自测的时候很难发现,是因为没有放到具体的生产环境中去,因此,开发过程中一定要考虑到未来部署后可能出现的问题,编码时尽量规避。

作者简介:大家好,我是 liuzhen007(Data-Mining),是一位音视频技术爱好者,同时也是CSDN博客专家、华为云社区云享专家、签约作者,欢迎关注我分享更多干货!

解决:http: TLS handshake error from *相关推荐

  1. http: TLS handshake error from xxx.xxx.xxx.xxx:xxxx : read tcp xxx.xxx.xxx.xxx:6443->xxx.xxx.xxx.xxx

    目录 一.问题描述 二.问题分析 解决方法: 一.问题描述 使用阿里云SLB做 kube-apiserver负载,查看kube-apiserver 日志一直在报 TLS handshake error ...

  2. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake ti

    docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake ti ...

  3. 报错 proxyconnect tcp: tls: first record does not look like a TLS handshake

    使用代理时出现此报错,解决方案如下 # 报错内容 Error: looks like "https://prometheus-community.github.io/helm-charts& ...

  4. TLS Handshake failed: tls: server selected unsupported protocol version 301

    TLS Handshake failed: tls: server selected unsupported protocol version 301 问题 问题分析 解决方法 问题 使用gorm链接 ...

  5. docker 错误 request canceled while waiting for connection 或 TLS handshake timeout 解决方案

    使用docker 拉镜像的时候,出现下面的错误: net/http: request canceled while waiting for connection (Client.Timeout exc ...

  6. 如何解决SSL/TLS握手过程中失败的错误?

    Fixes for the SSL/TLS Handshake Failed error for both internet users and site owners It's time for a ...

  7. docker配置代理pull报错:proxyconnect tcp: tls: first record does not look like a TLS handshake

    1.docker pull mysql报错 [root@k8s docker.service.d]# docker pull mysql Using default tag: latest Error ...

  8. Cloud Foundry 运行bosh create-env时报错: TLS handshake timeout

    在Linux上使用Bosh创建Director的时候报错,如下: bosh create-env bosh-deployment/bosh.yml \--state state.json \ --va ...

  9. git:Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists)....

    Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). 解决办法一:保 ...

最新文章

  1. CF思维联系--CodeForces -214C (拓扑排序+思维+贪心)
  2. 用c语言构建二叉树(重点)
  3. 有关 google analytics
  4. System学习笔记004---Windows系统中hosts文件的作用_Zookeeper在SpringBoot中报错需要配置一下这个文件
  5. 1104File Space Bitmap Block损坏能修复吗
  6. java 虚拟机内存不足_JAVA虚拟机内存不够解决办法
  7. 开发者需要的 9 款代码比较工具
  8. 精神分析理论-弗洛伊德
  9. 回溯法 | 图的m着色问题
  10. 邮件安全风险评估方案
  11. javascript引入方式:嵌入式,外链式,行内式
  12. 显示器偏色测试软件,显示器显示偏色
  13. 陶哲轩实分析 3.1节 习题试解
  14. 批量移动文件夹到对应文件夹
  15. 先有史记还是先有资治通鉴?司马迁、司马光和司马懿三人什么关系?
  16. c#版汉字拼音大全,支持多音字
  17. 案例十、检测域名是否到期
  18. Dubbo2.6.5入门——简单的HelloWorld
  19. 转载:嵌入式系统综述之二
  20. 趣味测试小程序源码带流量主广告位开源小程序

热门文章

  1. 3COM SS3 4400交换机VLAN功能设置
  2. 深度学习模型部署之模型优化
  3. 疫情加速IT人才外包服务普及应用~
  4. 新闻分页---新闻发布系统
  5. 记一次没遇到过的UPX脱壳
  6. 计算机网络 王道论坛1
  7. 电脑上的计算机自动打开,手机连接电脑自动打开word
  8. Latex 页面调整常用参数
  9. 【07月03日】A股ROE最高排名
  10. 金山毒霸2014官方免费下载