eggjs 框架代理调试 SELF_SIGNED_CERT_IN_CHAIN 报错解决方案
2017-06-26 11:10
405 查看
eggjs 中的 this.ctx.curl 可以发起一个请求,配置 proxy 可以很方面的通过接口进行问题定位。代理方式如下:
1、开启 egg-development-proxyagent ,配置 http_proxy 、 https_proxy 环境变量,将代理地址配置为本地 8888
2、使用 charles 代理抓包
如果是 https 的请求,需要通过 help -> SSL Proxying -> Install Charles Root Certificate 安装证书到 Keychain,并配置为 Always Trust。
charles 中右键对应的 https 请求,Enable SSL Proxying
3、Node 环境变量配置
由于本地 charles 为自签名证书,egg 会报一个 SELF_SIGNED_CERT_IN_CHAIN 的错误,开发环境配置以下环境变量运行即可
1、开启 egg-development-proxyagent ,配置 http_proxy 、 https_proxy 环境变量,将代理地址配置为本地 8888
export https_proxy=http://127.0.0.1:8888;export http_proxy=http://127.0.0.1:8888
2、使用 charles 代理抓包
如果是 https 的请求,需要通过 help -> SSL Proxying -> Install Charles Root Certificate 安装证书到 Keychain,并配置为 Always Trust。
charles 中右键对应的 https 请求,Enable SSL Proxying
3、Node 环境变量配置
由于本地 charles 为自签名证书,egg 会报一个 SELF_SIGNED_CERT_IN_CHAIN 的错误,开发环境配置以下环境变量运行即可
export NODE_TLS_REJECT_UNAUTHORIZED=0 && npm run dev
相关文章推荐
- jenkins 使用Git 报错:SSL certificate problem: self signed certificate in certificate chain
- pyspider HTTP 599: SSL certificate problem: self signed certificate in certificate chain解决方法
- All-In-One Code Framework: 微软一站式开发技术框架解决方案 2009-7-30 新增sample code简介
- All-In-One Code Framework 微软一站式开发技术框架解决方案 中文说明
- All-In-One Code Framework: 微软一站式开发技术框架解决方案 2009-6-14 新增sample code简介
- git clone出现fatal: unable to access 'https://': SSL certificate problem: self signed certificate in
- Xcode7 真机调试出现错误:The executable was signed with invalid entitlements.(The entitlements specified in y
- Capturing 'self' strongly in this block is likely to lead to retain cycle 解决方案
- Capturing self strongly in this block is likely to lead to retain cycle解决方案
- Generate certificate in Java -- Self signed certificate
- curl_error()报错:SSL certificate problem: self signed certificate in certificate
- curl_error()报错:SSL certificate problem: self signed certificate in certificate
- All-In-One Code Framework: 微软一站式开发技术框架解决方案 2009-8-26 新增sample code简介
- How to Create a Self Signed Certificate in IIS 7& Chrome setting
- 关于使用由CA机构(EJBCA)颁发的证书实现SLLSocket双向认证服务端报null cert chain的解决方案
- OPC UA Error: Could not add self-signed certificate to certficate store.
- [Nodejs] 错误 DEPTH_ZERO_SELF_SIGNED_CERT
- STM32用JLINK 烧写程序时出现NO Cortex-m device found in JTAG chain现象和解决方案
- All-In-One Code Framework: 微软一站式开发技术框架解决方案 2009-7-8 新增sample code简介
- Renewing a self-signed certificate in SBS 2003