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

Server: Automatically generate a self-signed TLS cert if needed #78243

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

DanCech
Copy link
Collaborator

@DanCech DanCech commented Nov 15, 2023

Currently when running Grafana in https (tls) or http2 mode the user must provide a TLS certificate and private key.

This PR adds the ability for Grafana to generate a self-signed certificate automatically if the user does not provide a certificate or key file.

If either certificate or key file are specified the old behavior is unchanged, with an error produced if one is provided without the other, the specified files do not exist, etc.

As part of this update the certificate loading code between configureHttps and configureHttp2 has also been moved out into a shared tlsCertificates helper.

@DanCech DanCech added the no-backport Skip backport of PR label Nov 15, 2023
@DanCech DanCech requested a review from a team as a code owner November 15, 2023 21:37
@DanCech DanCech requested review from papagian, zserge and yangkb09 and removed request for a team November 15, 2023 21:37
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.3.x milestone Nov 15, 2023
Copy link
Member

@ryantxu ryantxu left a comment

Choose a reason for hiding this comment

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

LGTM -- adding:

[server]
protocol = https

gives us:

image

@DanCech DanCech merged commit 647f576 into main Dec 5, 2023
29 checks passed
@DanCech DanCech deleted the self-signed-cert branch December 5, 2023 15:04
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants