Skip to content

Commit 553657a

Browse files
committed
test
Signed-off-by: Jonh Wendell <[email protected]>
1 parent 3dcb02f commit 553657a

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

source/common/tls/cert_validator/default_validator.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ absl::StatusOr<int> DefaultCertValidator::initializeSslContexts(std::vector<SSL_
8888

8989
for (auto& ctx : contexts) {
9090
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
91-
// RH - Restore reloadable feature check to avoid failure of RevokedIntermediateCertificate test
92-
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.enable_intermediate_ca")) {
93-
X509_STORE_set_flags(store, X509_V_FLAG_PARTIAL_CHAIN);
94-
}
91+
92+
#ifndef ENVOY_SSL_OPENSSL
93+
// This doesn't work on OpenSSL: https://github.com/openssl/openssl/issues/5081
94+
X509_STORE_set_flags(store, X509_V_FLAG_PARTIAL_CHAIN);
95+
#endif
96+
9597
bool has_crl = false;
9698
for (const X509_INFO* item : list.get()) {
9799
if (item->x509) {
@@ -146,10 +148,12 @@ absl::StatusOr<int> DefaultCertValidator::initializeSslContexts(std::vector<SSL_
146148

147149
for (auto& ctx : contexts) {
148150
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
149-
// RH - Restore reloadable feature check to avoid failure of RevokedIntermediateCertificate test
150-
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.enable_intermediate_ca")) {
151-
X509_STORE_set_flags(store, X509_V_FLAG_PARTIAL_CHAIN);
152-
}
151+
152+
#ifndef ENVOY_SSL_OPENSSL
153+
// This doesn't work on OpenSSL: https://github.com/openssl/openssl/issues/5081
154+
X509_STORE_set_flags(store, X509_V_FLAG_PARTIAL_CHAIN);
155+
#endif
156+
153157
for (const X509_INFO* item : list.get()) {
154158
if (item->crl) {
155159
X509_STORE_add_crl(store, item->crl);

test/common/tls/ssl_socket_test.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6141,13 +6141,6 @@ TEST_P(SslSocketTest, RevokedIntermediateCertificate) {
61416141
testUtil(complete_revoked_test_options.setExpectedServerStats("ssl.fail_verify_error")
61426142
.setExpectedVerifyErrorCode(X509_V_ERR_CERT_REVOKED));
61436143

6144-
// On OpenSSL, the following check fails due to https://github.com/openssl/openssl/issues/5081.
6145-
// To make it pass, we have to temporarily set the enable_intermediate_ca feature flag to false.
6146-
// This ensures that the X509_V_FLAG_PARTIAL_CHAIN option doesn't get applied to the trust store,
6147-
// which ensures that full cert chain & CRL processing occurs, which allows this check to pass.
6148-
TestScopedRuntime scoped_runtime;
6149-
scoped_runtime.mergeValues({{"envoy.reloadable_features.enable_intermediate_ca", "false"}});
6150-
61516144
// Ensure that complete crl chains succeed with unrevoked certificates.
61526145
TestUtilOptions complete_unrevoked_test_options(unrevoked_client_ctx_yaml,
61536146
complete_server_ctx_yaml, true, version_);
@@ -6234,13 +6227,6 @@ TEST_P(SslSocketTest, RevokedIntermediateCertificateCRLInTrustedCA) {
62346227
testUtil(complete_revoked_test_options.setExpectedServerStats("ssl.fail_verify_error")
62356228
.setExpectedVerifyErrorCode(X509_V_ERR_CERT_REVOKED));
62366229

6237-
// On OpenSSL, the following check fails due to https://github.com/openssl/openssl/issues/5081.
6238-
// To make it pass, we have to temporarily set the enable_intermediate_ca feature flag to false.
6239-
// This ensures that the X509_V_FLAG_PARTIAL_CHAIN option doesn't get applied to the trust store,
6240-
// which ensures that full cert chain & CRL processing occurs, which allows this check to pass.
6241-
TestScopedRuntime scoped_runtime;
6242-
scoped_runtime.mergeValues({{"envoy.reloadable_features.enable_intermediate_ca", "false"}});
6243-
62446230
// Ensure that complete crl chains succeed with unrevoked certificates.
62456231
TestUtilOptions complete_unrevoked_test_options(unrevoked_client_ctx_yaml,
62466232
complete_server_ctx_yaml, true, version_);

0 commit comments

Comments
 (0)