X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fs_server.c;h=0d6727ca43f38750d2495bcbd8d40a305a1567fc;hp=59b6305e97a5cf8d3584f147f2540ecf0b92b79c;hb=e18eef3d7ab9a6b4f229d95c8d32d25c66243103;hpb=9dd84053419aa220b5e66a5f9fcf809dbd6d9369 diff --git a/apps/s_server.c b/apps/s_server.c index 59b6305e97..0d6727ca43 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -153,6 +153,12 @@ typedef unsigned int u_int; #include #include #include +#ifndef OPENSSL_NO_DH +#include +#endif +#ifndef OPENSSL_NO_RSA +#include +#endif #include "s_apps.h" #include "timeouts.h" @@ -262,6 +268,9 @@ static char *engine_id=NULL; static const char *session_id_prefix=NULL; static int enable_timeouts = 0; +#ifdef mtu +#undef mtu +#endif static long mtu; static int cert_chain = 0; @@ -527,13 +536,18 @@ int MAIN(int argc, char *argv[]) char *CApath=NULL,*CAfile=NULL; unsigned char *context = NULL; char *dhfile = NULL; +#ifndef OPENSSL_NO_ECDH char *named_curve = NULL; +#endif int badop=0,bugs=0; int ret=1; int off=0; int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0; int state=0; SSL_METHOD *meth=NULL; +#ifdef sock_type +#undef sock_type +#endif int sock_type=SOCK_STREAM; #ifndef OPENSSL_NO_ENGINE ENGINE *e=NULL; @@ -818,21 +832,24 @@ bad: if (s_key_file == NULL) s_key_file = s_cert_file; - s_key = load_key(bio_err, s_key_file, s_key_format, 0, pass, e, - "server certificate private key file"); - if (!s_key) + if (nocert == 0) { - ERR_print_errors(bio_err); - goto end; - } + s_key = load_key(bio_err, s_key_file, s_key_format, 0, pass, e, + "server certificate private key file"); + if (!s_key) + { + ERR_print_errors(bio_err); + goto end; + } - s_cert = load_cert(bio_err,s_cert_file,s_cert_format, + s_cert = load_cert(bio_err,s_cert_file,s_cert_format, NULL, e, "server certificate file"); - if (!s_cert) - { - ERR_print_errors(bio_err); - goto end; + if (!s_cert) + { + ERR_print_errors(bio_err); + goto end; + } } if (s_dcert_file)