Skip to content

Instantly share code, notes, and snippets.

@mrugeshtank
Last active August 7, 2020 09:16
Show Gist options
  • Save mrugeshtank/8c3b8014c34f57bb599f7f9d06c6da25 to your computer and use it in GitHub Desktop.
Save mrugeshtank/8c3b8014c34f57bb599f7f9d06c6da25 to your computer and use it in GitHub Desktop.
# 1. Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# 2. Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# 3. Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# 4. At this point it’s a good idea to test whether the certificate works.
$ telnet gateway.sandbox.push.apple.com 2195
# 5. Let’s try connecting again, this time using our SSL certificate and private key to set up a secure connection.
$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment