From a05abef182846dfe06ee91d1c77838aa78b8049c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 26 Oct 2025 14:57:51 +0000 Subject: Deprecate the contents of the SSLClientCert namespace. This is full of footguns and isn't really needed. --- include/modules/ssl.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/modules/ssl.h') diff --git a/include/modules/ssl.h b/include/modules/ssl.h index 3d4b459c1..4526d7c9f 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -289,6 +289,7 @@ public: * @param sock The socket to get the certificate from, the socket does not have to use TLS * @return The TLS client certificate information, NULL if the peer is not using TLS */ + [[deprecated("Use SSLIOHook::IsSSL()->GetCertificate() instead")]] static ssl_cert* GetCertificate(StreamSocket* sock) { SSLIOHook* ssliohook = SSLIOHook::IsSSL(sock); @@ -305,12 +306,18 @@ public: * @return The key fingerprint from the TLS certificate sent by the peer, * empty if no cert was sent or the peer is not using TLS */ + [[deprecated("Use SSLIOHook::IsSSL()->GetCertificate()->GetFingerprint() instead")]] static std::string GetFingerprint(StreamSocket* sock) { - ssl_cert* cert = SSLClientCert::GetCertificate(sock); - if (cert) - return cert->GetFingerprint(); - return ""; + auto* ssliohook = SSLIOHook::IsSSL(sock); + if (!ssliohook) + return nullptr; + + auto* cert = ssliohook->GetCertificate(); + if (!cert) + return ""; + + return cert->GetFingerprint(); } }; -- cgit v1.3.1-10-gc9f91