Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman error: "Unable to verify the first certificate" when try to get from my .net core api

I have my brand new .NET Core service with API and I want to get list of items inside it. It's hosted on localhost and I always have this error:

16 ms
Warning: Unable to verify the first certificate
Network
Request Headers
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Postman-Token: e64e10c3-8e3a-4b47-9427-d994e2bdc9fd
Host: localhost:44397
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Request Body
Response Headers
Transfer-Encoding: chunked
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Tue, 19 Ja

n 2021 14:06:14 GMT
Response Body

How to fix it? I disabled/enabled SSL certification but it no helps.

like image 888
Obyi Avatar asked Jan 19 '21 14:01

Obyi


People also ask

How do I fix unable to verify the first certificate?

To fix 'Error: unable to verify the first certificate' in Node. js, we should set the appropriate root certificate. require('https'). globalAgent.options.ca = require('ssl-root-cas/latest').

How do I fix self-signed certificate error in Postman?

If you are using a self-signed certificate, make sure to add correct client certificate files (CRT, KEY, or PFX) from Settings > Certificates > Client Certificates > Add Certificate. Note: You can check for certificate data being used from the Network response pop-up or the console as explained here.

How do I add a certificate to my Postman?

Once you add a new client certificate, open up the Postman console and send a request to the configured domain. Make sure you're using https so the client certificate is sent along with the request. In the console, inspect the certificate that was sent along with the request.


3 Answers

There are 3 places to disable ssl verification:

  1. Request level: make sure it is off

enter image description here

  1. Global level: (Request level will have precedence)

enter image description here

  1. Remove client and CA certificate, turn it to off :

enter image description here

like image 138
PDHide Avatar answered Oct 07 '22 20:10

PDHide


First, your OS (Windows, Mac, Linux) must trust this certificate.

Then, in Postman, go to Settings > Certificates, and enable CA certification, then select the same trusted certificate.

like image 34
mnabeelx Avatar answered Oct 07 '22 21:10

mnabeelx


May be you forgotten to add this lines into Program.cs,

app.UseAuthentication();
app.UseAuthorization();
like image 2
Mucahid Uslu Avatar answered Oct 07 '22 20:10

Mucahid Uslu