Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 7f9111e

Browse files
committed
[proxy]域名严格匹配模式下,用IP访问HTTPS服务返回空响应
1 parent 9769120 commit 7f9111e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

teaproxy/listener.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,10 @@ func (this *Listener) matchSSL(domain string) (*teaconfigs.SSLConfig, *tls.Certi
601601
// 如果域名为空,则取第一个
602602
// 通常域名为空是因为是直接通过IP访问的
603603
if len(domain) == 0 {
604+
if teaconfigs.SharedProxySetting().MatchDomainStrictly {
605+
return nil, nil, errors.New("[proxy]no tls server name matched")
606+
}
607+
604608
if len(this.currentServers) > 0 && this.currentServers[0].SSL != nil {
605609
return this.currentServers[0].SSL, this.currentServers[0].SSL.FirstCert(), nil
606610
}

0 commit comments

Comments
 (0)