diff --git a/packages/gui/src/view/pages/setting.vue b/packages/gui/src/view/pages/setting.vue
index 404da60..d9a5bc8 100644
--- a/packages/gui/src/view/pages/setting.vue
+++ b/packages/gui/src/view/pages/setting.vue
@@ -16,6 +16,9 @@
启用远程配置
+
+ 为提升用户体验,
+
diff --git a/packages/mitmproxy/src/lib/interceptor/impl/proxy.js b/packages/mitmproxy/src/lib/interceptor/impl/proxy.js
index a8265bd..73f639d 100644
--- a/packages/mitmproxy/src/lib/interceptor/impl/proxy.js
+++ b/packages/mitmproxy/src/lib/interceptor/impl/proxy.js
@@ -63,6 +63,7 @@ module.exports = {
if (interceptOpt.sni != null) {
rOptions.servername = interceptOpt.sni
+ rOptions.agent.options.rejectUnauthorized = false
}
return true
},
diff --git a/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js b/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js
index 9d87753..6bf3938 100644
--- a/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js
+++ b/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js
@@ -16,6 +16,10 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e
let proxyReq
const rOptions = commonUtil.getOptionsFormRequest(req, ssl, externalProxy)
+ if (setting && setting.NODE_TLS_REJECT_UNAUTHORIZED) {
+ rOptions.agent.options.rejectUnauthorized = true
+ }
+
if (rOptions.headers.connection === 'close') {
req.socket.setKeepAlive(false)
} else if (rOptions.customSocketId != null) { // for NTLM
@@ -128,11 +132,6 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e
}
}
- // log.info('开始请求:', process.env.NODE_TLS_REJECT_UNAUTHORIZED, rOptions.rejectUnauthorized, rOptions.agent)
- if (setting && setting.NODE_TLS_REJECT_UNAUTHORIZED) {
- rOptions.agent.options.rejectUnauthorized = true
- }
-
proxyReq = (rOptions.protocol === 'https:' ? https : http).request(rOptions, (proxyRes) => {
const end = new Date().getTime()
const cost = end - start