From 9f7ceeded32ffe935a89015c876ac2932ec46c71 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 13 Jul 2016 15:28:08 +0200 Subject: [PATCH] Don't SSL_library_init() on every context create It will not be called when the second bit from the set_from_os parameter is set. This deals with issue #117 --- ChangeLog | 2 ++ src/context.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8459cd74..4dae9ffb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,8 @@ * Bugfix: Build fails with autoconf 2.63, works with 2.68. Thanks Robert Groenenberg * Doxygen output for getdns.h and getdns_extra.h only + * Do not call SSL_library_init() from getdns_context_create() when + the second bit from the set_from_os parameter is set. * 2016-03-31: Version 1.0.0b1 * openssl 1.1.0 support diff --git a/src/context.c b/src/context.c index b46dc3bd..b0c9a198 100644 --- a/src/context.c +++ b/src/context.c @@ -1297,7 +1297,9 @@ getdns_context_create_with_extended_memory_functions( /* Unbound needs SSL to be init'ed this early when TLS is used. However we * don't know that till later so we will have to do this every time. */ - SSL_library_init(); + if (set_from_os & 2 == 0) + SSL_library_init(); + #ifdef HAVE_LIBUNBOUND result->unbound_ctx = NULL; if ((r = rebuild_ub_ctx(result)))