if (!rspamd_cryptobox_decrypt_nm_inplace (m, dec_len, nonce,
nm, m - rspamd_cryptobox_mac_bytes (mode), mode)) {
- msg_err ("cannot verify encrypted message");
+ msg_err ("cannot verify encrypted message, first bytes of the input: %*xs",
+ (gint)MIN(msg->body_buf.len, 64), msg->body_buf.begin);
return -1;
}
*nlen = (o - path);
}
}
+
+void
+rspamd_http_connection_disable_encryption (struct rspamd_http_connection *conn)
+{
+ struct rspamd_http_connection_private *priv;
+
+ priv = conn->priv;
+
+ if (priv) {
+ if (priv->local_key) {
+ rspamd_keypair_unref (priv->local_key);
+ }
+ if (priv->peer_key) {
+ rspamd_pubkey_unref (priv->peer_key);
+ }
+
+ priv->local_key = NULL;
+ priv->peer_key = NULL;
+ priv->flags &= ~RSPAMD_HTTP_CONN_FLAG_ENCRYPTED;
+ }
+}
\ No newline at end of file
void rspamd_http_connection_set_max_size (struct rspamd_http_connection *conn,
gsize sz);
+void rspamd_http_connection_disable_encryption (struct rspamd_http_connection *conn);
+
/**
* Increase refcount for shared file (if any) to prevent early memory unlinking
* @param msg
struct rspamd_proxy_session *session;
session = bk_conn->s;
- msg_info_session ("abnormally closing connection from backend: %s, error: %s,"
+ msg_info_session ("abnormally closing connection from backend: %s, error: %e,"
" retries left: %d",
rspamd_inet_address_to_string (rspamd_upstream_addr (session->master_conn->up)),
- err->message,
+ err,
session->ctx->max_retries - session->retries);
session->retries ++;
rspamd_upstream_fail (bk_conn->up);