Commit 987045c74aee6db466632eb14e0f79cd0de470c7

Cristian OneČ› 2015-05-20T18:03:54

Call the openssl API to be able to work with SNI servers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index 2ebfac7..c5a2b0b 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -243,6 +243,9 @@ int openssl_connect(git_stream *stream)
 		return ssl_set_error(st->ssl, ret);
 	}
 
+	/* specify the host in case SNI is needed */
+	SSL_set_tlsext_host_name(st->ssl, st->socket->host);
+
 	if ((ret = SSL_connect(st->ssl)) <= 0)
 		return ssl_set_error(st->ssl, ret);