go-grpc-http1 icon indicating copy to clipboard operation
go-grpc-http1 copied to clipboard

How to use go-grpc-http1 behind a TLS?

Open ofirc opened this issue 1 year ago • 2 comments

Hi, I am trying to use go-grpc-http1 with a TLS server in HTTP/1 in the following way: client-tls.go.txt server-tls.go.txt

The server seems to run alright:

$ ./server-tls
2024/12/19 22:01:44 INFO: [core] [Server #1]Server created
2024/12/19 22:01:44 Server is listening on :8443 with TLS over HTTP/1.1

However, when I try to run the client, I get:

2024/12/19 22:10:59 Failed to call SayHello: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: tls: first record does not look like a TLS handshake"

Running the curl command with the custom CA passes with flying colors:

curl -v --cacert cert.pem https://localhost:8443 >& curl.txt

curl.txt

What could be the reason? am I initializing the client correctly?

Thanks, Ofir

ofirc avatar Dec 19 '24 20:12 ofirc

We (@ulexus) also hit this; are we passing the arguments wrong?

james-callahan avatar Sep 24 '25 02:09 james-callahan

hey there, I've hacked together a repo that allows me to use this behind IAP, which requires TLS; here's the repo, https://github.com/antholeole/grpc-over-iap and here's the code that puts it behind TLS - https://github.com/antholeole/grpc-over-iap/blob/wip/grpc_client.go#L65-L87

pretty involved but it can be done :)

antholeole avatar Nov 14 '25 23:11 antholeole