aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Jiangtao Li <jiangtao@google.com>2018-09-05 08:52:31 -0700
committerGravatar GitHub <noreply@github.com>2018-09-05 08:52:31 -0700
commit23afefe79b6fdb2f1e579c797697c2710d05ee40 (patch)
tree3146f56830bf7fde013cc096b3fca1db062b2f79 /test/core
parent19ed319a941cfdaf98a02353ee92d66626e1954a (diff)
parente361d0f6910db66e081d125e45e58b96e22d3e11 (diff)
Merge pull request #16536 from jiangtaoli2016/system_root
Turn loading system root certificates as default
Diffstat (limited to 'test/core')
-rw-r--r--test/core/security/linux_system_roots_test.cc6
-rw-r--r--test/core/security/security_connector_test.cc1
2 files changed, 1 insertions, 6 deletions
diff --git a/test/core/security/linux_system_roots_test.cc b/test/core/security/linux_system_roots_test.cc
index fce9c8dcc5..24d446de35 100644
--- a/test/core/security/linux_system_roots_test.cc
+++ b/test/core/security/linux_system_roots_test.cc
@@ -41,10 +41,6 @@
#include "gtest/gtest.h"
-#ifndef GRPC_USE_SYSTEM_SSL_ROOTS_ENV_VAR
-#define GRPC_USE_SYSTEM_SSL_ROOTS_ENV_VAR "GRPC_USE_SYSTEM_SSL_ROOTS"
-#endif
-
namespace grpc {
namespace {
@@ -68,7 +64,6 @@ TEST(CreateRootCertsBundleTest, ReturnsEmpty) {
}
TEST(CreateRootCertsBundleTest, BundlesCorrectly) {
- gpr_setenv(GRPC_USE_SYSTEM_SSL_ROOTS_ENV_VAR, "true");
// Test that CreateRootCertsBundle returns a correct slice.
grpc_slice roots_bundle = grpc_empty_slice();
GRPC_LOG_IF_ERROR(
@@ -81,7 +76,6 @@ TEST(CreateRootCertsBundleTest, BundlesCorrectly) {
char* bundle_str = grpc_slice_to_c_string(roots_bundle);
EXPECT_STREQ(result_str, bundle_str);
// Clean up.
- unsetenv(GRPC_USE_SYSTEM_SSL_ROOTS_ENV_VAR);
gpr_free(result_str);
gpr_free(bundle_str);
grpc_slice_unref(roots_bundle);
diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc
index 82d77eef8b..9dd37b975b 100644
--- a/test/core/security/security_connector_test.cc
+++ b/test/core/security/security_connector_test.cc
@@ -415,6 +415,7 @@ static void test_default_ssl_roots(void) {
/* Now setup a permanent failure for the overridden roots and we should get
an empty slice. */
+ gpr_setenv("GRPC_NOT_USE_SYSTEM_SSL_ROOTS", "true");
grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
GPR_ASSERT(GRPC_SLICE_IS_EMPTY(roots));