From 4bbf3c9899a56d4367d7c3111ef43006fd9bca4c Mon Sep 17 00:00:00 2001 From: sakzri Date: Sat, 19 Oct 2024 22:04:08 +0800 Subject: [PATCH] fix: handle domain with wildcards (#690) --- common/mylego/mylego.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/mylego/mylego.go b/common/mylego/mylego.go index 63e45d4..c326d7a 100644 --- a/common/mylego/mylego.go +++ b/common/mylego/mylego.go @@ -149,8 +149,8 @@ func (l *LegoCMD) RenewCert() (CertPath string, KeyPath string, ok bool, err err } func checkCertFile(domain string) (string, string, error) { - keyPath := path.Join(defaultPath, "certificates", fmt.Sprintf("%s.key", domain)) - certPath := path.Join(defaultPath, "certificates", fmt.Sprintf("%s.crt", domain)) + keyPath := path.Join(defaultPath, "certificates", fmt.Sprintf("%s.key", sanitizedDomain(domain))) + certPath := path.Join(defaultPath, "certificates", fmt.Sprintf("%s.crt", sanitizedDomain(domain))) if _, err := os.Stat(keyPath); os.IsNotExist(err) { return "", "", fmt.Errorf("cert key failed: %s", domain) }