handle buypass issuer not match

This commit is contained in:
dalun 2023-09-13 04:27:11 +00:00
parent c6c523e005
commit 8a5004e828

View File

@ -10,6 +10,7 @@ import (
"encoding/json"
"errors"
"log"
"strings"
)
// CA Defination, load from embeded json when startup
@ -36,9 +37,15 @@ func init() {
// Get the CA ACME server endpoint and error if not found
func loadCAApiServerFromName(caName string) (string, error) {
// handle BuyPass cert org section (Buypass AS-983163327)
if strings.HasPrefix(caName, "Buypass AS") {
caName = "Buypass"
}
val, ok := caDef.Production[caName]
if !ok {
return "", errors.New("This CA is not supported")
}
return val, nil
}