650873
diff -up openssl-1.0.1c/apps/s_client.c.default-paths openssl-1.0.1c/apps/s_client.c
650873
--- openssl-1.0.1c/apps/s_client.c.default-paths	2012-03-18 19:16:05.000000000 +0100
650873
+++ openssl-1.0.1c/apps/s_client.c	2012-12-06 18:24:06.425933203 +0100
650873
@@ -1166,12 +1166,19 @@ bad:
2ccfa6
 	if (!set_cert_key_stuff(ctx,cert,key))
2ccfa6
 		goto end;
2ccfa6
 
2ccfa6
-	if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) ||
2ccfa6
-		(!SSL_CTX_set_default_verify_paths(ctx)))
650873
+	if (CAfile == NULL && CApath == NULL)
2ccfa6
 		{
2ccfa6
-		/* BIO_printf(bio_err,"error setting default verify locations\n"); */
650873
-		ERR_print_errors(bio_err);
2ccfa6
-		/* goto end; */
650873
+		if (!SSL_CTX_set_default_verify_paths(ctx))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
650873
+		}
650873
+	else
650873
+		{
650873
+		if (!SSL_CTX_load_verify_locations(ctx,CAfile,CApath))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
2ccfa6
 		}
2ccfa6
 
2ccfa6
 #ifndef OPENSSL_NO_TLSEXT
650873
diff -up openssl-1.0.1c/apps/s_server.c.default-paths openssl-1.0.1c/apps/s_server.c
650873
--- openssl-1.0.1c/apps/s_server.c.default-paths	2012-03-18 19:16:05.000000000 +0100
650873
+++ openssl-1.0.1c/apps/s_server.c	2012-12-06 18:25:11.199329611 +0100
650873
@@ -1565,13 +1565,21 @@ bad:
d8cd5c
 		}
d8cd5c
 #endif
d8cd5c
 
d8cd5c
-	if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) ||
d8cd5c
-		(!SSL_CTX_set_default_verify_paths(ctx)))
650873
+	if (CAfile == NULL && CApath == NULL)
d8cd5c
 		{
d8cd5c
-		/* BIO_printf(bio_err,"X509_load_verify_locations\n"); */
650873
-		ERR_print_errors(bio_err);
d8cd5c
-		/* goto end; */
650873
+		if (!SSL_CTX_set_default_verify_paths(ctx))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
650873
+		}
650873
+	else
650873
+		{
650873
+		if (!SSL_CTX_load_verify_locations(ctx,CAfile,CApath))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
d8cd5c
 		}
650873
+
2ccfa6
 	if (vpm)
2ccfa6
 		SSL_CTX_set1_param(ctx, vpm);
650873
 
650873
@@ -1622,8 +1630,11 @@ bad:
aabbc9
 		else
aabbc9
 			SSL_CTX_sess_set_cache_size(ctx2,128);
d8cd5c
 
d8cd5c
-		if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) ||
d8cd5c
-			(!SSL_CTX_set_default_verify_paths(ctx2)))
d8cd5c
+		if (!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath))
d8cd5c
+			{
d8cd5c
+			ERR_print_errors(bio_err);
d8cd5c
+			}
d8cd5c
+		if (!SSL_CTX_set_default_verify_paths(ctx2))
d8cd5c
 			{
d8cd5c
 			ERR_print_errors(bio_err);
d8cd5c
 			}
650873
diff -up openssl-1.0.1c/apps/s_time.c.default-paths openssl-1.0.1c/apps/s_time.c
650873
--- openssl-1.0.1c/apps/s_time.c.default-paths	2006-04-17 14:22:13.000000000 +0200
650873
+++ openssl-1.0.1c/apps/s_time.c	2012-12-06 18:27:41.694574044 +0100
650873
@@ -373,12 +373,19 @@ int MAIN(int argc, char **argv)
d8cd5c
 
d8cd5c
 	SSL_load_error_strings();
d8cd5c
 
d8cd5c
-	if ((!SSL_CTX_load_verify_locations(tm_ctx,CAfile,CApath)) ||
d8cd5c
-		(!SSL_CTX_set_default_verify_paths(tm_ctx)))
650873
+	if (CAfile == NULL && CApath == NULL)
d8cd5c
 		{
d8cd5c
-		/* BIO_printf(bio_err,"error setting default verify locations\n"); */
650873
-		ERR_print_errors(bio_err);
d8cd5c
-		/* goto end; */
728b11
+		if (!SSL_CTX_set_default_verify_paths(tm_ctx))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
650873
+		}
650873
+	else
650873
+		{
728b11
+		if (!SSL_CTX_load_verify_locations(tm_ctx,CAfile,CApath))
650873
+			{
650873
+			ERR_print_errors(bio_err);
650873
+			}
d8cd5c
 		}
d8cd5c
 
d8cd5c
 	if (tm_cipher == NULL)