Commit 1d39b657 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Allow reloading TLS key on the fly

parent a6eb48e4
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "yp.h" #include "yp.h"
#include "fserve.h" #include "fserve.h"
#include "stats.h" #include "stats.h"
#include "connection.h"
#define CATMODULE "CONFIG" #define CATMODULE "CONFIG"
#define CONFIG_DEFAULT_LOCATION "Earth" #define CONFIG_DEFAULT_LOCATION "Earth"
...@@ -636,6 +637,7 @@ void config_reread_config(void) ...@@ -636,6 +637,7 @@ void config_reread_config(void)
config_set_config(&new_config); config_set_config(&new_config);
config = config_get_config_unlocked(); config = config_get_config_unlocked();
restart_logging(config); restart_logging(config);
connection_reread_config(config);
yp_recheck_config(config); yp_recheck_config(config);
fserve_recheck_mime_types(config); fserve_recheck_mime_types(config);
stats_global(config); stats_global(config);
......
...@@ -107,6 +107,7 @@ static matchfile_t *banned_ip, *allowed_ip; ...@@ -107,6 +107,7 @@ static matchfile_t *banned_ip, *allowed_ip;
rwlock_t _source_shutdown_rwlock; rwlock_t _source_shutdown_rwlock;
static void _handle_connection(void); static void _handle_connection(void);
static void get_ssl_certificate(ice_config_t *config);
void connection_initialize(void) void connection_initialize(void)
{ {
...@@ -142,6 +143,11 @@ void connection_shutdown(void) ...@@ -142,6 +143,11 @@ void connection_shutdown(void)
_initialized = 0; _initialized = 0;
} }
void connection_reread_config(struct ice_config_tag *config)
{
get_ssl_certificate(config);
}
static unsigned long _next_connection_id(void) static unsigned long _next_connection_id(void)
{ {
unsigned long id; unsigned long id;
......
...@@ -49,6 +49,7 @@ typedef struct connection_tag ...@@ -49,6 +49,7 @@ typedef struct connection_tag
void connection_initialize(void); void connection_initialize(void);
void connection_shutdown(void); void connection_shutdown(void);
void connection_reread_config(struct ice_config_tag *config);
void connection_accept_loop(void); void connection_accept_loop(void);
int connection_setup_sockets(struct ice_config_tag *config); int connection_setup_sockets(struct ice_config_tag *config);
void connection_close(connection_t *con); void connection_close(connection_t *con);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment