mirror of
https://github.com/fosrl/newt.git
synced 2026-07-11 03:53:21 -05:00
[PR #185] [MERGED] feat(healthcheck): add TLS SNI header to request when needed #365
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/185
Author: @water-sucks
Created: 12/4/2025
Status: ✅ Merged
Merged: 12/4/2025
Merged by: @oschwartz10612
Base:
main← Head:add-tls-server-name-to-healthchecks📝 Commits (1)
8a45f6ffeat(healthcheck): add TLS SNI header to request when needed📊 Changes
1 file changed (+13 additions, -13 deletions)
View changed files
📝
healthcheck/healthcheck.go(+13 -13)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Add the Server Name Indication (SNI) field to healthcheck requests, if present in the target config.
SNI handling is already present for proxying resources, but this has not been implemented for healthcheck requests yet until this commit.
In order to facilitate this, this commit moves the client instantiation to when the healthcheck is performed, rather than as a part of the monitor init code. This may have minor performance implications, but this can be monitored later, since users are probably not running that many healthchecks as to where this would become a problem. Maybe I'll be proven wrong? I sure hope not.
This is the corresponding Newt component to https://github.com/fosrl/pangolin/pull/1971, and probably should be merged in tandem with it.
How to test?
Run the Newt binary with a corresponding version of Pangolin that adds the target healthcheck SNI field from the linked PR, and make sure that Newt proxies the SNI headers correctly down and receives the correct certificate to work with when it is specified from the target healthcheck config.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.