From: Vsevolod Stakhov Date: Wed, 1 Mar 2017 08:46:04 +0000 (+0000) Subject: [Fix] Do not try to set keys for unencrypted requests in proxy X-Git-Tag: 1.5.0~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=00ab7ecb957b80ee7dec1f6146f688804eed789b;p=rspamd.git [Fix] Do not try to set keys for unencrypted requests in proxy --- 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 (