-
Notifications
You must be signed in to change notification settings - Fork 341
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
[question] Example for onSecuring for SSL certficate? #527
Comments
Hmmm afaik I know what is going on. OpenSSL is initialized a bit "upside-down". First you need to the create SSL_CTX, then you need to create SSL with the preconfigured SSL_CTX. During SSL creation OpenSSL copies a whole lot of stuff from the SSL_CTX to SSL. So if OnSecuring is called after the SSL is initialized, you are way to late. I have modified amqp-cpp locally, basically like this:
and it seems to fix my issue |
Tibor Harsszegi, thanks plenty! I was really hitting the wall with the same problem because I couldn't do two-way SSL until I saw your fix. I did make it to trying to configure the onSecuring but I hit the same wall you did...until I read your post. I ended up throwing my SSL_CTX_use_PrivateKey_file call in the SslContext constructor and calling it a day. Thanks again! |
Hi,
I'm trying to use SSL and I fail to do so:
bool onSecuring(AMQP::TcpConnection* /* connection /, SSL ssl) override
{
auto* ssl_ctx = SSL_get_SSL_CTX(ssl);
}
This works fine, context is configured, however the server rejects this with "no_client_certificate_provided".
The same set of certificates with SimpleAmqpClient work fine, e.g. I can connect to the same broker.
Any documentation / hint how to use SSL with amqp-cpp?
Thanks,
The text was updated successfully, but these errors were encountered: