tanhakabir / rest-book

REST Book is a Visual Studio Code extension that allows you to perform REST calls in a Notebook interface.
https://marketplace.visualstudio.com/items?itemName=tanhakabir.rest-book
MIT License
248 stars 24 forks source link

How to skip certificate validation? #104

Open naleczynskia opened 3 years ago

naleczynskia commented 3 years ago

I have a development website that uses a self-signed certificate for HTTPS. Thus I get the following: Error: self signed certificate

How can I skip certificate validation? What is the mechanism used to validate certificate?

LarryWMSN commented 3 years ago

I'm getting Error: certificate signature failure when trying to connect to a asp.net site using .Net 6 and VS 2022 preview running in debug mode locally.

githubdatabridge commented 3 years ago

I also have the same issue on my end on localhost with https:

marklnz commented 3 years ago

Similar for me - I have a suite of microservices running in docker with ports exposed to localhost, and I use a locally generated certificate for SSL. I get "Error: unable to verify the first certificate" rather than the "Error: Self signed certificate" that others get.

ipeevski commented 3 years ago

My error is slightly different, but same issue - need a way to skip SSL validation.

Error: "Error: unable to verify the first certificate"

schmitty-0 commented 2 years ago

Hello,

any update on this? It would be very useful to be able to at least disable the verification.

BTW: I've seen both errors "self signed certificate" and "unable to verify the first certificate" on different services

noelhibbard commented 2 years ago

My really hacky workaround was to add this line: process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

As the first line of this file: %USERPROFILE%\.vscode\extensions\tanhakabir.rest-book-6.0.1\dist\extension-node.js

If the extension gets an update I assume it will wipe out your change. It seems like a huge oversight to not have an option to ignore cert warnings. Especially considering how common it is to use self signed certs during the development phase of REST APIs.

taisbak commented 1 year ago

The above hack worked for me as well.

However, it would be great to have a proper solution.

The vscode extension Rest Client apparently knows how to do it.

Maybe guided by this article on Stack Overflow: Error: unable to verify the first certificate in nodejs.