How to check the connection to remote server with a digital certificate (client authentication)
6,068
You can use curl or wget.
curl --cert <your cert>
or
wget --certificate=<yourt cert>
THe certificate (of course with priv key) needs to be located in a p12 file. You can specify the passphrase of this file.
Related videos on Youtube
Comments
-
Tim over 1 year
I got a digital certificate with extensions for server and client authentication and a private key.
Now I want to connect to a remote server (REST web services) which should accept my requests because of my certificate. As a first step I want to check if this connection will work. The remote server is not under my control.
I have this REST URL https://host.test.com/REST/admin/user/1212/ and I need to do the request with the certificate. So how can I do this through command line (Linux system)?
-
Tim almost 10 yearsI used it this way
openssl s_client -connect host.test.com:443 -cert myCert.pem -key myKey.pem
, but this only test the connection to the server, not the REST service. With this command, I get a timeout. I have only one certificate, no Root-CA or Intermediate. -
Tim almost 10 yearsI works with
wget --certificate ./myCert.pem --private-key ./myKey.pem "https://host.test.com/REST/admin/user/1212/"
. Thank you -
Mark Meyer almost 10 yearsCan you post the initial output of the command? Timeout sounds a lot like there's a network filter in place. Obviously you can speak HTTP over the secured connection right in the console. If the SSL connect works you can do
GET /REST/admin/user/1212/ HTTP/1.1\nHost: host.test.com\n
where the\n
denotes a newline (simply hit return).