summaryrefslogtreecommitdiff
path: root/imap/src/osdep/unix/ssl_unix.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-07-18 00:53:34 -0600
committerEduardo Chappa <chappa@washington.edu>2020-07-18 00:53:34 -0600
commitef159279c142ec4f3b3a1938cfeadc74d5891070 (patch)
tree6a670c9b33666abcb81c824bb36fdc7c920d697d /imap/src/osdep/unix/ssl_unix.c
parent50f4fdaa40ab3195377f22243c3ba4287389d207 (diff)
downloadalpine-ef159279c142ec4f3b3a1938cfeadc74d5891070.tar.xz
* Addition of the variables User Certs Dir and User Certs File, which allow
a user to specify the location of server certificates that the user trusts.
Diffstat (limited to 'imap/src/osdep/unix/ssl_unix.c')
-rw-r--r--imap/src/osdep/unix/ssl_unix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c
index 4ebe1ae7..1f64b57e 100644
--- a/imap/src/osdep/unix/ssl_unix.c
+++ b/imap/src/osdep/unix/ssl_unix.c
@@ -421,6 +421,11 @@ static char *ssl_start_work (SSLSTREAM *stream,char *host,unsigned long flags)
SSL_CTX_load_verify_locations (stream->context, CAfile, CApath);
else /* set default paths to CAs... */
SSL_CTX_set_default_verify_paths (stream->context);
+ /* Load app certificates */
+ CAfile = (char *) mail_parameters (NIL,GET_SSLAPPCAFILE,NIL);
+ CApath = (char *) mail_parameters (NIL,GET_SSLAPPCAPATH,NIL);
+ if (CAfile != NIL || CApath != NIL)
+ SSL_CTX_load_verify_locations (stream->context, CAfile, CApath);
/* want to send client certificate? */
if (scc && (s = (*scc) ()) && (sl = strlen (s))) {
if ((cert = PEM_read_bio_X509 (bio = BIO_new_mem_buf (s,sl),NIL,NIL,NIL)) != NULL) {