Skip to content

Commit

Permalink
fix: adding comment suggestion explaining about ensuring the use of h…
Browse files Browse the repository at this point in the history
…ashing for consistently retrieving a SNI for the masquerade IP address
  • Loading branch information
WendelHime committed Jul 30, 2024
1 parent 58b3171 commit 3da002e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions masquerade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
}
Expand Down

0 comments on commit 3da002e

Please sign in to comment.