@@ -115,6 +115,15 @@ static void flb_output_free_properties(struct flb_output_instance *ins)
115115 if (ins -> tls_key_passwd ) {
116116 flb_sds_destroy (ins -> tls_key_passwd );
117117 }
118+ if (ins -> tls_min_version ) {
119+ flb_sds_destroy (ins -> tls_min_version );
120+ }
121+ if (ins -> tls_max_version ) {
122+ flb_sds_destroy (ins -> tls_max_version );
123+ }
124+ if (ins -> tls_ciphers ) {
125+ flb_sds_destroy (ins -> tls_ciphers );
126+ }
118127#endif
119128}
120129
@@ -907,6 +916,15 @@ int flb_output_set_property(struct flb_output_instance *ins,
907916 else if (prop_key_check ("tls .key_passwd ", k , len ) == 0 ) {
908917 flb_utils_set_plugin_string_property ("tls.key_passwd" , & ins -> tls_key_passwd , tmp );
909918 }
919+ else if (prop_key_check ("tls .min_version ", k , len ) == 0 ) {
920+ flb_utils_set_plugin_string_property ("tls.min_version" , & ins -> tls_min_version , tmp );
921+ }
922+ else if (prop_key_check ("tls .max_version ", k , len ) == 0 ) {
923+ flb_utils_set_plugin_string_property ("tls.max_version" , & ins -> tls_max_version , tmp );
924+ }
925+ else if (prop_key_check ("tls .ciphers ", k , len ) == 0 ) {
926+ flb_utils_set_plugin_string_property ("tls.ciphers" , & ins -> tls_ciphers , tmp );
927+ }
910928#endif
911929 else if (prop_key_check ("storage.total_limit_size" , k , len ) == 0 && tmp ) {
912930 if (strcasecmp (tmp , "off" ) == 0 ||
@@ -1271,6 +1289,26 @@ int flb_output_init_all(struct flb_config *config)
12711289 return -1 ;
12721290 }
12731291 }
1292+
1293+ if (ins -> tls_min_version != NULL || ins -> tls_max_version != NULL ) {
1294+ ret = flb_tls_set_minmax_proto (ins -> tls , ins -> tls_min_version , ins -> tls_max_version );
1295+ if (ret != 0 ) {
1296+ flb_error ("[output %s] error setting up minmax protocol version of TLS" ,
1297+ ins -> name );
1298+ flb_output_instance_destroy (ins );
1299+ return -1 ;
1300+ }
1301+ }
1302+
1303+ if (ins -> tls_ciphers != NULL ) {
1304+ ret = flb_tls_set_ciphers (ins -> tls , ins -> tls_ciphers );
1305+ if (ret != 0 ) {
1306+ flb_error ("[output %s] error setting up TLS ciphers up to TLSv1.2" ,
1307+ ins -> name );
1308+ flb_output_instance_destroy (ins );
1309+ return -1 ;
1310+ }
1311+ }
12741312 }
12751313#endif
12761314 /*
0 commit comments