debugs(33, 5, "Finding SSL certificate for " << sslBumpCertKey << " in cache");
Ssl::LocalContextStorage * ssl_ctx_cache = Ssl::TheGlobalContextStorage.getLocalStorage(port->s);
Security::ContextPtr dynCtx = nullptr;
- Ssl::SSL_CTX_Pointer *cachedCtx = ssl_ctx_cache ? ssl_ctx_cache->get(sslBumpCertKey.termedBuf()) : NULL;
+ Security::ContextPointer *cachedCtx = ssl_ctx_cache ? ssl_ctx_cache->get(sslBumpCertKey.termedBuf()) : nullptr;
if (cachedCtx && (dynCtx = cachedCtx->get())) {
debugs(33, 5, "SSL certificate for " << sslBumpCertKey << " found in cache");
if (Ssl::verifySslCertificate(dynCtx, certProperties)) {
Ssl::LocalContextStorage *ssl_ctx_cache = Ssl::TheGlobalContextStorage.getLocalStorage(port->s);
assert(sslBumpCertKey.size() > 0 && sslBumpCertKey[0] != '\0');
if (sslContext) {
- if (!ssl_ctx_cache || !ssl_ctx_cache->add(sslBumpCertKey.termedBuf(), new Ssl::SSL_CTX_Pointer(sslContext))) {
+ if (!ssl_ctx_cache || !ssl_ctx_cache->add(sslBumpCertKey.termedBuf(), new Security::ContextPointer(sslContext))) {
// If it is not in storage delete after using. Else storage deleted it.
fd_table[clientConnection->fd].dynamicSslContext = sslContext;
}
#include "ip/Address.h"
#include "mgr/Action.h"
#include "mgr/Command.h"
+#include "security/forward.h"
#include "SquidTime.h"
#include "ssl/gadgets.h"
virtual bool aggregatable() const { return false; }
};
-typedef LruMap<SSL_CTX_Pointer, SSL_CTX_SIZE> LocalContextStorage;
+typedef LruMap<Security::ContextPointer, SSL_CTX_SIZE> LocalContextStorage;
/// Class for storing/manipulating LocalContextStorage per local listening address/port.
class GlobalContextStorage
CtoCpp1(X509_REQ_free, X509_REQ *)
typedef TidyPointer<X509_REQ, X509_REQ_free_cpp> X509_REQ_Pointer;
-CtoCpp1(SSL_CTX_free, SSL_CTX *)
-typedef TidyPointer<SSL_CTX, SSL_CTX_free_cpp> SSL_CTX_Pointer;
-
sk_free_wrapper(sk_X509_NAME, STACK_OF(X509_NAME) *, X509_NAME_free)
typedef TidyPointer<STACK_OF(X509_NAME), sk_X509_NAME_free_wrapper> X509_NAME_STACK_Pointer;
Ssl::createSSLContext(Security::CertPointer & x509, Ssl::EVP_PKEY_Pointer & pkey, AnyP::PortCfg &port)
{
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
- Ssl::SSL_CTX_Pointer sslContext(SSL_CTX_new(TLS_server_method()));
+ Security::ContextPointer sslContext(SSL_CTX_new(TLS_server_method()));
#else
- Ssl::SSL_CTX_Pointer sslContext(SSL_CTX_new(SSLv23_server_method()));
+ Security::ContextPointer sslContext(SSL_CTX_new(SSLv23_server_method()));
#endif
if (!SSL_CTX_use_certificate(sslContext.get(), x509.get()))