summaryrefslogtreecommitdiffstats
path: root/apps/s_client.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2004-12-13 18:02:23 +0000
committerDr. Stephen Henson <steve@openssl.org>2004-12-13 18:02:23 +0000
commitabbc186bd2798afc4ad405af15d7e2668d66ef3e (patch)
tree534987276bedf4b83f084cee44bd32d92aaa8c01 /apps/s_client.c
parentde6859e4422b2b00448731c47872befb4df2a278 (diff)
Fix s_client so it works without a certificate again.
Diffstat (limited to 'apps/s_client.c')
-rw-r--r--apps/s_client.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index 0204b517b1..c1fcd9d97f 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -482,21 +482,32 @@ bad:
if (key_file == NULL)
key_file = cert_file;
- key = load_key(bio_err, key_file, key_format, 0, pass, e,
- "client certificate private key file");
- if (!key)
+
+ if (key_file)
+
{
- ERR_print_errors(bio_err);
- goto end;
+
+ key = load_key(bio_err, key_file, key_format, 0, pass, e,
+ "client certificate private key file");
+ if (!key)
+ {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
}
- cert = load_cert(bio_err,cert_file,cert_format,
- NULL, e, "client certificate file");
+ if (cert_file)
- if (!cert)
{
- ERR_print_errors(bio_err);
- goto end;
+ cert = load_cert(bio_err,cert_file,cert_format,
+ NULL, e, "client certificate file");
+
+ if (!cert)
+ {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
}
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL