Skip to content

Commit

Permalink
fts-tika: Fixed HTTPS support by properly propagating SSL client sett…
Browse files Browse the repository at this point in the history
…ings from mail_user.
  • Loading branch information
stephanbosch authored and GitLab committed Feb 7, 2017
1 parent 5266310 commit 2a5682a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/fts/Makefile.am
Expand Up @@ -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 \
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/fts/fts-parser-tika.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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");
Expand All @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 2a5682a

Please sign in to comment.