[SSL证书]免费证书申请增加HTTP认证方式

This commit is contained in:
刘祥超
2020-12-03 18:19:09 +08:00
parent 94ca1f1fe1
commit 5c8b7c6cf6
9 changed files with 107 additions and 53 deletions

View File

@@ -52,7 +52,12 @@ func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bo
}
// 本地IP
ip := net.ParseIP(ipAddr).To4()
ipObj := net.ParseIP(ipAddr)
if ipObj == nil {
logs.Println("[USER_MUST_AUTH]invalid client address: " + ipAddr)
return false
}
ip := ipObj.To4()
if ip == nil {
logs.Println("[USER_MUST_AUTH]invalid client address: " + ipAddr)
return false