diff options
author | Richard Levitte <levitte@openssl.org> | 2016-09-09 09:32:00 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-09-20 18:24:24 +0200 |
commit | 54d72ef0f019db383f8e98342b9b77c5da8541e5 (patch) | |
tree | dc33301cf78b10e8f92caa44406f2b7cdc072f83 | |
parent | 3656ea1c2217f38d44f3f34253e7c16f1b40ba77 (diff) |
Fixup BIO demos for OpenSSL 1.1.x
Call SSL_CTX_new() before doing any configuration.
(or call OPENSSL_ssl_init())
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r-- | demos/bio/server-cmod.c | 4 | ||||
-rw-r--r-- | demos/bio/server-conf.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/demos/bio/server-cmod.c b/demos/bio/server-cmod.c index dfe233538e..9cb246375c 100644 --- a/demos/bio/server-cmod.c +++ b/demos/bio/server-cmod.c @@ -27,13 +27,13 @@ int main(int argc, char *argv[]) SSL_CTX *ctx; int ret = 1, i; + ctx = SSL_CTX_new(TLS_server_method()); + if (CONF_modules_load_file("cmod.cnf", "testapp", 0) <= 0) { fprintf(stderr, "Error processing config file\n"); goto err; } - ctx = SSL_CTX_new(TLS_server_method()); - if (SSL_CTX_config(ctx, "server") == 0) { fprintf(stderr, "Error configuring server.\n"); goto err; diff --git a/demos/bio/server-conf.c b/demos/bio/server-conf.c index 84d39f5f70..41b13089c6 100644 --- a/demos/bio/server-conf.c +++ b/demos/bio/server-conf.c @@ -34,6 +34,7 @@ int main(int argc, char *argv[]) char buf[512]; int ret = 1, i; + ctx = SSL_CTX_new(TLS_server_method()); conf = NCONF_new(NULL); @@ -52,7 +53,6 @@ int main(int argc, char *argv[]) goto err; } - ctx = SSL_CTX_new(TLS_server_method()); cctx = SSL_CONF_CTX_new(); SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_SERVER); SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CERTIFICATE); |