From 1b5c8304823a109d62db84d634ed7dd2f496ded1 Mon Sep 17 00:00:00 2001 From: Philipp Hossner Date: Wed, 10 Dec 2025 22:04:57 +0100 Subject: [PATCH] BUG/MINOR: handlers: populate sha256_finger_print in SSL certificate responses The SSL certificate storage handlers were not copying the Sha256FingerPrint field from GetCertificatesInfo() to the API response, even though the field is available in client-native's CertificatesInfo struct. This caused clients relying on fingerprint-based change detection to always see certificates as changed, since the fingerprint was never returned. --- handlers/ssl_cert_storage.go | 69 +++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/handlers/ssl_cert_storage.go b/handlers/ssl_cert_storage.go index 70960859..238af5ca 100644 --- a/handlers/ssl_cert_storage.go +++ b/handlers/ssl_cert_storage.go @@ -91,17 +91,18 @@ func (h *StorageGetOneStorageSSLCertificateHandlerImpl) Handle(params storage.Ge return storage.NewGetOneStorageSSLCertificateDefault(int(*e.Code)).WithPayload(e) } retf := &models.SslCertificate{ - File: filename, - Description: "managed SSL file", - StorageName: filepath.Base(filename), - Size: &size, - NotAfter: (*strfmt.DateTime)(info.NotAfter), - NotBefore: (*strfmt.DateTime)(info.NotBefore), - Issuers: info.Issuers, - Domains: info.DNS, - IPAddresses: info.IPs, - Subject: info.Subject, - Serial: info.Serial, + File: filename, + Description: "managed SSL file", + StorageName: filepath.Base(filename), + Size: &size, + NotAfter: (*strfmt.DateTime)(info.NotAfter), + NotBefore: (*strfmt.DateTime)(info.NotBefore), + Issuers: info.Issuers, + Domains: info.DNS, + IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, + Sha256FingerPrint: info.Sha256FingerPrint, } return storage.NewGetOneStorageSSLCertificateOK().WithPayload(retf) } @@ -211,17 +212,18 @@ func (h *StorageReplaceStorageSSLCertificateHandlerImpl) Handle(params storage.R return storage.NewReplaceStorageSSLCertificateDefault(int(*e.Code)).WithPayload(e) } retf := &models.SslCertificate{ - File: filename, - Description: "managed SSL file", - StorageName: filepath.Base(filename), - Size: misc.Int64P(len(params.Data)), - NotAfter: (*strfmt.DateTime)(info.NotAfter), - NotBefore: (*strfmt.DateTime)(info.NotBefore), - Issuers: info.Issuers, - Domains: info.DNS, - IPAddresses: info.IPs, - Subject: info.Subject, - Serial: info.Serial, + File: filename, + Description: "managed SSL file", + StorageName: filepath.Base(filename), + Size: misc.Int64P(len(params.Data)), + NotAfter: (*strfmt.DateTime)(info.NotAfter), + NotBefore: (*strfmt.DateTime)(info.NotBefore), + Issuers: info.Issuers, + Domains: info.DNS, + IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, + Sha256FingerPrint: info.Sha256FingerPrint, } skipReload := false @@ -295,17 +297,18 @@ func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.Cr return storage.NewCreateStorageSSLCertificateDefault(int(*e.Code)).WithPayload(e) } retf := &models.SslCertificate{ - File: filename, - Description: "managed SSL file", - StorageName: filepath.Base(filename), - Size: &size, - NotAfter: (*strfmt.DateTime)(info.NotAfter), - NotBefore: (*strfmt.DateTime)(info.NotBefore), - Issuers: info.Issuers, - Domains: info.DNS, - IPAddresses: info.IPs, - Subject: info.Subject, - Serial: info.Serial, + File: filename, + Description: "managed SSL file", + StorageName: filepath.Base(filename), + Size: &size, + NotAfter: (*strfmt.DateTime)(info.NotAfter), + NotBefore: (*strfmt.DateTime)(info.NotBefore), + Issuers: info.Issuers, + Domains: info.DNS, + IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, + Sha256FingerPrint: info.Sha256FingerPrint, } skipReload := false