Browse Source

优化sni拦截器

pull/284/head
王良 8 months ago
parent
commit
ecbec8e11e
  1. 2
      packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js
  2. 2
      packages/mitmproxy/src/lib/interceptor/impl/req/sni.js

2
packages/mitmproxy/src/lib/interceptor/impl/req/proxy.js

@ -64,7 +64,7 @@ module.exports = {
if (interceptOpt.sni != null) {
rOptions.servername = interceptOpt.sni
if (rOptions.agent) {
if (rOptions.agent && rOptions.agent.options) {
rOptions.agent.options.rejectUnauthorized = false
}
}

2
packages/mitmproxy/src/lib/interceptor/impl/req/sni.js

@ -3,7 +3,7 @@ module.exports = {
const { rOptions, log } = context
if (interceptOpt.sni != null) {
rOptions.servername = interceptOpt.sni
if (rOptions.agent) {
if (rOptions.agent && rOptions.agent.options) {
rOptions.agent.options.rejectUnauthorized = false
}
log.info('sni intercept: sni replace servername:', rOptions.hostname, '➜', rOptions.servername)

Loading…
Cancel
Save