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