ssl pinning with pfx certificate in swift 4

we are begginer with swift development.

Trying to implement ssl pinning using pfx certificate to identify our server. but we are stll getting some errors.

if possibe plz provide me one demo example of ssl pinning with pfx file...

Replies

You seem to be mixing up your terms:

  • SSL pinning typically refers to the client-authenticates-server step, where the client does extra checking of the server’s certificate. See this page for more background. Certificate pinning requires that your app embed information about the server’s certificate, typically the public key or certificate of the server’s leaf certificate, or one of the certificates in the chain from that leaf to the root.

  • A

    .pfx
    file typically holds a digital identity, that is, the combination of a certificate and the private key that matches the public key in that certificate. A digital identity is most commonly used in TLS mutual authentication (see this page), aka client certificate authenticate, which is part of the server-authenticates-client step.

So which of these are you trying do?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

we would like to do client certificate authentication, any ref code will help

we would like to do client certificate authentication

Presuming that you’re using

NSURLSession
, you should read Handling an Authentication Challenge first to learn how to handle authenticate challenges in general. The specific challenge you need to handle is
NSURLAuthenticationMethodClientCertificate
. You can look at this post for a simple example of how to handle that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"