TLS: preload configuration items
[users/heiko/exim.git] / src / src / queue.c
index 6748afd5d8c99e5eaa237ccf29f530faaf165edc..4c93c1d7fc15bc9cac29f705d71e8a13db50c256 100644 (file)
@@ -26,6 +26,9 @@ Michael Haardt. */
 #define LOG2_MAXNODES 32
 
 
+#ifndef DISABLE_TLS
+static BOOL queue_tls_init = FALSE;
+#endif
 
 /*************************************************
 *  Helper sort function for queue_get_spool_list *
@@ -648,6 +651,16 @@ for (int i = queue_run_in_order ? -1 : 0;
     report_time_since(&timestamp_startup, US"queue msg selected");
 #endif
 
+#ifndef DISABLE_TLS
+    if (!queue_tls_init)
+      {
+      queue_tls_init = TRUE;
+      /* Preload TLS library info for smtp transports.  Once, and only if we
+      have a delivery to do. */
+      tls_client_creds_reload(FALSE);
+      }
+#endif
+
 single_item_retry:
     if ((pid = exim_fork(US"qrun-delivery")) == 0)
       {