Hello!
Is it possible to use a client certificate with an URLConnection request? I am using a Mac, the certificate is also stored in the keychain, so requests using Safari are working.
Or do I have to use cURL to do it?
What would other possible methods be?
Thanks,
Paul
Hi Paul
I think this has been asked before and the answer is unfortunately no. As it stands, URLConnection doesn’t expose the functionality to do this, at least not yet.
The HTTPSecureSocket class allows you to set a certificate file. However, I never tested whether this works as a client certificate. Also this class is now deprecated so technically shouldn’t be used anymore.
You’re probably going to have to use cURL or rely on a plugin for now