Skip to content

Conversation

sergiou87
Copy link
Member

@sergiou87 sergiou87 commented Aug 22, 2024

Closes #18991

Description

Some self-hosted repositories may not have a valid SSL certificate and that could be ok. Git offers the http.sslverify option to disable SSL verification for all git operations, or only for git operations on certain hosts. We could use that here, but we don't want to duplicate that logic to match domains, order of preference of different options...

Instead, we'll just reject all requests to /meta that fail SSL verification. The reasoning for that is:

  1. This request is only used to find out if the host is a GitHub Enterprise instance. It's ok if this fails for whatever reason for self-hosted repositories, since returning undefined in this function means "we don't know if this is a GitHub host or not".
  2. We're want to assume (for now, at least) that GitHub Enterprise instances are always running with a valid SSL certificate.

If we used fetch for this, in the case of an invalid SSL certificate Electron would dispatch a 'certificate-error' event on the main process that we must handle to allow the request to finish (in this case, by rejecting it). However, we're using https.request here, so we don't need to handle that and can get rid of the complexity of dealing with stuff happening on the main process.

Release notes

Notes: [Fixed] Don't show certificate error when pushing to self-hosted repositories

@sergiou87 sergiou87 changed the title Git check certificate error Don't show certificate error when pushing to self-hosted repositories Aug 23, 2024
@sergiou87
Copy link
Member Author

Superseded by #19297

@sergiou87 sergiou87 closed this Sep 23, 2024
@sergiou87 sergiou87 deleted the git-check-certificate-error branch December 18, 2024 11:15
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.

1 participant