Fossil SCM

Use the SSL_set_tlsext_host_name() function only if it is available.

drh 2011-12-23 14:00 trunk
Commit cb52442608ce154d6469a66cacf1c7db0ba31021
1 file changed +2
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -210,14 +210,16 @@
210210
}
211211
212212
iBio = BIO_new_ssl_connect(sslCtx);
213213
BIO_get_ssl(iBio, &ssl);
214214
215
+#if (SSLEAY_VERSION_NUMBER >= 0x00908070) && !defined(OPENSSL_NO_TLSEXT)
215216
if( !SSL_set_tlsext_host_name(ssl, g.urlName) ){
216217
fossil_warning("WARNING: failed to set server name indication (SNI), "
217218
"continuing without it.\n");
218219
}
220
+#endif
219221
220222
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
221223
if( iBio==NULL ) {
222224
ssl_set_errmsg("SSL: cannot open SSL (%s)",
223225
ERR_reason_error_string(ERR_get_error()));
224226
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -210,14 +210,16 @@
210 }
211
212 iBio = BIO_new_ssl_connect(sslCtx);
213 BIO_get_ssl(iBio, &ssl);
214
 
215 if( !SSL_set_tlsext_host_name(ssl, g.urlName) ){
216 fossil_warning("WARNING: failed to set server name indication (SNI), "
217 "continuing without it.\n");
218 }
 
219
220 SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
221 if( iBio==NULL ) {
222 ssl_set_errmsg("SSL: cannot open SSL (%s)",
223 ERR_reason_error_string(ERR_get_error()));
224
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -210,14 +210,16 @@
210 }
211
212 iBio = BIO_new_ssl_connect(sslCtx);
213 BIO_get_ssl(iBio, &ssl);
214
215 #if (SSLEAY_VERSION_NUMBER >= 0x00908070) && !defined(OPENSSL_NO_TLSEXT)
216 if( !SSL_set_tlsext_host_name(ssl, g.urlName) ){
217 fossil_warning("WARNING: failed to set server name indication (SNI), "
218 "continuing without it.\n");
219 }
220 #endif
221
222 SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
223 if( iBio==NULL ) {
224 ssl_set_errmsg("SSL: cannot open SSL (%s)",
225 ERR_reason_error_string(ERR_get_error()));
226

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button