-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds insecure flag, implements #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
## [4.0.21](v4.0.20...v4.0.21) (2020-12-17) ### Bug Fixes * Adds insecure flag, implements ([#213](#213)) ([88e7d87](88e7d87))
🎉 This PR is included in version 4.0.21 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@@ -29,6 +30,16 @@ export class RequestHelpers { | |||
return ['User-Agent', `AuditJS/${pack.version} (${environment} ${environmentVersion}; ${system})`]; | |||
} | |||
|
|||
public static getAgent(insecure = false): Agent | undefined { | |||
if (insecure) { | |||
return new HttpsAgent({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of insecure, the proxy setting is ignored...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of insecure, the proxy setting is ignored...
I think I see what you mean. I added some tests of the getAgent()
method in: 3316651, but I'm unsure how best to deal with the case of an 'insecure proxy`. What would we want to see it do? (What to expect() in this test?)
I'm unsure how the insecure url and proxy would interact.
A PR to handle this case would be great!
And/Or a new Issue to track this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you assumptions are correct. This is what would be a combination of proxy and insecure.
To achieve this, I think we should pass the insecure flag to https-proxy-agent. It can take either a string (like now) or an option object. I think this object can have this flags.
Allows for someone to ignore invalid SSL certs
This pull request makes the following changes:
index.ts
IqRequestService.ts
getAgent(insecure: boolean = false)
that will either get an insecure HTTPS Agent, or a Proxy Agent, or nothing if nothing is neededcc @bhamail / @DarthHater / @allenhsieh / @ken-duck