X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fs_server.c;h=70cf5d766101a70a5702ceafdf0a1217fc9b69dd;hp=dad9f61a0f2105f42ca523eebe3b271b10dbbd8a;hb=685755937a4f9f8b16f8953f631e14808f785c39;hpb=b5cadfb564a604c0ba1c49984ac796cfd8310731 diff --git a/apps/s_server.c b/apps/s_server.c index dad9f61a0f..70cf5d7661 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -300,6 +300,7 @@ static int cert_status_cb(SSL *s, void *arg); static int no_resume_ephemeral = 0; static int s_msg=0; static int s_quiet=0; +static int s_ign_eof=0; static int s_brief=0; static char *keymatexportlabel=NULL; @@ -475,6 +476,9 @@ static void sv_usage(void) BIO_printf(bio_err,"usage: s_server [args ...]\n"); BIO_printf(bio_err,"\n"); BIO_printf(bio_err," -accept arg - port to accept on (default is %d)\n",PORT); + BIO_printf(bio_err," -checkhost host - check peer certificate matches \"host\"\n"); + BIO_printf(bio_err," -checkemail email - check peer certificate matches \"email\"\n"); + BIO_printf(bio_err," -checkip ipaddr - check peer certificate matches \"ipaddr\"\n"); BIO_printf(bio_err," -context arg - set session ID context\n"); BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n"); BIO_printf(bio_err," -Verify arg - turn on peer certificate verification, must have a cert.\n"); @@ -1216,6 +1220,10 @@ int MAIN(int argc, char *argv[]) #endif s_nbio_test=1; } + else if (strcmp(*argv,"-ign_eof") == 0) + s_ign_eof=1; + else if (strcmp(*argv,"-no_ign_eof") == 0) + s_ign_eof=0; else if (strcmp(*argv,"-debug") == 0) { s_debug=1; } #ifndef OPENSSL_NO_TLSEXT @@ -1438,10 +1446,6 @@ int MAIN(int argc, char *argv[]) keymatexportlen=atoi(*(++argv)); if (keymatexportlen == 0) goto bad; } -#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL - else if (strcmp(*argv, "-debug_broken_protocol") == 0) - cert_flags |= SSL_CERT_FLAG_BROKEN_PROTCOL; -#endif else { BIO_printf(bio_err,"unknown option %s\n",*argv); @@ -3258,6 +3262,12 @@ static int rev_body(char *hostname, int s, unsigned char *context) p--; i--; } + if (!s_ign_eof && i == 5 && !strncmp(buf, "CLOSE", 5)) + { + ret = 1; + BIO_printf(bio_err, "CONNECTION CLOSED\n"); + goto end; + } BUF_reverse((unsigned char *)buf, NULL, i); buf[i] = '\n'; BIO_write(io, buf, i + 1);