Skip to content

Commit

Permalink
feat: 自签证书支持 ipv6 (1Panel-dev#6627)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Sep 29, 2024
1 parent 4c275ba commit e03b728
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions backend/app/service/website_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,14 @@ func (w WebsiteCAService) ObtainSSL(req request.WebsiteCAObtain) (*model.Website
if req.Domains != "" {
domainArray := strings.Split(req.Domains, "\n")
for _, domain := range domainArray {
if !common.IsValidDomain(domain) {
err = buserr.WithName("ErrDomainFormat", domain)
return nil, err
} else {
if ipAddress := net.ParseIP(domain); ipAddress == nil {
domains = append(domains, domain)
} else {
ips = append(ips, ipAddress)
if ipAddress := net.ParseIP(domain); ipAddress == nil {
if !common.IsValidDomain(domain) {
err = buserr.WithName("ErrDomainFormat", domain)
return nil, err
}
domains = append(domains, domain)
} else {
ips = append(ips, ipAddress)
}
}
if len(domains) > 0 {
Expand Down

0 comments on commit e03b728

Please sign in to comment.