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

Binary signing for macOS #66

Closed
dignifiedquire opened this issue Oct 19, 2015 · 7 comments
Closed

Binary signing for macOS #66

dignifiedquire opened this issue Oct 19, 2015 · 7 comments
Labels

Comments

@dignifiedquire
Copy link
Member

No description provided.

@dignifiedquire
Copy link
Member Author

@jbenet how long do you think this will take you? Is it realistic to get this done for 1.0?

@jbenet
Copy link
Member

jbenet commented Oct 19, 2015

i'm not sure. i'll look into it, but this week is basically shot for me. if you need it this week, then no. next week is likely. then there's apple's review process. i think it's much faster now, but it used to take a week or something.

@dignifiedquire
Copy link
Member Author

That's fine, I'll do the prerelease unsigned this week and want to wait at least one week anyway before the real release.

@dignifiedquire
Copy link
Member Author

Ref electron/packager#163

@daviddias daviddias modified the milestone: 1.0.0 Nov 8, 2015
@daviddias daviddias removed this from the 1.0.0 milestone Nov 22, 2017
@daviddias daviddias removed the chore label Nov 25, 2017
@hacdias hacdias changed the title Setup OS X signing process Binary signing for macOS Nov 23, 2018
@hacdias hacdias mentioned this issue Nov 23, 2018
15 tasks
@hacdias hacdias added this to the v1.0 milestone Nov 24, 2018
@hacdias hacdias removed this from the v0.6 milestone Dec 21, 2018
This was referenced Jan 3, 2019
@hacdias hacdias added the area/macos MacOS label Jan 6, 2019
@olizilla
Copy link
Member

olizilla commented Jan 22, 2019

Happy to say we're getting a first pass on "signed releases for macOS" in to the next release, in significantly less than 4 years after the initial proposal.

Of note, it is tricky. There are a bunch of hoops you have to jump through on the Apple Developer portal and more on the local keychain handling, and more again to wire it up to CI.

Disclaimer: this is my first go-round with this, but the output has created an electron-builder created .dmg that can be installed on macOS with just the "this app came from the internet warning" and not the "you cant install this app becuase it is from the unknown" warning... so i'm reasonably happy with the results. And yes, this is about the worst admin flow I have ever seen. I think xcode is supposed to hide some of this from you, but we didn't come this far to open up that thing.

with an apple team account created, and you as the team agent...

  • You need to be the Apple Developer "Team Agent" to create certificates.
  • There can be only one Team Agent, having the admin role wont do.
  • You must have 2 factor auth enabled on your apple ID.
  • With all that in place, log in to https://developer.apple.com and click "Certificates, IDs & Profiles"
  • Choose "macOS" from the drop down in the top left that initially says "iOS, tvOS, watchOS"
  • Hit the plus in the top right to start the cert creation flow. You need to do this twice for both Developer ID Application and Developer ID Installer. You can use the same CSR for both.
1 2 3 4
screenshot 2019-01-23 at 09 27 06 screenshot 2019-01-23 at 09 27 24 screenshot 2019-01-23 at 09 27 35 screenshot 2019-01-23 at 09 27 57
Pick Developer ID to create certs for distribution outside of the app store Pick Developer ID Application. You will need to do this again for Developer ID Installer too. blurb about creating a CSR Go create your CSR, as described below
  • You create Certificate Signing Request via your local Keychain Access app to create certificates.
    • keychain access > certificate assistant > Request a certificate from a certificate authority

screenshot 2019-01-23 at 09 19 45

- Fill out the details. should match your apple ID, and you should be your team agent. - Leave CA email address blank and "choose save to disk"

screenshot 2019-01-23 at 09 20 53

- Upload the CSR file you just created to the apple developer portal - You must create both a `Developer Installer` and a `Developer Application` certifcate, and download them to your local keychain. - You have to access them via the "My Certificates" filter, to enable the "export as .p12" option. If you navigate to them via another filter or search, that export option is not available. You better be the team agent if you want that to work. If all the planets are aligned you should be able to export them as a combined, encrypted `.p12` file like so

add-apple-certs

Then follow the steps in https://www.electron.build/code-signing#travis-appveyor-and-other-ci-servers to wire it up for CI

To sign app on build server you need to set CSC_LINK, CSC_KEY_PASSWORD:

  • Export certificate. Consider to not use special characters (for bash) in the password because “values are not escaped when your builds are executed”.
  • Encode file to base64 (macOS: base64 -i yourFile.p12 -o envValue.txt, Linux: base64 yourFile.p12 > envValue.txt).

Thanks to @jesseclay for sticking with me on this advenure!

@olizilla
Copy link
Member

@hacdias
Copy link
Member

hacdias commented Feb 12, 2019

Binary signing is set up and working. The next version will have macOS signed binaries.

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

No branches or pull requests

5 participants