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

Support directly passing key and certificate rather than loading from file #34

Merged
merged 3 commits into from Nov 8, 2014

Conversation

pnc
Copy link
Contributor

@pnc pnc commented Nov 7, 2014

We make multiple connections for a couple different iOS applications, and so we store our keys in the database rather than on the filesystem. This change lets you specify a DER-encoded key and certificate as part of #apns_connection's options, mimicking ssl:connect's options.

Another way to do this would be to directly support setting ssl:connect options in #apns_connection. If you prefer this, let me know!

This fixes #26.

I've left this as working commits for easier review, but I can squash prior to a merge.

If you plan to merge this, I'd like to add a snippet to the README about how to use Erlang's public_key module to decode keys into the proper format for use with these new options.

@elbrujohalcon
Copy link
Member

@pnc looks good, can you update README.md accordingly, please?

@pnc
Copy link
Contributor Author

pnc commented Nov 7, 2014

@elbrujohalcon Let me know if that looks good!

I'm exposing the fact that ssl:connect wants the binary key as {'RSAPrivateKey', binary()}. If we want to assume Apple will only accept RSA keys, we could hide this detail inside ssl_opts.

Have you ever tried submitting a DSA signing request to the Developer Portal?

@elbrujohalcon
Copy link
Member

@pnc no, I have not. But, I don't mind exposing that detail. I'll just merge the pull request

elbrujohalcon pushed a commit that referenced this pull request Nov 8, 2014
Support directly passing key and certificate rather than loading from file
@elbrujohalcon elbrujohalcon merged commit 18e13d2 into inaka:master Nov 8, 2014
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.

ssl:connect with the content of the certificate not pem file
2 participants