insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

GRPC not working with https

Open AdrianoAE opened this issue 10 months ago • 9 comments

Expected Behavior

Be able to call GRPC server with https endpoint.

Actual Behavior

When running GRPC server in .NET the endpoint will be https://localhost:XXXX, the current parser does not allow to specify https and the connection fails.

Error invoking remote method 'grpc.loadMethodsFromReflection': Error: 14 UNAVAILABLE: Name resolution failed for target dns:https://localhost:51811

The server is running properly since Postman has no issues, insomnia can't connect at all. Replacing https with grpcs does not work.

Reproduction Steps

No response

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

8.6.1

What operating system are you using?

Windows

Operating System Version

Windows 11

Installation method

insomnia.rest

Last Known Working Insomnia version

No response

AdrianoAE avatar Apr 06 '24 20:04 AdrianoAE

This seems to be more of a DNS problem that a TLS problem. Can you try to consume https://127.0.0.1:51811 ?

subnetmarco avatar Apr 12 '24 15:04 subnetmarco

I've tried that, but gave it another try image

AdrianoAE avatar Apr 12 '24 17:04 AdrianoAE

any update on this?

AdrianoAE avatar Apr 25 '24 20:04 AdrianoAE

AFAIK it's atypical to use a http protocol to connect to a grpc server. Without a proxy, a regular gRPC server is expecting grpc://.

Please provide screenshots of both postman and insomnia including the request and response panes

jackkav avatar Apr 26 '24 07:04 jackkav

There isn't much to show, it simply works with Postman image

image

The implementation is done by Microsoft under https://github.com/grpc/grpc-dotnet

Tried with 127.0.0.1:51811 Error: 1 CANCELLED: Call cancelled

https://127.0.0.1:51811 Error: 14 UNAVAILABLE: Name resolution failed for target dns:https://127.0.0.1:51811

grpcs://127.0.0.1:51811 Error: 14 UNAVAILABLE: No connection established. Last error: unable to verify the first certificate (2024-04-26T21:44:31.816Z)

AdrianoAE avatar Apr 26 '24 21:04 AdrianoAE

Same problem. I'm exposing a .NET Web API on 5002 (HTTP) and (5052 (HTTPS), after creating a project from the .NET GRPC service template.

HTTP works. HTTPS doesn't.

In Postman both just works.

Setup: image

HTTP response: image

HTTPS response: image

modestotech avatar May 14 '24 12:05 modestotech

Postman is a closed source project. So I can't compare their implementation to insomnia, if you could try grpcurl or grpcui and let us know if it works for you that would be a huge help for us to solve this for you.

@modestotech could you take a look at the .NET logs and see if this comment looks familar https://github.com/grpc/grpc-node/issues/2340#issuecomment-1664644017

jackkav avatar May 19 '24 18:05 jackkav

here's the endpoint tried via grpcurl image

here's the endpoint tried via postman, image

here's the error in insomnia, image

rizanzaky avatar Jul 08 '24 10:07 rizanzaky

I have the same issue. It tries to resolve https:// as far as I understand this. There is no setting to change to TLS in insomnia.

After some testing: use grpcs:// insted of https! This solved my problem.

Gradlon avatar Aug 26 '24 09:08 Gradlon

@jackkav any feedback based on the last comments?

subnetmarco avatar Aug 30 '24 14:08 subnetmarco