From 0da8d1fd403794058a0184abd3eaffd46156f62f Mon Sep 17 00:00:00 2001 From: Christian Betz Date: Tue, 13 Sep 2016 17:02:22 -0400 Subject: ssl: add support for SSL SNI --- librabbitmq/amqp_openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c index 234a698..2a43e81 100644 --- a/librabbitmq/amqp_openssl.c +++ b/librabbitmq/amqp_openssl.c @@ -204,6 +204,13 @@ static int amqp_ssl_socket_open(void *base, const char *host, int port, BIO_set_fd(bio, self->sockfd, BIO_NOCLOSE); SSL_set_bio(self->ssl, bio, bio); + status = SSL_set_tlsext_host_name(self->ssl, host); + if (!status) { + self->internal_error = SSL_get_error(self->ssl, status); + status = AMQP_STATUS_SSL_ERROR; + goto error_out2; + } + start_connect: status = SSL_connect(self->ssl); if (status != 1) { -- cgit v1.2.1