Fossil SCM

Add the "test-ssl-trust-store" command for testing and diagnostics.

drh 2020-04-26 15:39 trunk
Commit 67147dd6be1acdb1f30008c20be1cb292af0f8a8c69f1a5360b9976458e7e3e2
1 file changed +20
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -30,10 +30,11 @@
3030
#ifdef FOSSIL_ENABLE_SSL
3131
3232
#include <openssl/bio.h>
3333
#include <openssl/ssl.h>
3434
#include <openssl/err.h>
35
+#include <openssl/x509.h>
3536
3637
#include "http_ssl.h"
3738
#include <assert.h>
3839
#include <sys/types.h>
3940
@@ -498,5 +499,24 @@
498499
}
499500
return total;
500501
}
501502
502503
#endif /* FOSSIL_ENABLE_SSL */
504
+
505
+/*
506
+** COMMAND: test-ssl-trust-store
507
+**
508
+** Show the file and directory where OpenSSL looks for certificates
509
+** of trusted CAs.
510
+*/
511
+void test_ssl_info(void){
512
+#if !defined(FOSSIL_ENABLE_SSL)
513
+ fossil_print("SSL disabled in this build\n");
514
+#else
515
+ fossil_print("file: %-14s %s\n",
516
+ X509_get_default_cert_file_env(),
517
+ X509_get_default_cert_file());
518
+ fossil_print("dir: %-14s %s\n",
519
+ X509_get_default_cert_dir_env(),
520
+ X509_get_default_cert_dir());
521
+#endif
522
+}
503523
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -30,10 +30,11 @@
30 #ifdef FOSSIL_ENABLE_SSL
31
32 #include <openssl/bio.h>
33 #include <openssl/ssl.h>
34 #include <openssl/err.h>
 
35
36 #include "http_ssl.h"
37 #include <assert.h>
38 #include <sys/types.h>
39
@@ -498,5 +499,24 @@
498 }
499 return total;
500 }
501
502 #endif /* FOSSIL_ENABLE_SSL */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -30,10 +30,11 @@
30 #ifdef FOSSIL_ENABLE_SSL
31
32 #include <openssl/bio.h>
33 #include <openssl/ssl.h>
34 #include <openssl/err.h>
35 #include <openssl/x509.h>
36
37 #include "http_ssl.h"
38 #include <assert.h>
39 #include <sys/types.h>
40
@@ -498,5 +499,24 @@
499 }
500 return total;
501 }
502
503 #endif /* FOSSIL_ENABLE_SSL */
504
505 /*
506 ** COMMAND: test-ssl-trust-store
507 **
508 ** Show the file and directory where OpenSSL looks for certificates
509 ** of trusted CAs.
510 */
511 void test_ssl_info(void){
512 #if !defined(FOSSIL_ENABLE_SSL)
513 fossil_print("SSL disabled in this build\n");
514 #else
515 fossil_print("file: %-14s %s\n",
516 X509_get_default_cert_file_env(),
517 X509_get_default_cert_file());
518 fossil_print("dir: %-14s %s\n",
519 X509_get_default_cert_dir_env(),
520 X509_get_default_cert_dir());
521 #endif
522 }
523

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button