diff options
author | Vladimir Kobal <vlad@prokk.net> | 2020-11-05 19:08:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 19:08:17 +0200 |
commit | 943ee2482b16a81afd54b426f4fb0952f99c48e7 (patch) | |
tree | 5603b2bbd3cba974f665699a2b132256b2dfe912 /libnetdata/socket | |
parent | edd6d02dec1c65593acb9d7b98dbb3f594d58c3a (diff) |
Add HTTP and HTTPS support to the simple exporting connector (#9911)
Diffstat (limited to 'libnetdata/socket')
-rw-r--r-- | libnetdata/socket/security.c | 26 | ||||
-rw-r--r-- | libnetdata/socket/security.h | 4 |
2 files changed, 14 insertions, 16 deletions
diff --git a/libnetdata/socket/security.c b/libnetdata/socket/security.c index 2f340ad996..53366c4d8f 100644 --- a/libnetdata/socket/security.c +++ b/libnetdata/socket/security.c @@ -2,7 +2,7 @@ #ifdef ENABLE_HTTPS -SSL_CTX *netdata_opentsdb_ctx=NULL; +SSL_CTX *netdata_exporting_ctx=NULL; SSL_CTX *netdata_client_ctx=NULL; SSL_CTX *netdata_srv_ctx=NULL; const char *security_key=NULL; @@ -201,7 +201,7 @@ static SSL_CTX * security_initialize_openssl_server() { * @param selector informs the context that must be initialized, the following list has the valid values: * NETDATA_SSL_CONTEXT_SERVER - the server context * NETDATA_SSL_CONTEXT_STREAMING - Starts the streaming context. - * NETDATA_SSL_CONTEXT_OPENTSDB - Starts the OpenTSDB contextv + * NETDATA_SSL_CONTEXT_EXPORTING - Starts the OpenTSDB contextv */ void security_start_ssl(int selector) { switch (selector) { @@ -222,8 +222,8 @@ void security_start_ssl(int selector) { SSL_CTX_set_mode(netdata_client_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE |SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER |SSL_MODE_AUTO_RETRY); break; } - case NETDATA_SSL_CONTEXT_OPENTSDB: { - netdata_opentsdb_ctx = security_initialize_openssl_client(); + case NETDATA_SSL_CONTEXT_EXPORTING: { + netdata_exporting_ctx = security_initialize_openssl_client(); break; } } @@ -234,20 +234,18 @@ void security_start_ssl(int selector) { * * Clean all the allocated contexts from netdata. */ -void security_clean_openssl() { - if (netdata_srv_ctx) - { - SSL_CTX_free(netdata_srv_ctx); - } +void security_clean_openssl() +{ + if (netdata_srv_ctx) { + SSL_CTX_free(netdata_srv_ctx); + } - if (netdata_client_ctx) - { + if (netdata_client_ctx) { SSL_CTX_free(netdata_client_ctx); } - if ( netdata_opentsdb_ctx ) - { - SSL_CTX_free(netdata_opentsdb_ctx); + if (netdata_exporting_ctx) { + SSL_CTX_free(netdata_exporting_ctx); } #if OPENSSL_VERSION_NUMBER < OPENSSL_VERSION_110 diff --git a/libnetdata/socket/security.h b/libnetdata/socket/security.h index 6eee80324f..17ecc6d05a 100644 --- a/libnetdata/socket/security.h +++ b/libnetdata/socket/security.h @@ -14,7 +14,7 @@ #define NETDATA_SSL_CONTEXT_SERVER 0 #define NETDATA_SSL_CONTEXT_STREAMING 1 -#define NETDATA_SSL_CONTEXT_OPENTSDB 2 +#define NETDATA_SSL_CONTEXT_EXPORTING 2 # ifdef ENABLE_HTTPS @@ -34,7 +34,7 @@ struct netdata_ssl{ uint32_t flags; //The flags for SSL connection }; -extern SSL_CTX *netdata_opentsdb_ctx; +extern SSL_CTX *netdata_exporting_ctx; extern SSL_CTX *netdata_client_ctx; extern SSL_CTX *netdata_srv_ctx; extern const char *security_key; |