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;
if (Security::ProxyOutgoingConfig.encryptTransport) {
debugs(3, 2, "initializing https:// proxy context");
- Config.ssl_client.sslContext = Security::ProxyOutgoingConfig.createClientContext(false);
- if (!Config.ssl_client.sslContext) {
+
+ const auto rawSslContext = Security::ProxyOutgoingConfig.createClientContext(false);
+ 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
#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()) {
Dns::ResolveClientAddressesAsap = false;
delete Config.ssl_client.defaultPeerContext;
Config.ssl_client.defaultPeerContext = nullptr;
- Config.ssl_client.sslContext.reset();
+ delete Config.ssl_client.sslContext_;
+ Config.ssl_client.sslContext_ = nullptr;
#if USE_OPENSSL
Ssl::unloadSquidUntrusted();
#endif