@ -39,6 +39,8 @@
static int use_lt_credentials = 0 ;
static int anon_credentials = 0 ;
static int use_lt_credentials_only = 0 ;
static int timestamp_credentials = 0 ;
////// ALPN //////////
@ -1162,6 +1164,7 @@ static void set_option(int c, char *value)
if ( get_bool_value ( value ) ) {
turn_params . ct = TURN_CREDENTIALS_LONG_TERM ;
use_lt_credentials = 1 ;
use_lt_credentials_only = 1 ;
} else {
turn_params . ct = TURN_CREDENTIALS_UNDEFINED ;
use_lt_credentials = 0 ;
@ -1223,12 +1226,14 @@ static void set_option(int c, char *value)
# endif
case AUTH_SECRET_OPT :
turn_params . use_auth_secret_with_timestamp = 1 ;
timestamp_credentials = 1 ;
turn_params . ct = TURN_CREDENTIALS_LONG_TERM ;
use_lt_credentials = 1 ;
break ;
case STATIC_AUTH_SECRET_VAL_OPT :
add_to_secrets_list ( & turn_params . default_users_db . ram_db . static_auth_secrets , value ) ;
turn_params . use_auth_secret_with_timestamp = 1 ;
timestamp_credentials = 1 ;
turn_params . ct = TURN_CREDENTIALS_LONG_TERM ;
use_lt_credentials = 1 ;
break ;
@ -1989,6 +1994,10 @@ int main(int argc, char **argv)
exit ( - 1 ) ;
}
if ( use_lt_credentials_only & & timestamp_credentials ) {
TURN_LOG_FUNC ( TURN_LOG_LEVEL_ERROR , " \n CONFIGURATION ALERT: you specified --lt-cred-mech and --use-auth-secret both. Check your configuration. \n " ) ;
}
if ( ! use_lt_credentials & & ! anon_credentials ) {
if ( turn_params . default_users_db . ram_db . users_number ) {
TURN_LOG_FUNC ( TURN_LOG_LEVEL_WARNING , " \n CONFIGURATION ALERT: you specified long-term user accounts, (-u option) \n but you did not specify the long-term credentials option \n (-a or --lt-cred-mech option). \n I am turning --lt-cred-mech ON for you, but double-check your configuration. \n " ) ;