Skip to content

hack/test-cmd.sh broken on newer Mac (maybe?) #1011

Closed

Description

@smarterclayton

Mac seems to have problem with PEM format in curl or something?

curl https://localhost:8443/healtz --key openshift.local.certificates/admin/key.key --cert openshift.local.certificates/admin/cert.crt 

curl: (58) SSL: Can't load the certificate "openshift.local.certificates/admin/cert.crt" and its private key: OSStatus -25299

Activity

  1. liggitt commented on Feb 13, 2015

    @liggitt
    Contributor

    from curl manpage:

    --cert <certificate[:password]>
    ...
    The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine.
    ...
    (iOS and Mac OS X only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and private key.

    we can create a p12 cert file like this:

    openssl pkcs12 -export -inkey key.key -in cert.crt -out cert.p12 -password pass:
    

    What's less clear is when we should do this, or how to detect we need to use the p12 cert form

  2. smarterclayton commented on Feb 13, 2015

    @smarterclayton
    ContributorAuthor

    Maybe I'll just add a CURL_PK12_ENCODE for the test stuff

    On Feb 13, 2015, at 3:26 PM, Jordan Liggitt [email protected] wrote:

    from curl manpage:

    --cert
    ...
    The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine.
    ...
    (iOS and Mac OS X only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and private key.

    we can create a p12 cert file like this:

    openssl pkcs12 -export -inkey key.key -in cert.crt -out cert.p12 -password pass:
    What's less clear is when we should do this, or how to detect we need to use the p12 cert form

    —
    Reply to this email directly or view it on GitHub.

  3. liggitt commented on Feb 13, 2015

    @liggitt
    Contributor

    If you need to include the entire cert chain in the p12 cert, do this:

    openssl pkcs12 -export -inkey key.key -in cert.crt -CAfile root.crt -chain -out cert.p12 -password pass:
    
  4. smarterclayton commented on Feb 18, 2015

    @smarterclayton
    ContributorAuthor

    Fixed by referenced, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions