aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-01 08:46:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-01 08:46:41 +0000
commit00ab7ecb957b80ee7dec1f6146f688804eed789b (patch)
tree6536d08e73982048ddd6848a0e823b57c845fb45
parentd8b1514abb2e1b31cadf789bda7cc532312ce0bb (diff)
downloadrspamd-00ab7ecb957b80ee7dec1f6146f688804eed789b.tar.gz
rspamd-00ab7ecb957b80ee7dec1f6146f688804eed789b.zip
[Fix] Do not try to set keys for unencrypted requests in proxy
-rw-r--r--src/rspamd_proxy.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 33ac428af..ea8964d85 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -1067,9 +1067,11 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session)
session->ctx->keys_cache,
NULL);
- rspamd_http_connection_set_key (bk_conn->backend_conn,
- session->ctx->local_key);
- msg->peer_key = rspamd_pubkey_ref (m->key);
+ if (m->key) {
+ rspamd_http_connection_set_key (bk_conn->backend_conn,
+ session->ctx->local_key);
+ msg->peer_key = rspamd_pubkey_ref (m->key);
+ }
if (m->local ||
rspamd_inet_address_is_local (rspamd_upstream_addr (bk_conn->up))) {
@@ -1267,9 +1269,12 @@ retry:
session->master_conn->parser_to_ref = backend->parser_to_ref;
msg = rspamd_http_connection_copy_msg (session->client_message);
- rspamd_http_connection_set_key (session->master_conn->backend_conn,
- session->ctx->local_key);
- msg->peer_key = rspamd_pubkey_ref (backend->key);
+
+ if (backend->key) {
+ msg->peer_key = rspamd_pubkey_ref (backend->key);
+ rspamd_http_connection_set_key (session->master_conn->backend_conn,
+ session->ctx->local_key);
+ }
if (backend->local ||
rspamd_inet_address_is_local (