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

keychain-import.sh does not import the certificate with the private key properly #4

Open
cohortswitchback opened this issue Apr 1, 2022 · 1 comment

Comments

@cohortswitchback
Copy link

The certificate gets added to Keychain Access.app, but it appears to be orphaned from its private key (which would normally show up underneath it). Conversely, you can usually see when filtering to private key the certificate underneath it. Server.app won't show the certificate. Trying to pull it in manually won't work because it asks for the passphrase, which is presumably generated with " PASS=$(openssl rand -base64 45 | tr -d /=+ | cut -c -30)" and isn't stored.

@cohortswitchback
Copy link
Author

cohortswitchback commented Apr 1, 2022

Screen Shot 2022-04-01 at 12 56 14 PM

This was after manually setting a password and manual transform of PEM files into p12 format. I then manually added the cert to Server.app and then it showed up properly in KeyChain access. This is on Mac OS 12.3.1.

My hunch is, both of these steps in the script are not completing all the way:

# Import the p12 file into the keychain
    security import "${PEM_FOLDER}/letsencrypt_sslcert.p12" -f pkcs12 -k /Library/Keychains/System.keychain -P $PASS -T /Applications/Server.app/Contents/ServerRoot/System/Library/CoreServices/ServerManagerDaemon.bundle/Contents/MacOS/servermgrd

    # Delete the older certificate from the keychain
    security delete-certificate -Z $(security find-identity -v -p ssl-server -s ${DOMAIN} | grep "1)" | cut -d " " -f 4) -t /Library/Keychains/System.keychain

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

No branches or pull requests

3 participants
@cohortswitchback and others