Skip to content

Commit 0da8d1f

Browse files
Christian Betzalanxz
authored andcommitted
ssl: add support for SSL SNI
1 parent 8ab25ab commit 0da8d1f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

librabbitmq/amqp_openssl.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ static int amqp_ssl_socket_open(void *base, const char *host, int port,
204204
BIO_set_fd(bio, self->sockfd, BIO_NOCLOSE);
205205
SSL_set_bio(self->ssl, bio, bio);
206206

207+
status = SSL_set_tlsext_host_name(self->ssl, host);
208+
if (!status) {
209+
self->internal_error = SSL_get_error(self->ssl, status);
210+
status = AMQP_STATUS_SSL_ERROR;
211+
goto error_out2;
212+
}
213+
207214
start_connect:
208215
status = SSL_connect(self->ssl);
209216
if (status != 1) {

0 commit comments

Comments
 (0)