From 3da002e5cd71890e42ac5210bc7f08bcfaa8fdb9 Mon Sep 17 00:00:00 2001 From: WendelHime <6754291+WendelHime@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:35:28 -0300 Subject: [PATCH] fix: adding comment suggestion explaining about ensuring the use of hashing for consistently retrieving a SNI for the masquerade IP address --- masquerade.go | 1 + 1 file changed, 1 insertion(+) diff --git a/masquerade.go b/masquerade.go index 2dceda6..0abade8 100644 --- a/masquerade.go +++ b/masquerade.go @@ -117,6 +117,7 @@ func NewProvider(hosts map[string]string, testURL string, masquerades []*Masquer for _, m := range masquerades { var sni string if d.SNIConfig != nil && d.SNIConfig.UseArbitrarySNIs { + // Ensure that we use a consistent SNI for a given combination of IP address and SNI set crc32Hash := int(crc32.ChecksumIEEE([]byte(m.IpAddress))) sni = d.SNIConfig.ArbitrarySNIs[crc32Hash%len(d.SNIConfig.ArbitrarySNIs)] }