-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike on HTTPS reverse proxy for pd #1766
Comments
That shows working TLS termination with an HTTP 200 response. That's progress! But it isn't enough to make Buf Studio happy. Why not? Caddyfile for serving the above
|
Progress, but still short of the mark. Here's what's running:
If I use this URL in Buf Studio, I see an error:
However, in the web console for my browser, I see a 200 OK on the OPTIONS request. (Previously, a CORS error was displayed. Massaging the associated HTTP headers via the Caddyfile resolved that problem.) If you run this curl command exported from the web console, you'll see a 200 yourself locally:
That's not good enough for Buf Studio. What does work on Buf Studio is this URL, which requires that you:
For what it's worth, you can also set the Target to |
The I'm a little confused about what's going on with the CORS headers there. Previously, I got Buf Studio to work against So it seems to me like the problem is likely somehow related to the way Caddy is being used as a proxy -- which reinforces the goal of having this functionality built into |
I rebased the experimental support I did in #1666 onto the Maybe we could try running that on a publicly accessible machine with a DNS name, and see if it still works? |
Aye, giving that a shot now... |
New server up at |
Yep, works for me. It's a bit weird and uncomfortable that the experimental auto-https code works without extra setup, but Caddy doesn't. It might be useful to compare headers or something between them to see if we get any clues about why? |
Let me take a look. Downgrading caddy to HTTP1.1 may help. |
That was it. Caddy defaults to HTTP2, and we explicitly set HTTP1.1 for tonic-web here: Lines 212 to 213 in 349f66f
Try
So we can easily bolt on a temporary HTTPS solution on any testnet with this method. Will leave these two machines running for 038-kalyke, and update "pd-tls.penumbra.zone" for 039, when the time comes. Haven't done this yet, but omitting the http1 downgrade should be possible if we're using https on the frontend. Will try that soon and note results. |
Sick, nice find! Does that config force HTTP/1 only, or allow either HTTP/1 or HTTP/2? We'll need HTTP/2 to support native grpc; in |
As written it's h1 only, but I just updated it to |
I think we might need/want h1 support in |
Made a small change to the cluster config, which provides automatic HTTPS for pd: https://grpc.testnet-preview.penumbra.zone. That URL works just fine in Buf Studio, and will remain working. The same setup isn't yet live for the weekly testnet, given delays in #1659, but plan of record is to cut over on the deploy for #1757. I'll handle that over there. Leaving the |
As of 040-themisto (#1814), we now have a stable HTTPS for talking to pd: That URL will remain active as we release subsequent testnets. Similarly, Cleaned up the temporary "pd-tls" and "buf-studio" hosts, since they're no longer necessary. |
We want to expose
pd
's gRPC service over HTTPS on 443/TCP. For now, it'd be enough to use a reverse proxy that speaks h2/grpc. The goal is to use Buf Studio to query the protos. Here's an example URL: https://studio.buf.build/penumbra-zone/penumbra/penumbra.view.v1alpha1.ViewProtocolService/ChainParameters?target=https%3A%2F%2Fgrpc.testnet-preview.penumbra.zone&selectedProtocol=grpc-web (n.b. change thetarget
URL param as necessary)Attempt to use
caddy
to expose a fullnode's pd service over HTTPS. We think theh2c://
scheme would enough; see this HN comment and the official Caddy docs. Additionally, see the Buf Studio docs on CORS for necessary headers.This work is towards longer-term efforts like #1406 & #1556. For now, we simply want to unblock external partners who are consuming the protobufs in browsers.
The text was updated successfully, but these errors were encountered: