@@ -596,6 +596,15 @@ int flb_input_set_property(struct flb_input_instance *ins,
596596 else if (prop_key_check ("tls .key_passwd ", k , len ) == 0 ) {
597597 flb_utils_set_plugin_string_property ("tls.key_passwd" , & ins -> tls_key_passwd , tmp );
598598 }
599+ else if (prop_key_check ("tls .min_version ", k , len ) == 0 ) {
600+ flb_utils_set_plugin_string_property ("tls.min_version" , & ins -> tls_min_version , tmp );
601+ }
602+ else if (prop_key_check ("tls .max_version ", k , len ) == 0 ) {
603+ flb_utils_set_plugin_string_property ("tls.max_version" , & ins -> tls_max_version , tmp );
604+ }
605+ else if (prop_key_check ("tls .ciphers ", k , len ) == 0 ) {
606+ flb_utils_set_plugin_string_property ("tls.ciphers" , & ins -> tls_ciphers , tmp );
607+ }
599608#endif
600609 else if (prop_key_check ("storage .type ", k , len ) == 0 && tmp ) {
601610 /* Set the storage type */
@@ -742,6 +751,18 @@ void flb_input_instance_destroy(struct flb_input_instance *ins)
742751 flb_sds_destroy (ins -> tls_key_passwd );
743752 }
744753
754+ if (ins -> tls_min_version ) {
755+ flb_sds_destroy (ins -> tls_min_version );
756+ }
757+
758+ if (ins -> tls_max_version ) {
759+ flb_sds_destroy (ins -> tls_max_version );
760+ }
761+
762+ if (ins -> tls_ciphers ) {
763+ flb_sds_destroy (ins -> tls_ciphers );
764+ }
765+
745766 /* release the tag if any */
746767 flb_sds_destroy (ins -> tag );
747768
@@ -1321,6 +1342,26 @@ int flb_input_init_all(struct flb_config *config)
13211342 flb_input_instance_destroy (ins );
13221343 return -1 ;
13231344 }
1345+
1346+ if (ins -> tls_min_version != NULL || ins -> tls_max_version != NULL ) {
1347+ ret = flb_tls_set_minmax_proto (ins -> tls , ins -> tls_min_version , ins -> tls_max_version );
1348+ if (ret != 0 ) {
1349+ flb_error ("[input %s] error setting up minmax protocol version of TLS" ,
1350+ ins -> name );
1351+ flb_input_instance_destroy (ins );
1352+ return -1 ;
1353+ }
1354+ }
1355+
1356+ if (ins -> tls_ciphers != NULL ) {
1357+ ret = flb_tls_set_ciphers (ins -> tls , ins -> tls_ciphers );
1358+ if (ret != 0 ) {
1359+ flb_error ("[input %s] error setting up TLS ciphers up to TLSv1.2" ,
1360+ ins -> name );
1361+ flb_input_instance_destroy (ins );
1362+ return -1 ;
1363+ }
1364+ }
13241365 }
13251366
13261367 return 0 ;
0 commit comments