I'm trying to talk to a REST web service that requires certificates to make the call. I got two files from my client - a *.pem and a *.key file.
Using these two files, I can make the call to that web service on the command line using curl:
curl.exe -k -v "MyUrl" --cert mycert.pem --key mycertkey.key This works. But I would like to use Fiddler and ultimately my own C# code to make that call - but how??
In Fiddler, I'm reading about having to provide the certificate as a ClientCertificate.cer file in a specific directory..... but I have a .pem and a .key file - how do those "translate" into a *.cer file?
And how can I use those *.pem and *.key files in my own C# code to make a call to that web service (using RestSharp or just a plain WebRequest) ?
Update: following the answer by Drew Burchett, I imported my .pem file into the certificate store on my machine, and then exported it to a .cer file ("DER-encoded, binary") and placed it in Fiddler's folder. When attemping a call to the REST service, I still get this error from Fiddler:
[Fiddler] The connection to '......' failed.
System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https; HTTPS handshake to (url) failed.
System.Security.Authentication.AuthenticationException Error with SSPI call, see internal exception; the format of the received message was unexpected or erroneous
Funny enough, the last paragraph (the System.Security.Authentication.AuthenticationException paragraph) shows up in German on my system, while the rest is in English.... odd......
Update #2:
Attempting this in C# code using the WebRequest with the https:// prefix and the certificate installed in the certificate store (my own certificates, trusted root certificates) fails with an error:
System.Net.WebException was caught
HResult=-2146233079
Message=The request was aborted: no secure SSL/TLS channel could be established.
Any ideas?