-
Notifications
You must be signed in to change notification settings - Fork 36
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
No way to specify CA/client certificate for SSL connections. #168
Comments
You can pass the context method to the connection constructor: redis/include/boost/redis/connection.hpp Line 346 in 7caea92
|
It is just the method. Can I pass the whole context in? I need to specify CA certificate, as well as client cert/key for mutual authentication. |
At the moment you can't pass the context. I agree that passing the whole context would have been more flexible, so I might change that in a future release. But I fail to see why you can't first pass the method and then set whatever you have to set. There is only one non-trivial constructor in ssl::context, which is the one you will be using anyway https://www.boost.org/doc/libs/1_83_0/doc/html/boost_asio/reference/ssl__context/context.html |
Is there any API I can use to directly access the SSL context of current connection from boost::redis? The |
Yeah it is missing. I will add one. |
I think just adding a constructor with ssl context passed in is sufficient, like Beast's secure websocket. Letting end users play with existing ssl context may interfere with ongoing async ops (or you'll need to document when they can/cannot make change safely) |
Did not have the time to look at this yet. Perhaps in the forthcoming weekends. |
@grapland0 It was not my intention to close the ticket, so please reopen if necessary. The PR adds the getters you were missing to the ssl-context. I am still unsure whether and how I will allow passing a custom ssl context to the connection. This is what Boost.MySql does (from a conversation with @anarthal)
|
Please note that it is UB to set properties of SSL contexts once a ssl::stream is created from them. If |
Fix is merged now. Please have a look. |
It always constuct a system-default ssl context which uses system common CA set and no client certificate (for mutual authentation at server side).
The text was updated successfully, but these errors were encountered: