From d3d19ed683a889e744485cd56f6d3d7ff25b39ed Mon Sep 17 00:00:00 2001 From: Michael Slusarz Date: Thu, 24 May 2018 21:43:42 -0600 Subject: [PATCH] push-notification: Add SSL support for OX driver --- src/plugins/push-notification/Makefile.am | 1 + src/plugins/push-notification/push-notification-driver-ox.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/plugins/push-notification/Makefile.am b/src/plugins/push-notification/Makefile.am index b7a3a6157c..0f4abb7e9c 100644 --- a/src/plugins/push-notification/Makefile.am +++ b/src/plugins/push-notification/Makefile.am @@ -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 = diff --git a/src/plugins/push-notification/push-notification-driver-ox.c b/src/plugins/push-notification/push-notification-driver-ox.c index e8cb660f45..89ad0d55ea 100644 --- a/src/plugins/push-notification/push-notification-driver-ox.c +++ b/src/plugins/push-notification/push-notification-driver-ox.c @@ -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); } }