Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Insomnia Rest Client with Client Certificates?

I'm trying to use Insomnia with Client Certificates. I followed this document from the Insomnia documentation. I added my certificate pem files and password.

The problem is that I'm still getting this error:

Error: Couldn't connect to server.

Do you have any idea why? Thanks.

like image 560
eli Avatar asked Jun 06 '17 10:06

eli


2 Answers

Insomnia seems rather strict in the rules to apply the client certificate. For example, if you connect to localhost:5050 you should put localhost:5050 as the host. Localhost as such does not work in this case.

Key + Certificate is also the safest way to get working results. I've noticed a number of cases where the encapsulated certificates (PFX) didn't work but the key + certificate file did. I assume that this is related to the way the pfx-certificates are created because it also applies for the browsers I test with.

like image 199
fvanrysselberghe Avatar answered Nov 01 '22 14:11

fvanrysselberghe


I was able to consume an extremely and rare service using insomnia version 2021.4.1. I could not consume it with Soapui nor Postman.

I followed these easy steps. It worked at first attempt :D, just the p12 file was enough on my case.

certificate-client-on-insomnia

Importing Certificates with Insomnia

I will put here the official documentation, in case the link disappears:

Insomnia supports PFX (Mac), and PEM (Windows and Linux) certificates. To import a new certificate, open the Document/Collection Settings dialog – accessible from the top-left menu – and click on the Client Certificates tab. From here, you can add new certificates and view existing ones.

Now lets walk through how to import one.

If you’re familiar with client certificates, the only field needing explanation should be the Host field.

  • Host: certificate will be sent when the host (and port if specified) matches
  • PFX: certificate in PFX or PKCS12 format (Only supported on Mac)
  • CRT File + Key File: certificate and key pair (only supported on Windows and Linux)
  • Passphrase: An optional passphrase for the certificate if required

After importing a certificate, it will show up in the main certificates list. From here, it can be enabled/disabled or deleted.

like image 44
JRichardsz Avatar answered Nov 01 '22 16:11

JRichardsz