gRPC example issue

Hi, For the las couple days I’ve been trying to deploy a gRPC server, I went through the gRPC tutorial on the docs but at first I couldn’t get it working. I found a post from 7 months ago that had somewhat the same issues that I did.

I finally got it working and even deployed my own service, but I can’t understand why having the handlers as [] works and I would like to understand what is happening here to get a little bit more knowledge on the matter. Once I set the handlers as [] I can call grpcurl but I have to set the -plaintext flag, which I am pretty sure once I hit production this would be something to be concerned about ?

A little bit more context:
Both my backend and client are written in go.
Setting the handlers with ["tls"] I am able to call with grpcurl without any extra flags but my go client won’t connect, it would print out an error saying connection closed before server preface received.
Once I remove the handlers I can call from my client but when trying grpcurl without -plaintext I get tls: first record does not look like a TLS handshake.

Is it possible to have tls enabled and being able to call my service from both my client and grpcurl?

Hi @danielsan22

Can you send logs of when this issue happened with TLS handler?

Hi Lubien, my app name is throbbing-water-7344.

And for the logs what I see right now is this:


2022-07-19T19:33:36Z app[2bd526fe] dfw [info]2022/07/19 19:33:36 listening on [fdaa:0:7868:a7b:a062:2bd5:26fe:2]:22 (DNS: [fdaa::3]:53)
2022-07-19T19:33:37Z app[2bd526fe] dfw [info]2022/07/19 19:33:37 Running build command!
2022-07-19T19:33:39Z app[2bd526fe] dfw [info]2022/07/19 19:33:39 Build ok.
2022-07-19T19:33:39Z app[2bd526fe] dfw [info]2022/07/19 19:33:39 Restarting the given command.
2022-07-19T19:33:39Z app[2bd526fe] dfw [info]2022/07/19 19:33:39 stderr: 2022/07/19 19:33:39 { 8080 tcp}
2022-07-19T19:34:07Z runner[8fbe3493] dfw [info]Shutting down virtual machine
2022-07-19T19:34:08Z app[8fbe3493] dfw [info]Sending signal SIGINT to main child process w/ PID 515
error.message="while TCP-proxying data to/from app: failed to copy (direction=server->client, error=Connection reset by peer (os error 104))" 2022-07-19T19:34:39Z proxy[2bd526fe] dfw [error]
error.message="while TCP-proxying data to/from app: failed to copy (direction=server->client, error=Connection reset by peer (os error 104))" 2022-07-19T19:35:26Z proxy[2bd526fe] dfw [error]
error.message="while TCP-proxying data to/from app: failed to copy (direction=server->client, error=Connection reset by peer (os error 104))" 2022-07-19T19:45:33Z proxy[2bd526fe] dfw [error]
error.message="while TCP-proxying data to/from app: failed to copy (direction=server->client, error=Connection reset by peer (os error 104))" 2022-07-19T19:45:35Z proxy[2bd526fe] dfw [error]

I can also share the source code if you want.

Thanks for that!

What happens is that TLS handler will normalize HTTP requests into HTTP 1.1, hopefully that can be of some help.

We have in mind support for HTTP 2.0 but it’s not on our roadmap yet

Ah got it, I think that cleared things up. All TLS responsibility is then passed to my app instead of the basic config fly provides, so if I would like to have some security i would have to implement tls through some gRPC config on my end, am I right?

thanks for the response!

1 Like

Yes, indeed. Glad to help

1 Like