Skip to content

Commit 79a7d21

Browse files
committed
Turn on SNI by default on hosts with resources.
1 parent 95675c7 commit 79a7d21

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,6 @@ endif()
12991299
# - CRL monitor
13001300
# - User crypto
13011301
# - Whitewood netRandom client library
1302-
# - SNI
13031302
# - Max fragment length
13041303
# - ALPN
13051304
# - Trusted CA indication
@@ -1315,8 +1314,14 @@ add_option(WOLFSSL_CRL
13151314
"Enable CRL (Use =io for inline CRL HTTP GET) (default: disabled)"
13161315
"no" "yes;no;io")
13171316

1317+
1318+
set(SNI_DEFAULT "no")
1319+
if(("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|x86|AMD64|arm64") OR
1320+
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
1321+
set(SNI_DEFAULT "yes")
1322+
endif()
13181323
set(WOLFSSL_SNI_HELP_STRING "Enable SNI (default: disabled)")
1319-
add_option(WOLFSSL_SNI ${WOLFSSL_SNI_HELP_STRING} "no" "yes;no")
1324+
add_option(WOLFSSL_SNI ${WOLFSSL_SNI_HELP_STRING} ${SNI_DEFAULT} "yes;no")
13201325

13211326
set(WOLFSSL_TLSX_HELP_STRING "Enable all TLS Extensions (default: disabled)")
13221327
add_option(WOLFSSL_TLSX ${WOLFSSL_TLSX_HELP_STRING} "no" "yes;no")

configure.ac

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4971,21 +4971,22 @@ AC_ARG_WITH([wnr],
49714971

49724972

49734973
# SNI
4974+
# enable SNI automatically for x86_64/x86/aarch64/amd64
4975+
SNI_DEFAULT=no
4976+
if test "$host_cpu" = "x86_64" || test "$host_cpu" = "x86" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"
4977+
then
4978+
SNI_DEFAULT=yes
4979+
fi
49744980
AC_ARG_ENABLE([sni],
4975-
[AS_HELP_STRING([--enable-sni],[Enable SNI (default: disabled)])],
4981+
[AS_HELP_STRING([--enable-sni],[Enable SNI (default: enabled on x86_64/x86/aarch64/amd64)])],
49764982
[ ENABLED_SNI=$enableval ],
4977-
[ ENABLED_SNI=no ]
4983+
[ ENABLED_SNI=$SNI_DEFAULT ]
49784984
)
4979-
if test "x$ENABLED_QT" = "xyes"
4985+
if test "x$ENABLED_QT" = "xyes" || test "$ENABLED_QUIC" = "yes"
49804986
then
49814987
ENABLED_SNI="yes"
49824988
fi
49834989

4984-
if test "$ENABLED_QUIC" = "yes"
4985-
then
4986-
ENABLED_SNI=yes
4987-
fi
4988-
49894990
if test "x$ENABLED_SNI" = "xyes"
49904991
then
49914992
AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"

0 commit comments

Comments
 (0)