Skip to content

Commit

Permalink
push-notification: Add SSL support for OX driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Slusarz authored and cmouse committed May 28, 2018
1 parent 646a917 commit d3d19ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/push-notification/Makefile.am
Expand Up @@ -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 =
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/push-notification/push-notification-driver-ox.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}
Expand Down

0 comments on commit d3d19ed

Please sign in to comment.