@@ -98,6 +98,11 @@ struct flb_config_map output_global_properties[] = {
9898 0 , FLB_FALSE , 0 ,
9999 "Sets whether using enterprise certstore or not on an output (Windows)"
100100 },
101+ {
102+ FLB_CONFIG_MAP_STR , "tls.windows.client_thumbprints" , NULL ,
103+ 0 , FLB_FALSE , 0 ,
104+ "Comma-separated list of certificate thumbprints (SHA1/SHA256) to trust from the Windows store (Windows)"
105+ },
101106
102107 {0 }
103108};
@@ -193,6 +198,9 @@ static void flb_output_free_properties(struct flb_output_instance *ins)
193198 if (ins -> tls_win_certstore_name ) {
194199 flb_sds_destroy (ins -> tls_win_certstore_name );
195200 }
201+ if (ins -> tls_win_thumbprints ) {
202+ flb_sds_destroy (ins -> tls_win_thumbprints );
203+ }
196204# endif
197205#endif
198206}
@@ -774,6 +782,7 @@ struct flb_output_instance *flb_output_new(struct flb_config *config,
774782# if defined(FLB_SYSTEM_WINDOWS )
775783 instance -> tls_win_certstore_name = NULL ;
776784 instance -> tls_win_use_enterprise_certstore = FLB_FALSE ;
785+ instance -> tls_win_thumbprints = NULL ;
777786# endif
778787#endif
779788
@@ -1007,6 +1016,9 @@ int flb_output_set_property(struct flb_output_instance *ins,
10071016 ins -> tls_win_use_enterprise_certstore = flb_utils_bool (tmp );
10081017 flb_sds_destroy (tmp );
10091018 }
1019+ else if (prop_key_check ("tls.windows.client_thumbprints" , k , len ) == 0 && tmp ) {
1020+ flb_utils_set_plugin_string_property ("tls.windows.client_thumbprints" , & ins -> tls_win_thumbprints , tmp );
1021+ }
10101022# endif
10111023#endif
10121024 else if (prop_key_check ("storage.total_limit_size" , k , len ) == 0 && tmp ) {
@@ -1421,6 +1433,16 @@ int flb_output_init_all(struct flb_config *config)
14211433 }
14221434 }
14231435
1436+ if (ins -> tls_win_thumbprints ) {
1437+ ret = flb_tls_set_client_thumbprints (ins -> tls , ins -> tls_win_thumbprints );
1438+ if (ret == -1 ) {
1439+ flb_error ("[input %s] error set up to use thumbprints of certificates in TLS context" ,
1440+ ins -> name );
1441+
1442+ return -1 ;
1443+ }
1444+ }
1445+
14241446 if (ins -> tls_win_certstore_name ) {
14251447 flb_debug ("[output %s] starting to load %s certstore in TLS context" ,
14261448 ins -> name , ins -> tls_win_certstore_name );
0 commit comments