提交 16c6deed 编写于 作者: R Richard Levitte

Fixup BIO demos for OpenSSL 1.1.x

Note: server-cmod doesn't seem to do things right...  from loading
cmod.cnf, it tries to load libssl_conf.so.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 08029dfa
...@@ -23,10 +23,6 @@ int main(int argc, char **argv) ...@@ -23,10 +23,6 @@ int main(int argc, char **argv)
const char *connect_str = "localhost:4433"; const char *connect_str = "localhost:4433";
int nargs = argc - 1; int nargs = argc - 1;
ERR_load_crypto_strings();
ERR_load_SSL_strings();
SSL_library_init();
ctx = SSL_CTX_new(TLS_client_method()); ctx = SSL_CTX_new(TLS_client_method());
cctx = SSL_CONF_CTX_new(); cctx = SSL_CONF_CTX_new();
SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CLIENT); SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CLIENT);
......
...@@ -26,10 +26,6 @@ int main(int argc, char **argv) ...@@ -26,10 +26,6 @@ int main(int argc, char **argv)
const char *connect_str = "localhost:4433"; const char *connect_str = "localhost:4433";
long errline = -1; long errline = -1;
ERR_load_crypto_strings();
ERR_load_SSL_strings();
SSL_library_init();
conf = NCONF_new(NULL); conf = NCONF_new(NULL);
if (NCONF_load(conf, "connect.cnf", &errline) <= 0) { if (NCONF_load(conf, "connect.cnf", &errline) <= 0) {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
static int done = 0; static int done = 0;
void interrupt() void interrupt(int sig)
{ {
done = 1; done = 1;
} }
...@@ -58,11 +58,6 @@ int main(int argc, char *argv[]) ...@@ -58,11 +58,6 @@ int main(int argc, char *argv[])
else else
port = argv[1]; port = argv[1];
SSL_load_error_strings();
/* Add ciphers and message digests */
OpenSSL_add_ssl_algorithms();
ctx = SSL_CTX_new(TLS_server_method()); ctx = SSL_CTX_new(TLS_server_method());
if (!SSL_CTX_use_certificate_chain_file(ctx, CERT_FILE)) if (!SSL_CTX_use_certificate_chain_file(ctx, CERT_FILE))
goto err; goto err;
......
...@@ -55,11 +55,6 @@ char *argv[]; ...@@ -55,11 +55,6 @@ char *argv[];
sock_init(); sock_init();
#endif #endif
/* Lets get nice error messages */
SSL_load_error_strings();
/* Setup all the global SSL stuff */
OpenSSL_add_ssl_algorithms();
ssl_ctx = SSL_CTX_new(TLS_client_method()); ssl_ctx = SSL_CTX_new(TLS_client_method());
/* Enable trust chain verification */ /* Enable trust chain verification */
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <signal.h> #include <signal.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
...@@ -30,11 +31,6 @@ int main(int argc, char *argv[]) ...@@ -30,11 +31,6 @@ int main(int argc, char *argv[])
char **args = argv + 1; char **args = argv + 1;
int nargs = argc - 1; int nargs = argc - 1;
SSL_load_error_strings();
/* Add ciphers and message digests */
OpenSSL_add_ssl_algorithms();
ctx = SSL_CTX_new(TLS_server_method()); ctx = SSL_CTX_new(TLS_server_method());
cctx = SSL_CONF_CTX_new(); cctx = SSL_CONF_CTX_new();
......
...@@ -27,11 +27,6 @@ int main(int argc, char *argv[]) ...@@ -27,11 +27,6 @@ int main(int argc, char *argv[])
SSL_CTX *ctx; SSL_CTX *ctx;
int ret = 1, i; int ret = 1, i;
SSL_load_error_strings();
/* Add ciphers and message digests */
OpenSSL_add_ssl_algorithms();
if (CONF_modules_load_file("cmod.cnf", "testapp", 0) <= 0) { if (CONF_modules_load_file("cmod.cnf", "testapp", 0) <= 0) {
fprintf(stderr, "Error processing config file\n"); fprintf(stderr, "Error processing config file\n");
goto err; goto err;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <signal.h> #include <signal.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
...@@ -33,10 +34,6 @@ int main(int argc, char *argv[]) ...@@ -33,10 +34,6 @@ int main(int argc, char *argv[])
char buf[512]; char buf[512];
int ret = 1, i; int ret = 1, i;
SSL_load_error_strings();
/* Add ciphers and message digests */
OpenSSL_add_ssl_algorithms();
conf = NCONF_new(NULL); conf = NCONF_new(NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册