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 option to skip SSL verification #24

Open
sugat009 opened this issue Oct 2, 2024 · 3 comments
Open

Add option to skip SSL verification #24

sugat009 opened this issue Oct 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@sugat009
Copy link
Member

sugat009 commented Oct 2, 2024

Can a flag like --ignore-self-signed-certificate that ignores self-signed certificates or --skip-ssl-verification that completely ignores SSL verification be added? This would be very helpful during dev testing where instances may or may not be SSL-signed.

@sugat009 sugat009 added the enhancement New feature or request label Oct 2, 2024
@jkuester
Copy link
Collaborator

jkuester commented Oct 8, 2024

We should be able to do the axios calls with a custom agent that sets rejectUnauthorized: false. (Kinda unrelated, but I wonder if we actually need axios or if we would be fine with just calling fetch?)

I am tempted to say this should just be default behavior. 🤔

@sugat009
Copy link
Member Author

sugat009 commented Oct 8, 2024

For the workaround, I used the https.Agent from node:https.

...
import https from 'node:https';
...
const instance = axios.create({
  httpsAgent: new https.Agent({
    rejectUnauthorized: false,
  }),
});

...
      await instance.post(path, { docs });
...

@sugat009
Copy link
Member Author

sugat009 commented Oct 8, 2024

Even for fetch the solution is somewhat similar. It includes using a custom agent there as well.

  1. Ref 1
  2. Ref 2

For scripting purposes, an environment variable could be set it seems.

  1. Ref 1

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

No branches or pull requests

2 participants