-
-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for SSL client cert authentication and server certificate validation when connecting to RabbitMQ #4541
Conversation
server certificate using provided CA bundle for message bus (RabbitMQ) connections. Option names are consistent with the same option names for MongoDB. Update affected code so connection and URLs are only retrieved in a single place.
self._publisher = SharedPoolPublishers().get_publisher(urls=urls) | ||
self._exchange = exchange | ||
|
||
def publish_create(self, payload): | ||
with Timer(key='amqp.publish.create'): | ||
self._publisher.publish(payload, self._exchange, CREATE_RK) | ||
self._publisher.publgish(payload, self._exchange, CREATE_RK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny typo
|
||
class AnnouncementPublisher(object): | ||
def __init__(self, urls): | ||
def __init__(self, urls=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connection retrieval and URL handling is now centralized in a single place so there is really no need for this url
argument here anymore.
To make the code nicer, I could simply remove it from all those classes.
there is no need for this argument anymore.
@Kami No, we don't auto-generate SSL/CA in K8s/HA work, leaving that part for user consideration/configuration. |
@@ -41,7 +41,7 @@ | |||
|
|||
SKIP_GROUPS = ['api_pecan', 'rbac', 'results_tracker'] | |||
|
|||
# We group auth options together to nake it a bit more clear what applies where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROFL 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Nake it!
…ection_ssl_options
listener on port 5671. Default non SSL listener is exposed on port 5672.
f091833
to
3b77449
Compare
RabbitMQ on Travis tests.
uncomment to test this functionality.
I pushed changes so we now also expose SSL listener when running RabbitMQ on Travis (67fc03f, 3b77449, 922cb23) and added some basic tests which verify that those parameters work as expected (88a6d57). In the future, we should do the same for MongoDB (we don't have any integration tests for SSL related parameters, just unit ones which are lacking). NOTE: At the moment we only run those tests on Travis, because RabbitMQ SSL listener is not set up on local vagrant dev VMs. |
1eaa005
to
0c69ebd
Compare
0c69ebd
to
5387ece
Compare
36cbe7a
to
44e513e
Compare
ancient Precise version.
These tests were added in StackStorm#4541. Now that we're on xenial, we can reenable them. This skips upgrading rabbitmq. reverts 44e513e originally added in 5387ece reverts 922cb23
This pull request adds two of the features we were missing for fully secure and verified connections to RabbitMQ message bus:
Both of those features were already supported for database (MongoDB) connection, but not for RabbitMQ.
Keep in mind that secure SSL / TLS connections to RabbitMQ were already possible (without verifying server certificate), but that wasn't documented anywhere. StackStorm/st2docs#848 fixed that.
Nice thing is that we can use same naming for those options for
database
andmessaging
section (ssl_keyfile
,ssl_certfile
,ssl_cert_reqes
,ssl_ca_certs
).Example config entries:
Implementation wise, I needed to refactor some code so we now retrieve a properly configured
Connection
object in a single centralized place.TODO