Skip to content

I encounter error. "SSL: Can't load the certificate" #6

Description

@carlhung

I followed the steps on readme. installed successfully:
brew reinstall curl --with-openssl --with-nghttp2
brew link curl --force

I went to my developer account. generated APN-development certificate and download the certificate with cer format. double clicked to import to "keychain" and exported a file with p12 format. no password set. typed the command:
openssl pkcs12 -in certificate.p12 -out newfile.crt.pem -clcerts -nokeys
openssl pkcs12 -in certificate.p12 -out newfile.key.pem -nocerts -nodes
to generate newfile.crt.pem and newfile.key.pem files. while using this library i got the error:

  • Trying 17.188.138.73...
  • TCP_NODELAY set
  • Connected to api.development.push.apple.com (17.188.138.73) port 443 (#0)
  • WARNING: SSL: CURLOPT_SSLKEY is ignored by Secure Transport. The private key must be in the Keychain.
  • WARNING: SSL: The Security framework only supports loading identities that are in PKCS#12 format.
  • SSL: Can't load the certificate "/Users/Carl/Documents/swift/time/pem/newfile.crt.pem" and its private key: OSStatus -25299
  • Curl_http_done: called premature == 0
  • Closing connection 0
    ret = CURLcode(rawValue: 58)
    Problem with the local SSL certificate

I use an application called "APN tester", my certificate worked fine. I got the post message using tester.

how can i fix it? thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions