int ssl_sock_load_cert(char *path, struct bind_conf *bind_conf, char **err);
int ssl_sock_load_srv_cert(char *path, struct server *server, char **err);
void ssl_free_global_issuers(void);
+int ssl_initialize_random(void);
int ssl_sock_load_cert_list_file(char *file, int dir, struct bind_conf *bind_conf, struct proxy *curproxy, char **err);
int ssl_init_single_engine(const char *engine_id, const char *def_algorithms);
#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
if (init_acl() != 0)
exit(1);
+#ifdef USE_OPENSSL
+ /* Initialize the random generator.
+ * Must be called before chroot for access to /dev/urandom
+ */
+ if (!ssl_initialize_random()) {
+ ha_alert("OpenSSL random data generator initialization failed.\n");
+ exit(1);
+ }
+#endif
+
/* Initialise lua. */
hlua_init();
* if the random is said as not implemented, because we expect that openssl
* will use another method once needed.
*/
-static int ssl_initialize_random()
+int ssl_initialize_random(void)
{
unsigned char random;
static int random_initialized = 0;
int cfgerr = 0;
SSL_CTX *ctx = srv->ssl_ctx.ctx;
- /* Make sure openssl opens /dev/urandom before the chroot */
- if (!ssl_initialize_random()) {
- ha_alert("OpenSSL random data generator initialization failed.\n");
- cfgerr++;
- }
-
/* Automatic memory computations need to know we use SSL there */
global.ssl_used_backend = 1;
/* Automatic memory computations need to know we use SSL there */
global.ssl_used_frontend = 1;
- /* Make sure openssl opens /dev/urandom before the chroot */
- if (!ssl_initialize_random()) {
- ha_alert("OpenSSL random data generator initialization failed.\n");
- err++;
- }
/* Create initial_ctx used to start the ssl connection before do switchctx */
if (!bind_conf->initial_ctx) {
err += ssl_initial_ctx(bind_conf);