Skip to content

Commit

Permalink
auth-policy: Enable SSL connections
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and GitLab committed Jan 8, 2017
1 parent 8327721 commit 77ed2f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auth/Makefile.am
Expand Up @@ -58,7 +58,8 @@ auth_libs = \
../lib-otp/libotp.la \
$(LIBDOVECOT_SQL)

auth_CPPFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS)
auth_CPPFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS) \
-I$(top_srcdir)/src/lib-ssl-iostream
auth_LDADD = $(auth_libs) $(LIBDOVECOT) $(AUTH_LIBS) $(BINARY_LDFLAGS)
auth_DEPENDENCIES = $(auth_libs) $(LIBDOVECOT_DEPS)

Expand Down
11 changes: 11 additions & 0 deletions src/auth/auth-policy.c
Expand Up @@ -15,6 +15,7 @@
#include "auth-penalty.h"
#include "auth-settings.h"
#include "auth-policy.h"
#include "iostream-ssl.h"

#define AUTH_POLICY_DNS_SOCKET_PATH "dns-client"

Expand Down Expand Up @@ -156,9 +157,19 @@ void auth_policy_open_and_close_to_key(const char *fromkey, const char *tokey, s

void auth_policy_init(void)
{
struct ssl_iostream_settings ssl_set;
i_zero(&ssl_set);

http_client_set.request_absolute_timeout_msecs = global_auth_settings->policy_server_timeout_msecs;
if (global_auth_settings->debug)
http_client_set.debug = 1;
ssl_set.ca_dir = global_auth_settings->ssl_client_ca_dir;
ssl_set.ca_file = global_auth_settings->ssl_client_ca_file;
if (*ssl_set.ca_dir == '\0' &&
*ssl_set.ca_file == '\0')
ssl_set.allow_invalid_cert = TRUE;

http_client_set.ssl = &ssl_set;
http_client = http_client_init(&http_client_set);

/* prepare template */
Expand Down

0 comments on commit 77ed2f5

Please sign in to comment.