diff options
Diffstat (limited to 'include/modules/ssl.h')
| -rw-r--r-- | include/modules/ssl.h | 15 |
1 files changed, 11 insertions, 4 deletions
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(); } }; |
