Data publisher that publishes data via AMQP to RMQ
Nginx that exposes an endpoint for STOMP
Clients that consume data via STOMP (accessing the RMQ with their JWT tokens)
Everything works in our stack in normal conditions but when we run the stack behind a corporate proxy we face the issue.
RMQ receives the connections from STOMP clients but it cannot verify the tokens since it cannot get the key from our Keycloak (because of proxy it cannot reach out).
We solved this issue for other components of our stack by setting environment variables such as http_proxy, https_proxy and no_proxy.
I passed these variables to the RMQ as below but still, it cannot parse the JWT token:
2024-01-31 14:21:17.102107+00:00 [warn] <0.2042.0> Description: "Authenticity is not established by certificate path validation"
2024-01-31 14:21:17.102107+00:00 [warn] <0.2042.0> Reason: "Option {verify, verify_peer} and cacertfile/cacerts is missing"
2024-01-31 14:21:17.102107+00:00 [warn] <0.2042.0>
2024-01-31 14:21:25.103685+00:00 [warn] <0.2036.0> STOMP login failed for user '': authentication failed
2024-01-31 14:21:25.103845+00:00 [erro] <0.2036.0> STOMP error frame sent:
2024-01-31 14:21:25.103845+00:00 [erro] <0.2036.0> Message: "Bad CONNECT"
2024-01-31 14:21:25.103845+00:00 [erro] <0.2036.0> Detail: "Access refused for user ''\n"
2024-01-31 14:21:25.103845+00:00 [erro] <0.2036.0> Server private detail: none
So what is the solution in this case? I couldn't find that much info on how to run RMQ behind corporate proxy set aside fetching key and working with JWT.
Reproduction steps
Run a RabbitMQ behind a proxy in a way that it can't access to the Keycloak
Set http_proxy for RMQ
Try to open a connection with the JWT token that you got from Keycloak
Expected behavior
RabbitMQ or Oauth2 plugin should pick up the http_proxy and no_proxy environment variables and use them to reach Keycloak and fetch the keys.
Describe the bug
We have a stack consist of:
rabbitmq_auth_backend_oauth2
plugin enabled that fetches the keys from our Keycloak:Everything works in our stack in normal conditions but when we run the stack behind a corporate proxy we face the issue.
RMQ receives the connections from STOMP clients but it cannot verify the tokens since it cannot get the key from our Keycloak (because of proxy it cannot reach out).
We solved this issue for other components of our stack by setting environment variables such as
http_proxy
,https_proxy
andno_proxy
.I passed these variables to the RMQ as below but still, it cannot parse the JWT token:
RMQ logs:
So what is the solution in this case? I couldn't find that much info on how to run RMQ behind corporate proxy set aside fetching key and working with JWT.
Reproduction steps
Expected behavior
RabbitMQ or Oauth2 plugin should pick up the
http_proxy
andno_proxy
environment variables and use them to reach Keycloak and fetch the keys.Additional context
No response