优化sni拦截器

pull/284/head
王良 2024-03-26 15:23:09 +08:00
parent 8384b86d71
commit ecbec8e11e
2 changed files with 2 additions and 2 deletions

View File

@ -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
}
}

View File

@ -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)