@ -695,6 +695,8 @@ void RunModeInitializeOutputs(void)
ConfNode * output , * output_config ;
const char * enabled ;
char tls_log_enabled = 0 ;
char tls_store_present = 0 ;
TAILQ_FOREACH ( output , & outputs - > head , next ) {
@ -706,6 +708,10 @@ void RunModeInitializeOutputs(void)
exit ( 1 ) ;
}
if ( strcmp ( output - > val , " tls-store " ) = = 0 ) {
tls_store_present = 1 ;
}
enabled = ConfNodeLookupChildValue ( output_config , " enabled " ) ;
if ( enabled = = NULL | | ! ConfValIsTrue ( enabled ) ) {
continue ;
@ -742,6 +748,8 @@ void RunModeInitializeOutputs(void)
" files installed to add lua support. " ) ;
continue ;
# endif
} else if ( strcmp ( output - > val , " tls-log " ) = = 0 ) {
tls_log_enabled = 1 ;
}
OutputModule * module = OutputGetModuleByConfName ( output - > val ) ;
@ -847,6 +855,40 @@ void RunModeInitializeOutputs(void)
SetupOutput ( module - > name , module , output_ctx ) ;
}
}
/* Backward compatibility code */
if ( ! tls_store_present & & tls_log_enabled ) {
/* old YAML with no "tls-store" in outputs. "tls-log" value needs
* to be started using ' tls - log ' config as own config */
SCLogWarning ( SC_ERR_CONF_YAML_ERROR ,
" Please use 'tls-store' in YAML to configure TLS storage " ) ;
TAILQ_FOREACH ( output , & outputs - > head , next ) {
output_config = ConfNodeLookupChild ( output , output - > val ) ;
if ( strcmp ( output - > val , " tls-log " ) = = 0 ) {
OutputModule * module = OutputGetModuleByConfName ( " tls-store " ) ;
if ( module = = NULL ) {
SCLogWarning ( SC_ERR_INVALID_ARGUMENT ,
" No output module named %s, ignoring " , " tls-store " ) ;
continue ;
}
OutputCtx * output_ctx = NULL ;
if ( module - > InitFunc ! = NULL ) {
output_ctx = module - > InitFunc ( output_config ) ;
if ( output_ctx = = NULL ) {
continue ;
}
}
AddOutputToFreeList ( module , output_ctx ) ;
SetupOutput ( module - > name , module , output_ctx ) ;
}
}
}
}
/**