Merge 327ea19746e7b0431a17562496dd0e708ab99abc into b3455fa99a5e8d07133d5140017ec7c49f032a07

This commit is contained in:
Josh De Winne 2025-03-24 22:14:04 +00:00 committed by GitHub
commit e869dc6fd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,6 +263,8 @@ func (a *Dialer) dial(ctx context.Context) (*ClientConn, error) {
// fixed, this is a workaround. It might also be useful for future debugging.
var forceNoise443 = envknob.RegisterBool("TS_FORCE_NOISE_443")
var disableRecentNoiseDialHeuristic = envknob.RegisterBool("TS_DISABLE_RECENT_NOISE_DIAL_HEURISTIC")
// forceNoise443 reports whether the controlclient noise dialer should always
// use HTTPS connections as its underlay connection (double crypto). This can
// be necessary when networks or middle boxes are messing with port 80.
@ -271,7 +273,7 @@ func (d *Dialer) forceNoise443() bool {
return true
}
if d.HealthTracker.LastNoiseDialWasRecent() {
if !disableRecentNoiseDialHeuristic() && d.HealthTracker.LastNoiseDialWasRecent() {
// If we dialed recently, assume there was a recent failure and fall
// back to HTTPS dials for the subsequent retries.
//