Home > front end >  SSL certificate problem: unable to get local issuer certificate insomnia
SSL certificate problem: unable to get local issuer certificate insomnia

Time:03-08

I'm working on a simple API with auth, made on .NET, and would like to use Insomnia to make some tests on it. The API uses OAuth 2 Client Credentials, and this is were I get in trouble.

I get the following error:
Insomnia ERROR

Failed to fetch token url=https://localhost:5001/connect/token status=0
no description provided

So I can't get a token, and therefore I can't make any requests to my API. Its weird because my simple Client console app can get the token, which makes me think the problem is not in the code of the Identity server or the API, but Insomnia is unable to get a local issuer certificate.

Here is the response timeline:

Preparing request to https://localhost:5001/connect/token
Current time is 2022-02-21T03:55:30.752Z
Using libcurl/7.73.0-DEV OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.9 WinIDN libssh2/1.9.0_DEV nghttp2/1.41.0
Using default HTTP version
Disable timeout
Enable automatic URL encoding
Enable SSL validation
Enable cookie sending with jar of 0 cookies
  Trying ::1:5001...
Connected to localhost (::1) port 5001 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: C:\Users\********\AppData\Local\Temp\insomnia_2021.7.2\ca-certs.pem
CApath: none
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
TLSv1.2 (OUT), TLS alert, unknown CA (560):
SSL certificate problem: unable to get local issuer certificate
Closing connection 0

I already searched for a solution everywhere, but I got nothing, so I would be really glad if anyone can shed a light on the problem for me.

CodePudding user response:

Sooo after an nigth of trying to mess with SSL certificates, I discovered the only thing I needed to do, was to go to Insomnia, click on to the Application tab, select preferences and dismark the Validate certificates during authentication checkbox on the Security section.

Application>preferences

I knew I needed to dismark validate certificates(unde the Request and Response section)but i didnt know there was an checkbox just for auth requests.

This solution fits for my needs,but I am still curios how someone could do that by adding certificates in the collection settings of Insomnia, if thats possible for this case at all. God knows I tried.

Welp, I at least hope this post helps someone who is beggining on Insomnia as me.

  • Related