Removes more Wild Cloud cruft.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
type CertStatus struct {
|
||||
Exists bool `json:"exists"`
|
||||
Domain string `json:"domain"`
|
||||
Wildcard bool `json:"wildcard,omitempty"`
|
||||
Expiry time.Time `json:"expiry,omitempty"`
|
||||
CertPath string `json:"certPath,omitempty"`
|
||||
KeyPath string `json:"keyPath,omitempty"`
|
||||
@@ -118,8 +119,8 @@ func (m *Manager) GetStatus(domain string) *CertStatus {
|
||||
status.CertPath = pemPath
|
||||
status.KeyPath = pemPath
|
||||
|
||||
// Parse expiry from the certificate
|
||||
cmd := exec.Command("openssl", "x509", "-in", pemPath, "-noout", "-enddate", "-issuer")
|
||||
// Parse certificate metadata
|
||||
cmd := exec.Command("openssl", "x509", "-in", pemPath, "-noout", "-enddate", "-issuer", "-subject")
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
return status
|
||||
@@ -140,6 +141,11 @@ func (m *Manager) GetStatus(domain string) *CertStatus {
|
||||
if strings.HasPrefix(line, "issuer=") {
|
||||
status.IssuerCN = strings.TrimPrefix(line, "issuer=")
|
||||
}
|
||||
if strings.HasPrefix(line, "subject=") {
|
||||
if strings.Contains(line, "CN = *.") {
|
||||
status.Wildcard = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return status
|
||||
|
||||
Reference in New Issue
Block a user