标题:Client network socket disconnected before secure TLS connection was established

我在使用 SAP Spartacus 连接 Commerce Cloud 后台 OCC API 时,遇到如下错误消息:

Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:610:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1546:19)
at Object.onceWrapper (events.js:421:28)
at ZoneDelegate.invokeTask (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:140414:35)
at Object.onInvokeTask (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:174114:33)
at ZoneDelegate.invokeTask (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:140413:40)
at Zone.runTask (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:140181:51)
at ZoneTask.invokeTask (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:140496:38)
at TLSSocket.ZoneTask.invoke (c:\Code\SPA\strange\mystore\dist\mystore\server\main.js:140485:52)
at TLSSocket.emit (events.js:327:22)

调试截图:

解决方案

将所有的 OCC 调用经过一个本地 reverse-proxy 进行路由(基于 npm http-proxy-cli)。

(1) set “CX_BASE_URL”: “http://localhost:4500” in .env-cmdrc file (:4500, 端口可以任意指定)

(2) rebuild app and ssr, and serve ssr
Proxy calls to our OCC dev server (https://40……) through http://localhost:4500 , and ignore TLS issues (–no-verify), and optionally make it verbose (-v)

使用下面的命名行安装 http-proxy-cli

$ npm install -g http-proxy-cli

run

$ http-proxy -p 4500 -P --no-verify -v https://40.x.x.x:9002

更多Jerry的原创文章,尽在:“汪子熙”:

Client network socket disconnected before secure TLS connection was established相关推荐

  1. npm ERR! network request to https://registry.npmjs.org/axios failed, reason: Client network socket d

    在终端通过npm install 安装axios/sass等第三方库时报错 npm ERR! network request to https://registry.npmjs.org/axios f ...

  2. 数据库连接报错之IO异常(The Network Adapter could not establish the connection)

    数据库连接报错之IO异常(The Network Adapter could not establish the connection) 参考文章: (1)数据库连接报错之IO异常(The Netwo ...

  3. Io 异常: The Network Adapter could not establish the connection(转)

    Io 异常: The Network Adapter could not establish the connection(转) 参考文章: (1)Io 异常: The Network Adapter ...

  4. 网络套接字(Network socket)

    网络套接字(英语:Network socket:又译网络套接字.网络接口.网络插槽)在计算机科学中是电脑网络中进程间资料流的端点.使用以网际协议(Internet Protocol)为通信基础的网络套 ...

  5. 启动tomcat提示The Network Adapter could not establish the connection

    启动tomcat时,报错 The Network Adapter could not establish the connection 解决办法: 1.IP错误 设置URL时错误 例如:jdbc:or ...

  6. The Network Adapter could not establish the connection解决

    本人最近在移植虚拟机,因为可以方便的移植里面的数据库.移植完系统之后,在新的电脑上面,用以前的代码再次访问 虚拟机中的Oracle数据库时出现一下错误:The Network Adapter coul ...

  7. oracle出现The Network Adapter could not establish the connection的问题

    原文链接:https://blog.csdn.net/wohuozheng/article/details/80525094 如果你确定你的监听,服务,使用sql developer能登陆上,但是使用 ...

  8. java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection 解决

    为什么80%的码农都做不了架构师?>>>    有个项目使用的log4j进行日志记录的,同时也是用log4j中的数据库配置直接把相应级别的日志直接插入oracle. 在把项目部署的另 ...

  9. fatal: 无法访问 ‘x.git/‘gnutls_handshake() failed: The TLS connection was non-properly terminated.解决办法

    我在服务器上克隆代码时报错: #git clone --recursive https://github.com/stevenlovegrove/Pangolin.git 正克隆到 'Pangolin ...

最新文章

  1. PyTorch中torchvision介绍
  2. 有没有办法检查`null`和`undefined`?
  3. 面试官,别再问高并发了!
  4. git的常用命令总结
  5. VTK:可视化算法之DataSetSurface
  6. 计算机性能在线测评,关于电脑性能测试的常见的几大方法
  7. 新款 Azure .NET SDK 如何设定 Content-Type
  8. C++学习之路 | PTA乙级—— 1039 到底买不买 (20 分)(精简)
  9. DWR+Spring配置使用
  10. 人生百态:三件事现出三类人
  11. python培训班靠谱吗-Python培训机构就业靠不靠谱?
  12. NodeMCU(ESP8266)使用UDP控制8x8点阵显示
  13. 以下不正确的C语言标识符是( ),以下不正确的C语言标识符是 _____。
  14. 电子计算机X线体层摄影,X线计算机体层摄影.pdf
  15. python beautifulsoup库下载_python之Beautiful Soup库
  16. AI项目环境搭建go+supervisor+openresty
  17. 调用html事件,HTML 事件
  18. Strings must be encoded before hashing
  19. 谈谈如何发起一次会议
  20. flam3 ubuntu 依赖文件

热门文章

  1. 使用html表格标签做一份简历表
  2. 网络知识:水晶头网线和网线插座接法制作过程介绍
  3. 婚姻家庭法重点复习提纲
  4. Pomodoro方法
  5. 第五章 定积分及其应用
  6. excel 宏录制,宏代码查看
  7. 2020-08-07#自学编程方法论# 怎么学到后面越来越难?达克效应在作祟!
  8. SQL SERVER 实用教程(第四版) 实验 1-10 非标准答案
  9. Java实现 LeetCode 37 解数独
  10. 手工植锡、焊接BGA芯片