Skip to content

Commit

Permalink
Marked Config.ssl_client.sslContext as obsolete/internal
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard-bagdasaryan committed Nov 20, 2024
1 parent 6d4463f commit dc66a68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/SquidConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ class SquidConfig
struct {
Security::FuturePeerContext *defaultPeerContext;
// TODO: Remove when FuturePeerContext above becomes PeerContext
Security::ContextPointer *sslContext;
/// \deprecated Legacy storage. Use defaultPeerContext instead.
Security::ContextPointer *sslContext_;
#if USE_OPENSSL
char *foreignIntermediateCertsPath;
acl_access *cert_error;
Expand Down
12 changes: 6 additions & 6 deletions src/cache_cf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -961,18 +961,18 @@ configDoConfigure(void)
debugs(3, 2, "initializing https:// proxy context");

const auto rawSslContext = Security::ProxyOutgoingConfig.createClientContext(false);
Config.ssl_client.sslContext = rawSslContext ? new Security::ContextPointer(rawSslContext) : nullptr;
if (!Config.ssl_client.sslContext) {
Config.ssl_client.sslContext_ = rawSslContext ? new Security::ContextPointer(rawSslContext) : nullptr;
if (!Config.ssl_client.sslContext_) {
#if USE_OPENSSL
fatal("ERROR: Could not initialize https:// proxy context");
#else
debugs(3, DBG_IMPORTANT, "ERROR: proxying https:// currently still requires --with-openssl");
#endif
}
#if USE_OPENSSL
Ssl::useSquidUntrusted(Config.ssl_client.sslContext->get());
Ssl::useSquidUntrusted(Config.ssl_client.sslContext_->get());
#endif
Config.ssl_client.defaultPeerContext = new Security::FuturePeerContext(Security::ProxyOutgoingConfig, *Config.ssl_client.sslContext);
Config.ssl_client.defaultPeerContext = new Security::FuturePeerContext(Security::ProxyOutgoingConfig, *Config.ssl_client.sslContext_);
}

for (const auto &p: CurrentCachePeers()) {
Expand Down Expand Up @@ -3915,8 +3915,8 @@ configFreeMemory(void)
Dns::ResolveClientAddressesAsap = false;
delete Config.ssl_client.defaultPeerContext;
Config.ssl_client.defaultPeerContext = nullptr;
delete Config.ssl_client.sslContext;
Config.ssl_client.sslContext = nullptr;
delete Config.ssl_client.sslContext_;
Config.ssl_client.sslContext_ = nullptr;
#if USE_OPENSSL
Ssl::unloadSquidUntrusted();
#endif
Expand Down

0 comments on commit dc66a68

Please sign in to comment.