目录

  • 问题
  • 解决
  • 结尾

问题

今天以容器的形式在公网上一个部署了一个云服务,在测试环境是没有问题的,不知道为什么部署到 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. HDU2085:核反应堆(递推)
  2. 软件架构最佳实践和案例分析
  3. 子路由里嵌套子路由、嵌套多重子路由
  4. php定义枚举,PHP中Enum(枚举)用法实例详解
  5. JAVA服务治理实践之无侵入的应用服务监控--转
  6. 【编程】二叉搜索树的定义
  7. postgres循环sql
  8. linux运维常用命令一句话
  9. WEB安全基础-PHP中GET与POST实践
  10. ThinkPHP文件上传
  11. java怎么写网络爬虫_教你如何编写简单的网络爬虫
  12. ODP.NET数据访问
  13. php把路由放在数据库,PHP导入Excel到数据库的方法 PHP把数据库数据导出到方法
  14. Ubuntu下反编译apk源码查看
  15. 问卷测试软件制作,最详细测评!在微信里做问卷调查,这 4 款小程序你一定会用到...
  16. 连续仨月霸占牛客榜首!京东T8呕心巨作:700页JVM虚拟机实战手册
  17. 讯飞输入法 语音识别功能 台式机设置
  18. 基于深度学习(AI人工智能)技术的机器视觉外观检测系统-GalileoX软件介绍
  19. Java征途:行者的地图
  20. java 24点经典纸牌益智游戏

热门文章

  1. 资料分享|kafka学习秘籍
  2. 购物兔成功入驻“金山软件管家”
  3. SA的恶魔:态势感知的敌人
  4. 基于卷积神经网络CNN的电影推荐系统
  5. Linux下Oracle19c离线rpm安装
  6. 普通人应该如何找到,一个适合自己的创业项目?开一家赚钱的小店?
  7. 05.去,走你想要的人生——有条理地生活:秩序即是力量(笔记)
  8. 计算机毕业设计Javavue架构云餐厅美食订餐系统(源码+系统+mysql数据库+lw文档)
  9. 2k服务器关闭后 在线生涯模式如何保存,NBA2K15离线玩生涯模式存档方法 生涯存档离线怎么玩_3DM单机...
  10. 微信公众号开发 https访问的封装