Skip to content

Instantly share code, notes, and snippets.

@swapnull-in
Forked from kublaios/gist:f01cdf4369c86ddd6d71
Last active June 10, 2022 17:26
Show Gist options
  • Save swapnull-in/c37d5ad818f48106d2e59a8fb877b621 to your computer and use it in GitHub Desktop.
Save swapnull-in/c37d5ad818f48106d2e59a8fb877b621 to your computer and use it in GitHub Desktop.

Revisions

  1. Swapnil Godambe revised this gist Apr 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dev Certificate
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ $ openssl x509 -in aps_development.cer -inform der -out apns_cert_dev.pem
    $ openssl pkcs12 -nocerts -in aps_development.p12 -out apns_key_dev.pem

    # Finally, combine the certificate and key into a single .pem file
    $ cat apns_cert_dev.pem apns_key_dev.pem > ck.pem
    $ cat apns_cert_dev.pem apns_key_dev.pem > ck_dev.pem

    # At this point it’s a good idea to test whether the certificate works.
    $ telnet gateway.sandbox.push.apple.com 2195
  2. Swapnil Godambe renamed this gist Apr 24, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.txt → Dev Certificate
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    # Convert the .cer file into a .pem file:
    $ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
    # Convert the .cer file into a .pem file:
    $ openssl x509 -in aps_development.cer -inform der -out apns_cert_dev.pem

    # Convert the private key’s .p12 file into a .pem file:
    $ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
    $ openssl pkcs12 -nocerts -in aps_development.p12 -out apns_key_dev.pem

    # Finally, combine the certificate and key into a single .pem file
    $ cat PushChatCert.pem PushChatKey.pem > ck.pem
    $ cat apns_cert_dev.pem apns_key_dev.pem > ck.pem

    # At this point it’s a good idea to test whether the certificate works.
    $ telnet gateway.sandbox.push.apple.com 2195

    # 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
    $ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns_cert_dev.pem -key apns_key_dev.pem
  3. @kublaios kublaios created this gist Jun 27, 2014.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # Convert the .cer file into a .pem file:
    $ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem

    # Convert the private key’s .p12 file into a .pem file:
    $ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem

    # Finally, combine the certificate and key into a single .pem file
    $ cat PushChatCert.pem PushChatKey.pem > ck.pem

    # At this point it’s a good idea to test whether the certificate works.
    $ telnet gateway.sandbox.push.apple.com 2195

    # 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