-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de70b08
commit 9e27eb4
Showing
4 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/mitmproxy/src/lib/interceptor/impl/req/unVerifySsl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
name: 'unVerifySsl', | ||
priority: 123, | ||
requestIntercept (context, interceptOpt, req, res, ssl, next) { | ||
const { rOptions, log } = context | ||
|
||
if (rOptions.agent.options.rejectUnauthorized && rOptions.agent.unVerifySslAgent) { | ||
rOptions.agent = rOptions.agent.unVerifySslAgent | ||
log.info(`unVerifySsl intercept: ${rOptions.hostname}, unVerifySsl`) | ||
res.setHeader('DS-Interceptor', 'unVerifySsl') | ||
} else { | ||
log.info(`unVerifySsl intercept: ${rOptions.hostname}, already unVerifySsl`) | ||
res.setHeader('DS-Interceptor', 'already unVerifySsl') | ||
} | ||
|
||
return true | ||
}, | ||
is (interceptOpt) { | ||
return interceptOpt.unVerifySsl === true | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters