ScalaConsultants / reactive-rabbit

Reactive Streams driver for AMQP protocol. Powered by RabbitMQ library.
Apache License 2.0
184 stars 40 forks source link

Use custom SslContext? #50

Closed etspaceman closed 7 years ago

etspaceman commented 7 years ago

We use a custom SslContext when using RabbitMQ. I noticed that this library only allows for the standard SslContext to be used, provided a protocol string. It would be really nice to be able to pass a custom context into the constructor.

I'm effectively forced to extend the Connection trait and employ the custom SslContext in the interim.

LGLO commented 7 years ago

If you are able to prepare PR, I would take care of merging it. My proposal is to:

  1. rename ssl to sslProtocol in ConnectionSettings.
  2. add sslContext: Option[javax.net.ssl.SSLContext] to ConnectionSettings, default None.
  3. In Conversions first use sslContext to invoke factory.useSslContext(SSLContext) and if sslContext is None then use sslProtocol to invoke factory.useSslContext(String) I would not like to touch parsing config, if you get your ConnectionSettings from parsing config file, then I leave user with s.copy(sslContext = ...).
etspaceman commented 7 years ago

@LGLO PR Created:

https://github.com/ScalaConsultants/reactive-rabbit/pull/51

mkiedys commented 7 years ago

Merged.