aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jiangtao Li <jiangtao@google.com>2018-03-29 09:07:28 -0700
committerGravatar GitHub <noreply@github.com>2018-03-29 09:07:28 -0700
commitfa7cbb50fe40962cf443f43cabe38e98f9f162a3 (patch)
tree9624496d6f3a3c6a1217a36dbcf8df06bc386212 /src
parent7f25d201c3b7239c688445e2e3498a89ef28cea3 (diff)
parent4fe2cd255544b8cbeff7b340760791d8d1fad93e (diff)
Merge pull request #14858 from jiangtaoli2016/root_cert_once
Init default root certs store once
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/security/security_connector/security_connector.cc10
-rw-r--r--src/core/lib/security/security_connector/security_connector.h9
-rw-r--r--src/core/lib/surface/init.cc1
-rw-r--r--src/core/lib/surface/init.h1
-rw-r--r--src/core/lib/surface/init_secure.cc7
-rw-r--r--src/core/lib/surface/init_unsecure.cc2
6 files changed, 1 insertions, 29 deletions
diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc
index d7d5a8c4de..3551061aa4 100644
--- a/src/core/lib/security/security_connector/security_connector.cc
+++ b/src/core/lib/security/security_connector/security_connector.cc
@@ -1151,16 +1151,6 @@ const char* DefaultSslRootStore::GetPemRootCerts() {
GRPC_SLICE_START_PTR(default_pem_root_certs_);
}
-void DefaultSslRootStore::Initialize() {
- default_root_store_ = nullptr;
- default_pem_root_certs_ = grpc_empty_slice();
-}
-
-void DefaultSslRootStore::Destroy() {
- tsi_ssl_root_certs_store_destroy(default_root_store_);
- grpc_slice_unref_internal(default_pem_root_certs_);
-}
-
grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
grpc_slice result = grpc_empty_slice();
// First try to load the roots from the environment.
diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h
index 5d3d1e0f44..c4cc19db81 100644
--- a/src/core/lib/security/security_connector/security_connector.h
+++ b/src/core/lib/security/security_connector/security_connector.h
@@ -256,15 +256,6 @@ class DefaultSslRootStore {
// Gets the default PEM root certificate.
static const char* GetPemRootCerts();
- // Initializes the SSL root store's underlying data structure. It does not
- // load default SSL root certificates. Should only be called by
- // grpc_security_init().
- static void Initialize();
-
- // Destroys the default SSL root store. Should only be called by
- // grpc_security_shutdown().
- static void Destroy();
-
protected:
// Returns default PEM root certificates in nullptr terminated grpc_slice.
// This function is protected instead of private, so that it can be tested.
diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc
index 52e0ee1c44..bd436d6857 100644
--- a/src/core/lib/surface/init.cc
+++ b/src/core/lib/surface/init.cc
@@ -172,7 +172,6 @@ void grpc_shutdown(void) {
}
}
}
- grpc_security_shutdown();
grpc_iomgr_shutdown();
gpr_timers_global_destroy();
grpc_tracer_shutdown();
diff --git a/src/core/lib/surface/init.h b/src/core/lib/surface/init.h
index d8282b475b..9353208332 100644
--- a/src/core/lib/surface/init.h
+++ b/src/core/lib/surface/init.h
@@ -22,7 +22,6 @@
void grpc_register_security_filters(void);
void grpc_security_pre_init(void);
void grpc_security_init(void);
-void grpc_security_shutdown(void);
int grpc_is_initialized(void);
#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */
diff --git a/src/core/lib/surface/init_secure.cc b/src/core/lib/surface/init_secure.cc
index caa67c2512..28c6f7b121 100644
--- a/src/core/lib/surface/init_secure.cc
+++ b/src/core/lib/surface/init_secure.cc
@@ -78,9 +78,4 @@ void grpc_register_security_filters(void) {
maybe_prepend_server_auth_filter, nullptr);
}
-void grpc_security_init() {
- grpc_security_register_handshaker_factories();
- grpc_core::DefaultSslRootStore::Initialize();
-}
-
-void grpc_security_shutdown() { grpc_core::DefaultSslRootStore::Destroy(); }
+void grpc_security_init() { grpc_security_register_handshaker_factories(); }
diff --git a/src/core/lib/surface/init_unsecure.cc b/src/core/lib/surface/init_unsecure.cc
index 1c8d07b38b..2b3bc64382 100644
--- a/src/core/lib/surface/init_unsecure.cc
+++ b/src/core/lib/surface/init_unsecure.cc
@@ -25,5 +25,3 @@ void grpc_security_pre_init(void) {}
void grpc_register_security_filters(void) {}
void grpc_security_init(void) {}
-
-void grpc_security_shutdown(void) {}