-
Notifications
You must be signed in to change notification settings - Fork 654
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
Support gRPC-over-HTTPS using HTTPS proxy. #1295
Comments
Most of these HTTP CONNECT proxies seem to be used on |
A proxy hosted on Certificate validation will be handled using the typical means around root of trust (root certificate in the chain of trust). This root certificate will either be a well-known CA present in the operating system or default truststore, or it will be an internal CA where the root certificate is distributed to the application by augmenting the truststore or included as an override (see Intermediate certificates should be provided by the endpoint. For example, in a certificate chain with 4 certificates, one will the the leaf, one will be the root, and the other two will be intermediates. The proxy, in this case, will supply at least the leaf and the two intermediates, and optionally the root. If the root is supplied, this must match that which is present in the truststore. Single certificate chains, i.e. self-signed, may be used during testing, but is insecure in a production environment. |
So, in the case where the root certificate is distributed to the application, how should the application provide it to the proxy code? Is there a standard environment variable for doing that? |
|
I don't think you understand my question. Currently, gRPC's proxy feature is controlled using environment variables. I am asking how this part of the feature should be controlled from a similar perspective. Of course gRPC will have to use that information by passing that argument to |
I understand, but there's no good answer here given the current implementation. There is no conventional CA override for certificates via environment variables, especially in the proxy context. The closest is Dependency injection/inversion is the typical route (which is what I was alluding to via By means of the grpc-node/packages/grpc-js/src/channel-options.ts Lines 21 to 36 in 4db637e
...perhaps the desired signature would yield something similar to:
|
If there is no standard way of doing that, we can do what we want. Perhaps |
@bcoe had mentioned possible prior art with I advocate for: This tells us its A) for the proxy, 2) should be a certificate, and 3) a file containing the ca bundle (opposed to a directory) and not the ca contents itself. I take it you don't want to also support proxy configuration in |
That environment variable name looks good to me. I'm not opposed to configuring the proxy with |
PR #1243 introduced proxy support allowing for gRPC-over-HTTP, i.e. an unencrypted proxy. While gRPC is encrypted by means of HTTP/2, and remains so when tunneled, the initial connection to the proxy is not. See https://github.com/grpc/grpc-node/blob/%40grpc/grpc-js%400.7.0/packages/grpc-js/src/http_proxy.ts#L133-L145
The initial HTTP
CONNECT
call contains two pieces of potentially private/secret data:For these reasons it may be desirable to encrypt the
CONNECT
traffic via HTTPS.Additionally, the current implementation ignores the protocol defined in the proxy configuration (only
PROXY_INFO.address
is used). Whenhttps
is defined, this client will still attempt to connect overhttp
. If the proxy is expecting to negotiate TLS on the defined port (URL.host
), it will error unexpectedly.Solution
Detect the presence of HTTP or HTTPS via
URL.protocol
and make theCONNECT
request accordingly:Alternative
Be explicit about the lack of HTTPS support by both documenting, and detecting the usage of HTTPS and subsequently throwing an informative error.
The text was updated successfully, but these errors were encountered: