Skip to content

Read in self signed-cert #36

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

Closed
wants to merge 7 commits into from
Closed

Read in self signed-cert #36

wants to merge 7 commits into from

Conversation

jtamsut
Copy link
Contributor

@jtamsut jtamsut commented May 1, 2023

Closes github/vscode-github-actions#39

Background & Context

We have users that have self-signed CA certificates that are issued by an internal CA. This solution reads the certificate (provided by the user as an env var) and instantiates a Node HTTPS agent to make the request.

Octokit allows you to pass your own HTTP/HTTPS agent.

@jtamsut jtamsut requested a review from a team as a code owner May 1, 2023 22:04
auth: token,
userAgent: userAgent || `GitHub Actions Language Server`
});
const selfSignedCertPath = process.env.PATH_TO_SELF_SIGNED_CERT;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This env var should be set by the user. I'm not sure what the best way to set this is. It looks like you can set env vars for the extension in launch.json (reference)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Locally I can populate this env var by exporting a variable in zsh. Not sure if this will work on the installed extension.

Copy link
Member

Choose a reason for hiding this comment

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

@jtamsut I believe launch.json would be for setting environment variables when developing the extension.

I don't think that's doable for installed extensions. I think we should lean on the existing mechanisms for VS Code Extension settings here.

Copy link
Contributor

@KetchupOnMyKetchup KetchupOnMyKetchup left a comment

Choose a reason for hiding this comment

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

I'm good with us trying this out to see if it helps! Could you try messaging the users in the issue to let them know this will be released in the new version Friday + to give them info on options to try setting an env variable and have them let us know if it helps?

@@ -1,8 +1,26 @@
import {Octokit} from "@octokit/rest";
import {Agent} from "node:https";
Copy link
Member

Choose a reason for hiding this comment

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

Taking a dependency on a Node module could prevent this from being used in web browsers. It would be good to validate that there's a polyfill for this that we can use in Webpack, or a separate module altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. That's a great callout.

@KetchupOnMyKetchup KetchupOnMyKetchup self-requested a review May 3, 2023 18:57
@jtamsut jtamsut marked this pull request as draft May 3, 2023 22:24
@jtamsut jtamsut closed this May 8, 2023
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.

Respect the OS certificate store
3 participants