Skip to content
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

Merged
merged 2 commits into from
Dec 17, 2020
Merged

Adds insecure flag, implements #213

merged 2 commits into from
Dec 17, 2020

Conversation

DarthHater
Copy link
Member

Allows for someone to ignore invalid SSL certs

This pull request makes the following changes:

  • Implements a flag in index.ts
  • Sends flag to IqRequestService.ts
  • Implements a new getAgent(insecure: boolean = false) that will either get an insecure HTTPS Agent, or a Proxy Agent, or nothing if nothing is needed

cc @bhamail / @DarthHater / @allenhsieh / @ken-duck

Copy link
Contributor

@bhamail bhamail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@bhamail bhamail merged commit 88e7d87 into master Dec 17, 2020
@bhamail bhamail deleted the IgnoreInsecure branch December 17, 2020 21:16
DarthHater pushed a commit that referenced this pull request Dec 17, 2020
## [4.0.21](v4.0.20...v4.0.21) (2020-12-17)

### Bug Fixes

* Adds insecure flag, implements ([#213](#213)) ([88e7d87](88e7d87))
@DarthHater
Copy link
Member Author

🎉 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({
Copy link
Contributor

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...

Copy link
Contributor

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants