Added configuration options for TLS cipher suites and TLS versions.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2014, Jan Vidar Krey
|
||||
*
|
||||
* THIS FILE IS AUTOGENERATED - DO NOT MODIFY
|
||||
* Created 2014-05-14 11:38, by config.py
|
||||
* Created 2014-07-29 12:22, by config.py
|
||||
*/
|
||||
|
||||
void config_defaults(struct hub_config* config)
|
||||
@@ -51,6 +51,8 @@ void config_defaults(struct hub_config* config)
|
||||
config->tls_require_redirect_addr = hub_strdup("");
|
||||
config->tls_certificate = hub_strdup("");
|
||||
config->tls_private_key = hub_strdup("");
|
||||
config->tls_ciphersuite = hub_strdup("ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS");
|
||||
config->tls_version = hub_strdup("1.2");
|
||||
config->file_acl = hub_strdup("");
|
||||
config->file_plugins = hub_strdup("");
|
||||
config->msg_hub_full = hub_strdup("Hub is full");
|
||||
@@ -552,6 +554,26 @@ static int apply_config(struct hub_config* config, char* key, char* data, int li
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(key, "tls_ciphersuite"))
|
||||
{
|
||||
if (!apply_string(key, data, &config->tls_ciphersuite, (char*) ""))
|
||||
{
|
||||
LOG_ERROR("Configuration parse error on line %d", line_count);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(key, "tls_version"))
|
||||
{
|
||||
if (!apply_string(key, data, &config->tls_version, (char*) ""))
|
||||
{
|
||||
LOG_ERROR("Configuration parse error on line %d", line_count);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(key, "file_acl"))
|
||||
{
|
||||
if (!apply_string(key, data, &config->file_acl, (char*) ""))
|
||||
@@ -955,6 +977,10 @@ void free_config(struct hub_config* config)
|
||||
|
||||
hub_free(config->tls_private_key);
|
||||
|
||||
hub_free(config->tls_ciphersuite);
|
||||
|
||||
hub_free(config->tls_version);
|
||||
|
||||
hub_free(config->file_acl);
|
||||
|
||||
hub_free(config->file_plugins);
|
||||
@@ -1164,6 +1190,12 @@ void dump_config(struct hub_config* config, int ignore_defaults)
|
||||
if (!ignore_defaults || strcmp(config->tls_private_key, "") != 0)
|
||||
fprintf(stdout, "tls_private_key = \"%s\"\n", config->tls_private_key);
|
||||
|
||||
if (!ignore_defaults || strcmp(config->tls_ciphersuite, "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS") != 0)
|
||||
fprintf(stdout, "tls_ciphersuite = \"%s\"\n", config->tls_ciphersuite);
|
||||
|
||||
if (!ignore_defaults || strcmp(config->tls_version, "1.2") != 0)
|
||||
fprintf(stdout, "tls_version = \"%s\"\n", config->tls_version);
|
||||
|
||||
if (!ignore_defaults || strcmp(config->file_acl, "") != 0)
|
||||
fprintf(stdout, "file_acl = \"%s\"\n", config->file_acl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user