diff --git a/api/certificate/certificate.go b/api/certificate/certificate.go index b2351bc1..62cd47fb 100644 --- a/api/certificate/certificate.go +++ b/api/certificate/certificate.go @@ -25,7 +25,7 @@ func Transformer(certModel *model.Cert) (certificate *APICertificate) { if certModel.SSLCertificatePath != "" { if _, err := os.Stat(certModel.SSLCertificatePath); err == nil { sslCertificationBytes, _ = os.ReadFile(certModel.SSLCertificatePath) - if !cert.IsPublicKey(string(sslCertificationBytes)) { + if !cert.IsCertificate(string(sslCertificationBytes)) { sslCertificationBytes = []byte{} } } @@ -77,9 +77,9 @@ func GetCert(c *gin.Context) { type certJson struct { Name string `json:"name" binding:"required"` - SSLCertificatePath string `json:"ssl_certificate_path" binding:"required,publickey_path"` + SSLCertificatePath string `json:"ssl_certificate_path" binding:"required,certificate_path"` SSLCertificateKeyPath string `json:"ssl_certificate_key_path" binding:"required,privatekey_path"` - SSLCertificate string `json:"ssl_certificate" binding:"omitempty,publickey"` + SSLCertificate string `json:"ssl_certificate" binding:"omitempty,certificate"` SSLCertificateKey string `json:"ssl_certificate_key" binding:"omitempty,privatekey"` ChallengeMethod string `json:"challenge_method"` DnsCredentialID int `json:"dns_credential_id"` diff --git a/app/src/views/certificate/CertificateEditor.vue b/app/src/views/certificate/CertificateEditor.vue index 158d9748..c00e243f 100644 --- a/app/src/views/certificate/CertificateEditor.vue +++ b/app/src/views/certificate/CertificateEditor.vue @@ -164,7 +164,7 @@ const isManaged = computed(() => { :label="$gettext('SSL Certificate Path')" :validate-status="errors.ssl_certificate_path ? 'error' : ''" :help="errors.ssl_certificate_path === 'required' ? $gettext('This field is required') - : errors.ssl_certificate_path === 'publickey_path' + : errors.ssl_certificate_path === 'certificate_path' ? $gettext('The path exists, but the file is not a public key') : ''" >

@@ -193,7 +193,7 @@ const isManaged = computed(() => {