Pass client certificate for 2-way SSL authentication when using Import?

Is it possible to pass a client certificate along with an Import request for a URL? I need to access a PKI-authenticated API.

I’ve not done this myself, but I suggest taking a look at the documentation page for HTTPRequest. This function allows for specifying parameters, headers, request type, and so on (similar to curl). Wrap this with URLRead (or URLExecute) to actually send the request.

Thanks for responding Chad.

I’ve had a look, but wasn’t able to find anything in there that would allow me to pass the client certificate. One problem here is that the client certificate actually needs to be passed during the SSL tunnel negotiation, not during the HTTP request itself. In other languages this usually involves explicitly setting up an SSL context to replace the default one during a request. It’s rarely pretty. :slight_smile:

By the way, client certificate verification is how you allow authentication to a website by smart card. The user’s certificates are only unlocked on their machine when their smart card is plugged in, allowing the browser access to them to pass to the server over SSL/TLS. Then the web server can extract cryptographically verified user identity information from the certificate and authenticate the user.

It’s not common, but it’s important when it comes up.

I ended up using a client proxy to handle mutual TLS, GitHub - ghostunnel/ghostunnel: A simple TLS proxy with mutual authentication for securing non-TLS services. · GitHub which works for experimental purposes.
For production software I would need an inbuilt solution.