]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts-tika: Fixed HTTPS support by properly propagating SSL client settings from mail_user.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 22 Jan 2017 12:42:25 +0000 (13:42 +0100)
committerGitLab <gitlab@git.dovecot.net>
Tue, 7 Feb 2017 10:52:43 +0000 (12:52 +0200)
src/plugins/fts/Makefile.am
src/plugins/fts/fts-parser-tika.c

index ebf41d1e2f15a97673578b7d3dc79fa496608f18..2e7753c94753706fc1e0e08499e73457ac9f1be6 100644 (file)
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/lib \
        -I$(top_srcdir)/src/lib-settings \
        -I$(top_srcdir)/src/lib-fts \
+       -I$(top_srcdir)/src/lib-ssl-iostream \
        -I$(top_srcdir)/src/lib-http \
        -I$(top_srcdir)/src/lib-mail \
        -I$(top_srcdir)/src/lib-imap \
index b807fbf7c4f32af12e893835f66039a982759b1d..8457f28f26eeb4e5b4a48ed9f86594e417595bec 100644 (file)
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "istream.h"
 #include "module-context.h"
+#include "iostream-ssl.h"
 #include "http-url.h"
 #include "http-client.h"
 #include "message-parser.h"
@@ -39,6 +40,7 @@ tika_get_http_client_url(struct mail_user *user, struct http_url **http_url_r)
 {
        struct fts_parser_tika_user *tuser = TIKA_USER_CONTEXT(user);
        struct http_client_settings http_set;
+       struct ssl_iostream_settings ssl_set;
        const char *url, *error;
 
        url = mail_user_plugin_getenv(user, "fts_tika");
@@ -62,6 +64,9 @@ tika_get_http_client_url(struct mail_user *user, struct http_url **http_url_r)
        }
 
        if (tika_http_client == NULL) {
+               i_zero(&ssl_set);
+               mail_user_init_ssl_client_settings(user, &ssl_set);
+
                i_zero(&http_set);
                http_set.max_idle_time_msecs = 100;
                http_set.max_parallel_connections = 1;
@@ -70,6 +75,7 @@ tika_get_http_client_url(struct mail_user *user, struct http_url **http_url_r)
                http_set.max_attempts = 3;
                http_set.connect_timeout_msecs = 5*1000;
                http_set.request_timeout_msecs = 60*1000;
+               http_set.ssl = &ssl_set;
                http_set.debug = user->mail_debug;
                tika_http_client = http_client_init(&http_set);
        }