mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-12 04:30:53 +08:00
feat: 自签证书支持 ipv6 (#6627)
Refs https://github.com/1Panel-dev/1Panel/issues/6623
This commit is contained in:
parent
4c275ba52f
commit
e03b728240
1 changed files with 7 additions and 8 deletions
|
|
@ -217,15 +217,14 @@ func (w WebsiteCAService) ObtainSSL(req request.WebsiteCAObtain) (*model.Website
|
||||||
if req.Domains != "" {
|
if req.Domains != "" {
|
||||||
domainArray := strings.Split(req.Domains, "\n")
|
domainArray := strings.Split(req.Domains, "\n")
|
||||||
for _, domain := range domainArray {
|
for _, domain := range domainArray {
|
||||||
if !common.IsValidDomain(domain) {
|
if ipAddress := net.ParseIP(domain); ipAddress == nil {
|
||||||
err = buserr.WithName("ErrDomainFormat", domain)
|
if !common.IsValidDomain(domain) {
|
||||||
return nil, err
|
err = buserr.WithName("ErrDomainFormat", domain)
|
||||||
} else {
|
return nil, err
|
||||||
if ipAddress := net.ParseIP(domain); ipAddress == nil {
|
|
||||||
domains = append(domains, domain)
|
|
||||||
} else {
|
|
||||||
ips = append(ips, ipAddress)
|
|
||||||
}
|
}
|
||||||
|
domains = append(domains, domain)
|
||||||
|
} else {
|
||||||
|
ips = append(ips, ipAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(domains) > 0 {
|
if len(domains) > 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue