]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Add SSL support for OX driver
authorMichael Slusarz <michael.slusarz@dovecot.fi>
Fri, 25 May 2018 03:43:42 +0000 (21:43 -0600)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 28 May 2018 08:27:02 +0000 (08:27 +0000)
src/plugins/push-notification/Makefile.am
src/plugins/push-notification/push-notification-driver-ox.c

index b7a3a6157ca64bb24a36e25430f576f95a2ba0c5..0f4abb7e9cda3b1da02e557cf323aa70a1ad671e 100644 (file)
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/lib-index \
        -I$(top_srcdir)/src/lib-mail \
        -I$(top_srcdir)/src/lib-storage \
+       -I$(top_srcdir)/src/lib-ssl-iostream \
        -I$(top_srcdir)/src/plugins/notify
 
 NOPLUGIN_LDFLAGS =
index e8cb660f455f2546b7552a9e3051aadbde5720cd..89ad0d55eaaae7ebe17170929d1196aeebc92cc3 100644 (file)
@@ -12,6 +12,7 @@
 #include "mail-storage-private.h"
 #include "str.h"
 #include "strescape.h"
+#include "iostream-ssl.h"
 
 #include "push-notification-drivers.h"
 #include "push-notification-event-messagenew.h"
@@ -60,6 +61,7 @@ push_notification_driver_ox_init_global(struct mail_user *user,
        struct push_notification_driver_ox_config *config)
 {
     struct http_client_settings http_set;
+    struct ssl_iostream_settings ssl_set;
 
     if (ox_global->http_client == NULL) {
         /* this is going to use the first user's settings, but these are
@@ -69,6 +71,10 @@ push_notification_driver_ox_init_global(struct mail_user *user,
         http_set.max_attempts = config->http_max_retries+1;
         http_set.request_timeout_msecs = config->http_timeout_msecs;
 
+        i_zero(&ssl_set);
+        mail_user_init_ssl_client_settings(user, &ssl_set);
+        http_set.ssl = &ssl_set;
+
         ox_global->http_client = http_client_init(&http_set);
     }
 }