Hex Artifact Content

Artifact 488956d001a872889cfd2339d8b400c298b4b198:


0000: 41 43 5f 44 45 46 55 4e 28 5b 54 43 4c 54 4c 53  AC_DEFUN([TCLTLS
0010: 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c 5d 2c 20 5b  _SSL_OPENSSL], [
0020: 0a 09 6f 70 65 6e 73 73 6c 64 69 72 3d 27 27 0a  ..openssldir=''.
0030: 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 73 73  .AC_ARG_WITH([ss
0040: 6c 2d 64 69 72 5d 2c 0a 09 09 41 53 5f 48 45 4c  l-dir],...AS_HEL
0050: 50 5f 53 54 52 49 4e 47 28 0a 09 09 09 5b 2d 2d  P_STRING(....[--
0060: 77 69 74 68 2d 73 73 6c 2d 64 69 72 3d 3c 64 69  with-ssl-dir=<di
0070: 72 3e 5d 2c 0a 09 09 09 5b 64 65 70 72 65 63 61  r>],....[depreca
0080: 74 65 64 2c 20 75 73 65 20 2d 2d 77 69 74 68 2d  ted, use --with-
0090: 6f 70 65 6e 73 73 6c 2d 64 69 72 20 2d 2d 20 63  openssl-dir -- c
00a0: 75 72 72 65 6e 74 6c 79 20 68 61 73 20 74 68 65  urrently has the
00b0: 20 73 61 6d 65 20 6d 65 61 6e 69 6e 67 5d 0a 09   same meaning]..
00c0: 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c  .), [....openssl
00d0: 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 0a 09  dir="$withval"..
00e0: 09 5d 0a 09 29 0a 09 41 43 5f 41 52 47 5f 57 49  .]..)..AC_ARG_WI
00f0: 54 48 28 5b 6f 70 65 6e 73 73 6c 2d 64 69 72 5d  TH([openssl-dir]
0100: 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49  ,...AS_HELP_STRI
0110: 4e 47 28 0a 09 09 09 5b 2d 2d 77 69 74 68 2d 6f  NG(....[--with-o
0120: 70 65 6e 73 73 6c 2d 64 69 72 3d 3c 64 69 72 3e  penssl-dir=<dir>
0130: 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 72  ],....[path to r
0140: 6f 6f 74 20 64 69 72 65 63 74 6f 72 79 20 6f 66  oot directory of
0150: 20 4f 70 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72   OpenSSL or Libr
0160: 65 53 53 4c 20 69 6e 73 74 61 6c 6c 61 74 69 6f  eSSL installatio
0170: 6e 5d 0a 09 09 29 2c 20 5b 0a 09 09 09 6f 70 65  n]...), [....ope
0180: 6e 73 73 6c 64 69 72 3d 22 24 77 69 74 68 76 61  nssldir="$withva
0190: 6c 22 0a 09 09 5d 0a 09 29 0a 0a 09 69 66 20 74  l"...]..)...if t
01a0: 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73 6c  est -n "$openssl
01b0: 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 69 66 20  dir"; then...if 
01c0: 74 65 73 74 20 2d 65 20 22 24 6f 70 65 6e 73 73  test -e "$openss
01d0: 6c 64 69 72 2f 6c 69 62 73 73 6c 2e 24 53 48 4f  ldir/libssl.$SHO
01e0: 42 4a 45 58 54 22 3b 20 74 68 65 6e 0a 09 09 09  BJEXT"; then....
01f0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d  TCLTLS_SSL_LIBS=
0200: 22 2d 4c 24 6f 70 65 6e 73 73 6c 64 69 72 20 2d  "-L$openssldir -
0210: 6c 73 73 6c 20 2d 6c 63 72 79 70 74 6f 22 0a 09  lssl -lcrypto"..
0220: 09 09 6f 70 65 6e 73 73 6c 64 69 72 3d 22 60 41  ..openssldir="`A
0230: 53 5f 44 49 52 4e 41 4d 45 28 5b 22 24 6f 70 65  S_DIRNAME(["$ope
0240: 6e 73 73 6c 64 69 72 22 5d 29 60 22 0a 09 09 65  nssldir"])`"...e
0250: 6c 73 65 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53  lse....TCLTLS_SS
0260: 4c 5f 4c 49 42 53 3d 22 2d 4c 24 6f 70 65 6e 73  L_LIBS="-L$opens
0270: 73 6c 64 69 72 2f 6c 69 62 20 2d 6c 73 73 6c 20  sldir/lib -lssl 
0280: 2d 6c 63 72 79 70 74 6f 22 0a 09 09 66 69 0a 09  -lcrypto"...fi..
0290: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41  .TCLTLS_SSL_CFLA
02a0: 47 53 3d 22 2d 49 24 6f 70 65 6e 73 73 6c 64 69  GS="-I$openssldi
02b0: 72 2f 69 6e 63 6c 75 64 65 22 0a 09 09 54 43 4c  r/include"...TCL
02c0: 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41 47 53  TLS_SSL_CPPFLAGS
02d0: 3d 22 2d 49 24 6f 70 65 6e 73 73 6c 64 69 72 2f  ="-I$openssldir/
02e0: 69 6e 63 6c 75 64 65 22 0a 09 66 69 0a 0a 09 64  include"..fi...d
02f0: 6e 6c 20 55 73 65 20 70 6b 67 2d 63 6f 6e 66 69  nl Use pkg-confi
0300: 67 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6c 69  g to find the li
0310: 62 72 61 72 69 65 73 0a 09 41 43 5f 41 52 47 5f  braries..AC_ARG_
0320: 56 41 52 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f  VAR([TCLTLS_SSL_
0330: 4c 49 42 53 5d 2c 20 5b 6c 69 62 72 61 72 69 65  LIBS], [librarie
0340: 73 20 74 6f 20 70 61 73 73 20 74 6f 20 74 68 65  s to pass to the
0350: 20 6c 69 6e 6b 65 72 20 66 6f 72 20 4f 70 65 6e   linker for Open
0360: 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d  SSL or LibreSSL]
0370: 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54  )..AC_ARG_VAR([T
0380: 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53  CLTLS_SSL_CFLAGS
0390: 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c 65 72 20 66  ], [C compiler f
03a0: 6c 61 67 73 20 66 6f 72 20 4f 70 65 6e 53 53 4c  lags for OpenSSL
03b0: 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a 09   or LibreSSL])..
03c0: 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c 54  AC_ARG_VAR([TCLT
03d0: 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41 47 53 5d  LS_SSL_CPPFLAGS]
03e0: 2c 20 5b 43 20 70 72 65 70 72 6f 63 65 73 73 6f  , [C preprocesso
03f0: 72 20 66 6c 61 67 73 20 66 6f 72 20 4f 70 65 6e  r flags for Open
0400: 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d  SSL or LibreSSL]
0410: 29 0a 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24  )..if test -z "$
0420: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22  TCLTLS_SSL_LIBS"
0430: 3b 20 74 68 65 6e 0a 09 09 54 43 4c 54 4c 53 5f  ; then...TCLTLS_
0440: 53 53 4c 5f 4c 49 42 53 3d 22 60 22 24 7b 50 4b  SSL_LIBS="`"${PK
0450: 47 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73  GCONFIG}" openss
0460: 6c 20 2d 2d 6c 69 62 73 60 22 20 7c 7c 20 41 43  l --libs`" || AC
0470: 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62  _MSG_ERROR([Unab
0480: 6c 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 53  le to get OpenSS
0490: 4c 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d  L Configuration]
04a0: 29 0a 09 66 69 0a 09 69 66 20 74 65 73 74 20 2d  )..fi..if test -
04b0: 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43  z "$TCLTLS_SSL_C
04c0: 46 4c 41 47 53 22 3b 20 74 68 65 6e 0a 09 09 54  FLAGS"; then...T
04d0: 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53  CLTLS_SSL_CFLAGS
04e0: 3d 22 60 22 24 7b 50 4b 47 43 4f 4e 46 49 47 7d  ="`"${PKGCONFIG}
04f0: 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61  " openssl --cfla
0500: 67 73 2d 6f 6e 6c 79 2d 6f 74 68 65 72 60 22 20  gs-only-other`" 
0510: 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28  || AC_MSG_ERROR(
0520: 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f  [Unable to get O
0530: 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61  penSSL Configura
0540: 74 69 6f 6e 5d 29 0a 09 66 69 0a 09 69 66 20 74  tion])..fi..if t
0550: 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c 53 5f  est -z "$TCLTLS_
0560: 53 53 4c 5f 43 50 50 46 4c 41 47 53 22 3b 20 74  SSL_CPPFLAGS"; t
0570: 68 65 6e 0a 09 09 54 43 4c 54 4c 53 5f 53 53 4c  hen...TCLTLS_SSL
0580: 5f 43 50 50 46 4c 41 47 53 3d 22 60 22 24 7b 50  _CPPFLAGS="`"${P
0590: 4b 47 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73  KGCONFIG}" opens
05a0: 73 6c 20 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79  sl --cflags-only
05b0: 2d 49 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45  -I`" || AC_MSG_E
05c0: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20  RROR([Unable to 
05d0: 67 65 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66  get OpenSSL Conf
05e0: 69 67 75 72 61 74 69 6f 6e 5d 29 0a 09 66 69 0a  iguration])..fi.
05f0: 0a 09 64 6e 6c 20 53 61 76 65 20 63 6f 6d 70 69  ..dnl Save compi
0600: 6c 65 2d 61 6c 74 65 72 69 6e 67 20 76 61 72 69  le-altering vari
0610: 61 62 6c 65 73 20 77 65 20 61 72 65 20 63 68 61  ables we are cha
0620: 6e 67 69 6e 67 0a 09 53 41 56 45 5f 4c 49 42 53  nging..SAVE_LIBS
0630: 3d 22 24 7b 4c 49 42 53 7d 22 0a 09 53 41 56 45  ="${LIBS}"..SAVE
0640: 5f 43 46 4c 41 47 53 3d 22 24 7b 43 46 4c 41 47  _CFLAGS="${CFLAG
0650: 53 7d 22 0a 09 53 41 56 45 5f 43 50 50 46 4c 41  S}"..SAVE_CPPFLA
0660: 47 53 3d 22 24 7b 43 50 50 46 4c 41 47 53 7d 22  GS="${CPPFLAGS}"
0670: 0a 0a 09 64 6e 6c 20 55 70 64 61 74 65 20 63 6f  ...dnl Update co
0680: 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 20 76  mpile-altering v
0690: 61 72 69 61 62 6c 65 73 20 74 6f 20 69 6e 63 6c  ariables to incl
06a0: 75 64 65 20 74 68 65 20 4f 70 65 6e 53 53 4c 20  ude the OpenSSL 
06b0: 6c 69 62 72 61 72 69 65 73 0a 09 4c 49 42 53 3d  libraries..LIBS=
06c0: 22 24 7b 53 41 56 45 5f 4c 49 42 53 7d 20 24 7b  "${SAVE_LIBS} ${
06d0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 7d  TCLTLS_SSL_LIBS}
06e0: 22 0a 09 43 46 4c 41 47 53 3d 22 24 7b 53 41 56  "..CFLAGS="${SAV
06f0: 45 5f 43 46 4c 41 47 53 7d 20 24 7b 54 43 4c 54  E_CFLAGS} ${TCLT
0700: 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 7d 22 0a  LS_SSL_CFLAGS}".
0710: 09 43 50 50 46 4c 41 47 53 3d 22 24 7b 53 41 56  .CPPFLAGS="${SAV
0720: 45 5f 43 50 50 46 4c 41 47 53 7d 20 24 7b 54 43  E_CPPFLAGS} ${TC
0730: 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41 47  LTLS_SSL_CPPFLAG
0740: 53 7d 22 0a 0a 09 64 6e 6c 20 56 65 72 69 66 79  S}"...dnl Verify
0750: 20 74 68 61 74 20 62 61 73 69 63 20 66 75 6e 63   that basic func
0760: 74 69 6f 6e 61 6c 69 74 79 20 69 73 20 74 68 65  tionality is the
0770: 72 65 0a 09 41 43 5f 4c 41 4e 47 5f 50 55 53 48  re..AC_LANG_PUSH
0780: 28 43 29 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43  (C)..AC_MSG_CHEC
0790: 4b 49 4e 47 28 5b 69 66 20 61 20 62 61 73 69 63  KING([if a basic
07a0: 20 4f 70 65 6e 53 53 4c 20 70 72 6f 67 72 61 6d   OpenSSL program
07b0: 20 77 6f 72 6b 73 5d 29 0a 09 41 43 5f 4c 49 4e   works])..AC_LIN
07c0: 4b 5f 49 46 45 4c 53 45 28 5b 41 43 5f 4c 41 4e  K_IFELSE([AC_LAN
07d0: 47 5f 50 52 4f 47 52 41 4d 28 5b 0a 23 69 6e 63  G_PROGRAM([.#inc
07e0: 6c 75 64 65 20 3c 6f 70 65 6e 73 73 6c 2f 73 73  lude <openssl/ss
07f0: 6c 2e 68 3e 0a 23 69 66 20 28 53 53 4c 45 41 59  l.h>.#if (SSLEAY
0800: 5f 56 45 52 53 49 4f 4e 5f 4e 55 4d 42 45 52 20  _VERSION_NUMBER 
0810: 3e 3d 20 30 78 30 39 30 37 30 30 30 4c 29 0a 23  >= 0x0907000L).#
0820: 20 69 6e 63 6c 75 64 65 20 3c 6f 70 65 6e 73 73   include <openss
0830: 6c 2f 63 6f 6e 66 2e 68 3e 0a 23 65 6e 64 69 66  l/conf.h>.#endif
0840: 0a 09 09 5d 2c 20 5b 0a 20 20 28 76 6f 69 64 29  ...], [.  (void)
0850: 53 53 4c 5f 6c 69 62 72 61 72 79 5f 69 6e 69 74  SSL_library_init
0860: 28 29 3b 0a 20 20 53 53 4c 5f 6c 6f 61 64 5f 65  ();.  SSL_load_e
0870: 72 72 6f 72 5f 73 74 72 69 6e 67 73 28 29 3b 0a  rror_strings();.
0880: 20 20 4f 50 45 4e 53 53 4c 5f 63 6f 6e 66 69 67    OPENSSL_config
0890: 28 4e 55 4c 4c 29 3b 0a 09 09 5d 29 5d 2c 20 5b  (NULL);...])], [
08a0: 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  ...AC_MSG_RESULT
08b0: 28 5b 79 65 73 5d 29 0a 09 5d 2c 20 5b 0a 09 09  ([yes])..], [...
08c0: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e  AC_MSG_RESULT([n
08d0: 6f 5d 29 0a 09 09 41 43 5f 4d 53 47 5f 45 52 52  o])...AC_MSG_ERR
08e0: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 63 6f  OR([Unable to co
08f0: 6d 70 69 6c 65 20 61 20 62 61 73 69 63 20 70 72  mpile a basic pr
0900: 6f 67 72 61 6d 20 75 73 69 6e 67 20 4f 70 65 6e  ogram using Open
0910: 53 53 4c 5d 29 0a 09 5d 29 0a 09 41 43 5f 4c 41  SSL])..])..AC_LA
0920: 4e 47 5f 50 4f 50 28 5b 43 5d 29 0a 0a 09 64 6e  NG_POP([C])...dn
0930: 6c 20 44 65 74 65 72 6d 69 6e 65 20 69 66 20 53  l Determine if S
0940: 53 4c 76 32 20 69 73 20 73 75 70 70 6f 72 74 65  SLv2 is supporte
0950: 64 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c  d..if test "$tcl
0960: 74 6c 73 5f 73 73 6c 5f 73 73 6c 32 22 20 3d 20  tls_ssl_ssl2" = 
0970: 22 74 72 75 65 22 3b 20 74 68 65 6e 0a 09 09 41  "true"; then...A
0980: 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 53 53 4c  C_CHECK_FUNC(SSL
0990: 76 32 5f 6d 65 74 68 6f 64 2c 2c 20 5b 0a 09 09  v2_method,, [...
09a0: 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 32  .tcltls_ssl_ssl2
09b0: 3d 27 66 61 6c 73 65 27 0a 09 09 5d 29 0a 09 66  ='false'...])..f
09c0: 69 0a 0a 09 69 66 20 74 65 73 74 20 22 24 74 63  i...if test "$tc
09d0: 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 32 22 20 3d  ltls_ssl_ssl2" =
09e0: 20 22 66 61 6c 73 65 22 3b 20 74 68 65 6e 0a 09   "false"; then..
09f0: 09 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 53 53  .AC_DEFINE(NO_SS
0a00: 4c 32 2c 20 5b 31 5d 2c 20 5b 44 65 66 69 6e 65  L2, [1], [Define
0a10: 20 74 68 69 73 20 74 6f 20 64 69 73 61 62 6c 65   this to disable
0a20: 20 53 53 4c 76 32 20 69 6e 20 4f 70 65 6e 53 53   SSLv2 in OpenSS
0a30: 4c 20 73 75 70 70 6f 72 74 5d 29 0a 09 66 69 0a  L support])..fi.
0a40: 0a 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20  ..dnl Determine 
0a50: 69 66 20 53 53 4c 76 33 20 69 73 20 73 75 70 70  if SSLv3 is supp
0a60: 6f 72 74 65 64 0a 09 69 66 20 74 65 73 74 20 22  orted..if test "
0a70: 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 33  $tcltls_ssl_ssl3
0a80: 22 20 3d 20 22 74 72 75 65 22 3b 20 74 68 65 6e  " = "true"; then
0a90: 0a 09 09 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43  ...AC_CHECK_FUNC
0aa0: 28 53 53 4c 76 33 5f 6d 65 74 68 6f 64 2c 2c 20  (SSLv3_method,, 
0ab0: 5b 0a 09 09 09 74 63 6c 74 6c 73 5f 73 73 6c 5f  [....tcltls_ssl_
0ac0: 73 73 6c 33 3d 27 66 61 6c 73 65 27 0a 09 09 5d  ssl3='false'...]
0ad0: 29 0a 09 66 69 0a 0a 09 69 66 20 74 65 73 74 20  )..fi...if test 
0ae0: 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c  "$tcltls_ssl_ssl
0af0: 33 22 20 3d 20 22 66 61 6c 73 65 22 3b 20 74 68  3" = "false"; th
0b00: 65 6e 0a 09 09 41 43 5f 44 45 46 49 4e 45 28 4e  en...AC_DEFINE(N
0b10: 4f 5f 53 53 4c 33 2c 20 5b 31 5d 2c 20 5b 44 65  O_SSL3, [1], [De
0b20: 66 69 6e 65 20 74 68 69 73 20 74 6f 20 64 69 73  fine this to dis
0b30: 61 62 6c 65 20 53 53 4c 76 33 20 69 6e 20 4f 70  able SSLv3 in Op
0b40: 65 6e 53 53 4c 20 73 75 70 70 6f 72 74 5d 29 0a  enSSL support]).
0b50: 09 66 69 0a 0a 09 64 6e 6c 20 44 65 74 65 72 6d  .fi...dnl Determ
0b60: 69 6e 65 20 69 66 20 54 4c 53 76 31 2e 30 20 69  ine if TLSv1.0 i
0b70: 73 20 73 75 70 70 6f 72 74 65 64 0a 09 69 66 20  s supported..if 
0b80: 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 73  test "$tcltls_ss
0b90: 6c 5f 74 6c 73 31 5f 30 22 20 3d 20 22 74 72 75  l_tls1_0" = "tru
0ba0: 65 22 3b 20 74 68 65 6e 0a 09 09 41 43 5f 43 48  e"; then...AC_CH
0bb0: 45 43 4b 5f 46 55 4e 43 28 54 4c 53 76 31 5f 6d  ECK_FUNC(TLSv1_m
0bc0: 65 74 68 6f 64 2c 2c 20 5b 0a 09 09 09 74 63 6c  ethod,, [....tcl
0bd0: 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 30 3d 27  tls_ssl_tls1_0='
0be0: 66 61 6c 73 65 27 0a 09 09 5d 29 0a 09 66 69 0a  false'...])..fi.
0bf0: 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 74  ..if test "$tclt
0c00: 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 30 22 20 3d  ls_ssl_tls1_0" =
0c10: 20 22 66 61 6c 73 65 22 3b 20 74 68 65 6e 0a 09   "false"; then..
0c20: 09 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 54 4c  .AC_DEFINE(NO_TL
0c30: 53 31 2c 20 5b 31 5d 2c 20 5b 44 65 66 69 6e 65  S1, [1], [Define
0c40: 20 74 68 69 73 20 74 6f 20 64 69 73 61 62 6c 65   this to disable
0c50: 20 54 4c 53 76 31 2e 30 20 69 6e 20 4f 70 65 6e   TLSv1.0 in Open
0c60: 53 53 4c 20 73 75 70 70 6f 72 74 5d 29 0a 09 66  SSL support])..f
0c70: 69 0a 0a 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e  i...dnl Determin
0c80: 65 20 69 66 20 54 4c 53 76 31 2e 31 20 69 73 20  e if TLSv1.1 is 
0c90: 73 75 70 70 6f 72 74 65 64 0a 09 69 66 20 74 65  supported..if te
0ca0: 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f  st "$tcltls_ssl_
0cb0: 74 6c 73 31 5f 31 22 20 3d 20 22 74 72 75 65 22  tls1_1" = "true"
0cc0: 3b 20 74 68 65 6e 0a 09 09 41 43 5f 43 48 45 43  ; then...AC_CHEC
0cd0: 4b 5f 46 55 4e 43 28 54 4c 53 76 31 5f 31 5f 6d  K_FUNC(TLSv1_1_m
0ce0: 65 74 68 6f 64 2c 2c 20 5b 0a 09 09 09 74 63 6c  ethod,, [....tcl
0cf0: 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 31 3d 27  tls_ssl_tls1_1='
0d00: 66 61 6c 73 65 27 0a 09 09 5d 29 0a 09 66 69 0a  false'...])..fi.
0d10: 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 74  ..if test "$tclt
0d20: 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 31 22 20 3d  ls_ssl_tls1_1" =
0d30: 20 22 66 61 6c 73 65 22 3b 20 74 68 65 6e 0a 09   "false"; then..
0d40: 09 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 54 4c  .AC_DEFINE(NO_TL
0d50: 53 31 5f 31 2c 20 5b 31 5d 2c 20 5b 44 65 66 69  S1_1, [1], [Defi
0d60: 6e 65 20 74 68 69 73 20 74 6f 20 64 69 73 61 62  ne this to disab
0d70: 6c 65 20 54 4c 53 76 31 2e 31 20 69 6e 20 4f 70  le TLSv1.1 in Op
0d80: 65 6e 53 53 4c 20 73 75 70 70 6f 72 74 5d 29 0a  enSSL support]).
0d90: 09 66 69 0a 0a 09 64 6e 6c 20 44 65 74 65 72 6d  .fi...dnl Determ
0da0: 69 6e 65 20 69 66 20 54 4c 53 76 31 2e 32 20 69  ine if TLSv1.2 i
0db0: 73 20 73 75 70 70 6f 72 74 65 64 0a 09 69 66 20  s supported..if 
0dc0: 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 73  test "$tcltls_ss
0dd0: 6c 5f 74 6c 73 31 5f 32 22 20 3d 20 22 74 72 75  l_tls1_2" = "tru
0de0: 65 22 3b 20 74 68 65 6e 0a 09 09 41 43 5f 43 48  e"; then...AC_CH
0df0: 45 43 4b 5f 46 55 4e 43 28 54 4c 53 76 31 5f 32  ECK_FUNC(TLSv1_2
0e00: 5f 6d 65 74 68 6f 64 2c 2c 20 5b 0a 09 09 09 74  _method,, [....t
0e10: 63 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 32  cltls_ssl_tls1_2
0e20: 3d 27 66 61 6c 73 65 27 0a 09 09 5d 29 0a 09 66  ='false'...])..f
0e30: 69 0a 0a 09 69 66 20 74 65 73 74 20 22 24 74 63  i...if test "$tc
0e40: 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 32 22  ltls_ssl_tls1_2"
0e50: 20 3d 20 22 66 61 6c 73 65 22 3b 20 74 68 65 6e   = "false"; then
0e60: 0a 09 09 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f  ...AC_DEFINE(NO_
0e70: 54 4c 53 31 5f 32 2c 20 5b 31 5d 2c 20 5b 44 65  TLS1_2, [1], [De
0e80: 66 69 6e 65 20 74 68 69 73 20 74 6f 20 64 69 73  fine this to dis
0e90: 61 62 6c 65 20 54 4c 53 76 31 2e 32 20 69 6e 20  able TLSv1.2 in 
0ea0: 4f 70 65 6e 53 53 4c 20 73 75 70 70 6f 72 74 5d  OpenSSL support]
0eb0: 29 0a 09 66 69 0a 0a 09 41 43 5f 43 41 43 48 45  )..fi...AC_CACHE
0ec0: 5f 56 41 4c 28 5b 74 63 6c 74 6c 73 5f 63 76 5f  _VAL([tcltls_cv_
0ed0: 66 75 6e 63 5f 74 6c 73 65 78 74 5f 68 6f 73 74  func_tlsext_host
0ee0: 6e 61 6d 65 5d 2c 20 5b 0a 09 09 41 43 5f 43 48  name], [...AC_CH
0ef0: 45 43 4b 5f 46 55 4e 43 28 53 53 4c 5f 73 65 74  ECK_FUNC(SSL_set
0f00: 5f 74 6c 73 65 78 74 5f 68 6f 73 74 5f 6e 61 6d  _tlsext_host_nam
0f10: 65 2c 20 5b 0a 09 09 09 74 63 6c 74 6c 73 5f 63  e, [....tcltls_c
0f20: 76 5f 66 75 6e 63 5f 74 6c 73 65 78 74 5f 68 6f  v_func_tlsext_ho
0f30: 73 74 6e 61 6d 65 3d 27 79 65 73 27 0a 09 09 5d  stname='yes'...]
0f40: 2c 20 5b 0a 09 09 09 74 63 6c 74 6c 73 5f 63 76  , [....tcltls_cv
0f50: 5f 66 75 6e 63 5f 74 6c 73 65 78 74 5f 68 6f 73  _func_tlsext_hos
0f60: 74 6e 61 6d 65 3d 27 6e 6f 27 0a 09 09 5d 29 0a  tname='no'...]).
0f70: 09 5d 29 0a 0a 09 69 66 20 74 65 73 74 20 22 24  .])...if test "$
0f80: 74 63 6c 74 6c 73 5f 63 76 5f 66 75 6e 63 5f 74  tcltls_cv_func_t
0f90: 6c 73 65 78 74 5f 68 6f 73 74 6e 61 6d 65 22 20  lsext_hostname" 
0fa0: 3d 20 27 6e 6f 27 3b 20 74 68 65 6e 0a 09 09 41  = 'no'; then...A
0fb0: 43 5f 44 45 46 49 4e 45 28 5b 4f 50 45 4e 53 53  C_DEFINE([OPENSS
0fc0: 4c 5f 4e 4f 5f 54 4c 53 45 58 54 5d 2c 20 5b 31  L_NO_TLSEXT], [1
0fd0: 5d 2c 20 5b 44 65 66 69 6e 65 20 74 68 69 73 20  ], [Define this 
0fe0: 69 66 20 79 6f 75 72 20 4f 70 65 6e 53 53 4c 20  if your OpenSSL 
0ff0: 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74  does not support
1000: 20 74 68 65 20 54 4c 53 20 45 78 74 65 6e 73 69   the TLS Extensi
1010: 6f 6e 20 66 6f 72 20 53 4e 49 5d 29 0a 09 66 69  on for SNI])..fi
1020: 0a 0a 09 64 6e 6c 20 52 65 73 74 6f 72 65 20 63  ...dnl Restore c
1030: 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 20  ompile-altering 
1040: 76 61 72 69 61 62 6c 65 73 0a 09 4c 49 42 53 3d  variables..LIBS=
1050: 22 24 7b 53 41 56 45 5f 4c 49 42 53 7d 22 0a 09  "${SAVE_LIBS}"..
1060: 43 46 4c 41 47 53 3d 22 24 7b 53 41 56 45 5f 43  CFLAGS="${SAVE_C
1070: 46 4c 41 47 53 7d 22 0a 09 43 50 50 46 4c 41 47  FLAGS}"..CPPFLAG
1080: 53 3d 22 24 7b 53 41 56 45 5f 43 50 50 46 4c 41  S="${SAVE_CPPFLA
1090: 47 53 7d 22 0a 5d 29 0a                          GS}".]).