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>
This commit is contained in:
Richard Levitte 2016-09-09 09:32:00 +02:00
parent 3656ea1c22
commit 54d72ef0f0
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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);