@@ -83,6 +83,16 @@ struct flb_config_map output_global_properties[] = {
83
83
"Accepted values: a positive integer, 'no_limits', 'false', or 'off' to disable retry limits, "
84
84
"or 'no_retries' to disable retries entirely."
85
85
},
86
+ {
87
+ FLB_CONFIG_MAP_STR , "tls.windows.certstore_name" , NULL ,
88
+ 0 , FLB_FALSE , 0 ,
89
+ "Sets the certstore name on an output (Windows)"
90
+ },
91
+ {
92
+ FLB_CONFIG_MAP_STR , "tls.windows.use_enterprise_store" , NULL ,
93
+ 0 , FLB_FALSE , 0 ,
94
+ "Sets whether using enterprise certstore or not on an output (Windows)"
95
+ },
86
96
87
97
{0 }
88
98
};
@@ -174,6 +184,11 @@ static void flb_output_free_properties(struct flb_output_instance *ins)
174
184
if (ins -> tls_ciphers ) {
175
185
flb_sds_destroy (ins -> tls_ciphers );
176
186
}
187
+ # if defined(FLB_SYSTEM_WINDOWS )
188
+ if (ins -> tls_win_certstore_name ) {
189
+ flb_sds_destroy (ins -> tls_win_certstore_name );
190
+ }
191
+ # endif
177
192
#endif
178
193
}
179
194
@@ -751,6 +766,10 @@ struct flb_output_instance *flb_output_new(struct flb_config *config,
751
766
instance -> tls_crt_file = NULL ;
752
767
instance -> tls_key_file = NULL ;
753
768
instance -> tls_key_passwd = NULL ;
769
+ # if defined(FLB_SYSTEM_WINDOWS )
770
+ instance -> tls_win_certstore_name = NULL ;
771
+ instance -> tls_win_use_enterprise_certstore = FLB_FALSE ;
772
+ # endif
754
773
#endif
755
774
756
775
if (plugin -> flags & FLB_OUTPUT_NET ) {
@@ -975,6 +994,15 @@ int flb_output_set_property(struct flb_output_instance *ins,
975
994
else if (prop_key_check ("tls .ciphers ", k , len ) == 0 ) {
976
995
flb_utils_set_plugin_string_property ("tls.ciphers" , & ins -> tls_ciphers , tmp );
977
996
}
997
+ # if defined(FLB_SYSTEM_WINDOWS )
998
+ else if (prop_key_check ("tls.windows.certstore_name" , k , len ) == 0 && tmp ) {
999
+ flb_utils_set_plugin_string_property ("tls.windows.certstore_name" , & ins -> tls_win_certstore_name , tmp );
1000
+ }
1001
+ else if (prop_key_check ("tls.windows.use_enterprise_store" , k , len ) == 0 && tmp ) {
1002
+ ins -> tls_win_use_enterprise_certstore = flb_utils_bool (tmp );
1003
+ flb_sds_destroy (tmp );
1004
+ }
1005
+ # endif
978
1006
#endif
979
1007
else if (prop_key_check ("storage.total_limit_size" , k , len ) == 0 && tmp ) {
980
1008
if (strcasecmp (tmp , "off" ) == 0 ||
@@ -1359,6 +1387,36 @@ int flb_output_init_all(struct flb_config *config)
1359
1387
return -1 ;
1360
1388
}
1361
1389
}
1390
+
1391
+ # if defined (FLB_SYSTEM_WINDOWS )
1392
+ if (ins -> tls_win_use_enterprise_certstore ) {
1393
+ ret = flb_tls_set_use_enterprise_store (ins -> tls , ins -> tls_win_use_enterprise_certstore );
1394
+ if (ret == -1 ) {
1395
+ flb_error ("[input %s] error set up to use enterprise certstore in TLS context" ,
1396
+ ins -> name );
1397
+
1398
+ return -1 ;
1399
+ }
1400
+ }
1401
+
1402
+ if (ins -> tls_win_certstore_name ) {
1403
+ ret = flb_tls_set_certstore_name (ins -> tls , ins -> tls_win_certstore_name );
1404
+ if (ret == -1 ) {
1405
+ flb_error ("[output %s] error specify certstore name in TLS context" ,
1406
+ ins -> name );
1407
+
1408
+ return -1 ;
1409
+ }
1410
+
1411
+ ret = flb_tls_load_system_certificates (ins -> tls );
1412
+ if (ret == -1 ) {
1413
+ flb_error ("[output %s] error set up to load certstore with a user-defined name in TLS context" ,
1414
+ ins -> name );
1415
+
1416
+ return -1 ;
1417
+ }
1418
+ }
1419
+ # endif
1362
1420
}
1363
1421
#endif
1364
1422
/*
0 commit comments