Skip to content

Enterprise self-signed/untrusted certificate support #671

Closed

Description

@niik

Refs #667

It's not uncommon for GitHub Enterprise instances to run with a self-signed certificate or certificate signed by a non-authorative CA. There's several reasons why that might be true. These include:

  • a freshly launched GHE instance like a trial
  • of our AWS/Azure templates which generate a self-signed certificate on launch
  • GHE instances which run on non TLD domains (like ghe.lan) for which no CA will give out a certificate

We need to make sure that our enterprise sign in flow can handle an untrusted certificate and present enough information that the user can make an informed decision about whether to trust it permanently. I don't know how this works on Mac, maybe it's already taken care by the system, but on Windows we're going to have to do a bit of work for this to work nicely.

First, we need a way of installing a certificate into the appropriate certificate store. Second, we need a way of keeping the curl ca-bundle file in sync with the certificate store. This all works in the current version on Desktop on Windows. The implementation for the order of certificates in the ca-bundle is rather finicky but luckily we have a reference implementation in MsysGitCertificateInstaller.cs as well as a starting point for installing certificates in the store (SystemCertificateInstaller.cs). I'm assuming this will require us to write some native helpers on Windows.

This is the current flow on Windows

Activity

  1. joshaber commented on Nov 21, 2016

    @joshaber
    Contributor

    I don't know how this works on Mac, maybe it's already taken care by the system

    It's fairly similar on Mac. We'd get a callback saying the certificate was not trusted, and we'd present a standard system dialog to accept or reject it. I'd be surprised if Electron already exposed those hooks so we'd probably need to do some work there.

    Second, we need a way of keeping the curl ca-bundle file in sync with the certificate store.

    This is also relevant to #340, right? If, e.g., Git for Windows' curl knew about the system certificate store, we'd be in fine shape.

  2. shiftkey commented on Nov 21, 2016

    @shiftkey
    Member

    This is also relevant to #340, right? If, e.g., Git for Windows' curl knew about the system certificate store, we'd be in fine shape.

    Had a chat with @dscho about this today, and from his understanding there's no way to compile curl with support for both resolving using the certificate bundle and the Windows certificate store. But he's not looked at that area for a while, so this might have changed.

    Otherwise, yes, we're porting our existing tricks from Desktop...

  3. added this to the milestone on Jan 19, 2017
  4. self-assigned this
    on Mar 29, 2017
  5. joshaber commented on Mar 31, 2017

    @joshaber
    Contributor

    I have an Electron PR underway in electron/electron#9068, but I'm wondering about the security tradeoffs we're making here. I've opened https://github.com/github/desktop/issues/486 to loop in the Security team.

  6. joshaber commented on Apr 3, 2017

    @joshaber
    Contributor

    The Electron PR is now electron/electron#9099.

  7. joshaber commented on Apr 4, 2017

    @joshaber
    Contributor

    Electron PR has landed. Now we just need a new release including it.

  8. added a commit that references this issue on Apr 7, 2017
  9. removed their assignment
    on Apr 18, 2017
  10. niik commented on Apr 18, 2017

    @niik
    MemberAuthor

    @shiftkey I'm tentatively re-assigning this to you since you've started to look into this.

    We're not gonna be able to get anything as fancy as the native Mac view but we should pop the native windows certificate install prompt as per the Gif above. It should show automatically when attempting to install a certificate into the trusted root authorities store. That's all we're doing on Windows. I'm pretty terrible at anything C/C++ but this looks promising: https://msdn.microsoft.com/en-us/library/windows/desktop/aa382037(v=vs.85).aspx

  11. shiftkey commented on Apr 21, 2017

    @shiftkey
    Member

    Opened the upstream PR here electron/electron#9242

  12. shiftkey commented on Apr 27, 2017

    @shiftkey
    Member

    Moving this into M4 but it's under active development.

  13. 5 remaining items

  14. zeke commented on May 11, 2017

    @zeke
    Contributor

    Hey sorry for the trouble.

    this is something we can get to after Tuesday - and I'd love to help get the two in sync for the future, so this pain is worth it in the long run.

    Glad to hear it's not a blocker. We'll get it sorted.

  15. shiftkey commented on May 11, 2017

    @shiftkey
    Member

    @zeke so far there's a few naming things that I'm working through, but I'll throw some feedback over as I get to the bottom of what's missing from the existing type declarations (it may be some false positives on our end that didn't reflect the real API).

  16. shiftkey commented on May 12, 2017

    @shiftkey
    Member

    @joshaber given this is tied to the Electron update, do we want to push this into the beta announcement? Or should I move it to the next milestone?

  17. joshaber commented on May 12, 2017

    @joshaber
    Contributor

    Yup 👍 Moving to the next release.

  18. sgredell commented on Aug 21, 2017

    @sgredell

    I'm encountering a self-signed cert error when attempting to clone from Github Enterprise in 0.8.0

    GitHub Desktop version: 0.8.0

    OS version: Windows 10

    I am now able to login, but unable to clone a repository.

    Cloning into 'C:\Users\steve.gredell\Documents\GitHub\analytics-pipeline'...
    fatal: unable to access 'https://<enterprise-server>/<org>/<repo-name>.git/': SSL certificate problem: self signed certificate in certificate chain
    

    I haven't been keeping up with the Beta version, but a coworker informed me that last week he was able to login and clone from our enterprise server with no issues. Is there a way to get at older (windows) versions of Desktop Beta to test this?

    Also let me know if you'd rather I make a new issue.

  19. w60001 commented on Aug 21, 2017

    @w60001

    I'm also seeing a regression on this in 0.8.0, which just started popping up after an auto-update to the latest GitHub Desktop version this morning.

  20. shiftkey commented on Aug 21, 2017

    @shiftkey
    Member

    @sgredell @w60001 it looks like someone opened #2514 to track this - please add your notes there.

  21. locked as resolved and limited conversation to collaborators on Jul 21, 2018
  22. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions