@@ -152,6 +152,14 @@ static void tls_context_destroy(void *ctx_backend)
152152 ctx -> alpn = NULL ;
153153 }
154154
155+ #if defined(FLB_SYSTEM_WINDOWS )
156+ if (ctx -> certstore_name != NULL ) {
157+ flb_free (ctx -> certstore_name );
158+
159+ ctx -> certstore_name = NULL ;
160+ }
161+ #endif
162+
155163 pthread_mutex_unlock (& ctx -> mutex );
156164
157165 flb_free (ctx );
@@ -788,6 +796,34 @@ static int tls_set_ciphers(struct flb_tls *tls, const char *ciphers)
788796 return 0 ;
789797}
790798
799+ #if defined(FLB_SYSTEM_WINDOWS )
800+ static int tls_set_certstore_name (struct flb_tls * tls , const char * certstore_name )
801+ {
802+ struct tls_context * ctx = tls -> ctx ;
803+
804+ pthread_mutex_lock (& ctx -> mutex );
805+
806+ ctx -> certstore_name = flb_strdup (certstore_name );
807+
808+ pthread_mutex_unlock (& ctx -> mutex );
809+
810+ return 0 ;
811+ }
812+
813+ static int tls_set_use_enterprise_store (struct flb_tls * tls , int use_enterprise )
814+ {
815+ struct tls_context * ctx = tls -> ctx ;
816+
817+ pthread_mutex_lock (& ctx -> mutex );
818+
819+ ctx -> use_enterprise_store = !!use_enterprise ;
820+
821+ pthread_mutex_unlock (& ctx -> mutex );
822+
823+ return 0 ;
824+ }
825+ #endif
826+
791827static void * tls_session_create (struct flb_tls * tls ,
792828 int fd )
793829{
@@ -1187,4 +1223,8 @@ static struct flb_tls_backend tls_openssl = {
11871223 .net_read = tls_net_read ,
11881224 .net_write = tls_net_write ,
11891225 .net_handshake = tls_net_handshake ,
1226+ #if defined(FLB_SYSTEM_WINDOWS )
1227+ .set_certstore_name = tls_set_certstore_name ,
1228+ .set_use_enterprise_store = tls_set_use_enterprise_store ,
1229+ #endif
11901230};
0 commit comments