Validate hostname if it was found in SNI

This commit is contained in:
9seconds
2021-03-26 17:23:30 +03:00
parent ce30e128e5
commit 5eca6ecb05
5 changed files with 64 additions and 8 deletions
+7
View File
@@ -144,6 +144,13 @@ func (p *Proxy) doFakeTLSHandshake(ctx *streamContext) bool {
return false
}
if hello.Host != "" && hello.Host != p.secret.Host {
p.logger.BindStr("hostname", hello.Host).Info("incorrect domain was found in SNI")
p.doDomainFronting(ctx, rewind)
return false
}
if err := p.timeAttackDetector.Valid(hello.Time); err != nil {
p.logger.InfoError("invalid faketls time", err)
p.doDomainFronting(ctx, rewind)