Security callback debug print out.
[openssl.git] / apps / s_client.c
index f85309f9003f1fc104c73a871c537a9244867dbf..f8c059a25ad5bbc1945d9c68d662b94f39aa3fce 100644 (file)
@@ -702,6 +702,7 @@ static char *jpake_secret = NULL;
        int crl_format = FORMAT_PEM;
        int crl_download = 0;
        STACK_OF(X509_CRL) *crls = NULL;
+       int sdebug = 0;
 
        meth=SSLv23_client_method();
 
@@ -713,8 +714,6 @@ static char *jpake_secret = NULL;
        c_msg=0;
        c_showcerts=0;
 
-       X509V3_EXT_add_rfc6962();
-
        if (bio_err == NULL)
                bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
@@ -876,6 +875,10 @@ static char *jpake_secret = NULL;
                else if (strcmp(*argv,"-trace") == 0)
                        c_msg=2;
 #endif
+               else if (strcmp(*argv,"-security_debug") == 0)
+                       { sdebug=1; }
+               else if (strcmp(*argv,"-security_debug_verbose") == 0)
+                       { sdebug=2; }
                else if (strcmp(*argv,"-showcerts") == 0)
                        c_showcerts=1;
                else if (strcmp(*argv,"-nbio_test") == 0)
@@ -1304,6 +1307,9 @@ bad:
                goto end;
                }
 
+       if (sdebug)
+               ssl_ctx_security_debug(ctx, bio_err, sdebug);
+
        if (vpm)
                SSL_CTX_set1_param(ctx, vpm);
 
@@ -2195,7 +2201,6 @@ end:
                BIO_free(bio_c_msg);
                bio_c_msg=NULL;
                }
-       X509V3_EXT_cleanup();
        apps_shutdown();
        OPENSSL_EXIT(ret);
        }