summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-08 18:27:08 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-08 18:27:08 +0300
commit42691b66514e903396d708e13721b9d457be5d03 (patch)
tree54021304984e31181bed8068a7c2698223d33b9e /src/app.c
parent95ceeeddd59ec8ea95a14fb203b5a789dcc2a5b8 (diff)
App: Default CA cert setup
In case prefs.cfg doesn't set CA file/path, we'll still need to initialize the CA cert store for later use.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app.c b/src/app.c
index 9f785a98..854b6404 100644
--- a/src/app.c
+++ b/src/app.c
@@ -302,6 +302,7 @@ static const iString *prefsFileName_(void) {
302 302
303static void loadPrefs_App_(iApp *d) { 303static void loadPrefs_App_(iApp *d) {
304 iUnused(d); 304 iUnused(d);
305 iBool haveCA = iFalse;
305 /* Create the data dir if it doesn't exist yet. */ 306 /* Create the data dir if it doesn't exist yet. */
306 makeDirs_Path(collectNewCStr_String(dataDir_App_())); 307 makeDirs_Path(collectNewCStr_String(dataDir_App_()));
307 iFile *f = new_File(prefsFileName_()); 308 iFile *f = new_File(prefsFileName_());
@@ -326,6 +327,7 @@ static void loadPrefs_App_(iApp *d) {
326 /* Background requests may be started before these commands would get 327 /* Background requests may be started before these commands would get
327 handled via the event loop. */ 328 handled via the event loop. */
328 handleCommand_App(cmd); 329 handleCommand_App(cmd);
330 haveCA = iTrue;
329 } 331 }
330 else if (equal_Command(cmd, "customframe")) { 332 else if (equal_Command(cmd, "customframe")) {
331 d->prefs.customFrame = arg_Command(cmd); 333 d->prefs.customFrame = arg_Command(cmd);
@@ -347,8 +349,8 @@ static void loadPrefs_App_(iApp *d) {
347 } 349 }
348 delete_String(str); 350 delete_String(str);
349 } 351 }
350 else { 352 if (!haveCA) {
351 /* default preference values */ 353 /* Default CA setup. */
352 setCACertificates_TlsRequest(&d->prefs.caFile, &d->prefs.caPath); 354 setCACertificates_TlsRequest(&d->prefs.caFile, &d->prefs.caPath);
353 } 355 }
354#if !defined (LAGRANGE_CUSTOM_FRAME) 356#if !defined (LAGRANGE_CUSTOM_FRAME)