Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Commit 3b702e2

Browse files
committed
Add support for client-side SNI
1 parent 8e0deb6 commit 3b702e2

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

extra.mk.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ OBJOPENSSL_SHARED_LIB = @OBJOPENSSL_SHARED_LIB@
22
OBJOPENSSL_STATIC_LIB = @OBJOPENSSL_STATIC_LIB@
33
OBJOPENSSL_FRAMEWORK = @OBJOPENSSL_FRAMEWORK@
44

5-
OBJFW_LIBS = @OBJFW_LIBS@
65
OBJFW_FRAMEWORK_LIBS = @OBJFW_FRAMEWORK_LIBS@
6+
OBJFW_LIBS = @OBJFW_LIBS@

src/SSLSocket.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@ - (void)SSL_startTLSWithExpectedHost: (OFString *)host
199199
SSLError: error];
200200
}
201201

202+
if (SSL_set_tlsext_host_name(_SSL, [host UTF8String]) != 1) {
203+
unsigned long error = ERR_get_error();
204+
205+
[self close];
206+
207+
@throw [SSLConnectionFailedException exceptionWithHost: host
208+
port: port
209+
socket: self
210+
SSLError: error];
211+
}
212+
202213
if (_certificateVerificationEnabled) {
203214
X509_VERIFY_PARAM *param = SSL_get0_param(_SSL);
204215

0 commit comments

Comments
 (0)