prober: allow custom tls.Config for TLS probes (#17186)

Updates https://github.com/tailscale/corp/issues/28569

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
Andrew Lytvynov
2025-09-18 09:10:33 -07:00
committed by GitHub
parent 73bbd7caca
commit 70dfdac609
5 changed files with 38 additions and 20 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ package prober_test
import (
"context"
"crypto/tls"
"flag"
"fmt"
"log"
@@ -40,7 +41,7 @@ func ExampleForEachAddr() {
// This function is called every time we discover a new IP address to check.
makeTLSProbe := func(addr netip.Addr) []*prober.Probe {
pf := prober.TLSWithIP(*hostname, netip.AddrPortFrom(addr, 443))
pf := prober.TLSWithIP(netip.AddrPortFrom(addr, 443), &tls.Config{ServerName: *hostname})
if *verbose {
logger := logger.WithPrefix(log.Printf, fmt.Sprintf("[tls %s]: ", addr))
pf = probeLogWrapper(logger, pf)