Skip to content
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

feat: add config to overwrite grpc certificate #1870

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

K3das
Copy link

@K3das K3das commented Apr 13, 2024

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

This adds two config options to overwrite the TLS certificate for the gRPC API

# Use separate a certificate for gRPC, this overwrites
# the global certificate.
grpc_tls_cert_path: ""
grpc_tls_key_path: ""

(closes #1709)

Copy link
Collaborator

@ohdearaugustin ohdearaugustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -40,6 +40,11 @@ grpc_listen_addr: 127.0.0.1:50443
# are doing.
grpc_allow_insecure: false

# Use separate a certificate for gRPC, this overwrites
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Use separate a certificate for gRPC, this overwrites
# Use separate a x509 certificate for gRPC, this overwrites

@kradalby
Copy link
Collaborator

Overwrite sounds incorrect, it's more like using separate certs for grpc.

What is the use case for this, why would you want it?

It will also need some sort of integration tests.

@K3das
Copy link
Author

K3das commented Apr 21, 2024

I used "overwrite" since that would imply that, by default, it would use certificates defined in the other settings, I'm happy to change this wording.

My use case is described in the attached issue; I don't want to configure TLS for the HTTP API endpoints, but configure it for the gRPC endpoints.

I'll add integration tests if you still consider this an acceptable change.

@kradalby
Copy link
Collaborator

My use case is described in the attached issue; I don't want to configure TLS for the HTTP API endpoints, but configure it for the gRPC endpoints.

OK, I am not super stoked about this as we mainly encourage less knobs to configure this kind of stuff as users seem to find them, try to use them and generate support load. I appreciate that it is useful for power users whom understand how to use them, we have no good mechanism for preventing everyone else from doing it.

I can particular imagine that a lot of people using varieties of proxies will run into things here.

I'll add integration tests if you still consider this an acceptable change.

I do not know exactly how I want them to look or how to test something like this, so this might be a challenging exercise in it self, but if you want to take a stab at it, you are welcome to do so.

Comment on lines +45 to +46
grpc_tls_cert_path: ""
grpc_tls_key_path: ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, with the growing amount of options it should end up like:

Suggested change
grpc_tls_cert_path: ""
grpc_tls_key_path: ""
grpc:
allow_insecure: false
tls:
cert_path: ""
tls_key_path: ""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, though this would create breaking changes, which @ohdearaugustin asked to avoid

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to map the allow insecure to the new value.

@K3das K3das marked this pull request as draft April 22, 2024 17:48
@K3das
Copy link
Author

K3das commented Apr 22, 2024

I do not know exactly how I want them to look or how to test something like this, so this might be a challenging exercise in it self, but if you want to take a stab at it, you are welcome to do so.

Not sure either, but this could probably involve working on a better test suite for the TLS implementation, since from what I understand, ACME is completely untested. Alternatively, integration tests could generate and trust a certificate for gRPC like they do for the HTTP API, then just check the fingerprint(?).

Outside of CLI tests, are there tests for gRPC at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split TLS options for gRPC and HTTP
3 participants