From 481f7542752ee05d8ca5e04aedb9e00d06c4e524 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Tue, 19 May 2020 13:29:59 +0800 Subject: [PATCH] =?UTF-8?q?TSG-1518=20=E6=94=B9=E8=BF=9BTFE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2Certstore=E8=BF=87=E7=A8=8B=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=BA=E5=88=B6=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20enable=5Fhealth=5Fcheck=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/tfe/tfe.conf | 3 +++ platform/src/key_keeper.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/tfe/tfe.conf b/conf/tfe/tfe.conf index 918dbd1..ae645ad 100644 --- a/conf/tfe/tfe.conf +++ b/conf/tfe/tfe.conf @@ -43,6 +43,9 @@ cert_store_host=192.168.10.8 cert_store_port=9991 ca_path=resource/tfe/tango-ca-trust-ca.pem untrusted_ca_path=resource/tfe/tango-ca-untrust-ca.pem +# health_check only for "mode=normal" +# default 1 +enable_health_check=1 [debug] passthrough_all_tcp=0 diff --git a/platform/src/key_keeper.cpp b/platform/src/key_keeper.cpp index 8156efd..13fb115 100644 --- a/platform/src/key_keeper.cpp +++ b/platform/src/key_keeper.cpp @@ -49,6 +49,7 @@ struct key_keeper struct key_keeper_stat stat; int cert_expire_time; + unsigned int enable_health_check; pthread_t thread; }; @@ -562,6 +563,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo MESA_load_profile_string_def(profile, section, "cert_store_host", keeper->cert_store_host, sizeof(keeper->cert_store_host), ""); + MESA_load_profile_uint_def(profile, section, "enable_health_check", &(keeper->enable_health_check), 1); MESA_load_profile_uint_def(profile, section, "cert_store_port", &(keeper->cert_store_port), 80); MESA_load_profile_uint_def(profile, section, "hash_slot_size", &(keeper->hash_slot_size), 1024*128); MESA_load_profile_uint_def(profile, section, "hash_expire_seconds", &(keeper->hash_expire_seconds), 5*60); @@ -595,7 +597,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo } } // KK_MODE_CERT_STORE: create thread for certstore health check - else + if (keeper->work_mode == KK_MODE_CERT_STORE && keeper->enable_health_check) { pthread_attr_t attr; pthread_attr_init(&attr);