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

Add HTTPS rejectUnauthorized option #993

Closed

Conversation

spinda
Copy link
Contributor

@spinda spinda commented Dec 21, 2024

Description

This allows for connecting to cameras with self-signed certificates over HTTPS.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

This allows for connecting to cameras with self-signed certificates over
HTTPS.
@spinda
Copy link
Contributor Author

spinda commented Dec 21, 2024

Oops, I just discovered this is already possible via the agent option. Closing.

@spinda spinda closed this Dec 21, 2024
@FantasticFiasco
Copy link
Owner

FantasticFiasco commented Dec 22, 2024

Hi @spinda! Out of curiosity, how did you accomplish this using the agent option?

@spinda
Copy link
Contributor Author

spinda commented Dec 22, 2024

Hi @FantasticFiasco! Like this:

new Connection(
  Protocol.Https,
  host,
  port,
  username,
  password,
  {
    agent: new HttpsAgent({
      rejectUnauthorized: false,
    }),
  },
);

@FantasticFiasco
Copy link
Owner

Nice, thanks!

@FantasticFiasco
Copy link
Owner

With the upcoming migration from got to fetch, the following issue is showing us how to accept invalid certificates using fetch.

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

Successfully merging this pull request may close these issues.

2 participants