增加证书OCSP错误日志管理

This commit is contained in:
GoEdgeLab
2022-03-11 20:27:53 +08:00
parent 91a4666f60
commit 76d12ea65a
3 changed files with 210 additions and 0 deletions

View File

@@ -1 +1,31 @@
package models
import "encoding/json"
func (this *SSLCert) DecodeDNSNames() []string {
if len(this.DnsNames) == 0 {
return nil
}
var result = []string{}
var err = json.Unmarshal([]byte(this.DnsNames), &result)
if err != nil {
return nil
}
return result
}
func (this *SSLCert) DecodeCommonNames() []string {
if len(this.CommonNames) == 0 {
return nil
}
var result = []string{}
var err = json.Unmarshal([]byte(this.CommonNames), &result)
if err != nil {
return nil
}
return result
}