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

bug: Accept either paths or strings containing the cert for APNS #241

Merged
merged 3 commits into from
Dec 2, 2020

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Dec 1, 2020

Closes #240

Description

Allow APNS certificates to be inlined into environment variables.

NOTE
The Environment Variable name needs to be specified as:

AUTOEND_APNS__CHANNELS (note the double underscore between APNS and CHANNELS.)

inlined certificates should include new line characters (e.g.
AUTOEND_APNS__CHANNELS='{"dev":{"cert":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----","key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"}}'

Values that do not begin with a "-" are presumed to be paths to key and certificates.

Testing

While this will not produce a valid APNS key, you can generate a readable PKCS8 cert and key file using the following:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
openssl pkcs8 -topk8 -inform pem -outform pem -in key.pem -out pkcs8.key -nocrypt

cert.pem = the cert value
pkcs8.key = the key value

These can be incorporated into a bash command to verify that the APNS service is started.

Issue

Closes #240

@jrconlin
Copy link
Member Author

jrconlin commented Dec 1, 2020

@Mcat12, yes. Under bash (and a few other shells) "." will break an environment variable, which will cause things to fail.

@jrconlin jrconlin requested a review from a team December 1, 2020 17:45
Copy link

@fzzzy fzzzy left a comment

Choose a reason for hiding this comment

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

⚙️

@fzzzy fzzzy merged commit b3dd8a3 into master Dec 2, 2020
@jrconlin jrconlin mentioned this pull request Dec 2, 2020
@jrconlin jrconlin deleted the bug/240-certs branch March 1, 2021 23:20
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.

endpoint: Read APN certs from environment
3 participants