diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc index a61333183ee6cf..0277f9202d64c3 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc @@ -761,7 +761,7 @@ void SecureContext::SetX509StoreFlag(unsigned long flags) { } X509_STORE* SecureContext::GetCertStoreOwnedByThisSecureContext() { - if (owned_cert_store_cached_ != nullptr) return owned_cert_store_cached_; + if (own_cert_store_cache_ != nullptr) return own_cert_store_cache_; X509_STORE* cert_store = SSL_CTX_get_cert_store(ctx_.get()); if (cert_store == GetOrCreateRootCertStore()) { @@ -769,7 +769,7 @@ X509_STORE* SecureContext::GetCertStoreOwnedByThisSecureContext() { SSL_CTX_set_cert_store(ctx_.get(), cert_store); } - return owned_cert_store_cached_ = cert_store; + return own_cert_store_cache_ = cert_store; } void SecureContext::SetAllowPartialTrustChain( diff --git a/src/crypto/crypto_context.h b/src/crypto/crypto_context.h index f2a6befd44144e..c399fd15340598 100644 --- a/src/crypto/crypto_context.h +++ b/src/crypto/crypto_context.h @@ -147,7 +147,8 @@ class SecureContext final : public BaseObject { SSLCtxPointer ctx_; X509Pointer cert_; X509Pointer issuer_; - X509_STORE* owned_cert_store_cached_ = nullptr; + // Non-owning cache for SSL_CTX_get_cert_store(ctx_.get()) + X509_STORE* own_cert_store_cache_ = nullptr; #ifndef OPENSSL_NO_ENGINE bool client_cert_engine_provided_ = false; ncrypto::EnginePointer private_key_engine_; diff --git a/test/parallel/test-tls-client-allow-partial-trust-chain.js b/test/parallel/test-tls-client-allow-partial-trust-chain.js index 2296088b19b253..ffa6b2b1677c93 100644 --- a/test/parallel/test-tls-client-allow-partial-trust-chain.js +++ b/test/parallel/test-tls-client-allow-partial-trust-chain.js @@ -1,12 +1,9 @@ 'use strict'; const common = require('../common'); - -if (!common.hasCrypto) - common.skip('missing crypto'); +if (!common.hasCrypto) { common.skip('missing crypto'); }; const assert = require('assert'); const { once } = require('events'); -const tls = require('tls'); const fixtures = require('../common/fixtures'); // agent6-cert.pem is signed by intermediate cert of ca3. @@ -14,7 +11,8 @@ const fixtures = require('../common/fixtures'); const { it, beforeEach, afterEach, describe } = require('node:test'); -describe('allowPartialTrustChain', function() { +describe('allowPartialTrustChain', { skip: !common.hasCrypto }, function() { + const tls = require('tls'); let server; let client; let opts;