Skip to content

Commit

Permalink
rabbitmq: Enabling rabbitmq_publish for any route and disabling peer
Browse files Browse the repository at this point in the history
verification

Enabling rabbitmq_publish function on any route so we can send events on reply
reception.
Also disabling peer verification on the TLS handshake if no CA file is
configured.
  • Loading branch information
joelbax authored and miconda committed Aug 12, 2023
1 parent 170067e commit 2475dfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/rabbitmq/doc/rabbitmq_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ modparam("rabbitmq", "direct_reply_to", 1)
</itemizedlist>

<para>
This function can be used from REQUEST_ROUTE.
This function can be used from any route.
</para>

<example>
Expand Down
8 changes: 4 additions & 4 deletions src/modules/rabbitmq/rabbitmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int rbmq_fixup_free_params(void **param, int param_no)
/* module commands */
static cmd_export_t cmds[] = {
{"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_spve_all,
fixup_free_spve_all, REQUEST_ROUTE},
fixup_free_spve_all, ANY_ROUTE},
{"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5,
rbmq_fixup_params, rbmq_fixup_free_params, REQUEST_ROUTE},
{0, 0, 0, 0, 0, 0}};
Expand Down Expand Up @@ -597,10 +597,10 @@ static int rabbitmq_connect(amqp_connection_state_t *conn)
}

#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 8
amqp_ssl_socket_set_verify(amqp_sock, 1);
amqp_ssl_socket_set_verify(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
#else
amqp_ssl_socket_set_verify_peer(amqp_sock, 1);
amqp_ssl_socket_set_verify_hostname(amqp_sock, 1);
amqp_ssl_socket_set_verify_peer(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
amqp_ssl_socket_set_verify_hostname(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
#endif

ret = amqp_socket_open(amqp_sock, amqp_info.host, amqp_info.port);
Expand Down

0 comments on commit 2475dfa

Please sign in to comment.