Hex Artifact Content

Artifact f5eb83f938faf4ba405c00973b987b4d02c6f724f97abbbb2b929a258872a5be:


0000: 27 5c 22 0a 27 5c 22 20 47 65 6e 65 72 61 74 65  '\".'\" Generate
0010: 64 20 66 72 6f 6d 20 66 69 6c 65 20 27 74 6c 73  d from file 'tls
0020: 5c 26 2e 6d 61 6e 27 20 62 79 20 74 63 6c 6c 69  \&.man' by tclli
0030: 62 2f 64 6f 63 74 6f 6f 6c 73 20 77 69 74 68 20  b/doctools with 
0040: 66 6f 72 6d 61 74 20 27 6e 72 6f 66 66 27 0a 27  format 'nroff'.'
0050: 5c 22 20 43 6f 70 79 72 69 67 68 74 20 28 63 29  \" Copyright (c)
0060: 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61   1999 Matt Newma
0070: 6e 0a 27 5c 22 20 43 6f 70 79 72 69 67 68 74 20  n.'\" Copyright 
0080: 28 63 29 20 32 30 30 34 20 53 74 61 72 66 69 73  (c) 2004 Starfis
0090: 68 20 53 79 73 74 65 6d 73 0a 27 5c 22 20 43 6f  h Systems.'\" Co
00a0: 70 79 72 69 67 68 74 20 28 63 29 20 32 30 32 34  pyright (c) 2024
00b0: 20 42 72 69 61 6e 20 4f 27 48 61 67 61 6e 0a 27   Brian O'Hagan.'
00c0: 5c 22 0a 2e 54 48 20 22 74 6c 73 22 20 6e 20 32  \"..TH "tls" n 2
00d0: 5c 26 2e 30 5c 26 2e 31 20 74 6c 73 20 22 54 63  \&.0\&.1 tls "Tc
00e0: 6c 20 54 4c 53 20 65 78 74 65 6e 73 69 6f 6e 22  l TLS extension"
00f0: 0a 2e 5c 22 20 54 68 65 20 2d 2a 2d 20 6e 72 6f  ..\" The -*- nro
0100: 66 66 20 2d 2a 2d 20 64 65 66 69 6e 69 74 69 6f  ff -*- definitio
0110: 6e 73 20 62 65 6c 6f 77 20 61 72 65 20 66 6f 72  ns below are for
0120: 20 73 75 70 70 6c 65 6d 65 6e 74 61 6c 20 6d 61   supplemental ma
0130: 63 72 6f 73 20 75 73 65 64 0a 2e 5c 22 20 69 6e  cros used..\" in
0140: 20 54 63 6c 2f 54 6b 20 6d 61 6e 75 61 6c 20 65   Tcl/Tk manual e
0150: 6e 74 72 69 65 73 2e 0a 2e 5c 22 0a 2e 5c 22 20  ntries...\"..\" 
0160: 2e 41 50 20 74 79 70 65 20 6e 61 6d 65 20 69 6e  .AP type name in
0170: 2f 6f 75 74 20 3f 69 6e 64 65 6e 74 3f 0a 2e 5c  /out ?indent?..\
0180: 22 09 53 74 61 72 74 20 70 61 72 61 67 72 61 70  ".Start paragrap
0190: 68 20 64 65 73 63 72 69 62 69 6e 67 20 61 6e 20  h describing an 
01a0: 61 72 67 75 6d 65 6e 74 20 74 6f 20 61 20 6c 69  argument to a li
01b0: 62 72 61 72 79 20 70 72 6f 63 65 64 75 72 65 2e  brary procedure.
01c0: 0a 2e 5c 22 09 74 79 70 65 20 69 73 20 74 79 70  ..\".type is typ
01d0: 65 20 6f 66 20 61 72 67 75 6d 65 6e 74 20 28 69  e of argument (i
01e0: 6e 74 2c 20 65 74 63 2e 29 2c 20 69 6e 2f 6f 75  nt, etc.), in/ou
01f0: 74 20 69 73 20 65 69 74 68 65 72 20 22 69 6e 22  t is either "in"
0200: 2c 20 22 6f 75 74 22 2c 0a 2e 5c 22 09 6f 72 20  , "out",..\".or 
0210: 22 69 6e 2f 6f 75 74 22 20 74 6f 20 64 65 73 63  "in/out" to desc
0220: 72 69 62 65 20 77 68 65 74 68 65 72 20 70 72 6f  ribe whether pro
0230: 63 65 64 75 72 65 20 72 65 61 64 73 20 6f 72 20  cedure reads or 
0240: 6d 6f 64 69 66 69 65 73 20 61 72 67 2c 0a 2e 5c  modifies arg,..\
0250: 22 09 61 6e 64 20 69 6e 64 65 6e 74 20 69 73 20  ".and indent is 
0260: 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 73 65  equivalent to se
0270: 63 6f 6e 64 20 61 72 67 20 6f 66 20 2e 49 50 20  cond arg of .IP 
0280: 28 73 68 6f 75 6c 64 6e 27 74 20 65 76 65 72 20  (shouldn't ever 
0290: 62 65 0a 2e 5c 22 09 6e 65 65 64 65 64 3b 20 20  be..\".needed;  
02a0: 75 73 65 20 2e 41 53 20 62 65 6c 6f 77 20 69 6e  use .AS below in
02b0: 73 74 65 61 64 29 0a 2e 5c 22 0a 2e 5c 22 20 2e  stead)..\"..\" .
02c0: 41 53 20 3f 74 79 70 65 3f 20 3f 6e 61 6d 65 3f  AS ?type? ?name?
02d0: 0a 2e 5c 22 09 47 69 76 65 20 6d 61 78 69 6d 75  ..\".Give maximu
02e0: 6d 20 73 69 7a 65 73 20 6f 66 20 61 72 67 75 6d  m sizes of argum
02f0: 65 6e 74 73 20 66 6f 72 20 73 65 74 74 69 6e 67  ents for setting
0300: 20 74 61 62 20 73 74 6f 70 73 2e 20 20 54 79 70   tab stops.  Typ
0310: 65 20 61 6e 64 0a 2e 5c 22 09 6e 61 6d 65 20 61  e and..\".name a
0320: 72 65 20 65 78 61 6d 70 6c 65 73 20 6f 66 20 6c  re examples of l
0330: 61 72 67 65 73 74 20 70 6f 73 73 69 62 6c 65 20  argest possible 
0340: 61 72 67 75 6d 65 6e 74 73 20 74 68 61 74 20 77  arguments that w
0350: 69 6c 6c 20 62 65 20 70 61 73 73 65 64 0a 2e 5c  ill be passed..\
0360: 22 09 74 6f 20 2e 41 50 20 6c 61 74 65 72 2e 20  ".to .AP later. 
0370: 20 49 66 20 61 72 67 73 20 61 72 65 20 6f 6d 69   If args are omi
0380: 74 74 65 64 2c 20 64 65 66 61 75 6c 74 20 74 61  tted, default ta
0390: 62 20 73 74 6f 70 73 20 61 72 65 20 75 73 65 64  b stops are used
03a0: 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 42 53 0a 2e 5c  ...\"..\" .BS..\
03b0: 22 09 53 74 61 72 74 20 62 6f 78 20 65 6e 63 6c  ".Start box encl
03c0: 6f 73 75 72 65 2e 20 20 46 72 6f 6d 20 68 65 72  osure.  From her
03d0: 65 20 75 6e 74 69 6c 20 6e 65 78 74 20 2e 42 45  e until next .BE
03e0: 2c 20 65 76 65 72 79 74 68 69 6e 67 20 77 69 6c  , everything wil
03f0: 6c 20 62 65 0a 2e 5c 22 09 65 6e 63 6c 6f 73 65  l be..\".enclose
0400: 64 20 69 6e 20 6f 6e 65 20 6c 61 72 67 65 20 62  d in one large b
0410: 6f 78 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 42 45 0a  ox...\"..\" .BE.
0420: 2e 5c 22 09 45 6e 64 20 6f 66 20 62 6f 78 20 65  .\".End of box e
0430: 6e 63 6c 6f 73 75 72 65 2e 0a 2e 5c 22 0a 2e 5c  nclosure...\"..\
0440: 22 20 2e 43 53 0a 2e 5c 22 09 42 65 67 69 6e 20  " .CS..\".Begin 
0450: 63 6f 64 65 20 65 78 63 65 72 70 74 2e 0a 2e 5c  code excerpt...\
0460: 22 0a 2e 5c 22 20 2e 43 45 0a 2e 5c 22 09 45 6e  "..\" .CE..\".En
0470: 64 20 63 6f 64 65 20 65 78 63 65 72 70 74 2e 0a  d code excerpt..
0480: 2e 5c 22 0a 2e 5c 22 20 2e 56 53 20 3f 76 65 72  .\"..\" .VS ?ver
0490: 73 69 6f 6e 3f 20 3f 62 72 3f 0a 2e 5c 22 09 42  sion? ?br?..\".B
04a0: 65 67 69 6e 20 76 65 72 74 69 63 61 6c 20 73 69  egin vertical si
04b0: 64 65 62 61 72 2c 20 66 6f 72 20 75 73 65 20 69  debar, for use i
04c0: 6e 20 6d 61 72 6b 69 6e 67 20 6e 65 77 6c 79 2d  n marking newly-
04d0: 63 68 61 6e 67 65 64 20 70 61 72 74 73 0a 2e 5c  changed parts..\
04e0: 22 09 6f 66 20 6d 61 6e 20 70 61 67 65 73 2e 20  ".of man pages. 
04f0: 20 54 68 65 20 66 69 72 73 74 20 61 72 67 75 6d   The first argum
0500: 65 6e 74 20 69 73 20 69 67 6e 6f 72 65 64 20 61  ent is ignored a
0510: 6e 64 20 75 73 65 64 20 66 6f 72 20 72 65 63 6f  nd used for reco
0520: 72 64 69 6e 67 0a 2e 5c 22 09 74 68 65 20 76 65  rding..\".the ve
0530: 72 73 69 6f 6e 20 77 68 65 6e 20 74 68 65 20 2e  rsion when the .
0540: 56 53 20 77 61 73 20 61 64 64 65 64 2c 20 73 6f  VS was added, so
0550: 20 74 68 61 74 20 74 68 65 20 73 69 64 65 62 61   that the sideba
0560: 72 73 20 63 61 6e 20 62 65 0a 2e 5c 22 09 66 6f  rs can be..\".fo
0570: 75 6e 64 20 61 6e 64 20 72 65 6d 6f 76 65 64 20  und and removed 
0580: 77 68 65 6e 20 74 68 65 79 20 72 65 61 63 68 20  when they reach 
0590: 61 20 63 65 72 74 61 69 6e 20 61 67 65 2e 20 20  a certain age.  
05a0: 49 66 20 61 6e 6f 74 68 65 72 20 61 72 67 75 6d  If another argum
05b0: 65 6e 74 0a 2e 5c 22 09 69 73 20 70 72 65 73 65  ent..\".is prese
05c0: 6e 74 2c 20 74 68 65 6e 20 61 20 6c 69 6e 65 20  nt, then a line 
05d0: 62 72 65 61 6b 20 69 73 20 66 6f 72 63 65 64 20  break is forced 
05e0: 62 65 66 6f 72 65 20 73 74 61 72 74 69 6e 67 20  before starting 
05f0: 74 68 65 20 73 69 64 65 62 61 72 2e 0a 2e 5c 22  the sidebar...\"
0600: 0a 2e 5c 22 20 2e 56 45 0a 2e 5c 22 09 45 6e 64  ..\" .VE..\".End
0610: 20 6f 66 20 76 65 72 74 69 63 61 6c 20 73 69 64   of vertical sid
0620: 65 62 61 72 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 44  ebar...\"..\" .D
0630: 53 0a 2e 5c 22 09 42 65 67 69 6e 20 61 6e 20 69  S..\".Begin an i
0640: 6e 64 65 6e 74 65 64 20 75 6e 66 69 6c 6c 65 64  ndented unfilled
0650: 20 64 69 73 70 6c 61 79 2e 0a 2e 5c 22 0a 2e 5c   display...\"..\
0660: 22 20 2e 44 45 0a 2e 5c 22 09 45 6e 64 20 6f 66  " .DE..\".End of
0670: 20 69 6e 64 65 6e 74 65 64 20 75 6e 66 69 6c 6c   indented unfill
0680: 65 64 20 64 69 73 70 6c 61 79 2e 0a 2e 5c 22 0a  ed display...\".
0690: 2e 5c 22 20 2e 53 4f 20 3f 6d 61 6e 70 61 67 65  .\" .SO ?manpage
06a0: 3f 0a 2e 5c 22 09 53 74 61 72 74 20 6f 66 20 6c  ?..\".Start of l
06b0: 69 73 74 20 6f 66 20 73 74 61 6e 64 61 72 64 20  ist of standard 
06c0: 6f 70 74 69 6f 6e 73 20 66 6f 72 20 61 20 54 6b  options for a Tk
06d0: 20 77 69 64 67 65 74 2e 20 54 68 65 20 6d 61 6e   widget. The man
06e0: 70 61 67 65 0a 2e 5c 22 09 61 72 67 75 6d 65 6e  page..\".argumen
06f0: 74 20 64 65 66 69 6e 65 73 20 77 68 65 72 65 20  t defines where 
0700: 74 6f 20 6c 6f 6f 6b 20 75 70 20 74 68 65 20 73  to look up the s
0710: 74 61 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 3b  tandard options;
0720: 20 69 66 0a 2e 5c 22 09 6f 6d 69 74 74 65 64 2c   if..\".omitted,
0730: 20 64 65 66 61 75 6c 74 73 20 74 6f 20 22 6f 70   defaults to "op
0740: 74 69 6f 6e 73 22 2e 20 54 68 65 20 6f 70 74 69  tions". The opti
0750: 6f 6e 73 20 66 6f 6c 6c 6f 77 20 6f 6e 20 73 75  ons follow on su
0760: 63 63 65 73 73 69 76 65 0a 2e 5c 22 09 6c 69 6e  ccessive..\".lin
0770: 65 73 2c 20 69 6e 20 74 68 72 65 65 20 63 6f 6c  es, in three col
0780: 75 6d 6e 73 20 73 65 70 61 72 61 74 65 64 20 62  umns separated b
0790: 79 20 74 61 62 73 2e 0a 2e 5c 22 0a 2e 5c 22 20  y tabs...\"..\" 
07a0: 2e 53 45 0a 2e 5c 22 09 45 6e 64 20 6f 66 20 6c  .SE..\".End of l
07b0: 69 73 74 20 6f 66 20 73 74 61 6e 64 61 72 64 20  ist of standard 
07c0: 6f 70 74 69 6f 6e 73 20 66 6f 72 20 61 20 54 6b  options for a Tk
07d0: 20 77 69 64 67 65 74 2e 0a 2e 5c 22 0a 2e 5c 22   widget...\"..\"
07e0: 20 2e 4f 50 20 63 6d 64 4e 61 6d 65 20 64 62 4e   .OP cmdName dbN
07f0: 61 6d 65 20 64 62 43 6c 61 73 73 0a 2e 5c 22 09  ame dbClass..\".
0800: 53 74 61 72 74 20 6f 66 20 64 65 73 63 72 69 70  Start of descrip
0810: 74 69 6f 6e 20 6f 66 20 61 20 73 70 65 63 69 66  tion of a specif
0820: 69 63 20 6f 70 74 69 6f 6e 2e 20 20 63 6d 64 4e  ic option.  cmdN
0830: 61 6d 65 20 67 69 76 65 73 20 74 68 65 0a 2e 5c  ame gives the..\
0840: 22 09 6f 70 74 69 6f 6e 27 73 20 6e 61 6d 65 20  ".option's name 
0850: 61 73 20 73 70 65 63 69 66 69 65 64 20 69 6e 20  as specified in 
0860: 74 68 65 20 63 6c 61 73 73 20 63 6f 6d 6d 61 6e  the class comman
0870: 64 2c 20 64 62 4e 61 6d 65 20 67 69 76 65 73 0a  d, dbName gives.
0880: 2e 5c 22 09 74 68 65 20 6f 70 74 69 6f 6e 27 73  .\".the option's
0890: 20 6e 61 6d 65 20 69 6e 20 74 68 65 20 6f 70 74   name in the opt
08a0: 69 6f 6e 20 64 61 74 61 62 61 73 65 2c 20 61 6e  ion database, an
08b0: 64 20 64 62 43 6c 61 73 73 20 67 69 76 65 73 0a  d dbClass gives.
08c0: 2e 5c 22 09 74 68 65 20 6f 70 74 69 6f 6e 27 73  .\".the option's
08d0: 20 63 6c 61 73 73 20 69 6e 20 74 68 65 20 6f 70   class in the op
08e0: 74 69 6f 6e 20 64 61 74 61 62 61 73 65 2e 0a 2e  tion database...
08f0: 5c 22 0a 2e 5c 22 20 2e 55 4c 20 61 72 67 31 20  \"..\" .UL arg1 
0900: 61 72 67 32 0a 2e 5c 22 09 50 72 69 6e 74 20 61  arg2..\".Print a
0910: 72 67 31 20 75 6e 64 65 72 6c 69 6e 65 64 2c 20  rg1 underlined, 
0920: 74 68 65 6e 20 70 72 69 6e 74 20 61 72 67 32 20  then print arg2 
0930: 6e 6f 72 6d 61 6c 6c 79 2e 0a 2e 5c 22 0a 2e 5c  normally...\"..\
0940: 22 20 2e 51 57 20 61 72 67 31 20 3f 61 72 67 32  " .QW arg1 ?arg2
0950: 3f 0a 2e 5c 22 09 50 72 69 6e 74 20 61 72 67 31  ?..\".Print arg1
0960: 20 69 6e 20 71 75 6f 74 65 73 2c 20 74 68 65 6e   in quotes, then
0970: 20 61 72 67 32 20 6e 6f 72 6d 61 6c 6c 79 20 28   arg2 normally (
0980: 66 6f 72 20 74 72 61 69 6c 69 6e 67 20 70 75 6e  for trailing pun
0990: 63 74 75 61 74 69 6f 6e 29 2e 0a 2e 5c 22 0a 2e  ctuation)...\"..
09a0: 5c 22 20 2e 50 51 20 61 72 67 31 20 3f 61 72 67  \" .PQ arg1 ?arg
09b0: 32 3f 0a 2e 5c 22 09 50 72 69 6e 74 20 61 6e 20  2?..\".Print an 
09c0: 6f 70 65 6e 20 70 61 72 65 6e 74 68 65 73 69 73  open parenthesis
09d0: 2c 20 61 72 67 31 20 69 6e 20 71 75 6f 74 65 73  , arg1 in quotes
09e0: 2c 20 74 68 65 6e 20 61 72 67 32 20 6e 6f 72 6d  , then arg2 norm
09f0: 61 6c 6c 79 0a 2e 5c 22 09 28 66 6f 72 20 74 72  ally..\".(for tr
0a00: 61 69 6c 69 6e 67 20 70 75 6e 63 74 75 61 74 69  ailing punctuati
0a10: 6f 6e 29 20 61 6e 64 20 74 68 65 6e 20 61 20 63  on) and then a c
0a20: 6c 6f 73 69 6e 67 20 70 61 72 65 6e 74 68 65 73  losing parenthes
0a30: 69 73 2e 0a 2e 5c 22 0a 2e 5c 22 09 23 20 53 65  is...\"..\".# Se
0a40: 74 20 75 70 20 74 72 61 70 73 20 61 6e 64 20 6f  t up traps and o
0a50: 74 68 65 72 20 6d 69 73 63 65 6c 6c 61 6e 65 6f  ther miscellaneo
0a60: 75 73 20 73 74 75 66 66 20 66 6f 72 20 54 63 6c  us stuff for Tcl
0a70: 2f 54 6b 20 6d 61 6e 20 70 61 67 65 73 2e 0a 2e  /Tk man pages...
0a80: 69 66 20 74 20 2e 77 68 20 2d 31 2e 33 69 20 5e  if t .wh -1.3i ^
0a90: 42 0a 2e 6e 72 20 5e 6c 20 5c 6e 28 2e 6c 0a 2e  B..nr ^l \n(.l..
0aa0: 61 64 20 62 0a 2e 5c 22 09 23 20 53 74 61 72 74  ad b..\".# Start
0ab0: 20 61 6e 20 61 72 67 75 6d 65 6e 74 20 64 65 73   an argument des
0ac0: 63 72 69 70 74 69 6f 6e 0a 2e 64 65 20 41 50 0a  cription..de AP.
0ad0: 2e 69 65 20 21 22 5c 5c 24 34 22 22 20 2e 54 50  .ie !"\\$4"" .TP
0ae0: 20 5c 5c 24 34 0a 2e 65 6c 20 5c 7b 5c 0a 2e 20   \\$4..el \{\.. 
0af0: 20 20 69 65 20 21 22 5c 5c 24 32 22 22 20 2e 54    ie !"\\$2"" .T
0b00: 50 20 5c 5c 6e 28 29 43 75 0a 2e 20 20 20 65 6c  P \\n()Cu..   el
0b10: 20 20 20 20 20 20 20 20 20 20 2e 54 50 20 31 35            .TP 15
0b20: 0a 2e 5c 7d 0a 2e 74 61 20 5c 5c 6e 28 29 41 75  ..\}..ta \\n()Au
0b30: 20 5c 5c 6e 28 29 42 75 0a 2e 69 65 20 21 22 5c   \\n()Bu..ie !"\
0b40: 5c 24 33 22 22 20 5c 7b 5c 0a 5c 26 5c 5c 24 31  \$3"" \{\.\&\\$1
0b50: 20 5c 5c 66 49 5c 5c 24 32 5c 5c 66 50 20 28 5c   \\fI\\$2\\fP (\
0b60: 5c 24 33 29 0a 2e 5c 22 2e 62 0a 2e 5c 7d 0a 2e  \$3)..\".b..\}..
0b70: 65 6c 20 5c 7b 5c 0a 2e 62 72 0a 2e 69 65 20 21  el \{\..br..ie !
0b80: 22 5c 5c 24 32 22 22 20 5c 7b 5c 0a 5c 26 5c 5c  "\\$2"" \{\.\&\\
0b90: 24 31 09 5c 5c 66 49 5c 5c 24 32 5c 5c 66 50 0a  $1.\\fI\\$2\\fP.
0ba0: 2e 5c 7d 0a 2e 65 6c 20 5c 7b 5c 0a 5c 26 5c 5c  .\}..el \{\.\&\\
0bb0: 66 49 5c 5c 24 31 5c 5c 66 50 0a 2e 5c 7d 0a 2e  fI\\$1\\fP..\}..
0bc0: 5c 7d 0a 2e 2e 0a 2e 5c 22 09 23 20 64 65 66 69  \}.....\".# defi
0bd0: 6e 65 20 74 61 62 62 69 6e 67 20 76 61 6c 75 65  ne tabbing value
0be0: 73 20 66 6f 72 20 2e 41 50 0a 2e 64 65 20 41 53  s for .AP..de AS
0bf0: 0a 2e 6e 72 20 29 41 20 31 30 6e 0a 2e 69 66 20  ..nr )A 10n..if 
0c00: 21 22 5c 5c 24 31 22 22 20 2e 6e 72 20 29 41 20  !"\\$1"" .nr )A 
0c10: 5c 5c 77 27 5c 5c 24 31 27 75 2b 33 6e 0a 2e 6e  \\w'\\$1'u+3n..n
0c20: 72 20 29 42 20 5c 5c 6e 28 29 41 75 2b 31 35 6e  r )B \\n()Au+15n
0c30: 0a 2e 5c 22 0a 2e 69 66 20 21 22 5c 5c 24 32 22  ..\"..if !"\\$2"
0c40: 22 20 2e 6e 72 20 29 42 20 5c 5c 77 27 5c 5c 24  " .nr )B \\w'\\$
0c50: 32 27 75 2b 5c 5c 6e 28 29 41 75 2b 33 6e 0a 2e  2'u+\\n()Au+3n..
0c60: 6e 72 20 29 43 20 5c 5c 6e 28 29 42 75 2b 5c 5c  nr )C \\n()Bu+\\
0c70: 77 27 28 69 6e 2f 6f 75 74 29 27 75 2b 32 6e 0a  w'(in/out)'u+2n.
0c80: 2e 2e 0a 2e 41 53 20 54 63 6c 5f 49 6e 74 65 72  ....AS Tcl_Inter
0c90: 70 20 54 63 6c 5f 43 72 65 61 74 65 49 6e 74 65  p Tcl_CreateInte
0ca0: 72 70 20 69 6e 2f 6f 75 74 0a 2e 5c 22 09 23 20  rp in/out..\".# 
0cb0: 42 53 20 2d 20 73 74 61 72 74 20 62 6f 78 65 64  BS - start boxed
0cc0: 20 74 65 78 74 0a 2e 5c 22 09 23 20 5e 79 20 3d   text..\".# ^y =
0cd0: 20 73 74 61 72 74 69 6e 67 20 79 20 6c 6f 63 61   starting y loca
0ce0: 74 69 6f 6e 0a 2e 5c 22 09 23 20 5e 62 20 3d 20  tion..\".# ^b = 
0cf0: 31 0a 2e 64 65 20 42 53 0a 2e 62 72 0a 2e 6d 6b  1..de BS..br..mk
0d00: 20 5e 79 0a 2e 6e 72 20 5e 62 20 31 75 0a 2e 69   ^y..nr ^b 1u..i
0d10: 66 20 6e 20 2e 6e 66 0a 2e 69 66 20 6e 20 2e 74  f n .nf..if n .t
0d20: 69 20 30 0a 2e 69 66 20 6e 20 5c 6c 27 5c 5c 6e  i 0..if n \l'\\n
0d30: 28 2e 6c 75 5c 28 75 6c 27 0a 2e 69 66 20 6e 20  (.lu\(ul'..if n 
0d40: 2e 66 69 0a 2e 2e 0a 2e 5c 22 09 23 20 42 45 20  .fi.....\".# BE 
0d50: 2d 20 65 6e 64 20 62 6f 78 65 64 20 74 65 78 74  - end boxed text
0d60: 20 28 64 72 61 77 20 62 6f 78 20 6e 6f 77 29 0a   (draw box now).
0d70: 2e 64 65 20 42 45 0a 2e 6e 66 0a 2e 74 69 20 30  .de BE..nf..ti 0
0d80: 0a 2e 6d 6b 20 5e 74 0a 2e 69 65 20 6e 20 5c 6c  ..mk ^t..ie n \l
0d90: 27 5c 5c 6e 28 5e 6c 75 5c 28 75 6c 27 0a 2e 65  '\\n(^lu\(ul'..e
0da0: 6c 20 5c 7b 5c 0a 2e 5c 22 09 44 72 61 77 20 66  l \{\..\".Draw f
0db0: 6f 75 72 2d 73 69 64 65 64 20 62 6f 78 20 6e 6f  our-sided box no
0dc0: 72 6d 61 6c 6c 79 2c 20 62 75 74 20 64 6f 6e 27  rmally, but don'
0dd0: 74 20 64 72 61 77 20 74 6f 70 20 6f 66 0a 2e 5c  t draw top of..\
0de0: 22 09 62 6f 78 20 69 66 20 74 68 65 20 62 6f 78  ".box if the box
0df0: 20 73 74 61 72 74 65 64 20 6f 6e 20 61 6e 20 65   started on an e
0e00: 61 72 6c 69 65 72 20 70 61 67 65 2e 0a 2e 69 65  arlier page...ie
0e10: 20 21 5c 5c 6e 28 5e 62 2d 31 20 5c 7b 5c 0a 5c   !\\n(^b-1 \{\.\
0e20: 68 27 2d 31 2e 35 6e 27 5c 4c 27 7c 5c 5c 6e 28  h'-1.5n'\L'|\\n(
0e30: 5e 79 75 2d 31 76 27 5c 6c 27 5c 5c 6e 28 5e 6c  ^yu-1v'\l'\\n(^l
0e40: 75 2b 33 6e 5c 28 75 6c 27 5c 4c 27 5c 5c 6e 28  u+3n\(ul'\L'\\n(
0e50: 5e 74 75 2b 31 76 2d 5c 5c 6e 28 5e 79 75 27 5c  ^tu+1v-\\n(^yu'\
0e60: 6c 27 7c 30 75 2d 31 2e 35 6e 5c 28 75 6c 27 0a  l'|0u-1.5n\(ul'.
0e70: 2e 5c 7d 0a 2e 65 6c 20 5c 7d 5c 0a 5c 68 27 2d  .\}..el \}\.\h'-
0e80: 31 2e 35 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 79 75  1.5n'\L'|\\n(^yu
0e90: 2d 31 76 27 5c 68 27 5c 5c 6e 28 5e 6c 75 2b 33  -1v'\h'\\n(^lu+3
0ea0: 6e 27 5c 4c 27 5c 5c 6e 28 5e 74 75 2b 31 76 2d  n'\L'\\n(^tu+1v-
0eb0: 5c 5c 6e 28 5e 79 75 27 5c 6c 27 7c 30 75 2d 31  \\n(^yu'\l'|0u-1
0ec0: 2e 35 6e 5c 28 75 6c 27 0a 2e 5c 7d 0a 2e 5c 7d  .5n\(ul'..\}..\}
0ed0: 0a 2e 66 69 0a 2e 62 72 0a 2e 6e 72 20 5e 62 20  ..fi..br..nr ^b 
0ee0: 30 0a 2e 2e 0a 2e 5c 22 09 23 20 56 53 20 2d 20  0.....\".# VS - 
0ef0: 73 74 61 72 74 20 76 65 72 74 69 63 61 6c 20 73  start vertical s
0f00: 69 64 65 62 61 72 0a 2e 5c 22 09 23 20 5e 59 20  idebar..\".# ^Y 
0f10: 3d 20 73 74 61 72 74 69 6e 67 20 79 20 6c 6f 63  = starting y loc
0f20: 61 74 69 6f 6e 0a 2e 5c 22 09 23 20 5e 76 20 3d  ation..\".# ^v =
0f30: 20 31 20 28 66 6f 72 20 74 72 6f 66 66 3b 20 20   1 (for troff;  
0f40: 66 6f 72 20 6e 72 6f 66 66 20 74 68 69 73 20 64  for nroff this d
0f50: 6f 65 73 6e 27 74 20 6d 61 74 74 65 72 29 0a 2e  oesn't matter)..
0f60: 64 65 20 56 53 0a 2e 69 66 20 21 22 5c 5c 24 32  de VS..if !"\\$2
0f70: 22 22 20 2e 62 72 0a 2e 6d 6b 20 5e 59 0a 2e 69  "" .br..mk ^Y..i
0f80: 65 20 6e 20 27 6d 63 20 5c 73 31 32 5c 28 62 72  e n 'mc \s12\(br
0f90: 5c 73 30 0a 2e 65 6c 20 2e 6e 72 20 5e 76 20 31  \s0..el .nr ^v 1
0fa0: 75 0a 2e 2e 0a 2e 5c 22 09 23 20 56 45 20 2d 20  u.....\".# VE - 
0fb0: 65 6e 64 20 6f 66 20 76 65 72 74 69 63 61 6c 20  end of vertical 
0fc0: 73 69 64 65 62 61 72 0a 2e 64 65 20 56 45 0a 2e  sidebar..de VE..
0fd0: 69 65 20 6e 20 27 6d 63 0a 2e 65 6c 20 5c 7b 5c  ie n 'mc..el \{\
0fe0: 0a 2e 65 76 20 32 0a 2e 6e 66 0a 2e 74 69 20 30  ..ev 2..nf..ti 0
0ff0: 0a 2e 6d 6b 20 5e 74 0a 5c 68 27 7c 5c 5c 6e 28  ..mk ^t.\h'|\\n(
1000: 5e 6c 75 2b 33 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e  ^lu+3n'\L'|\\n(^
1010: 59 75 2d 31 76 5c 28 62 76 27 5c 76 27 5c 5c 6e  Yu-1v\(bv'\v'\\n
1020: 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28 5e 59 75 27  (^tu+1v-\\n(^Yu'
1030: 5c 68 27 2d 7c 5c 5c 6e 28 5e 6c 75 2b 33 6e 27  \h'-|\\n(^lu+3n'
1040: 0a 2e 73 70 20 2d 31 0a 2e 66 69 0a 2e 65 76 0a  ..sp -1..fi..ev.
1050: 2e 5c 7d 0a 2e 6e 72 20 5e 76 20 30 0a 2e 2e 0a  .\}..nr ^v 0....
1060: 2e 5c 22 09 23 20 53 70 65 63 69 61 6c 20 6d 61  .\".# Special ma
1070: 63 72 6f 20 74 6f 20 68 61 6e 64 6c 65 20 70 61  cro to handle pa
1080: 67 65 20 62 6f 74 74 6f 6d 3a 20 20 66 69 6e 69  ge bottom:  fini
1090: 73 68 20 6f 66 66 20 63 75 72 72 65 6e 74 0a 2e  sh off current..
10a0: 5c 22 09 23 20 62 6f 78 2f 73 69 64 65 62 61 72  \".# box/sidebar
10b0: 20 69 66 20 69 6e 20 62 6f 78 2f 73 69 64 65 62   if in box/sideb
10c0: 61 72 20 6d 6f 64 65 2c 20 74 68 65 6e 20 69 6e  ar mode, then in
10d0: 76 6f 6b 65 64 20 73 74 61 6e 64 61 72 64 0a 2e  voked standard..
10e0: 5c 22 09 23 20 70 61 67 65 20 62 6f 74 74 6f 6d  \".# page bottom
10f0: 20 6d 61 63 72 6f 2e 0a 2e 64 65 20 5e 42 0a 2e   macro...de ^B..
1100: 65 76 20 32 0a 27 74 69 20 30 0a 27 6e 66 0a 2e  ev 2.'ti 0.'nf..
1110: 6d 6b 20 5e 74 0a 2e 69 66 20 5c 5c 6e 28 5e 62  mk ^t..if \\n(^b
1120: 20 5c 7b 5c 0a 2e 5c 22 09 44 72 61 77 20 74 68   \{\..\".Draw th
1130: 72 65 65 2d 73 69 64 65 64 20 62 6f 78 20 69 66  ree-sided box if
1140: 20 74 68 69 73 20 69 73 20 74 68 65 20 62 6f 78   this is the box
1150: 27 73 20 66 69 72 73 74 20 70 61 67 65 2c 0a 2e  's first page,..
1160: 5c 22 09 64 72 61 77 20 74 77 6f 20 73 69 64 65  \".draw two side
1170: 73 20 62 75 74 20 6e 6f 20 74 6f 70 20 6f 74 68  s but no top oth
1180: 65 72 77 69 73 65 2e 0a 2e 69 65 20 21 5c 5c 6e  erwise...ie !\\n
1190: 28 5e 62 2d 31 20 5c 68 27 2d 31 2e 35 6e 27 5c  (^b-1 \h'-1.5n'\
11a0: 4c 27 7c 5c 5c 6e 28 5e 79 75 2d 31 76 27 5c 6c  L'|\\n(^yu-1v'\l
11b0: 27 5c 5c 6e 28 5e 6c 75 2b 33 6e 5c 28 75 6c 27  '\\n(^lu+3n\(ul'
11c0: 5c 4c 27 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c  \L'\\n(^tu+1v-\\
11d0: 6e 28 5e 79 75 27 5c 68 27 7c 30 75 27 5c 63 0a  n(^yu'\h'|0u'\c.
11e0: 2e 65 6c 20 5c 68 27 2d 31 2e 35 6e 27 5c 4c 27  .el \h'-1.5n'\L'
11f0: 7c 5c 5c 6e 28 5e 79 75 2d 31 76 27 5c 68 27 5c  |\\n(^yu-1v'\h'\
1200: 5c 6e 28 5e 6c 75 2b 33 6e 27 5c 4c 27 5c 5c 6e  \n(^lu+3n'\L'\\n
1210: 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28 5e 79 75 27  (^tu+1v-\\n(^yu'
1220: 5c 68 27 7c 30 75 27 5c 63 0a 2e 5c 7d 0a 2e 69  \h'|0u'\c..\}..i
1230: 66 20 5c 5c 6e 28 5e 76 20 5c 7b 5c 0a 2e 6e 72  f \\n(^v \{\..nr
1240: 20 5e 78 20 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c   ^x \\n(^tu+1v-\
1250: 5c 6e 28 5e 59 75 0a 5c 6b 78 5c 68 27 2d 5c 5c  \n(^Yu.\kx\h'-\\
1260: 6e 78 75 27 5c 68 27 7c 5c 5c 6e 28 5e 6c 75 2b  nxu'\h'|\\n(^lu+
1270: 33 6e 27 5c 6b 79 5c 4c 27 2d 5c 5c 6e 28 5e 78  3n'\ky\L'-\\n(^x
1280: 75 27 5c 76 27 5c 5c 6e 28 5e 78 75 27 5c 68 27  u'\v'\\n(^xu'\h'
1290: 7c 30 75 27 5c 63 0a 2e 5c 7d 0a 2e 62 70 0a 27  |0u'\c..\}..bp.'
12a0: 66 69 0a 2e 65 76 0a 2e 69 66 20 5c 5c 6e 28 5e  fi..ev..if \\n(^
12b0: 62 20 5c 7b 5c 0a 2e 6d 6b 20 5e 79 0a 2e 6e 72  b \{\..mk ^y..nr
12c0: 20 5e 62 20 32 0a 2e 5c 7d 0a 2e 69 66 20 5c 5c   ^b 2..\}..if \\
12d0: 6e 28 5e 76 20 5c 7b 5c 0a 2e 6d 6b 20 5e 59 0a  n(^v \{\..mk ^Y.
12e0: 2e 5c 7d 0a 2e 2e 0a 2e 5c 22 09 23 20 44 53 20  .\}.....\".# DS 
12f0: 2d 20 62 65 67 69 6e 20 64 69 73 70 6c 61 79 0a  - begin display.
1300: 2e 64 65 20 44 53 0a 2e 52 53 0a 2e 6e 66 0a 2e  .de DS..RS..nf..
1310: 73 70 0a 2e 2e 0a 2e 5c 22 09 23 20 44 45 20 2d  sp.....\".# DE -
1320: 20 65 6e 64 20 64 69 73 70 6c 61 79 0a 2e 64 65   end display..de
1330: 20 44 45 0a 2e 66 69 0a 2e 52 45 0a 2e 73 70 0a   DE..fi..RE..sp.
1340: 2e 2e 0a 2e 5c 22 09 23 20 53 4f 20 2d 20 73 74  ....\".# SO - st
1350: 61 72 74 20 6f 66 20 6c 69 73 74 20 6f 66 20 73  art of list of s
1360: 74 61 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 0a  tandard options.
1370: 2e 64 65 20 53 4f 0a 27 69 65 20 27 5c 5c 24 31  .de SO.'ie '\\$1
1380: 27 27 20 2e 64 73 20 53 6f 20 5c 5c 66 42 6f 70  '' .ds So \\fBop
1390: 74 69 6f 6e 73 5c 5c 66 52 0a 27 65 6c 20 2e 64  tions\\fR.'el .d
13a0: 73 20 53 6f 20 5c 5c 66 42 5c 5c 24 31 5c 5c 66  s So \\fB\\$1\\f
13b0: 52 0a 2e 53 48 20 22 53 54 41 4e 44 41 52 44 20  R..SH "STANDARD 
13c0: 4f 50 54 49 4f 4e 53 22 0a 2e 4c 50 0a 2e 6e 66  OPTIONS"..LP..nf
13d0: 0a 2e 74 61 20 35 2e 35 63 20 31 31 63 0a 2e 66  ..ta 5.5c 11c..f
13e0: 74 20 42 0a 2e 2e 0a 2e 5c 22 09 23 20 53 45 20  t B.....\".# SE 
13f0: 2d 20 65 6e 64 20 6f 66 20 6c 69 73 74 20 6f 66  - end of list of
1400: 20 73 74 61 6e 64 61 72 64 20 6f 70 74 69 6f 6e   standard option
1410: 73 0a 2e 64 65 20 53 45 0a 2e 66 69 0a 2e 66 74  s..de SE..fi..ft
1420: 20 52 0a 2e 4c 50 0a 53 65 65 20 74 68 65 20 5c   R..LP.See the \
1430: 5c 2a 28 53 6f 20 6d 61 6e 75 61 6c 20 65 6e 74  \*(So manual ent
1440: 72 79 20 66 6f 72 20 64 65 74 61 69 6c 73 20 6f  ry for details o
1450: 6e 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 6f  n the standard o
1460: 70 74 69 6f 6e 73 2e 0a 2e 2e 0a 2e 5c 22 09 23  ptions......\".#
1470: 20 4f 50 20 2d 20 73 74 61 72 74 20 6f 66 20 66   OP - start of f
1480: 75 6c 6c 20 64 65 73 63 72 69 70 74 69 6f 6e 20  ull description 
1490: 66 6f 72 20 61 20 73 69 6e 67 6c 65 20 6f 70 74  for a single opt
14a0: 69 6f 6e 0a 2e 64 65 20 4f 50 0a 2e 4c 50 0a 2e  ion..de OP..LP..
14b0: 6e 66 0a 2e 74 61 20 34 63 0a 43 6f 6d 6d 61 6e  nf..ta 4c.Comman
14c0: 64 2d 4c 69 6e 65 20 4e 61 6d 65 3a 09 5c 5c 66  d-Line Name:.\\f
14d0: 42 5c 5c 24 31 5c 5c 66 52 0a 44 61 74 61 62 61  B\\$1\\fR.Databa
14e0: 73 65 20 4e 61 6d 65 3a 09 5c 5c 66 42 5c 5c 24  se Name:.\\fB\\$
14f0: 32 5c 5c 66 52 0a 44 61 74 61 62 61 73 65 20 43  2\\fR.Database C
1500: 6c 61 73 73 3a 09 5c 5c 66 42 5c 5c 24 33 5c 5c  lass:.\\fB\\$3\\
1510: 66 52 0a 2e 66 69 0a 2e 49 50 0a 2e 2e 0a 2e 5c  fR..fi..IP.....\
1520: 22 09 23 20 43 53 20 2d 20 62 65 67 69 6e 20 63  ".# CS - begin c
1530: 6f 64 65 20 65 78 63 65 72 70 74 0a 2e 64 65 20  ode excerpt..de 
1540: 43 53 0a 2e 52 53 0a 2e 6e 66 0a 2e 74 61 20 2e  CS..RS..nf..ta .
1550: 32 35 69 20 2e 35 69 20 2e 37 35 69 20 31 69 0a  25i .5i .75i 1i.
1560: 2e 2e 0a 2e 5c 22 09 23 20 43 45 20 2d 20 65 6e  ....\".# CE - en
1570: 64 20 63 6f 64 65 20 65 78 63 65 72 70 74 0a 2e  d code excerpt..
1580: 64 65 20 43 45 0a 2e 66 69 0a 2e 52 45 0a 2e 2e  de CE..fi..RE...
1590: 0a 2e 5c 22 09 23 20 55 4c 20 2d 20 75 6e 64 65  ..\".# UL - unde
15a0: 72 6c 69 6e 65 20 77 6f 72 64 0a 2e 64 65 20 55  rline word..de U
15b0: 4c 0a 5c 5c 24 31 5c 6c 27 7c 30 5c 28 75 6c 27  L.\\$1\l'|0\(ul'
15c0: 5c 5c 24 32 0a 2e 2e 0a 2e 5c 22 09 23 20 51 57  \\$2.....\".# QW
15d0: 20 2d 20 61 70 70 6c 79 20 71 75 6f 74 61 74 69   - apply quotati
15e0: 6f 6e 20 6d 61 72 6b 73 20 74 6f 20 77 6f 72 64  on marks to word
15f0: 0a 2e 64 65 20 51 57 0a 2e 69 65 20 27 5c 5c 2a  ..de QW..ie '\\*
1600: 28 6c 71 27 22 27 20 60 60 5c 5c 24 31 27 27 5c  (lq'"' ``\\$1''\
1610: 5c 24 32 0a 2e 5c 22 22 20 66 69 78 20 65 6d 61  \$2..\"" fix ema
1620: 63 73 20 68 69 67 68 6c 69 67 68 74 69 6e 67 0a  cs highlighting.
1630: 2e 65 6c 20 5c 5c 2a 28 6c 71 5c 5c 24 31 5c 5c  .el \\*(lq\\$1\\
1640: 2a 28 72 71 5c 5c 24 32 0a 2e 2e 0a 2e 5c 22 09  *(rq\\$2.....\".
1650: 23 20 50 51 20 2d 20 61 70 70 6c 79 20 70 61 72  # PQ - apply par
1660: 65 6e 73 20 61 6e 64 20 71 75 6f 74 61 74 69 6f  ens and quotatio
1670: 6e 20 6d 61 72 6b 73 20 74 6f 20 77 6f 72 64 0a  n marks to word.
1680: 2e 64 65 20 50 51 0a 2e 69 65 20 27 5c 5c 2a 28  .de PQ..ie '\\*(
1690: 6c 71 27 22 27 20 28 60 60 5c 5c 24 31 27 27 5c  lq'"' (``\\$1''\
16a0: 5c 24 32 29 5c 5c 24 33 0a 2e 5c 22 22 20 66 69  \$2)\\$3..\"" fi
16b0: 78 20 65 6d 61 63 73 20 68 69 67 68 6c 69 67 68  x emacs highligh
16c0: 74 69 6e 67 0a 2e 65 6c 20 28 5c 5c 2a 28 6c 71  ting..el (\\*(lq
16d0: 5c 5c 24 31 5c 5c 2a 28 72 71 5c 5c 24 32 29 5c  \\$1\\*(rq\\$2)\
16e0: 5c 24 33 0a 2e 2e 0a 2e 5c 22 09 23 20 51 52 20  \$3.....\".# QR 
16f0: 2d 20 71 75 6f 74 65 64 20 72 61 6e 67 65 0a 2e  - quoted range..
1700: 64 65 20 51 52 0a 2e 69 65 20 27 5c 5c 2a 28 6c  de QR..ie '\\*(l
1710: 71 27 22 27 20 60 60 5c 5c 24 31 27 27 5c 5c 2d  q'"' ``\\$1''\\-
1720: 60 60 5c 5c 24 32 27 27 5c 5c 24 33 0a 2e 5c 22  ``\\$2''\\$3..\"
1730: 22 20 66 69 78 20 65 6d 61 63 73 20 68 69 67 68  " fix emacs high
1740: 6c 69 67 68 74 69 6e 67 0a 2e 65 6c 20 5c 5c 2a  lighting..el \\*
1750: 28 6c 71 5c 5c 24 31 5c 5c 2a 28 72 71 5c 5c 2d  (lq\\$1\\*(rq\\-
1760: 5c 5c 2a 28 6c 71 5c 5c 24 32 5c 5c 2a 28 72 71  \\*(lq\\$2\\*(rq
1770: 5c 5c 24 33 0a 2e 2e 0a 2e 5c 22 09 23 20 4d 54  \\$3.....\".# MT
1780: 20 2d 20 22 65 6d 70 74 79 22 20 73 74 72 69 6e   - "empty" strin
1790: 67 0a 2e 64 65 20 4d 54 0a 2e 51 57 20 22 22 0a  g..de MT..QW "".
17a0: 2e 2e 0a 2e 42 53 0a 2e 53 48 20 4e 41 4d 45 0a  ....BS..SH NAME.
17b0: 74 6c 73 20 5c 2d 20 62 69 6e 64 69 6e 67 20 74  tls \- binding t
17c0: 6f 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69  o the OpenSSL li
17d0: 62 72 61 72 79 20 66 6f 72 20 65 6e 63 72 79 70  brary for encryp
17e0: 74 65 64 20 73 6f 63 6b 65 74 20 61 6e 64 20 49  ted socket and I
17f0: 2f 4f 20 63 68 61 6e 6e 65 6c 20 63 6f 6d 6d 75  /O channel commu
1800: 6e 69 63 61 74 69 6f 6e 73 0a 2e 53 48 20 53 59  nications..SH SY
1810: 4e 4f 50 53 49 53 0a 70 61 63 6b 61 67 65 20 72  NOPSIS.package r
1820: 65 71 75 69 72 65 20 5c 66 42 54 63 6c 20 38 5c  equire \fBTcl 8\
1830: 26 2e 35 2d 5c 66 52 0a 2e 73 70 0a 70 61 63 6b  &.5-\fR..sp.pack
1840: 61 67 65 20 72 65 71 75 69 72 65 20 5c 66 42 74  age require \fBt
1850: 6c 73 20 32 5c 26 2e 30 5c 26 2e 31 5c 66 52 0a  ls 2\&.0\&.1\fR.
1860: 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 69 6e 69 74  .sp.\fBtls::init
1870: 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c  \fR ?\fI-option\
1880: 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52  fR? ?\fIvalue\fR
1890: 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61  ? ?\fI-option va
18a0: 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52  lue \&.\&.\&.\fR
18b0: 3f 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 73 6f  ?..sp.\fBtls::so
18c0: 63 6b 65 74 5c 66 52 20 3f 5c 66 49 2d 6f 70 74  cket\fR ?\fI-opt
18d0: 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75  ion\fR? ?\fIvalu
18e0: 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f  e\fR? ?\fI-optio
18f0: 6e 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26  n value \&.\&.\&
1900: 2e 5c 66 52 3f 20 5c 66 49 68 6f 73 74 5c 66 52  .\fR? \fIhost\fR
1910: 20 5c 66 49 70 6f 72 74 5c 66 52 0a 2e 73 70 0a   \fIport\fR..sp.
1920: 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66  \fBtls::socket\f
1930: 52 20 5c 66 42 2d 73 65 72 76 65 72 5c 66 52 20  R \fB-server\fR 
1940: 5c 66 49 63 6f 6d 6d 61 6e 64 5c 66 52 20 3f 5c  \fIcommand\fR ?\
1950: 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c  fI-option\fR? ?\
1960: 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49  fIvalue\fR? ?\fI
1970: 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26  -option value \&
1980: 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 20 5c 66 49 70  .\&.\&.\fR? \fIp
1990: 6f 72 74 5c 66 52 0a 2e 73 70 0a 5c 66 42 74 6c  ort\fR..sp.\fBtl
19a0: 73 3a 3a 69 6d 70 6f 72 74 5c 66 52 20 5c 66 49  s::import\fR \fI
19b0: 63 68 61 6e 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d  channel\fR ?\fI-
19c0: 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76  option\fR? ?\fIv
19d0: 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70  alue\fR? ?\fI-op
19e0: 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e 5c 26  tion value \&.\&
19f0: 2e 5c 26 2e 5c 66 52 3f 0a 2e 73 70 0a 5c 66 42  .\&.\fR?..sp.\fB
1a00: 74 6c 73 3a 3a 73 74 61 72 74 74 6c 73 5c 66 52  tls::starttls\fR
1a10: 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 20 3f   \fIchannel\fR ?
1a20: 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f  \fI-option\fR? ?
1a30: 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66  \fIvalue\fR? ?\f
1a40: 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c  I-option value \
1a50: 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 0a 2e 73 70  &.\&.\&.\fR?..sp
1a60: 0a 5c 66 42 74 6c 73 3a 3a 68 61 6e 64 73 68 61  .\fBtls::handsha
1a70: 6b 65 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  ke\fR \fIchannel
1a80: 5c 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a  \fR..sp.\fBtls::
1a90: 73 68 75 74 64 6f 77 6e 5c 66 52 20 5c 66 49 63  shutdown\fR \fIc
1aa0: 68 61 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a 5c 66  hannel\fR..sp.\f
1ab0: 42 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 5c 66  Btls::unimport\f
1ac0: 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a  R \fIchannel\fR.
1ad0: 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 75 6e 73 74  .sp.\fBtls::unst
1ae0: 61 63 6b 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65  ack\fR \fIchanne
1af0: 6c 5c 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a  l\fR..sp.\fBtls:
1b00: 3a 73 74 61 74 75 73 5c 66 52 20 3f 5c 66 42 2d  :status\fR ?\fB-
1b10: 6c 6f 63 61 6c 5c 66 52 3f 20 5c 66 49 63 68 61  local\fR? \fIcha
1b20: 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a 5c 66 42 74  nnel\fR..sp.\fBt
1b30: 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 5c 66  ls::connection\f
1b40: 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a  R \fIchannel\fR.
1b50: 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 63 69 70 68  .sp.\fBtls::ciph
1b60: 65 72 73 5c 66 52 20 3f 5c 66 49 70 72 6f 74 6f  ers\fR ?\fIproto
1b70: 63 6f 6c 5c 66 52 3f 20 3f 5c 66 49 76 65 72 62  col\fR? ?\fIverb
1b80: 6f 73 65 5c 66 52 3f 20 3f 5c 66 49 73 75 70 70  ose\fR? ?\fIsupp
1b90: 6f 72 74 65 64 5c 66 52 3f 0a 2e 73 70 0a 5c 66  orted\fR?..sp.\f
1ba0: 42 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c  Btls::protocols\
1bb0: 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 76  fR..sp.\fBtls::v
1bc0: 65 72 73 69 6f 6e 5c 66 52 0a 2e 73 70 0a 2e 42  ersion\fR..sp..B
1bd0: 45 0a 2e 53 48 20 44 45 53 43 52 49 50 54 49 4f  E..SH DESCRIPTIO
1be0: 4e 0a 54 68 69 73 20 65 78 74 65 6e 73 69 6f 6e  N.This extension
1bf0: 20 70 72 6f 76 69 64 65 73 20 54 43 4c 20 73 63   provides TCL sc
1c00: 72 69 70 74 20 61 63 63 65 73 73 20 74 6f 20 53  ript access to S
1c10: 65 63 75 72 65 20 53 6f 63 6b 65 74 20 4c 61 79  ecure Socket Lay
1c20: 65 72 20 28 53 53 4c 29 0a 63 6f 6d 6d 75 6e 69  er (SSL).communi
1c30: 63 61 74 69 6f 6e 73 20 75 73 69 6e 67 20 74 68  cations using th
1c40: 65 20 54 72 61 6e 73 70 6f 72 74 20 4c 61 79 65  e Transport Laye
1c50: 72 20 53 65 63 75 72 69 74 79 20 28 54 4c 53 29  r Security (TLS)
1c60: 20 70 72 6f 74 6f 63 6f 6c 5c 26 2e 20 49 74 20   protocol\&. It 
1c70: 70 72 6f 76 69 64 65 73 20 61 0a 67 65 6e 65 72  provides a.gener
1c80: 69 63 20 62 69 6e 64 69 6e 67 20 74 6f 20 5c 66  ic binding to \f
1c90: 49 4f 70 65 6e 53 53 4c 5c 66 52 20 5b 68 74 74  IOpenSSL\fR [htt
1ca0: 70 73 3a 2f 2f 77 77 77 5c 26 2e 6f 70 65 6e 73  ps://www\&.opens
1cb0: 73 6c 5c 26 2e 6f 72 67 2f 5d 2c 20 75 74 69 6c  sl\&.org/], util
1cc0: 69 7a 69 6e 67 20 74 68 65 0a 5c 66 42 54 63 6c  izing the.\fBTcl
1cd0: 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 5c 66 52  _StackChannel\fR
1ce0: 20 41 50 49 20 69 6e 20 54 43 4c 20 38 5c 26 2e   API in TCL 8\&.
1cf0: 34 20 6f 72 20 6c 61 74 65 72 5c 26 2e 20 54 68  4 or later\&. Th
1d00: 65 73 65 20 73 6f 63 6b 65 74 73 20 62 65 68 61  ese sockets beha
1d10: 76 65 20 65 78 61 63 74 6c 79 0a 74 68 65 20 73  ve exactly.the s
1d20: 61 6d 65 20 61 73 20 63 68 61 6e 6e 65 6c 73 20  ame as channels 
1d30: 63 72 65 61 74 65 64 20 75 73 69 6e 67 20 74 68  created using th
1d40: 65 20 62 75 69 6c 74 2d 69 6e 20 5c 66 42 73 6f  e built-in \fBso
1d50: 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 2c  cket\fR command,
1d60: 20 62 75 74 0a 70 72 6f 76 69 64 65 20 61 64 64   but.provide add
1d70: 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 20  itional options 
1d80: 66 6f 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20  for controlling 
1d90: 74 68 65 20 53 53 4c 2f 54 4c 53 20 73 65 73 73  the SSL/TLS sess
1da0: 69 6f 6e 5c 26 2e 0a 2e 53 48 20 43 4f 4d 50 41  ion\&...SH COMPA
1db0: 54 49 42 49 4c 49 54 59 0a 54 68 69 73 20 65 78  TIBILITY.This ex
1dc0: 74 65 6e 73 69 6f 6e 20 69 73 20 63 6f 6d 70 61  tension is compa
1dd0: 74 69 62 6c 65 20 77 69 74 68 20 4f 70 65 6e 53  tible with OpenS
1de0: 53 4c 20 31 5c 26 2e 31 5c 26 2e 31 20 6f 72 20  SL 1\&.1\&.1 or 
1df0: 6c 61 74 65 72 5c 26 2e 20 49 74 20 72 65 71 75  later\&. It requ
1e00: 69 72 65 73 20 54 63 6c 0a 76 65 72 73 69 6f 6e  ires Tcl.version
1e10: 20 38 5c 26 2e 35 20 6f 72 20 6c 61 74 65 72 20   8\&.5 or later 
1e20: 61 6e 64 20 77 69 6c 6c 20 77 6f 72 6b 20 77 69  and will work wi
1e30: 74 68 20 54 63 6c 20 39 5c 26 2e 30 5c 26 2e 0a  th Tcl 9\&.0\&..
1e40: 2e 53 48 20 43 4f 4d 4d 41 4e 44 53 0a 54 68 65  .SH COMMANDS.The
1e50: 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 65 20 74   following are t
1e60: 68 65 20 63 6f 6d 6d 61 6e 64 73 20 70 72 6f 76  he commands prov
1e70: 69 64 65 64 20 62 79 20 74 68 65 20 54 63 4c 54  ided by the TcLT
1e80: 4c 53 20 70 61 63 6b 61 67 65 5c 26 2e 20 53 65  LS package\&. Se
1e90: 65 0a 5c 66 42 45 78 61 6d 70 6c 65 73 5c 66 52  e.\fBExamples\fR
1ea0: 20 66 6f 72 20 65 78 61 6d 70 6c 65 20 75 73 61   for example usa
1eb0: 67 65 20 61 6e 64 20 74 68 65 20 22 5c 66 49 64  ge and the "\fId
1ec0: 65 6d 6f 73 5c 66 52 22 20 64 69 72 65 63 74 6f  emos\fR" directo
1ed0: 72 79 20 66 6f 72 0a 6d 6f 72 65 20 65 78 61 6d  ry for.more exam
1ee0: 70 6c 65 20 75 73 61 67 65 5c 26 2e 0a 2e 54 50  ple usage\&...TP
1ef0: 0a 5c 66 42 74 6c 73 3a 3a 69 6e 69 74 5c 66 52  .\fBtls::init\fR
1f00: 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f   ?\fI-option\fR?
1f10: 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f   ?\fIvalue\fR? ?
1f20: 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65  \fI-option value
1f30: 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 0a 4f   \&.\&.\&.\fR?.O
1f40: 70 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f 6e  ptional function
1f50: 20 74 6f 20 73 65 74 20 74 68 65 20 64 65 66 61   to set the defa
1f60: 75 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65 64  ult options used
1f70: 20 62 79 20 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b   by \fBtls::sock
1f80: 65 74 5c 66 52 5c 26 2e 20 49 66 20 79 6f 75 0a  et\fR\&. If you.
1f90: 63 61 6c 6c 20 5c 66 42 74 6c 73 3a 3a 69 6d 70  call \fBtls::imp
1fa0: 6f 72 74 5c 66 52 20 64 69 72 65 63 74 6c 79 2c  ort\fR directly,
1fb0: 20 74 68 65 20 76 61 6c 75 65 73 20 73 65 74 20   the values set 
1fc0: 62 79 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 20  by this command 
1fd0: 68 61 76 65 20 6e 6f 20 65 66 66 65 63 74 5c 26  have no effect\&
1fe0: 2e 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 73  ..This command s
1ff0: 75 70 70 6f 72 74 73 20 61 6c 6c 20 6f 66 20 74  upports all of t
2000: 68 65 20 73 61 6d 65 20 6f 70 74 69 6f 6e 73 20  he same options 
2010: 61 73 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 73  as the \fBtls::s
2020: 6f 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64  ocket\fR command
2030: 2c 0a 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f  ,.though you sho
2040: 75 6c 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f  uld limit your o
2050: 70 74 69 6f 6e 73 20 74 6f 20 6f 6e 6c 79 20 74  ptions to only t
2060: 68 65 20 54 4c 53 20 72 65 6c 61 74 65 64 20 6f  he TLS related o
2070: 6e 65 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c  nes\&...TP.\fBtl
2080: 73 3a 3a 73 6f 63 6b 65 74 5c 66 52 20 3f 5c 66  s::socket\fR ?\f
2090: 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66  I-option\fR? ?\f
20a0: 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d  Ivalue\fR? ?\fI-
20b0: 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e  option value \&.
20c0: 5c 26 2e 5c 26 2e 5c 66 52 3f 20 5c 66 49 68 6f  \&.\&.\fR? \fIho
20d0: 73 74 5c 66 52 20 5c 66 49 70 6f 72 74 5c 66 52  st\fR \fIport\fR
20e0: 0a 54 68 69 73 20 69 73 20 61 20 68 65 6c 70 65  .This is a helpe
20f0: 72 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20  r function that 
2100: 75 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e 64  utilizes the und
2110: 65 72 6c 79 69 6e 67 20 63 6f 6d 6d 61 6e 64 73  erlying commands
2120: 20 5c 66 42 73 6f 63 6b 65 74 5c 66 52 0a 61 6e   \fBsocket\fR.an
2130: 64 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74  d \fBtls::import
2140: 5c 66 52 20 74 6f 20 63 72 65 61 74 65 20 74 68  \fR to create th
2150: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 20  e connection\&. 
2160: 49 74 20 62 65 68 61 76 65 73 20 74 68 65 20 73  It behaves the s
2170: 61 6d 65 20 61 73 20 74 68 65 0a 6e 61 74 69 76  ame as the.nativ
2180: 65 20 54 43 4c 20 5c 66 42 73 6f 63 6b 65 74 5c  e TCL \fBsocket\
2190: 66 52 20 63 6f 6d 6d 61 6e 64 2c 20 62 75 74 20  fR command, but 
21a0: 61 6c 73 6f 20 73 75 70 70 6f 72 74 73 20 74 68  also supports th
21b0: 65 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74  e \fBtls::import
21c0: 5c 66 52 0a 63 6f 6d 6d 61 6e 64 20 6f 70 74 69  \fR.command opti
21d0: 6f 6e 73 20 77 69 74 68 20 6f 6e 65 20 61 64 64  ons with one add
21e0: 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 5c 26  itional option\&
21f0: 2e 20 49 74 20 72 65 74 75 72 6e 73 20 74 68 65  . It returns the
2200: 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 20   channel handle 
2210: 69 64 0a 66 6f 72 20 74 68 65 20 6e 65 77 20 73  id.for the new s
2220: 6f 63 6b 65 74 5c 26 2e 20 41 64 64 69 74 69 6f  ocket\&. Additio
2230: 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 61 72 65 3a  nal options are:
2240: 0a 2e 52 53 0a 2e 54 50 0a 5c 66 42 2d 61 75 74  ..RS..TP.\fB-aut
2250: 6f 73 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 5c  oservername\fR \
2260: 66 49 62 6f 6f 6c 5c 66 52 0a 49 66 20 5c 66 42  fIbool\fR.If \fB
2270: 74 72 75 65 5c 66 52 2c 20 61 75 74 6f 6d 61 74  true\fR, automat
2280: 69 63 61 6c 6c 79 20 73 65 74 20 74 68 65 20 5c  ically set the \
2290: 66 42 2d 73 65 72 76 65 72 6e 61 6d 65 5c 66 52  fB-servername\fR
22a0: 20 61 72 67 75 6d 65 6e 74 20 74 6f 20 74 68 65   argument to the
22b0: 0a 5c 66 49 68 6f 73 74 5c 66 52 20 61 72 67 75  .\fIhost\fR argu
22c0: 6d 65 6e 74 5c 26 2e 20 50 72 69 6f 72 20 74 6f  ment\&. Prior to
22d0: 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74   TclTLS 2\&.0, t
22e0: 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66  he default is \f
22f0: 42 66 61 6c 73 65 5c 66 52 5c 26 2e 0a 53 74 61  Bfalse\fR\&..Sta
2300: 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20  rting in TclTLS 
2310: 32 5c 26 2e 30 2c 20 74 68 65 20 64 65 66 61 75  2\&.0, the defau
2320: 6c 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52  lt is \fBtrue\fR
2330: 20 75 6e 6c 65 73 73 20 5c 66 42 2d 73 65 72 76   unless \fB-serv
2340: 65 72 6e 61 6d 65 5c 66 52 0a 69 73 20 61 6c 73  ername\fR.is als
2350: 6f 20 73 70 65 63 69 66 69 65 64 5c 26 2e 0a 2e  o specified\&...
2360: 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 73  RE..TP.\fBtls::s
2370: 6f 63 6b 65 74 5c 66 52 20 5c 66 42 2d 73 65 72  ocket\fR \fB-ser
2380: 76 65 72 5c 66 52 20 5c 66 49 63 6f 6d 6d 61 6e  ver\fR \fIcomman
2390: 64 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e  d\fR ?\fI-option
23a0: 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66  \fR? ?\fIvalue\f
23b0: 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76  R? ?\fI-option v
23c0: 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66  alue \&.\&.\&.\f
23d0: 52 3f 20 5c 66 49 70 6f 72 74 5c 66 52 0a 53 61  R? \fIport\fR.Sa
23e0: 6d 65 20 61 73 20 70 72 65 76 69 6f 75 73 20 63  me as previous c
23f0: 6f 6d 6d 61 6e 64 2c 20 62 75 74 20 69 6e 73 74  ommand, but inst
2400: 65 61 64 20 63 72 65 61 74 65 73 20 61 20 73 65  ead creates a se
2410: 72 76 65 72 20 73 6f 63 6b 65 74 20 66 6f 72 20  rver socket for 
2420: 63 6c 69 65 6e 74 73 20 74 6f 0a 63 6f 6e 6e 65  clients to.conne
2430: 63 74 20 74 6f 20 6a 75 73 74 20 6c 69 6b 65 20  ct to just like 
2440: 74 68 65 20 54 63 6c 20 5c 66 42 73 6f 63 6b 65  the Tcl \fBsocke
2450: 74 20 2d 73 65 72 76 65 72 5c 66 52 20 63 6f 6d  t -server\fR com
2460: 6d 61 6e 64 5c 26 2e 20 49 74 20 72 65 74 75 72  mand\&. It retur
2470: 6e 73 20 74 68 65 0a 63 68 61 6e 6e 65 6c 20 68  ns the.channel h
2480: 61 6e 64 6c 65 20 69 64 20 66 6f 72 20 74 68 65  andle id for the
2490: 20 6e 65 77 20 73 6f 63 6b 65 74 5c 26 2e 0a 2e   new socket\&...
24a0: 54 50 0a 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72  TP.\fBtls::impor
24b0: 74 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c  t\fR \fIchannel\
24c0: 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66  fR ?\fI-option\f
24d0: 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f  R? ?\fIvalue\fR?
24e0: 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c   ?\fI-option val
24f0: 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f  ue \&.\&.\&.\fR?
2500: 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 73 74 61  ..TP.\fBtls::sta
2510: 72 74 74 6c 73 5c 66 52 20 5c 66 49 63 68 61 6e  rttls\fR \fIchan
2520: 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69  nel\fR ?\fI-opti
2530: 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65  on\fR? ?\fIvalue
2540: 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e  \fR? ?\fI-option
2550: 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e   value \&.\&.\&.
2560: 5c 66 52 3f 0a 53 74 61 72 74 20 54 4c 53 20 65  \fR?.Start TLS e
2570: 6e 63 72 79 70 74 69 6f 6e 20 6f 6e 20 54 43 4c  ncryption on TCL
2580: 20 63 68 61 6e 6e 65 6c 20 5c 66 49 63 68 61 6e   channel \fIchan
2590: 6e 65 6c 5c 66 52 20 76 69 61 20 61 20 73 74 61  nel\fR via a sta
25a0: 63 6b 65 64 20 63 68 61 6e 6e 65 6c 5c 26 2e 20  cked channel\&. 
25b0: 49 74 0a 6e 65 65 64 20 6e 6f 74 20 62 65 20 61  It.need not be a
25c0: 20 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73   socket, but mus
25d0: 74 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72  t provide bi-dir
25e0: 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 5c 26 2e  ectional flow\&.
25f0: 20 41 6c 73 6f 20 73 65 74 73 20 73 65 73 73 69   Also sets sessi
2600: 6f 6e 0a 70 61 72 61 6d 65 74 65 72 73 20 66 6f  on.parameters fo
2610: 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c  r SSL handshake\
2620: 26 2e 20 56 61 6c 69 64 20 6f 70 74 69 6f 6e 73  &. Valid options
2630: 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66   are:..RS..TP.\f
2640: 42 2d 61 6c 70 6e 5c 66 52 20 5c 66 49 6c 69 73  B-alpn\fR \fIlis
2650: 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20 70 72 6f  t\fR.List of pro
2660: 74 6f 63 6f 6c 73 20 74 6f 20 6f 66 66 65 72 20  tocols to offer 
2670: 64 75 72 69 6e 67 20 41 70 70 6c 69 63 61 74 69  during Applicati
2680: 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f  on-Layer Protoco
2690: 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 0a 28 41  l Negotiation.(A
26a0: 4c 50 4e 29 5c 26 2e 20 46 6f 72 20 65 78 61 6d  LPN)\&. For exam
26b0: 70 6c 65 3a 20 5c 66 42 68 32 5c 66 52 20 61 6e  ple: \fBh2\fR an
26c0: 64 20 5c 66 42 68 74 74 70 2f 31 5c 26 2e 31 5c  d \fBhttp/1\&.1\
26d0: 66 52 2c 20 62 75 74 20 6e 6f 74 20 5c 66 42 68  fR, but not \fBh
26e0: 33 5c 66 52 20 6f 72 0a 5c 66 42 71 75 69 63 5c  3\fR or.\fBquic\
26f0: 66 52 5c 26 2e 20 54 68 69 73 20 6f 70 74 69 6f  fR\&. This optio
2700: 6e 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  n is new for Tcl
2710: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
2720: 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52 20 5c 66  .\fB-cadir\fR \f
2730: 49 64 69 72 65 63 74 6f 72 79 5c 66 52 0a 53 70  Idirectory\fR.Sp
2740: 65 63 69 66 69 65 73 20 74 68 65 20 64 69 72 65  ecifies the dire
2750: 63 74 6f 72 79 20 77 68 65 72 65 20 74 68 65 20  ctory where the 
2760: 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68  Certificate Auth
2770: 6f 72 69 74 79 20 28 43 41 29 20 63 65 72 74 69  ority (CA) certi
2780: 66 69 63 61 74 65 73 20 61 72 65 0a 73 74 6f 72  ficates are.stor
2790: 65 64 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  ed\&. The defaul
27a0: 74 20 69 73 20 70 6c 61 74 66 6f 72 6d 20 73 70  t is platform sp
27b0: 65 63 69 66 69 63 20 61 6e 64 20 63 61 6e 20 62  ecific and can b
27c0: 65 20 73 65 74 20 61 74 20 63 6f 6d 70 69 6c 65  e set at compile
27d0: 20 74 69 6d 65 5c 26 2e 20 54 68 65 0a 64 65 66   time\&. The.def
27e0: 61 75 6c 74 20 6c 6f 63 61 74 69 6f 6e 20 63 61  ault location ca
27f0: 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e 20  n be overridden 
2800: 62 79 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45  by the \fBSSL_CE
2810: 52 54 5f 44 49 52 5c 66 52 20 65 6e 76 69 72 6f  RT_DIR\fR enviro
2820: 6e 6d 65 6e 74 0a 76 61 72 69 61 62 6c 65 5c 26  nment.variable\&
2830: 2e 20 53 65 65 20 5c 66 42 43 65 72 74 69 66 69  . See \fBCertifi
2840: 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c  cate Validation\
2850: 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61  fR for more deta
2860: 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63  ils\&...TP.\fB-c
2870: 61 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65  afile\fR \fIfile
2880: 6e 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65  name\fR.Specifie
2890: 73 20 74 68 65 20 66 69 6c 65 20 77 69 74 68 20  s the file with 
28a0: 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20  the Certificate 
28b0: 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 20 63  Authority (CA) c
28c0: 65 72 74 69 66 69 63 61 74 65 73 20 74 6f 20 75  ertificates to u
28d0: 73 65 20 69 6e 0a 5c 66 42 50 45 4d 5c 66 52 20  se in.\fBPEM\fR 
28e0: 66 69 6c 65 20 66 6f 72 6d 61 74 5c 26 2e 20 54  file format\&. T
28f0: 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 22 5c  he default is "\
2900: 66 49 63 65 72 74 5c 26 2e 70 65 6d 5c 66 52 22  fIcert\&.pem\fR"
2910: 2c 20 69 6e 20 74 68 65 20 4f 70 65 6e 53 53 4c  , in the OpenSSL
2920: 0a 64 69 72 65 63 74 6f 72 79 5c 26 2e 20 54 68  .directory\&. Th
2930: 65 20 64 65 66 61 75 6c 74 20 66 69 6c 65 20 63  e default file c
2940: 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e  an be overridden
2950: 20 62 79 20 74 68 65 20 5c 66 42 53 53 4c 5f 43   by the \fBSSL_C
2960: 45 52 54 5f 46 49 4c 45 5c 66 52 20 65 6e 76 69  ERT_FILE\fR envi
2970: 72 6f 6e 6d 65 6e 74 0a 76 61 72 69 61 62 6c 65  ronment.variable
2980: 5c 26 2e 20 53 65 65 20 5c 66 42 43 65 72 74 69  \&. See \fBCerti
2990: 66 69 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f  ficate Validatio
29a0: 6e 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65  n\fR for more de
29b0: 74 61 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  tails\&...TP.\fB
29c0: 2d 63 61 73 74 6f 72 65 5c 66 52 20 5c 66 49 55  -castore\fR \fIU
29d0: 52 49 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20  RI\fR.Specifies 
29e0: 74 68 65 20 55 6e 69 66 6f 72 6d 20 52 65 73 6f  the Uniform Reso
29f0: 75 72 63 65 20 49 64 65 6e 74 69 66 69 65 72 20  urce Identifier 
2a00: 28 55 52 49 29 20 66 6f 72 20 74 68 65 20 43 65  (URI) for the Ce
2a10: 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72  rtificate Author
2a20: 69 74 79 0a 28 43 41 29 20 73 74 6f 72 65 2c 20  ity.(CA) store, 
2a30: 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 20 73  which may be a s
2a40: 69 6e 67 6c 65 20 63 6f 6e 74 61 69 6e 65 72 20  ingle container 
2a50: 6f 72 20 61 20 63 61 74 61 6c 6f 67 20 6f 66 20  or a catalog of 
2a60: 63 6f 6e 74 61 69 6e 65 72 73 5c 26 2e 0a 53 74  containers\&..St
2a70: 61 72 74 69 6e 67 20 77 69 74 68 20 4f 70 65 6e  arting with Open
2a80: 53 53 4c 20 33 5c 26 2e 32 20 6f 6e 20 4d 53 20  SSL 3\&.2 on MS 
2a90: 57 69 6e 64 6f 77 73 2c 20 73 65 74 20 74 6f 20  Windows, set to 
2aa0: 22 5c 66 42 6f 72 67 5c 26 2e 6f 70 65 6e 73 73  "\fBorg\&.openss
2ab0: 6c 5c 26 2e 77 69 6e 73 74 6f 72 65 3a 2f 2f 5c  l\&.winstore://\
2ac0: 66 52 22 0a 74 6f 20 75 73 65 20 74 68 65 20 62  fR".to use the b
2ad0: 75 69 6c 74 2d 69 6e 20 4d 53 20 57 69 6e 64 6f  uilt-in MS Windo
2ae0: 77 73 20 43 65 72 74 69 66 69 63 61 74 65 20 53  ws Certificate S
2af0: 74 6f 72 65 5c 26 2e 0a 53 65 65 20 5c 66 42 43  tore\&..See \fBC
2b00: 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64  ertificate Valid
2b10: 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 6d 6f 72  ation\fR for mor
2b20: 65 20 64 65 74 61 69 6c 73 5c 26 2e 0a 54 68 69  e details\&..Thi
2b30: 73 20 6f 70 74 69 6f 6e 20 69 73 20 6e 65 77 20  s option is new 
2b40: 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for TclTLS 1\&.8
2b50: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 65 72 74  \&...TP.\fB-cert
2b60: 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e  file\fR \fIfilen
2b70: 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ame\fR.Specifies
2b80: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65   the name of the
2b90: 20 66 69 6c 65 20 77 69 74 68 20 74 68 65 20 63   file with the c
2ba0: 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73  ertificate to us
2bb0: 65 20 69 6e 20 50 45 4d 20 66 6f 72 6d 61 74 0a  e in PEM format.
2bc0: 61 73 20 74 68 65 20 6c 6f 63 61 6c 20 28 63 6c  as the local (cl
2bd0: 69 65 6e 74 20 6f 72 20 73 65 72 76 65 72 29 20  ient or server) 
2be0: 63 65 72 74 69 66 69 63 61 74 65 5c 26 2e 20 49  certificate\&. I
2bf0: 74 20 61 6c 73 6f 20 63 6f 6e 74 61 69 6e 73 20  t also contains 
2c00: 74 68 65 20 70 75 62 6c 69 63 20 6b 65 79 5c 26  the public key\&
2c10: 2e 0a 2e 54 50 0a 5c 66 42 2d 63 65 72 74 5c 66  ...TP.\fB-cert\f
2c20: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 53  R \fIstring\fR.S
2c30: 70 65 63 69 66 69 65 73 20 74 68 65 20 63 65 72  pecifies the cer
2c40: 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 20  tificate to use 
2c50: 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64  as a DER encoded
2c60: 20 73 74 72 69 6e 67 20 28 58 5c 26 2e 35 30 39   string (X\&.509
2c70: 20 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42   DER)\&...TP.\fB
2c80: 2d 63 69 70 68 65 72 5c 66 52 20 5c 66 49 73 74  -cipher\fR \fIst
2c90: 72 69 6e 67 5c 66 52 0a 53 70 65 63 69 66 69 65  ring\fR.Specifie
2ca0: 73 20 74 68 65 20 6c 69 73 74 20 6f 66 20 63 69  s the list of ci
2cb0: 70 68 65 72 73 20 74 6f 20 75 73 65 20 66 6f 72  phers to use for
2cc0: 20 54 4c 53 20 31 5c 26 2e 32 20 61 6e 64 20 65   TLS 1\&.2 and e
2cd0: 61 72 6c 69 65 72 20 63 6f 6e 6e 65 63 74 69 6f  arlier connectio
2ce0: 6e 73 5c 26 2e 0a 53 74 72 69 6e 67 20 69 73 20  ns\&..String is 
2cf0: 61 20 63 6f 6c 6f 6e 20 22 5c 66 42 3a 5c 66 52  a colon "\fB:\fR
2d00: 22 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74  " separated list
2d10: 20 6f 66 20 63 69 70 68 65 72 73 5c 26 2e 0a 43   of ciphers\&..C
2d20: 69 70 68 65 72 73 20 63 61 6e 20 62 65 20 63 6f  iphers can be co
2d30: 6d 62 69 6e 65 64 20 75 73 69 6e 67 20 74 68 65  mbined using the
2d40: 20 22 5c 66 42 2b 5c 66 52 22 20 63 68 61 72 61   "\fB+\fR" chara
2d50: 63 74 65 72 5c 26 2e 0a 50 72 65 66 69 78 65 73  cter\&..Prefixes
2d60: 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20   can be used to 
2d70: 70 65 72 6d 61 6e 65 6e 74 6c 79 20 72 65 6d 6f  permanently remo
2d80: 76 65 20 22 5c 66 42 21 5c 66 52 22 2c 20 64 65  ve "\fB!\fR", de
2d90: 6c 65 74 65 20 22 5c 66 42 2d 5c 66 52 22 2c 20  lete "\fB-\fR", 
2da0: 6f 72 0a 6d 6f 76 65 20 74 6f 20 74 68 65 20 65  or.move to the e
2db0: 6e 64 20 22 5c 66 42 2b 5c 66 52 22 20 61 20 73  nd "\fB+\fR" a s
2dc0: 70 65 63 69 66 69 65 64 20 63 69 70 68 65 72 5c  pecified cipher\
2dd0: 26 2e 0a 4b 65 79 77 6f 72 64 73 20 5c 66 42 40  &..Keywords \fB@
2de0: 53 54 52 45 4e 47 54 48 5c 66 52 20 28 73 6f 72  STRENGTH\fR (sor
2df0: 74 20 62 79 20 61 6c 67 6f 72 69 74 68 6d 20 6b  t by algorithm k
2e00: 65 79 20 6c 65 6e 67 74 68 29 2c 0a 5c 66 42 40  ey length),.\fB@
2e10: 53 45 43 4c 45 56 45 4c 3d 5c 66 52 5c 66 49 6e  SECLEVEL=\fR\fIn
2e20: 5c 66 52 20 28 73 65 74 20 73 65 63 75 72 69 74  \fR (set securit
2e30: 79 20 6c 65 76 65 6c 20 74 6f 20 6e 29 2c 20 61  y level to n), a
2e40: 6e 64 0a 5c 66 42 44 45 46 41 55 4c 54 5c 66 52  nd.\fBDEFAULT\fR
2e50: 20 28 75 73 65 20 64 65 66 61 75 6c 74 20 63 69   (use default ci
2e60: 70 68 65 72 20 6c 69 73 74 2c 20 61 74 20 73 74  pher list, at st
2e70: 61 72 74 20 6f 6e 6c 79 29 20 63 61 6e 20 61 6c  art only) can al
2e80: 73 6f 20 62 65 20 73 70 65 63 69 66 69 65 64 5c  so be specified\
2e90: 26 2e 0a 53 65 65 20 74 68 65 20 5c 66 49 4f 70  &..See the \fIOp
2ea0: 65 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a  enSSL\fR [https:
2eb0: 2f 2f 64 6f 63 73 5c 26 2e 6f 70 65 6e 73 73 6c  //docs\&.openssl
2ec0: 5c 26 2e 6f 72 67 2f 6d 61 73 74 65 72 2f 6d 61  \&.org/master/ma
2ed0: 6e 31 2f 6f 70 65 6e 73 73 6c 2d 63 69 70 68 65  n1/openssl-ciphe
2ee0: 72 73 2f 23 6f 70 74 69 6f 6e 73 5d 0a 64 6f 63  rs/#options].doc
2ef0: 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72 20 74  umentation for t
2f00: 68 65 20 66 75 6c 6c 20 6c 69 73 74 20 6f 66 20  he full list of 
2f10: 76 61 6c 69 64 20 76 61 6c 75 65 73 5c 26 2e 0a  valid values\&..
2f20: 2e 54 50 0a 5c 66 42 2d 63 69 70 68 65 72 73 75  .TP.\fB-ciphersu
2f30: 69 74 65 73 5c 66 52 20 5c 66 49 73 74 72 69 6e  ites\fR \fIstrin
2f40: 67 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  g\fR.Specifies t
2f50: 68 65 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65  he list of ciphe
2f60: 72 20 73 75 69 74 65 73 20 74 6f 20 75 73 65 20  r suites to use 
2f70: 66 6f 72 20 54 4c 53 20 31 5c 26 2e 33 20 61 73  for TLS 1\&.3 as
2f80: 20 61 20 63 6f 6c 6f 6e 0a 22 5c 66 42 3a 5c 66   a colon."\fB:\f
2f90: 52 22 20 73 65 70 61 72 61 74 65 64 20 6c 69 73  R" separated lis
2fa0: 74 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74  t of cipher suit
2fb0: 65 20 6e 61 6d 65 73 5c 26 2e 20 53 65 65 20 74  e names\&. See t
2fc0: 68 65 0a 5c 66 49 4f 70 65 6e 53 53 4c 5c 66 52  he.\fIOpenSSL\fR
2fd0: 20 5b 68 74 74 70 73 3a 2f 2f 64 6f 63 73 5c 26   [https://docs\&
2fe0: 2e 6f 70 65 6e 73 73 6c 5c 26 2e 6f 72 67 2f 6d  .openssl\&.org/m
2ff0: 61 73 74 65 72 2f 6d 61 6e 31 2f 6f 70 65 6e 73  aster/man1/opens
3000: 73 6c 2d 63 69 70 68 65 72 73 2f 23 6f 70 74 69  sl-ciphers/#opti
3010: 6f 6e 73 5d 0a 64 6f 63 75 6d 65 6e 74 61 74 69  ons].documentati
3020: 6f 6e 20 66 6f 72 20 74 68 65 20 66 75 6c 6c 20  on for the full 
3030: 6c 69 73 74 20 6f 66 20 76 61 6c 69 64 20 76 61  list of valid va
3040: 6c 75 65 73 5c 26 2e 0a 54 68 69 73 20 6f 70 74  lues\&..This opt
3050: 69 6f 6e 20 69 73 20 6e 65 77 20 66 6f 72 20 54  ion is new for T
3060: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
3070: 54 50 0a 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66  TP.\fB-command\f
3080: 52 20 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66 52  R \fIcallback\fR
3090: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 63  .Specifies the c
30a0: 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20  allback command 
30b0: 74 6f 20 62 65 20 69 6e 76 6f 6b 65 64 20 61 74  to be invoked at
30c0: 20 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20   several points 
30d0: 64 75 72 69 6e 67 20 74 68 65 0a 68 61 6e 64 73  during the.hands
30e0: 68 61 6b 65 20 74 6f 20 70 61 73 73 20 65 72 72  hake to pass err
30f0: 6f 72 73 2c 20 74 72 61 63 69 6e 67 20 69 6e 66  ors, tracing inf
3100: 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e 64 20 70 72  ormation, and pr
3110: 6f 74 6f 63 6f 6c 20 6d 65 73 73 61 67 65 73 5c  otocol messages\
3120: 26 2e 0a 53 65 65 20 5c 66 42 43 61 6c 6c 62 61  &..See \fBCallba
3130: 63 6b 20 4f 70 74 69 6f 6e 73 5c 66 52 20 66 6f  ck Options\fR fo
3140: 72 20 6d 6f 72 65 20 69 6e 66 6f 5c 26 2e 0a 2e  r more info\&...
3150: 54 50 0a 5c 66 42 2d 64 68 70 61 72 61 6d 73 5c  TP.\fB-dhparams\
3160: 66 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65 5c 66  fR \fIfilename\f
3170: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
3180: 44 69 66 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 28  Diffie-Hellman (
3190: 44 48 29 20 70 61 72 61 6d 65 74 65 72 73 20 66  DH) parameters f
31a0: 69 6c 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b  ile\&...TP.\fB-k
31b0: 65 79 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c  eyfile\fR \fIfil
31c0: 65 6e 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69  ename\fR.Specifi
31d0: 65 73 20 74 68 65 20 70 72 69 76 61 74 65 20 6b  es the private k
31e0: 65 79 20 66 69 6c 65 5c 26 2e 20 54 68 65 20 64  ey file\&. The d
31f0: 65 66 61 75 6c 74 20 69 73 20 74 6f 20 75 73 65  efault is to use
3200: 20 74 68 65 20 66 69 6c 65 0a 73 70 65 63 69 66   the file.specif
3210: 69 65 64 20 62 79 20 74 68 65 20 5c 66 42 2d 63  ied by the \fB-c
3220: 65 72 74 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f  ertfile\fR optio
3230: 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65 79  n\&...TP.\fB-key
3240: 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52  \fR \fIstring\fR
3250: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 70  .Specifies the p
3260: 72 69 76 61 74 65 20 6b 65 79 20 74 6f 20 75 73  rivate key to us
3270: 65 20 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64  e as a DER encod
3280: 65 64 20 73 74 72 69 6e 67 20 28 50 4b 43 53 23  ed string (PKCS#
3290: 31 20 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c 66  1 DER)\&...TP.\f
32a0: 42 2d 6d 6f 64 65 6c 5c 66 52 20 5c 66 49 63 68  B-model\fR \fIch
32b0: 61 6e 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 20 74  annel\fR.Force t
32c0: 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f 20 73  his channel to s
32d0: 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 5c 66  hare the same \f
32e0: 49 53 53 4c 5f 43 54 58 5c 66 52 20 73 74 72 75  ISSL_CTX\fR stru
32f0: 63 74 75 72 65 20 61 73 20 74 68 65 0a 73 70 65  cture as the.spe
3300: 63 69 66 69 65 64 20 5c 66 49 63 68 61 6e 6e 65  cified \fIchanne
3310: 6c 5c 66 52 2c 20 61 6e 64 20 74 68 65 72 65 66  l\fR, and theref
3320: 6f 72 65 20 73 68 61 72 65 20 63 6f 6e 66 69 67  ore share config
3330: 2c 20 63 61 6c 6c 62 61 63 6b 73 2c 20 65 74 63  , callbacks, etc
3340: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 70 61 73 73  \&...TP.\fB-pass
3350: 77 6f 72 64 5c 66 52 20 5c 66 49 63 61 6c 6c 62  word\fR \fIcallb
3360: 61 63 6b 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ack\fR.Specifies
3370: 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 63 6f   the callback co
3380: 6d 6d 61 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20  mmand to invoke 
3390: 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65  when OpenSSL nee
33a0: 64 73 20 74 6f 20 6f 62 74 61 69 6e 20 61 0a 70  ds to obtain a.p
33b0: 61 73 73 77 6f 72 64 5c 26 2e 20 54 68 69 73 20  assword\&. This 
33c0: 69 73 20 74 79 70 69 63 61 6c 6c 79 20 75 73 65  is typically use
33d0: 64 20 74 6f 20 75 6e 6c 6f 63 6b 20 74 68 65 20  d to unlock the 
33e0: 70 72 69 76 61 74 65 20 6b 65 79 20 6f 66 20 61  private key of a
33f0: 20 63 65 72 74 69 66 69 63 61 74 65 5c 26 2e 0a   certificate\&..
3400: 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f  The callback sho
3410: 75 6c 64 20 72 65 74 75 72 6e 20 61 20 70 61 73  uld return a pas
3420: 73 77 6f 72 64 20 73 74 72 69 6e 67 5c 26 2e 20  sword string\&. 
3430: 54 68 69 73 20 6f 70 74 69 6f 6e 20 68 61 73 20  This option has 
3440: 63 68 61 6e 67 65 64 20 66 6f 72 0a 54 63 6c 54  changed for.TclT
3450: 4c 53 20 31 5c 26 2e 38 5c 26 2e 20 53 65 65 20  LS 1\&.8\&. See 
3460: 5c 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69  \fBCallback Opti
3470: 6f 6e 73 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20  ons\fR for more 
3480: 69 6e 66 6f 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  info\&...TP.\fB-
3490: 70 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 5c 66  post_handshake\f
34a0: 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 41 6c 6c  R \fIbool\fR.All
34b0: 6f 77 20 70 6f 73 74 2d 68 61 6e 64 73 68 61 6b  ow post-handshak
34c0: 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74  e session ticket
34d0: 20 75 70 64 61 74 65 73 5c 26 2e 20 54 68 69 73   updates\&. This
34e0: 20 6f 70 74 69 6f 6e 20 69 73 20 6e 65 77 20 66   option is new f
34f0: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
3500: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75 65  &...TP.\fB-reque
3510: 73 74 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52  st\fR \fIbool\fR
3520: 0a 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69  .Request a certi
3530: 66 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65 20  ficate from the 
3540: 70 65 65 72 20 64 75 72 69 6e 67 20 74 68 65 20  peer during the 
3550: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e  SSL handshake\&.
3560: 20 54 68 69 73 20 69 73 20 6e 65 65 64 65 64 0a   This is needed.
3570: 74 6f 20 64 6f 20 43 65 72 74 69 66 69 63 61 74  to do Certificat
3580: 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 26 2e 20  e Validation\&. 
3590: 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54  Starting in TclT
35a0: 4c 53 20 31 5c 26 2e 38 2c 20 74 68 65 20 64 65  LS 1\&.8, the de
35b0: 66 61 75 6c 74 20 69 73 0a 5c 66 42 74 72 75 65  fault is.\fBtrue
35c0: 5c 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20 63  \fR for client c
35d0: 6f 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 20 53 74  onnections\&. St
35e0: 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53  arting in TclTLS
35f0: 20 32 5c 26 2e 30 2c 20 69 66 20 73 65 74 20 74   2\&.0, if set t
3600: 6f 0a 5c 66 42 66 61 6c 73 65 5c 66 52 20 61 6e  o.\fBfalse\fR an
3610: 64 20 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52  d \fB-require\fR
3620: 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 2c 20   is \fBtrue\fR, 
3630: 74 68 65 6e 20 74 68 69 73 20 77 69 6c 6c 20 62  then this will b
3640: 65 0a 6f 76 65 72 72 69 64 64 65 6e 20 74 6f 20  e.overridden to 
3650: 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 0a 53 65  \fBtrue\fR\&..Se
3660: 65 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65  e \fBCertificate
3670: 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66   Validation\fR f
3680: 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c  or more details\
3690: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75 69  &...TP.\fB-requi
36a0: 72 65 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52  re\fR \fIbool\fR
36b0: 0a 52 65 71 75 69 72 65 20 61 20 76 61 6c 69 64  .Require a valid
36c0: 20 63 65 72 74 69 66 69 63 61 74 65 20 66 72 6f   certificate fro
36d0: 6d 20 74 68 65 20 70 65 65 72 20 64 75 72 69 6e  m the peer durin
36e0: 67 20 74 68 65 20 53 53 4c 20 68 61 6e 64 73 68  g the SSL handsh
36f0: 61 6b 65 5c 26 2e 20 49 66 20 74 68 69 73 20 69  ake\&. If this i
3700: 73 0a 73 65 74 20 74 6f 20 74 72 75 65 2c 20 74  s.set to true, t
3710: 68 65 6e 20 5c 66 42 2d 72 65 71 75 65 73 74 5c  hen \fB-request\
3720: 66 52 20 6d 75 73 74 20 61 6c 73 6f 20 62 65 20  fR must also be 
3730: 73 65 74 20 74 6f 20 74 72 75 65 20 61 6e 64 20  set to true and 
3740: 61 20 65 69 74 68 65 72 0a 5c 66 42 2d 63 61 64  a either.\fB-cad
3750: 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 66 69 6c  ir\fR, \fB-cafil
3760: 65 5c 66 52 2c 20 5c 66 42 2d 63 61 73 74 6f 72  e\fR, \fB-castor
3770: 65 5c 66 52 2c 20 6f 72 20 61 20 70 6c 61 74 66  e\fR, or a platf
3780: 6f 72 6d 20 64 65 66 61 75 6c 74 0a 6d 75 73 74  orm default.must
3790: 20 62 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20   be provided in 
37a0: 6f 72 64 65 72 20 74 6f 20 76 61 6c 69 64 61 74  order to validat
37b0: 65 20 61 67 61 69 6e 73 74 5c 26 2e 20 54 68 65  e against\&. The
37c0: 20 64 65 66 61 75 6c 74 20 69 6e 20 54 63 6c 54   default in TclT
37d0: 4c 53 20 31 5c 26 2e 38 20 61 6e 64 0a 65 61 72  LS 1\&.8 and.ear
37e0: 6c 69 65 72 20 76 65 72 73 69 6f 6e 73 20 69 73  lier versions is
37f0: 20 5c 66 42 66 61 6c 73 65 5c 66 52 20 73 69 6e   \fBfalse\fR sin
3800: 63 65 20 6e 6f 74 20 61 6c 6c 20 70 6c 61 74 66  ce not all platf
3810: 6f 72 6d 73 20 68 61 76 65 20 63 65 72 74 69 66  orms have certif
3820: 69 63 61 74 65 73 20 74 6f 0a 76 61 6c 69 64 61  icates to.valida
3830: 74 65 20 61 67 61 69 6e 73 74 20 69 6e 20 61 20  te against in a 
3840: 66 6f 72 6d 20 63 6f 6d 70 61 74 69 62 6c 65 20  form compatible 
3850: 77 69 74 68 20 4f 70 65 6e 53 53 4c 5c 26 2e 20  with OpenSSL\&. 
3860: 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54  Starting in TclT
3870: 4c 53 20 32 5c 26 2e 30 2c 0a 74 68 65 20 64 65  LS 2\&.0,.the de
3880: 66 61 75 6c 74 20 69 73 20 5c 66 42 74 72 75 65  fault is \fBtrue
3890: 5c 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20 63  \fR for client c
38a0: 6f 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 0a 53 65  onnections\&..Se
38b0: 65 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65  e \fBCertificate
38c0: 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66   Validation\fR f
38d0: 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c  or more details\
38e0: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 63 75 72  &...TP.\fB-secur
38f0: 69 74 79 5f 6c 65 76 65 6c 5c 66 52 20 5c 66 49  ity_level\fR \fI
3900: 69 6e 74 65 67 65 72 5c 66 52 0a 53 70 65 63 69  integer\fR.Speci
3910: 66 69 65 73 20 74 68 65 20 73 65 63 75 72 69 74  fies the securit
3920: 79 20 6c 65 76 65 6c 20 28 76 61 6c 75 65 20 66  y level (value f
3930: 72 6f 6d 20 30 20 74 6f 20 35 29 5c 26 2e 20 54  rom 0 to 5)\&. T
3940: 68 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65  he security leve
3950: 6c 20 61 66 66 65 63 74 73 0a 74 68 65 20 61 6c  l affects.the al
3960: 6c 6f 77 65 64 20 63 69 70 68 65 72 20 73 75 69  lowed cipher sui
3970: 74 65 20 65 6e 63 72 79 70 74 69 6f 6e 20 61 6c  te encryption al
3980: 67 6f 72 69 74 68 6d 73 2c 20 73 75 70 70 6f 72  gorithms, suppor
3990: 74 65 64 20 45 43 43 20 63 75 72 76 65 73 2c 0a  ted ECC curves,.
39a0: 73 75 70 70 6f 72 74 65 64 20 73 69 67 6e 61 74  supported signat
39b0: 75 72 65 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20  ure algorithms, 
39c0: 44 48 20 70 61 72 61 6d 65 74 65 72 20 73 69 7a  DH parameter siz
39d0: 65 73 2c 20 63 65 72 74 69 66 69 63 61 74 65 20  es, certificate 
39e0: 6b 65 79 20 73 69 7a 65 73 0a 61 6e 64 20 73 69  key sizes.and si
39f0: 67 6e 61 74 75 72 65 20 61 6c 67 6f 72 69 74 68  gnature algorith
3a00: 6d 73 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  ms\&. The defaul
3a10: 74 20 69 73 20 31 20 70 72 69 6f 72 20 74 6f 20  t is 1 prior to 
3a20: 4f 70 65 6e 53 53 4c 20 33 5c 26 2e 32 20 61 6e  OpenSSL 3\&.2 an
3a30: 64 20 32 0a 74 68 65 72 65 61 66 74 65 72 5c 26  d 2.thereafter\&
3a40: 2e 20 4c 65 76 65 6c 20 33 20 61 6e 64 20 68 69  . Level 3 and hi
3a50: 67 68 65 72 20 64 69 73 61 62 6c 65 20 73 75 70  gher disable sup
3a60: 70 6f 72 74 20 66 6f 72 20 73 65 73 73 69 6f 6e  port for session
3a70: 20 74 69 63 6b 65 74 73 20 61 6e 64 0a 6f 6e 6c   tickets and.onl
3a80: 79 20 61 63 63 65 70 74 20 63 69 70 68 65 72 20  y accept cipher 
3a90: 73 75 69 74 65 73 20 74 68 61 74 20 70 72 6f 76  suites that prov
3aa0: 69 64 65 20 66 6f 72 77 61 72 64 20 73 65 63 72  ide forward secr
3ab0: 65 63 79 5c 26 2e 0a 54 68 69 73 20 6f 70 74 69  ecy\&..This opti
3ac0: 6f 6e 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  on is new for Tc
3ad0: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
3ae0: 50 0a 5c 66 42 2d 73 65 72 76 65 72 5c 66 52 20  P.\fB-server\fR 
3af0: 5c 66 49 62 6f 6f 6c 5c 66 52 0a 53 70 65 63 69  \fIbool\fR.Speci
3b00: 66 69 65 73 20 77 68 65 74 68 65 72 20 74 6f 20  fies whether to 
3b10: 61 63 74 20 61 73 20 61 20 73 65 72 76 65 72 20  act as a server 
3b20: 61 6e 64 20 72 65 73 70 6f 6e 64 20 77 69 74 68  and respond with
3b30: 20 61 20 73 65 72 76 65 72 20 68 61 6e 64 73 68   a server handsh
3b40: 61 6b 65 20 77 68 65 6e 20 61 0a 63 6c 69 65 6e  ake when a.clien
3b50: 74 20 63 6f 6e 6e 65 63 74 73 20 61 6e 64 20 70  t connects and p
3b60: 72 6f 76 69 64 65 73 20 61 20 63 6c 69 65 6e 74  rovides a client
3b70: 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68   handshake\&. Th
3b80: 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42  e default is \fB
3b90: 66 61 6c 73 65 5c 66 52 5c 26 2e 0a 2e 54 50 0a  false\fR\&...TP.
3ba0: 5c 66 42 2d 73 65 72 76 65 72 6e 61 6d 65 5c 66  \fB-servername\f
3bb0: 52 20 5c 66 49 68 6f 73 74 6e 61 6d 65 5c 66 52  R \fIhostname\fR
3bc0: 0a 53 70 65 63 69 66 79 20 74 68 65 20 70 65 65  .Specify the pee
3bd0: 72 27 73 20 68 6f 73 74 6e 61 6d 65 5c 26 2e 20  r's hostname\&. 
3be0: 54 68 69 73 20 69 73 20 75 73 65 64 20 74 6f 20  This is used to 
3bf0: 73 65 74 20 74 68 65 20 54 4c 53 20 53 65 72 76  set the TLS Serv
3c00: 65 72 20 4e 61 6d 65 20 49 6e 64 69 63 61 74 69  er Name Indicati
3c10: 6f 6e 0a 28 53 4e 49 29 20 65 78 74 65 6e 73 69  on.(SNI) extensi
3c20: 6f 6e 5c 26 2e 20 53 65 74 20 74 68 69 73 20 74  on\&. Set this t
3c30: 6f 20 74 68 65 20 65 78 70 65 63 74 65 64 20 73  o the expected s
3c40: 65 72 76 65 72 6e 61 6d 65 20 69 6e 20 74 68 65  ervername in the
3c50: 20 73 65 72 76 65 72 27 73 20 63 65 72 74 69 66   server's certif
3c60: 69 63 61 74 65 0a 6f 72 20 6f 6e 65 20 6f 66 20  icate.or one of 
3c70: 74 68 65 20 53 75 62 6a 65 63 74 20 41 6c 74 65  the Subject Alte
3c80: 72 6e 61 74 65 20 4e 61 6d 65 73 20 28 53 41 4e  rnate Names (SAN
3c90: 29 5c 26 2e 20 53 74 61 72 74 69 6e 67 20 69 6e  )\&. Starting in
3ca0: 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74   TclTLS 2\&.0, t
3cb0: 68 69 73 20 77 69 6c 6c 0a 64 65 66 61 75 6c 74  his will.default
3cc0: 20 74 6f 20 74 68 65 20 68 6f 73 74 20 66 72 6f   to the host fro
3cd0: 6d 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 73 6f  m the \fBtls::so
3ce0: 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 5c  cket\fR command\
3cf0: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 73 73 69  &...TP.\fB-sessi
3d00: 6f 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69 6e 61  on_id\fR \fIbina
3d10: 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 53 70 65  ry_string\fR.Spe
3d20: 63 69 66 69 65 73 20 74 68 65 20 73 65 73 73 69  cifies the sessi
3d30: 6f 6e 20 69 64 20 74 6f 20 72 65 73 75 6d 65 20  on id to resume 
3d40: 61 20 73 65 73 73 69 6f 6e 5c 26 2e 20 4e 6f 74  a session\&. Not
3d50: 20 73 75 70 70 6f 72 74 65 64 20 79 65 74 5c 26   supported yet\&
3d60: 2e 0a 54 68 69 73 20 6f 70 74 69 6f 6e 20 69 73  ..This option is
3d70: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
3d80: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
3d90: 2d 73 73 6c 32 5c 66 52 20 5c 66 49 62 6f 6f 6c  -ssl2\fR \fIbool
3da0: 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f  \fR.Enable use o
3db0: 66 20 53 53 4c 20 76 32 5c 26 2e 54 68 65 20 64  f SSL v2\&.The d
3dc0: 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66 61 6c  efault is \fBfal
3dd0: 73 65 5c 66 52 5c 26 2e 0a 4f 70 65 6e 53 53 4c  se\fR\&..OpenSSL
3de0: 20 31 5c 26 2e 31 2b 20 6e 6f 20 6c 6f 6e 67 65   1\&.1+ no longe
3df0: 72 20 73 75 70 70 6f 72 74 73 20 53 53 4c 20 76  r supports SSL v
3e00: 32 2c 20 73 6f 20 74 68 69 73 20 6d 61 79 20 6e  2, so this may n
3e10: 6f 74 20 68 61 76 65 20 61 6e 79 20 65 66 66 65  ot have any effe
3e20: 63 74 5c 26 2e 0a 53 65 65 20 74 68 65 20 5c 66  ct\&..See the \f
3e30: 42 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c  Btls::protocols\
3e40: 66 52 20 63 6f 6d 6d 61 6e 64 20 66 6f 72 20 73  fR command for s
3e50: 75 70 70 6f 72 74 65 64 20 70 72 6f 74 6f 63 6f  upported protoco
3e60: 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 73  ls\&...TP.\fB-ss
3e70: 6c 33 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52  l3\fR \fIbool\fR
3e80: 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53  .Enable use of S
3e90: 53 4c 20 76 33 5c 26 2e 20 54 68 65 20 64 65 66  SL v3\&. The def
3ea0: 61 75 6c 74 20 69 73 20 5c 66 42 66 61 6c 73 65  ault is \fBfalse
3eb0: 5c 66 52 5c 26 2e 20 53 74 61 72 74 69 6e 67 20  \fR\&. Starting 
3ec0: 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 2c  in TclTLS 1\&.8,
3ed0: 0a 75 73 65 20 6f 66 20 53 53 4c 20 76 33 20 69  .use of SSL v3 i
3ee0: 66 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65  f only available
3ef0: 20 76 69 61 20 61 20 63 6f 6d 70 69 6c 65 20 74   via a compile t
3f00: 69 6d 65 20 6f 70 74 69 6f 6e 5c 26 2e 0a 4f 70  ime option\&..Op
3f10: 65 6e 53 53 4c 20 34 5c 26 2e 30 2b 20 6e 6f 20  enSSL 4\&.0+ no 
3f20: 6c 6f 6e 67 65 72 20 73 75 70 70 6f 72 74 73 20  longer supports 
3f30: 53 53 4c 20 76 33 2c 20 73 6f 20 74 68 69 73 20  SSL v3, so this 
3f40: 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 61 6e 79  may not have any
3f50: 20 65 66 66 65 63 74 5c 26 2e 0a 53 65 65 20 74   effect\&..See t
3f60: 68 65 20 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f  he \fBtls::proto
3f70: 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d 61 6e 64 20  cols\fR command 
3f80: 66 6f 72 20 73 75 70 70 6f 72 74 65 64 20 70 72  for supported pr
3f90: 6f 74 6f 63 6f 6c 73 5c 26 2e 0a 2e 54 50 0a 5c  otocols\&...TP.\
3fa0: 66 42 2d 74 6c 73 31 5c 66 52 20 5c 66 49 62 6f  fB-tls1\fR \fIbo
3fb0: 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73 65  ol\fR.Enable use
3fc0: 20 6f 66 20 54 4c 53 20 76 31 5c 26 2e 20 53 74   of TLS v1\&. St
3fd0: 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53  arting in TclTLS
3fe0: 20 32 5c 26 2e 30 2c 20 74 68 65 20 64 65 66 61   2\&.0, the defa
3ff0: 75 6c 74 20 69 73 20 5c 66 42 66 61 6c 73 65 5c  ult is \fBfalse\
4000: 66 52 5c 26 2e 0a 4e 6f 74 65 3a 20 54 4c 53 20  fR\&..Note: TLS 
4010: 31 5c 26 2e 30 20 6e 65 65 64 73 20 53 48 41 31  1\&.0 needs SHA1
4020: 20 74 6f 20 6f 70 65 72 61 74 65 2c 20 77 68 69   to operate, whi
4030: 63 68 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c  ch is only avail
4040: 61 62 6c 65 20 69 6e 20 73 65 63 75 72 69 74 79  able in security
4050: 20 6c 65 76 65 6c 0a 30 20 66 6f 72 20 4f 70 65   level.0 for Ope
4060: 6e 20 53 53 4c 20 33 5c 26 2e 30 2b 5c 26 2e 20  n SSL 3\&.0+\&. 
4070: 53 65 65 20 74 68 65 20 5c 66 42 2d 73 65 63 75  See the \fB-secu
4080: 72 69 74 79 5f 6c 65 76 65 6c 5c 66 52 20 6f 70  rity_level\fR op
4090: 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  tion\&...TP.\fB-
40a0: 74 6c 73 31 5c 26 2e 31 5c 66 52 20 5c 66 49 62  tls1\&.1\fR \fIb
40b0: 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73  ool\fR.Enable us
40c0: 65 20 6f 66 20 54 4c 53 20 76 31 5c 26 2e 31 5c  e of TLS v1\&.1\
40d0: 26 2e 20 53 74 61 72 74 69 6e 67 20 69 6e 20 54  &. Starting in T
40e0: 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68 65  clTLS 2\&.0, the
40f0: 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66   default is \fBf
4100: 61 6c 73 65 5c 66 52 5c 26 2e 0a 4e 6f 74 65 3a  alse\fR\&..Note:
4110: 20 54 4c 53 20 31 5c 26 2e 31 20 6e 65 65 64 73   TLS 1\&.1 needs
4120: 20 53 48 41 31 20 74 6f 20 6f 70 65 72 61 74 65   SHA1 to operate
4130: 2c 20 77 68 69 63 68 20 69 73 20 6f 6e 6c 79 20  , which is only 
4140: 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 73 65 63  available in sec
4150: 75 72 69 74 79 20 6c 65 76 65 6c 0a 30 20 66 6f  urity level.0 fo
4160: 72 20 4f 70 65 6e 20 53 53 4c 20 33 5c 26 2e 30  r Open SSL 3\&.0
4170: 2b 5c 26 2e 20 53 65 65 20 74 68 65 20 5c 66 42  +\&. See the \fB
4180: 2d 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c  -security_level\
4190: 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50  fR option\&...TP
41a0: 0a 5c 66 42 2d 74 6c 73 31 5c 26 2e 32 5c 66 52  .\fB-tls1\&.2\fR
41b0: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62   \fIbool\fR.Enab
41c0: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
41d0: 5c 26 2e 32 5c 26 2e 20 54 68 65 20 64 65 66 61  \&.2\&. The defa
41e0: 75 6c 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66  ult is \fBtrue\f
41f0: 52 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 74 6c 73  R\&...TP.\fB-tls
4200: 31 5c 26 2e 33 5c 66 52 20 5c 66 49 62 6f 6f 6c  1\&.3\fR \fIbool
4210: 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f  \fR.Enable use o
4220: 66 20 54 4c 53 20 76 31 5c 26 2e 33 5c 26 2e 20  f TLS v1\&.3\&. 
4230: 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c  The default is \
4240: 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 54 68 69  fBtrue\fR\&. Thi
4250: 73 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61  s is only availa
4260: 62 6c 65 0a 73 74 61 72 74 69 6e 67 20 77 69 74  ble.starting wit
4270: 68 20 4f 70 65 6e 53 53 4c 20 31 5c 26 2e 31 5c  h OpenSSL 1\&.1\
4280: 26 2e 31 20 61 6e 64 20 54 63 6c 54 4c 53 20 31  &.1 and TclTLS 1
4290: 5c 26 2e 37 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  \&.7\&...TP.\fB-
42a0: 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c  validatecommand\
42b0: 66 52 20 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66  fR \fIcallback\f
42c0: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
42d0: 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64  callback command
42e0: 20 74 6f 20 69 6e 76 6f 6b 65 20 74 6f 20 76 61   to invoke to va
42f0: 6c 69 64 61 74 65 20 74 68 65 20 70 65 65 72 20  lidate the peer 
4300: 63 65 72 74 69 66 69 63 61 74 65 73 0a 61 6e 64  certificates.and
4310: 20 6f 74 68 65 72 20 63 6f 6e 66 69 67 20 69 6e   other config in
4320: 66 6f 20 64 75 72 69 6e 67 20 74 68 65 20 70 72  fo during the pr
4330: 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61 74 69  otocol negotiati
4340: 6f 6e 20 70 68 61 73 65 5c 26 2e 20 54 68 69 73  on phase\&. This
4350: 20 63 61 6e 20 62 65 20 75 73 65 64 0a 62 79 20   can be used.by 
4360: 54 43 4c 20 73 63 72 69 70 74 73 20 74 6f 20 70  TCL scripts to p
4370: 65 72 66 6f 72 6d 20 74 68 65 69 72 20 6f 77 6e  erform their own
4380: 20 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c   Certificate Val
4390: 69 64 61 74 69 6f 6e 20 74 6f 20 73 75 70 70 6c  idation to suppl
43a0: 65 6d 65 6e 74 20 74 68 65 0a 64 65 66 61 75 6c  ement the.defaul
43b0: 74 20 76 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f  t validation pro
43c0: 76 69 64 65 64 20 62 79 20 4f 70 65 6e 53 53 4c  vided by OpenSSL
43d0: 5c 26 2e 20 54 68 65 20 73 63 72 69 70 74 20 6d  \&. The script m
43e0: 75 73 74 20 72 65 74 75 72 6e 20 61 20 62 6f 6f  ust return a boo
43f0: 6c 65 61 6e 20 74 72 75 65 0a 74 6f 20 63 6f 6e  lean true.to con
4400: 74 69 6e 75 65 20 74 68 65 20 6e 65 67 6f 74 69  tinue the negoti
4410: 61 74 69 6f 6e 5c 26 2e 20 53 65 65 20 5c 66 42  ation\&. See \fB
4420: 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69 6f 6e 73  Callback Options
4430: 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 69 6e 66  \fR for more inf
4440: 6f 5c 26 2e 0a 54 68 69 73 20 6f 70 74 69 6f 6e  o\&..This option
4450: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
4460: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a  LS 1\&.8\&...RE.
4470: 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 68 61 6e 64  .TP.\fBtls::hand
4480: 73 68 61 6b 65 5c 66 52 20 5c 66 49 63 68 61 6e  shake\fR \fIchan
4490: 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 73 20 74 68  nel\fR.Forces th
44a0: 65 20 54 4c 53 20 6e 65 67 6f 74 69 61 74 69 6f  e TLS negotiatio
44b0: 6e 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 74  n handshake to t
44c0: 61 6b 65 20 70 6c 61 63 65 20 69 6d 6d 65 64 69  ake place immedi
44d0: 61 74 65 6c 79 2c 20 61 6e 64 20 72 65 74 75 72  ately, and retur
44e0: 6e 73 20 30 0a 69 66 20 68 61 6e 64 73 68 61 6b  ns 0.if handshak
44f0: 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 72  e is still in pr
4500: 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63  ogress (non-bloc
4510: 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 20 74  king), or 1 if t
4520: 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77 61 73  he handshake was
4530: 0a 73 75 63 63 65 73 73 66 75 6c 5c 26 2e 20 49  .successful\&. I
4540: 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20  f the handshake 
4550: 66 61 69 6c 65 64 2c 20 61 6e 20 65 72 72 6f 72  failed, an error
4560: 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65   will be returne
4570: 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a  d\&...TP.\fBtls:
4580: 3a 73 68 75 74 64 6f 77 6e 5c 66 52 20 5c 66 49  :shutdown\fR \fI
4590: 63 68 61 6e 6e 65 6c 5c 66 52 0a 2e 54 50 0a 5c  channel\fR..TP.\
45a0: 66 42 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 5c  fBtls::unimport\
45b0: 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52  fR \fIchannel\fR
45c0: 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 75 6e 73  ..TP.\fBtls::uns
45d0: 74 61 63 6b 5c 66 52 20 5c 66 49 63 68 61 6e 6e  tack\fR \fIchann
45e0: 65 6c 5c 66 52 0a 54 68 69 73 20 74 65 72 6d 69  el\fR.This termi
45f0: 6e 61 74 65 73 20 74 68 65 20 53 53 4c 2f 54 4c  nates the SSL/TL
4600: 53 20 73 65 73 73 69 6f 6e 20 62 79 20 73 65 6e  S session by sen
4610: 64 69 6e 67 20 74 68 65 20 22 63 6c 6f 73 65 5f  ding the "close_
4620: 6e 6f 74 69 66 79 22 20 6d 65 73 73 61 67 65 20  notify" message 
4630: 61 6e 64 0a 72 65 6d 6f 76 65 73 20 74 68 65 20  and.removes the 
4640: 74 6f 70 20 6c 65 76 65 6c 20 73 74 61 63 6b 65  top level stacke
4650: 64 20 63 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 5c  d channel from \
4660: 66 49 63 68 61 6e 6e 65 6c 5c 66 52 2c 20 62 75  fIchannel\fR, bu
4670: 74 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 63 6c  t it does not cl
4680: 6f 73 65 0a 74 68 65 20 73 6f 63 6b 65 74 5c 26  ose.the socket\&
4690: 2e 20 49 74 20 69 73 20 74 68 65 20 63 6f 6d 70  . It is the comp
46a0: 6c 69 6d 65 6e 74 20 74 6f 20 5c 66 42 74 6c 73  liment to \fBtls
46b0: 3a 3a 69 6d 70 6f 72 74 5c 66 52 20 62 79 20 65  ::import\fR by e
46c0: 6e 64 69 6e 67 20 65 6e 63 72 79 70 74 69 6f 6e  nding encryption
46d0: 20 6f 66 0a 61 20 54 43 4c 20 63 68 61 6e 6e 65   of.a TCL channe
46e0: 6c 5c 26 2e 20 41 6e 20 65 72 72 6f 72 20 69 73  l\&. An error is
46f0: 20 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 20 69   thrown if TLS i
4700: 73 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 73 74  s not the top st
4710: 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 74 79  acked channel ty
4720: 70 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73  pe\&...TP.\fBtls
4730: 3a 3a 73 74 61 74 75 73 5c 66 52 20 3f 5c 66 42  ::status\fR ?\fB
4740: 2d 6c 6f 63 61 6c 5c 66 52 3f 20 5c 66 49 63 68  -local\fR? \fIch
4750: 61 6e 6e 65 6c 5c 66 52 0a 52 65 74 75 72 6e 73  annel\fR.Returns
4760: 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61   the current sta
4770: 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68  tus of an SSL ch
4780: 61 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65 73  annel\&. The res
4790: 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66  ult is a list of
47a0: 20 6b 65 79 2d 76 61 6c 75 65 0a 70 61 69 72 73   key-value.pairs
47b0: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20   describing the 
47c0: 53 53 4c 2c 20 63 65 72 74 69 66 69 63 61 74 65  SSL, certificate
47d0: 2c 20 61 6e 64 20 63 65 72 74 69 66 69 63 61 74  , and certificat
47e0: 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 73  e verification s
47f0: 74 61 74 75 73 5c 26 2e 20 49 66 0a 74 68 65 20  tatus\&. If.the 
4800: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61  SSL handshake ha
4810: 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65  s not yet comple
4820: 74 65 64 2c 20 61 6e 20 65 6d 70 74 79 20 6c 69  ted, an empty li
4830: 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 5c 26  st is returned\&
4840: 2e 20 49 66 20 74 68 65 0a 5c 66 42 2d 6c 6f 63  . If the.\fB-loc
4850: 61 6c 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73 20  al\fR option is 
4860: 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20  specified, then 
4870: 74 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69 66  the local certif
4880: 69 63 61 74 65 20 69 73 20 75 73 65 64 5c 26 2e  icate is used\&.
4890: 0a 52 65 74 75 72 6e 65 64 20 76 61 6c 75 65 73  .Returned values
48a0: 20 69 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a 53 53   include:..sp.SS
48b0: 4c 20 53 74 61 74 75 73 0a 2e 52 53 0a 2e 54 50  L Status..RS..TP
48c0: 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66 49 70  .\fBalpn\fR \fIp
48d0: 72 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68 65 20 70  rotocol\fR.The p
48e0: 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64  rotocol selected
48f0: 20 61 66 74 65 72 20 41 70 70 6c 69 63 61 74 69   after Applicati
4900: 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f  on-Layer Protoco
4910: 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 41  l Negotiation (A
4920: 4c 50 4e 29 5c 26 2e 0a 54 68 69 73 20 76 61 6c  LPN)\&..This val
4930: 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  ue is new for Tc
4940: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
4950: 50 0a 5c 66 42 63 69 70 68 65 72 5c 66 52 20 5c  P.\fBcipher\fR \
4960: 66 49 63 69 70 68 65 72 5c 66 52 0a 54 68 65 20  fIcipher\fR.The 
4970: 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69  current cipher i
4980: 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20 73 65  n use for the se
4990: 73 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ssion\&...TP.\fB
49a0: 70 65 65 72 6e 61 6d 65 5c 66 52 20 5c 66 49 6e  peername\fR \fIn
49b0: 61 6d 65 5c 66 52 0a 54 68 65 20 70 65 65 72 6e  ame\fR.The peern
49c0: 61 6d 65 20 66 72 6f 6d 20 74 68 65 20 63 65 72  ame from the cer
49d0: 74 69 66 69 63 61 74 65 5c 26 2e 0a 54 68 69 73  tificate\&..This
49e0: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
49f0: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
4a00: 2e 0a 2e 54 50 0a 5c 66 42 70 72 6f 74 6f 63 6f  ...TP.\fBprotoco
4a10: 6c 5c 66 52 20 5c 66 49 76 65 72 73 69 6f 6e 5c  l\fR \fIversion\
4a20: 66 52 0a 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20  fR.The protocol 
4a30: 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72  version used for
4a40: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a   the connection:
4a50: 20 53 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53   SSL2, SSL3, TLS
4a60: 31 2c 20 54 4c 53 31 5c 26 2e 31 2c 20 54 4c 53  1, TLS1\&.1, TLS
4a70: 31 5c 26 2e 32 2c 0a 54 4c 53 31 5c 26 2e 33 2c  1\&.2,.TLS1\&.3,
4a80: 20 6f 72 20 75 6e 6b 6e 6f 77 6e 5c 26 2e 20 54   or unknown\&. T
4a90: 68 69 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77  his value is new
4aa0: 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e   for TclTLS 1\&.
4ab0: 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 62 69 74  8\&...TP.\fBsbit
4ac0: 73 5c 66 52 20 5c 66 49 6e 5c 66 52 0a 54 68 65  s\fR \fIn\fR.The
4ad0: 20 6e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20   number of bits 
4ae0: 75 73 65 64 20 66 6f 72 20 74 68 65 20 73 65 73  used for the ses
4af0: 73 69 6f 6e 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a  sion key\&...TP.
4b00: 5c 66 42 73 69 67 6e 61 74 75 72 65 48 61 73 68  \fBsignatureHash
4b10: 41 6c 67 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49  Algorithm\fR \fI
4b20: 61 6c 67 6f 72 69 74 68 6d 5c 66 52 0a 54 68 65  algorithm\fR.The
4b30: 20 73 69 67 6e 61 74 75 72 65 20 68 61 73 68 20   signature hash 
4b40: 61 6c 67 6f 72 69 74 68 6d 5c 26 2e 0a 54 68 69  algorithm\&..Thi
4b50: 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66  s value is new f
4b60: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
4b70: 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74  &...TP.\fBsignat
4b80: 75 72 65 54 79 70 65 5c 66 52 20 5c 66 49 74 79  ureType\fR \fIty
4b90: 70 65 5c 66 52 0a 54 68 65 20 73 69 67 6e 61 74  pe\fR.The signat
4ba0: 75 72 65 20 74 79 70 65 20 76 61 6c 75 65 5c 26  ure type value\&
4bb0: 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73 20  ..This value is 
4bc0: 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31  new for TclTLS 1
4bd0: 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 76  \&.8\&...TP.\fBv
4be0: 65 72 69 66 79 44 65 70 74 68 5c 66 52 20 5c 66  erifyDepth\fR \f
4bf0: 49 6e 5c 66 52 0a 4d 61 78 69 6d 75 6d 20 64 65  In\fR.Maximum de
4c00: 70 74 68 20 66 6f 72 20 74 68 65 20 63 65 72 74  pth for the cert
4c10: 69 66 69 63 61 74 65 20 63 68 61 69 6e 20 76 65  ificate chain ve
4c20: 72 69 66 69 63 61 74 69 6f 6e 5c 26 2e 20 44 65  rification\&. De
4c30: 66 61 75 6c 74 20 69 73 20 2d 31 2c 20 74 6f 20  fault is -1, to 
4c40: 63 68 65 63 6b 20 61 6c 6c 5c 26 2e 0a 54 68 69  check all\&..Thi
4c50: 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66  s value is new f
4c60: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
4c70: 26 2e 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66 79  &...TP.\fBverify
4c80: 4d 6f 64 65 5c 66 52 20 5c 66 49 6c 69 73 74 5c  Mode\fR \fIlist\
4c90: 66 52 0a 4c 69 73 74 20 6f 66 20 63 65 72 74 69  fR.List of certi
4ca0: 66 69 63 61 74 65 20 76 65 72 69 66 69 63 61 74  ficate verificat
4cb0: 69 6f 6e 20 6d 6f 64 65 73 5c 26 2e 0a 54 68 69  ion modes\&..Thi
4cc0: 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66  s value is new f
4cd0: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
4ce0: 26 2e 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66 79  &...TP.\fBverify
4cf0: 52 65 73 75 6c 74 5c 66 52 20 5c 66 49 72 65 73  Result\fR \fIres
4d00: 75 6c 74 5c 66 52 0a 43 65 72 74 69 66 69 63 61  ult\fR.Certifica
4d10: 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20  te verification 
4d20: 72 65 73 75 6c 74 5c 26 2e 0a 54 68 69 73 20 76  result\&..This v
4d30: 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20  alue is new for 
4d40: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a  TclTLS 1\&.8\&..
4d50: 2e 54 50 0a 5c 66 42 63 61 5f 6e 61 6d 65 73 5c  .TP.\fBca_names\
4d60: 66 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a 4c 69  fR \fIlist\fR.Li
4d70: 73 74 20 6f 66 20 74 68 65 20 43 65 72 74 69 66  st of the Certif
4d80: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 69 65  icate Authoritie
4d90: 73 20 75 73 65 64 20 74 6f 20 63 72 65 61 74 65  s used to create
4da0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
4db0: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
4dc0: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
4dd0: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 49   1\&.8\&...RE..I
4de0: 50 0a 43 65 72 74 69 66 69 63 61 74 65 20 53 74  P.Certificate St
4df0: 61 74 75 73 0a 2e 52 53 0a 2e 54 50 0a 5c 66 42  atus..RS..TP.\fB
4e00: 61 6c 6c 5c 66 52 20 5c 66 49 73 74 72 69 6e 67  all\fR \fIstring
4e10: 5c 66 52 0a 44 75 6d 70 20 6f 66 20 61 6c 6c 20  \fR.Dump of all 
4e20: 63 65 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f  certificate info
4e30: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
4e40: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
4e50: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
4e60: 42 76 65 72 73 69 6f 6e 5c 66 52 20 5c 66 49 76  Bversion\fR \fIv
4e70: 61 6c 75 65 5c 66 52 0a 54 68 65 20 63 65 72 74  alue\fR.The cert
4e80: 69 66 69 63 61 74 65 20 76 65 72 73 69 6f 6e 5c  ificate version\
4e90: 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 72 69 61 6c  &...TP.\fBserial
4ea0: 4e 75 6d 62 65 72 5c 66 52 20 5c 66 49 73 74 72  Number\fR \fIstr
4eb0: 69 6e 67 5c 66 52 0a 54 68 65 20 73 65 72 69 61  ing\fR.The seria
4ec0: 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20  l number of the 
4ed0: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61  certificate as a
4ee0: 20 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 0a 54   hex string\&..T
4ef0: 68 69 73 20 76 61 6c 75 65 20 77 61 73 20 63 68  his value was ch
4f00: 61 6e 67 65 64 20 66 72 6f 6d 20 73 65 72 69 61  anged from seria
4f10: 6c 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e  l in TclTLS 1\&.
4f20: 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e  8\&...TP.\fBsign
4f30: 61 74 75 72 65 5c 66 52 20 5c 66 49 61 6c 67 6f  ature\fR \fIalgo
4f40: 72 69 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20  rithm\fR.Cipher 
4f50: 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66  algorithm used f
4f60: 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73  or certificate s
4f70: 69 67 6e 61 74 75 72 65 5c 26 2e 0a 54 68 69 73  ignature\&..This
4f80: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
4f90: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
4fa0: 2e 0a 2e 54 50 0a 5c 66 42 69 73 73 75 65 72 5c  ...TP.\fBissuer\
4fb0: 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a  fR \fIstring\fR.
4fc0: 54 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 65  The distinguishe
4fd0: 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74  d name (DN) of t
4fe0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69  he certificate i
4ff0: 73 73 75 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ssuer\&...TP.\fB
5000: 6e 6f 74 42 65 66 6f 72 65 5c 66 52 20 5c 66 49  notBefore\fR \fI
5010: 64 61 74 65 5c 66 52 0a 54 68 65 20 62 65 67 69  date\fR.The begi
5020: 6e 6e 69 6e 67 20 64 61 74 65 20 6f 66 20 74 68  nning date of th
5030: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61  e certificate va
5040: 6c 69 64 69 74 79 5c 26 2e 0a 2e 54 50 0a 5c 66  lidity\&...TP.\f
5050: 42 6e 6f 74 41 66 74 65 72 5c 66 52 20 5c 66 49  BnotAfter\fR \fI
5060: 64 61 74 65 5c 66 52 0a 54 68 65 20 65 78 70 69  date\fR.The expi
5070: 72 61 74 69 6f 6e 20 64 61 74 65 20 6f 66 20 74  ration date of t
5080: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 76  he certificate v
5090: 61 6c 69 64 69 74 79 5c 26 2e 0a 2e 54 50 0a 5c  alidity\&...TP.\
50a0: 66 42 73 75 62 6a 65 63 74 5c 66 52 20 5c 66 49  fBsubject\fR \fI
50b0: 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 64 69  string\fR.The di
50c0: 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65  stinguished name
50d0: 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72   (DN) of the cer
50e0: 74 69 66 69 63 61 74 65 20 73 75 62 6a 65 63 74  tificate subject
50f0: 5c 26 2e 20 46 69 65 6c 64 73 20 69 6e 63 6c 75  \&. Fields inclu
5100: 64 65 3a 20 43 6f 6d 6d 6f 6e 0a 4e 61 6d 65 20  de: Common.Name 
5110: 28 43 4e 29 2c 20 4f 72 67 61 6e 69 7a 61 74 69  (CN), Organizati
5120: 6f 6e 20 28 4f 29 2c 20 4c 6f 63 61 6c 69 74 79  on (O), Locality
5130: 20 6f 72 20 43 69 74 79 20 28 4c 29 2c 20 53 74   or City (L), St
5140: 61 74 65 20 6f 72 20 50 72 6f 76 69 6e 63 65 20  ate or Province 
5150: 28 53 29 2c 20 61 6e 64 0a 43 6f 75 6e 74 72 79  (S), and.Country
5160: 20 4e 61 6d 65 20 28 43 29 5c 26 2e 0a 2e 54 50   Name (C)\&...TP
5170: 0a 5c 66 42 69 73 73 75 65 72 55 6e 69 71 75 65  .\fBissuerUnique
5180: 49 44 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c  ID\fR \fIstring\
5190: 66 52 0a 54 68 65 20 69 73 73 75 65 72 20 75 6e  fR.The issuer un
51a0: 69 71 75 65 20 69 64 5c 26 2e 0a 54 68 69 73 20  ique id\&..This 
51b0: 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72  value is new for
51c0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
51d0: 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65 63 74 55  ..TP.\fBsubjectU
51e0: 6e 69 71 75 65 49 44 5c 66 52 20 5c 66 49 73 74  niqueID\fR \fIst
51f0: 72 69 6e 67 5c 66 52 0a 54 68 65 20 73 75 62 6a  ring\fR.The subj
5200: 65 63 74 20 75 6e 69 71 75 65 20 69 64 5c 26 2e  ect unique id\&.
5210: 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73 20 6e  .This value is n
5220: 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c  ew for TclTLS 1\
5230: 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6e 75  &.8\&...TP.\fBnu
5240: 6d 5f 65 78 74 65 6e 73 69 6f 6e 73 5c 66 52 20  m_extensions\fR 
5250: 5c 66 49 6e 5c 66 52 0a 4e 75 6d 62 65 72 20 6f  \fIn\fR.Number o
5260: 66 20 63 65 72 74 69 66 69 63 61 74 65 20 65 78  f certificate ex
5270: 74 65 6e 73 69 6f 6e 73 5c 26 2e 0a 54 68 69 73  tensions\&..This
5280: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
5290: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
52a0: 2e 0a 2e 54 50 0a 5c 66 42 65 78 74 65 6e 73 69  ...TP.\fBextensi
52b0: 6f 6e 73 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66  ons\fR \fIlist\f
52c0: 52 0a 4c 69 73 74 20 6f 66 20 63 65 72 74 69 66  R.List of certif
52d0: 69 63 61 74 65 20 65 78 74 65 6e 73 69 6f 6e 20  icate extension 
52e0: 6e 61 6d 65 73 5c 26 2e 0a 54 68 69 73 20 76 61  names\&..This va
52f0: 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54  lue is new for T
5300: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
5310: 54 50 0a 5c 66 42 61 75 74 68 6f 72 69 74 79 4b  TP.\fBauthorityK
5320: 65 79 49 64 65 6e 74 69 66 69 65 72 5c 66 52 20  eyIdentifier\fR 
5330: 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 41 75 74  \fIstring\fR.Aut
5340: 68 6f 72 69 74 79 20 4b 65 79 20 49 64 65 6e 74  hority Key Ident
5350: 69 66 69 65 72 20 28 41 4b 49 29 20 6f 66 20 74  ifier (AKI) of t
5360: 68 65 20 49 73 73 75 69 6e 67 20 43 41 20 63 65  he Issuing CA ce
5370: 72 74 69 66 69 63 61 74 65 20 74 68 61 74 20 73  rtificate that s
5380: 69 67 6e 65 64 20 74 68 65 0a 53 53 4c 20 63 65  igned the.SSL ce
5390: 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68  rtificate as a h
53a0: 65 78 20 73 74 72 69 6e 67 5c 26 2e 20 54 68 69  ex string\&. Thi
53b0: 73 20 76 61 6c 75 65 20 6d 61 74 63 68 65 73 20  s value matches 
53c0: 74 68 65 20 53 4b 49 20 76 61 6c 75 65 20 6f 66  the SKI value of
53d0: 20 74 68 65 0a 49 6e 74 65 72 6d 65 64 69 61 74   the.Intermediat
53e0: 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65  e CA certificate
53f0: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
5400: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
5410: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
5420: 42 73 75 62 6a 65 63 74 4b 65 79 49 64 65 6e 74  BsubjectKeyIdent
5430: 69 66 69 65 72 5c 66 52 20 5c 66 49 73 74 72 69  ifier\fR \fIstri
5440: 6e 67 5c 66 52 0a 53 75 62 6a 65 63 74 20 4b 65  ng\fR.Subject Ke
5450: 79 20 49 64 65 6e 74 69 66 69 65 72 20 28 53 4b  y Identifier (SK
5460: 49 29 20 68 61 73 68 20 6f 66 20 74 68 65 20 70  I) hash of the p
5470: 75 62 6c 69 63 20 6b 65 79 20 69 6e 73 69 64 65  ublic key inside
5480: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
5490: 20 61 73 20 61 0a 68 65 78 20 73 74 72 69 6e 67   as a.hex string
54a0: 5c 26 2e 20 55 73 65 64 20 74 6f 20 69 64 65 6e  \&. Used to iden
54b0: 74 69 66 79 20 63 65 72 74 69 66 69 63 61 74 65  tify certificate
54c0: 73 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 20 61  s that contain a
54d0: 20 70 61 72 74 69 63 75 6c 61 72 20 70 75 62 6c   particular publ
54e0: 69 63 20 6b 65 79 5c 26 2e 0a 54 68 69 73 20 76  ic key\&..This v
54f0: 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20  alue is new for 
5500: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a  TclTLS 1\&.8\&..
5510: 2e 54 50 0a 5c 66 42 73 75 62 6a 65 63 74 41 6c  .TP.\fBsubjectAl
5520: 74 4e 61 6d 65 5c 66 52 20 5c 66 49 6c 69 73 74  tName\fR \fIlist
5530: 5c 66 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20  \fR.List of all 
5540: 6f 66 20 74 68 65 20 53 75 62 6a 65 63 74 20 41  of the Subject A
5550: 6c 74 65 72 6e 61 74 69 76 65 20 4e 61 6d 65 73  lternative Names
5560: 20 28 53 41 4e 29 20 69 6e 63 6c 75 64 69 6e 67   (SAN) including
5570: 20 64 6f 6d 61 69 6e 20 6e 61 6d 65 73 2c 20 73   domain names, s
5580: 75 62 0a 64 6f 6d 61 69 6e 73 2c 20 61 6e 64 20  ub.domains, and 
5590: 49 50 20 61 64 64 72 65 73 73 65 73 20 74 68 61  IP addresses tha
55a0: 74 20 61 72 65 20 73 65 63 75 72 65 64 20 62 79  t are secured by
55b0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
55c0: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
55d0: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
55e0: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
55f0: 42 6f 63 73 70 5c 66 52 20 5c 66 49 6c 69 73 74  Bocsp\fR \fIlist
5600: 5c 66 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20  \fR.List of all 
5610: 4f 6e 6c 69 6e 65 20 43 65 72 74 69 66 69 63 61  Online Certifica
5620: 74 65 20 53 74 61 74 75 73 20 50 72 6f 74 6f 63  te Status Protoc
5630: 6f 6c 20 28 4f 43 53 50 29 20 55 52 4c 73 20 74  ol (OCSP) URLs t
5640: 68 61 74 20 63 61 6e 20 62 65 20 75 73 65 64 20  hat can be used 
5650: 74 6f 0a 63 68 65 63 6b 20 74 68 65 20 76 61 6c  to.check the val
5660: 69 64 69 74 79 20 6f 66 20 74 68 69 73 20 63 65  idity of this ce
5670: 72 74 69 66 69 63 61 74 65 5c 26 2e 0a 54 68 69  rtificate\&..Thi
5680: 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66  s value is new f
5690: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
56a0: 26 2e 0a 2e 54 50 0a 5c 66 42 63 65 72 74 69 66  &...TP.\fBcertif
56b0: 69 63 61 74 65 5c 66 52 20 5c 66 49 63 65 72 74  icate\fR \fIcert
56c0: 5c 66 52 0a 54 68 65 20 50 45 4d 20 65 6e 63 6f  \fR.The PEM enco
56d0: 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65 5c  ded certificate\
56e0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74  &...TP.\fBsignat
56f0: 75 72 65 41 6c 67 6f 72 69 74 68 6d 5c 66 52 20  ureAlgorithm\fR 
5700: 5c 66 49 61 6c 67 6f 72 69 74 68 6d 5c 66 52 0a  \fIalgorithm\fR.
5710: 43 69 70 68 65 72 20 61 6c 67 6f 72 69 74 68 6d  Cipher algorithm
5720: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 65   used for the ce
5730: 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74  rtificate signat
5740: 75 72 65 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75  ure\&..This valu
5750: 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  e is new for Tcl
5760: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
5770: 0a 5c 66 42 73 69 67 6e 61 74 75 72 65 56 61 6c  .\fBsignatureVal
5780: 75 65 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c  ue\fR \fIstring\
5790: 66 52 0a 43 65 72 74 69 66 69 63 61 74 65 20 73  fR.Certificate s
57a0: 69 67 6e 61 74 75 72 65 20 61 73 20 61 20 68 65  ignature as a he
57b0: 78 20 73 74 72 69 6e 67 5c 26 2e 0a 54 68 69 73  x string\&..This
57c0: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
57d0: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
57e0: 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74 75  ...TP.\fBsignatu
57f0: 72 65 44 69 67 65 73 74 5c 66 52 20 5c 66 49 76  reDigest\fR \fIv
5800: 65 72 73 69 6f 6e 5c 66 52 0a 43 65 72 74 69 66  ersion\fR.Certif
5810: 69 63 61 74 65 20 73 69 67 6e 69 6e 67 20 64 69  icate signing di
5820: 67 65 73 74 20 61 73 20 61 20 68 65 78 20 73 74  gest as a hex st
5830: 72 69 6e 67 5c 26 2e 0a 54 68 69 73 20 76 61 6c  ring\&..This val
5840: 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  ue is new for Tc
5850: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
5860: 50 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79 41 6c  P.\fBpublicKeyAl
5870: 67 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49 61 6c  gorithm\fR \fIal
5880: 67 6f 72 69 74 68 6d 5c 66 52 0a 43 65 72 74 69  gorithm\fR.Certi
5890: 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65  ficate signature
58a0: 20 70 75 62 6c 69 63 20 6b 65 79 20 61 6c 67 6f   public key algo
58b0: 72 69 74 68 6d 5c 26 2e 0a 54 68 69 73 20 76 61  rithm\&..This va
58c0: 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54  lue is new for T
58d0: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
58e0: 54 50 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79 5c  TP.\fBpublicKey\
58f0: 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a  fR \fIstring\fR.
5900: 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e  Certificate sign
5910: 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65 79  ature public key
5920: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67   as a hex string
5930: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
5940: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
5950: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
5960: 42 62 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66 52  Bbits\fR \fIn\fR
5970: 0a 4e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20  .Number of bits 
5980: 75 73 65 64 20 66 6f 72 20 63 65 72 74 69 66 69  used for certifi
5990: 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 6b  cate signature k
59a0: 65 79 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65  ey\&..This value
59b0: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
59c0: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a  LS 1\&.8\&...TP.
59d0: 5c 66 42 73 65 6c 66 5f 73 69 67 6e 65 64 5c 66  \fBself_signed\f
59e0: 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a  R \fIboolean\fR.
59f0: 57 68 65 74 68 65 72 20 74 68 65 20 63 65 72 74  Whether the cert
5a00: 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72  ificate signatur
5a10: 65 20 69 73 20 73 65 6c 66 20 73 69 67 6e 65 64  e is self signed
5a20: 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69  \&..This value i
5a30: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
5a40: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
5a50: 42 73 68 61 31 5f 68 61 73 68 5c 66 52 20 5c 66  Bsha1_hash\fR \f
5a60: 49 68 61 73 68 5c 66 52 0a 54 68 65 20 53 48 41  Ihash\fR.The SHA
5a70: 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 65  1 hash of the ce
5a80: 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68  rtificate as a h
5a90: 65 78 20 73 74 72 69 6e 67 5c 26 2e 0a 54 68 69  ex string\&..Thi
5aa0: 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66  s value is new f
5ab0: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
5ac0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 68 61 32 35 36  &...TP.\fBsha256
5ad0: 5f 68 61 73 68 5c 66 52 20 5c 66 49 68 61 73 68  _hash\fR \fIhash
5ae0: 5c 66 52 0a 54 68 65 20 53 48 41 32 35 36 20 68  \fR.The SHA256 h
5af0: 61 73 68 20 6f 66 20 74 68 65 20 63 65 72 74 69  ash of the certi
5b00: 66 69 63 61 74 65 20 61 73 20 61 20 68 65 78 20  ficate as a hex 
5b10: 73 74 72 69 6e 67 5c 26 2e 0a 54 68 69 73 20 76  string\&..This v
5b20: 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20  alue is new for 
5b30: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a  TclTLS 1\&.8\&..
5b40: 2e 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a  .RE..TP.\fBtls::
5b50: 63 6f 6e 6e 65 63 74 69 6f 6e 5c 66 52 20 5c 66  connection\fR \f
5b60: 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 52 65 74 75  Ichannel\fR.Retu
5b70: 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 20  rns the current 
5b80: 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 61 74 75  connection statu
5b90: 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e  s of an SSL chan
5ba0: 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65 73 75 6c  nel\&. The resul
5bb0: 74 20 69 73 20 61 20 6c 69 73 74 0a 6f 66 20 6b  t is a list.of k
5bc0: 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64  ey-value pairs d
5bd0: 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 63 6f  escribing the co
5be0: 6e 6e 65 63 74 69 6f 6e 5c 26 2e 0a 54 68 69 73  nnection\&..This
5bf0: 20 63 6f 6d 6d 61 6e 64 20 69 73 20 6e 65 77 20   command is new 
5c00: 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for TclTLS 1\&.8
5c10: 5c 26 2e 20 52 65 74 75 72 6e 65 64 20 76 61 6c  \&. Returned val
5c20: 75 65 73 20 69 6e 63 6c 75 64 65 3a 0a 2e 73 70  ues include:..sp
5c30: 0a 53 53 4c 20 53 74 61 74 75 73 0a 2e 52 53 0a  .SSL Status..RS.
5c40: 2e 54 50 0a 5c 66 42 73 74 61 74 65 5c 66 52 20  .TP.\fBstate\fR 
5c50: 5c 66 49 73 74 61 74 65 5c 66 52 0a 53 74 61 74  \fIstate\fR.Stat
5c60: 65 20 6f 66 20 74 68 65 20 63 6f 6e 6e 65 63 74  e of the connect
5c70: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65  ion\&...TP.\fBse
5c80: 72 76 65 72 6e 61 6d 65 5c 66 52 20 5c 66 49 6e  rvername\fR \fIn
5c90: 61 6d 65 5c 66 52 0a 54 68 65 20 6e 61 6d 65 20  ame\fR.The name 
5ca0: 6f 66 20 74 68 65 20 63 6f 6e 6e 65 63 74 65 64  of the connected
5cb0: 20 74 6f 20 73 65 72 76 65 72 5c 26 2e 0a 2e 54   to server\&...T
5cc0: 50 0a 5c 66 42 70 72 6f 74 6f 63 6f 6c 5c 66 52  P.\fBprotocol\fR
5cd0: 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a 54   \fIversion\fR.T
5ce0: 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73  he protocol vers
5cf0: 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 74 68 65  ion used for the
5d00: 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 20 53 53 4c   connection: SSL
5d10: 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31 2c 20 54  2, SSL3, TLS1, T
5d20: 4c 53 31 5c 26 2e 31 2c 20 54 4c 53 31 5c 26 2e  LS1\&.1, TLS1\&.
5d30: 32 2c 20 54 4c 53 31 5c 26 2e 33 2c 20 6f 72 20  2, TLS1\&.3, or 
5d40: 75 6e 6b 6e 6f 77 6e 5c 26 2e 0a 2e 54 50 0a 5c  unknown\&...TP.\
5d50: 66 42 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e 5f  fBrenegotiation_
5d60: 61 6c 6c 6f 77 65 64 5c 66 52 20 5c 66 49 62 6f  allowed\fR \fIbo
5d70: 6f 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72  olean\fR.Whether
5d80: 20 70 72 6f 74 6f 63 6f 6c 20 72 65 6e 65 67 6f   protocol renego
5d90: 74 69 61 74 69 6f 6e 20 69 73 20 73 75 70 70 6f  tiation is suppo
5da0: 72 74 65 64 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e  rted or not\&...
5db0: 54 50 0a 5c 66 42 73 65 63 75 72 69 74 79 5f 6c  TP.\fBsecurity_l
5dc0: 65 76 65 6c 5c 66 52 20 5c 66 49 6c 65 76 65 6c  evel\fR \fIlevel
5dd0: 5c 66 52 0a 54 68 65 20 73 65 63 75 72 69 74 79  \fR.The security
5de0: 20 6c 65 76 65 6c 20 75 73 65 64 20 66 6f 72 20   level used for 
5df0: 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20 63 69 70  selection of cip
5e00: 68 65 72 73 2c 20 6b 65 79 20 73 69 7a 65 2c 20  hers, key size, 
5e10: 65 74 63 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65  etc\&...TP.\fBse
5e20: 73 73 69 6f 6e 5f 72 65 75 73 65 64 5c 66 52 20  ssion_reused\fR 
5e30: 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68  \fIboolean\fR.Wh
5e40: 65 74 68 65 72 20 74 68 65 20 73 65 73 73 69 6f  ether the sessio
5e50: 6e 20 68 61 73 20 62 65 65 6e 20 72 65 75 73 65  n has been reuse
5e60: 64 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a  d or not\&...TP.
5e70: 5c 66 42 69 73 5f 73 65 72 76 65 72 5c 66 52 20  \fBis_server\fR 
5e80: 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68  \fIboolean\fR.Wh
5e90: 65 74 68 65 72 20 74 68 65 20 63 6f 6e 6e 65 63  ether the connec
5ea0: 74 69 6f 6e 20 69 73 20 63 6f 6e 66 69 67 75 72  tion is configur
5eb0: 65 64 20 61 73 20 61 20 73 65 72 76 65 72 20 28  ed as a server (
5ec0: 31 29 20 6f 72 20 63 6c 69 65 6e 74 20 28 30 29  1) or client (0)
5ed0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 63 6f 6d 70 72  \&...TP.\fBcompr
5ee0: 65 73 73 69 6f 6e 5c 66 52 20 5c 66 49 6d 6f 64  ession\fR \fImod
5ef0: 65 5c 66 52 0a 43 6f 6d 70 72 65 73 73 69 6f 6e  e\fR.Compression
5f00: 20 6d 65 74 68 6f 64 5c 26 2e 0a 2e 54 50 0a 5c   method\&...TP.\
5f10: 66 42 65 78 70 61 6e 73 69 6f 6e 5c 66 52 20 5c  fBexpansion\fR \
5f20: 66 49 6d 6f 64 65 5c 66 52 0a 45 78 70 61 6e 73  fImode\fR.Expans
5f30: 69 6f 6e 20 6d 65 74 68 6f 64 5c 26 2e 0a 2e 54  ion method\&...T
5f40: 50 0a 5c 66 42 63 61 4c 69 73 74 5c 66 52 20 5c  P.\fBcaList\fR \
5f50: 66 49 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f  fIlist\fR.List o
5f60: 66 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75  f Certificate Au
5f70: 74 68 6f 72 69 74 69 65 73 20 28 43 41 29 20 66  thorities (CA) f
5f80: 6f 72 20 58 5c 26 2e 35 30 39 20 63 65 72 74 69  or X\&.509 certi
5f90: 66 69 63 61 74 65 5c 26 2e 0a 2e 52 45 0a 2e 49  ficate\&...RE..I
5fa0: 50 0a 43 69 70 68 65 72 20 49 6e 66 6f 0a 2e 52  P.Cipher Info..R
5fb0: 53 0a 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5c  S..TP.\fBcipher\
5fc0: 66 52 20 5c 66 49 63 69 70 68 65 72 5c 66 52 0a  fR \fIcipher\fR.
5fd0: 54 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68  The current ciph
5fe0: 65 72 20 69 6e 20 75 73 65 20 66 6f 72 20 74 68  er in use for th
5ff0: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 0a  e connection\&..
6000: 2e 54 50 0a 5c 66 42 73 74 61 6e 64 61 72 64 5f  .TP.\fBstandard_
6010: 6e 61 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c  name\fR \fIname\
6020: 66 52 0a 54 68 65 20 73 74 61 6e 64 61 72 64 20  fR.The standard 
6030: 52 46 43 20 6e 61 6d 65 20 6f 66 20 63 69 70 68  RFC name of ciph
6040: 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 61 6c 67  er\&...TP.\fBalg
6050: 6f 72 69 74 68 6d 5f 62 69 74 73 5c 66 52 20 5c  orithm_bits\fR \
6060: 66 49 6e 5c 66 52 0a 54 68 65 20 6e 75 6d 62 65  fIn\fR.The numbe
6070: 72 20 6f 66 20 70 72 6f 63 65 73 73 65 64 20 62  r of processed b
6080: 69 74 73 20 75 73 65 64 20 66 6f 72 20 63 69 70  its used for cip
6090: 68 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65  her\&...TP.\fBse
60a0: 63 72 65 74 5f 62 69 74 73 5c 66 52 20 5c 66 49  cret_bits\fR \fI
60b0: 6e 5c 66 52 0a 54 68 65 20 6e 75 6d 62 65 72 20  n\fR.The number 
60c0: 6f 66 20 73 65 63 72 65 74 20 62 69 74 73 20 75  of secret bits u
60d0: 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 5c 26  sed for cipher\&
60e0: 2e 0a 2e 54 50 0a 5c 66 42 6d 69 6e 5f 76 65 72  ...TP.\fBmin_ver
60f0: 73 69 6f 6e 5c 66 52 20 5c 66 49 76 65 72 73 69  sion\fR \fIversi
6100: 6f 6e 5c 66 52 0a 54 68 65 20 6d 69 6e 69 6d 75  on\fR.The minimu
6110: 6d 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69  m protocol versi
6120: 6f 6e 20 66 6f 72 20 63 69 70 68 65 72 5c 26 2e  on for cipher\&.
6130: 0a 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5f 69  ..TP.\fBcipher_i
6140: 73 5f 61 65 61 64 5c 66 52 20 5c 66 49 62 6f 6f  s_aead\fR \fIboo
6150: 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72 20  lean\fR.Whether 
6160: 74 68 65 20 63 69 70 68 65 72 20 69 73 20 41 75  the cipher is Au
6170: 74 68 65 6e 74 69 63 61 74 65 64 20 45 6e 63 72  thenticated Encr
6180: 79 70 74 69 6f 6e 20 77 69 74 68 20 41 73 73 6f  yption with Asso
6190: 63 69 61 74 65 64 20 44 61 74 61 20 28 41 45 41  ciated Data (AEA
61a0: 44 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 63 69 70  D)\&...TP.\fBcip
61b0: 68 65 72 5f 69 64 5c 66 52 20 5c 66 49 69 64 5c  her_id\fR \fIid\
61c0: 66 52 0a 54 68 65 20 4f 70 65 6e 53 53 4c 20 63  fR.The OpenSSL c
61d0: 69 70 68 65 72 20 69 64 5c 26 2e 0a 2e 54 50 0a  ipher id\&...TP.
61e0: 5c 66 42 64 65 73 63 72 69 70 74 69 6f 6e 5c 66  \fBdescription\f
61f0: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 41  R \fIstring\fR.A
6200: 20 74 65 78 74 20 64 65 73 63 72 69 70 74 69 6f   text descriptio
6210: 6e 20 6f 66 20 74 68 65 20 63 69 70 68 65 72 5c  n of the cipher\
6220: 26 2e 0a 2e 54 50 0a 5c 66 42 68 61 6e 64 73 68  &...TP.\fBhandsh
6230: 61 6b 65 5f 64 69 67 65 73 74 5c 66 52 20 5c 66  ake_digest\fR \f
6240: 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 44 69 67 65  Iboolean\fR.Dige
6250: 73 74 20 75 73 65 64 20 64 75 72 69 6e 67 20 68  st used during h
6260: 61 6e 64 73 68 61 6b 65 5c 26 2e 0a 2e 52 45 0a  andshake\&...RE.
6270: 2e 49 50 0a 53 65 73 73 69 6f 6e 20 49 6e 66 6f  .IP.Session Info
6280: 0a 2e 52 53 0a 2e 54 50 0a 5c 66 42 61 6c 70 6e  ..RS..TP.\fBalpn
6290: 5c 66 52 20 5c 66 49 70 72 6f 74 6f 63 6f 6c 5c  \fR \fIprotocol\
62a0: 66 52 0a 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20  fR.The protocol 
62b0: 73 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 41  selected after A
62c0: 70 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72  pplication-Layer
62d0: 20 50 72 6f 74 6f 63 6f 6c 20 4e 65 67 6f 74 69   Protocol Negoti
62e0: 61 74 69 6f 6e 20 28 41 4c 50 4e 29 5c 26 2e 0a  ation (ALPN)\&..
62f0: 2e 54 50 0a 5c 66 42 72 65 73 75 6d 61 62 6c 65  .TP.\fBresumable
6300: 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66  \fR \fIboolean\f
6310: 52 0a 57 68 65 74 68 65 72 20 74 68 65 20 73 65  R.Whether the se
6320: 73 73 69 6f 6e 20 63 61 6e 20 62 65 20 72 65 73  ssion can be res
6330: 75 6d 65 64 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e  umed or not\&...
6340: 54 50 0a 5c 66 42 73 74 61 72 74 5f 74 69 6d 65  TP.\fBstart_time
6350: 5c 66 52 20 5c 66 49 73 65 63 6f 6e 64 73 5c 66  \fR \fIseconds\f
6360: 52 0a 54 69 6d 65 20 73 69 6e 63 65 20 73 65 73  R.Time since ses
6370: 73 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e 20  sion started in 
6380: 73 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65 70  seconds since ep
6390: 6f 63 68 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 69  och\&...TP.\fBti
63a0: 6d 65 6f 75 74 5c 66 52 20 5c 66 49 73 65 63 6f  meout\fR \fIseco
63b0: 6e 64 73 5c 66 52 0a 4d 61 78 20 64 75 72 61 74  nds\fR.Max durat
63c0: 69 6f 6e 20 6f 66 20 73 65 73 73 69 6f 6e 20 69  ion of session i
63d0: 6e 20 73 65 63 6f 6e 64 73 20 62 65 66 6f 72 65  n seconds before
63e0: 20 74 69 6d 65 2d 6f 75 74 5c 26 2e 0a 2e 54 50   time-out\&...TP
63f0: 0a 5c 66 42 6c 69 66 65 74 69 6d 65 5c 66 52 20  .\fBlifetime\fR 
6400: 5c 66 49 73 65 63 6f 6e 64 73 5c 66 52 0a 53 65  \fIseconds\fR.Se
6410: 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 6c 69 66  ssion ticket lif
6420: 65 74 69 6d 65 20 68 69 6e 74 20 69 6e 20 73 65  etime hint in se
6430: 63 6f 6e 64 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  conds\&...TP.\fB
6440: 73 65 73 73 69 6f 6e 5f 69 64 5c 66 52 20 5c 66  session_id\fR \f
6450: 49 62 69 6e 61 72 79 5f 73 74 72 69 6e 67 5c 66  Ibinary_string\f
6460: 52 0a 55 6e 69 71 75 65 20 73 65 73 73 69 6f 6e  R.Unique session
6470: 20 69 64 20 66 6f 72 20 75 73 65 20 69 6e 20 72   id for use in r
6480: 65 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73 73  esuming the sess
6490: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65  ion\&...TP.\fBse
64a0: 73 73 69 6f 6e 5f 74 69 63 6b 65 74 5c 66 52 20  ssion_ticket\fR 
64b0: 5c 66 49 62 69 6e 61 72 79 5f 73 74 72 69 6e 67  \fIbinary_string
64c0: 5c 66 52 0a 55 6e 69 71 75 65 20 73 65 73 73 69  \fR.Unique sessi
64d0: 6f 6e 20 74 69 63 6b 65 74 20 66 6f 72 20 75 73  on ticket for us
64e0: 65 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68  e in resuming th
64f0: 65 20 73 65 73 73 69 6f 6e 5c 26 2e 0a 2e 54 50  e session\&...TP
6500: 0a 5c 66 42 74 69 63 6b 65 74 5f 61 70 70 5f 64  .\fBticket_app_d
6510: 61 74 61 5c 66 52 20 5c 66 49 62 69 6e 61 72 79  ata\fR \fIbinary
6520: 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e 69 71 75  _string\fR.Uniqu
6530: 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74  e session ticket
6540: 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 64 61 74   application dat
6550: 61 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6d 61 73 74  a\&...TP.\fBmast
6560: 65 72 5f 6b 65 79 5c 66 52 20 5c 66 49 62 69 6e  er_key\fR \fIbin
6570: 61 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e  ary_string\fR.Un
6580: 69 71 75 65 20 73 65 73 73 69 6f 6e 20 6d 61 73  ique session mas
6590: 74 65 72 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c  ter key\&...TP.\
65a0: 66 42 73 65 73 73 69 6f 6e 5f 63 61 63 68 65 5f  fBsession_cache_
65b0: 6d 6f 64 65 5c 66 52 20 5c 66 49 6d 6f 64 65 5c  mode\fR \fImode\
65c0: 66 52 0a 53 65 72 76 65 72 20 63 61 63 68 65 20  fR.Server cache 
65d0: 6d 6f 64 65 20 28 63 6c 69 65 6e 74 2c 20 73 65  mode (client, se
65e0: 72 76 65 72 2c 20 6f 72 20 62 6f 74 68 29 5c 26  rver, or both)\&
65f0: 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73  ...RE..TP.\fBtls
6600: 3a 3a 63 69 70 68 65 72 73 5c 66 52 20 3f 5c 66  ::ciphers\fR ?\f
6610: 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 3f 20 3f 5c  Iprotocol\fR? ?\
6620: 66 49 76 65 72 62 6f 73 65 5c 66 52 3f 20 3f 5c  fIverbose\fR? ?\
6630: 66 49 73 75 70 70 6f 72 74 65 64 5c 66 52 3f 0a  fIsupported\fR?.
6640: 57 69 74 68 6f 75 74 20 61 6e 79 20 6f 70 74 69  Without any opti
6650: 6f 6e 73 2c 20 69 74 20 72 65 74 75 72 6e 73 20  ons, it returns 
6660: 61 20 6c 69 73 74 20 6f 66 20 61 6c 6c 20 73 79  a list of all sy
6670: 6d 6d 65 74 72 69 63 20 63 69 70 68 65 72 73 20  mmetric ciphers 
6680: 66 6f 72 20 75 73 65 20 77 69 74 68 20 74 68 65  for use with the
6690: 0a 5c 66 49 2d 63 69 70 68 65 72 5c 66 52 20 6f  .\fI-cipher\fR o
66a0: 70 74 69 6f 6e 5c 26 2e 20 57 69 74 68 20 5c 66  ption\&. With \f
66b0: 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 2c 20 6f 6e  Iprotocol\fR, on
66c0: 6c 79 20 74 68 65 20 63 69 70 68 65 72 73 20 73  ly the ciphers s
66d0: 75 70 70 6f 72 74 65 64 20 66 6f 72 20 74 68 61  upported for tha
66e0: 74 0a 70 72 6f 74 6f 63 6f 6c 20 61 72 65 20 72  t.protocol are r
66f0: 65 74 75 72 6e 65 64 5c 26 2e 20 53 65 65 20 74  eturned\&. See t
6700: 68 65 20 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f  he \fBtls::proto
6710: 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d 61 6e 64 20  cols\fR command 
6720: 66 6f 72 20 74 68 65 20 73 75 70 70 6f 72 74 65  for the supporte
6730: 64 0a 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e 20 49  d.protocols\&. I
6740: 66 20 5c 66 49 76 65 72 62 6f 73 65 5c 66 52 20  f \fIverbose\fR 
6750: 69 73 20 73 70 65 63 69 66 69 65 64 20 61 73 20  is specified as 
6760: 74 72 75 65 20 74 68 65 6e 20 61 20 76 65 72 62  true then a verb
6770: 6f 73 65 2c 20 68 75 6d 61 6e 20 72 65 61 64 61  ose, human reada
6780: 62 6c 65 0a 6c 69 73 74 20 69 73 20 72 65 74 75  ble.list is retu
6790: 72 6e 65 64 20 77 69 74 68 20 61 64 64 69 74 69  rned with additi
67a0: 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  onal information
67b0: 20 6f 6e 20 74 68 65 20 63 69 70 68 65 72 5c 26   on the cipher\&
67c0: 2e 20 49 66 20 5c 66 49 73 75 70 70 6f 72 74 65  . If \fIsupporte
67d0: 64 5c 66 52 0a 69 73 20 73 70 65 63 69 66 69 65  d\fR.is specifie
67e0: 64 20 61 73 20 74 72 75 65 2c 20 74 68 65 6e 20  d as true, then 
67f0: 6f 6e 6c 79 20 74 68 65 20 63 69 70 68 65 72 73  only the ciphers
6800: 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 20 70   supported for p
6810: 72 6f 74 6f 63 6f 6c 20 77 69 6c 6c 20 62 65 20  rotocol will be 
6820: 6c 69 73 74 65 64 5c 26 2e 0a 54 68 65 20 5c 66  listed\&..The \f
6830: 49 73 75 70 70 6f 72 74 65 64 5c 66 52 20 61 72  Isupported\fR ar
6840: 67 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  g is new for Tcl
6850: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
6860: 0a 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f  .\fBtls::protoco
6870: 6c 73 5c 66 52 0a 52 65 74 75 72 6e 73 20 61 20  ls\fR.Returns a 
6880: 6c 69 73 74 20 6f 66 20 74 68 65 20 73 75 70 70  list of the supp
6890: 6f 72 74 65 64 20 53 53 4c 2f 54 4c 53 20 70 72  orted SSL/TLS pr
68a0: 6f 74 6f 63 6f 6c 73 5c 26 2e 20 56 61 6c 69 64  otocols\&. Valid
68b0: 20 76 61 6c 75 65 73 20 61 72 65 3a 0a 5c 66 42   values are:.\fB
68c0: 73 73 6c 32 5c 66 52 2c 20 5c 66 42 73 73 6c 33  ssl2\fR, \fBssl3
68d0: 5c 66 52 2c 20 5c 66 42 74 6c 73 31 5c 66 52 2c  \fR, \fBtls1\fR,
68e0: 20 5c 66 42 74 6c 73 31 5c 26 2e 31 5c 66 52 2c   \fBtls1\&.1\fR,
68f0: 20 5c 66 42 74 6c 73 31 5c 26 2e 32 5c 66 52 2c   \fBtls1\&.2\fR,
6900: 20 61 6e 64 0a 5c 66 42 74 6c 73 31 5c 26 2e 33   and.\fBtls1\&.3
6910: 5c 66 52 5c 26 2e 20 45 78 61 63 74 20 6c 69 73  \fR\&. Exact lis
6920: 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 4f 70 65  t depends on Ope
6930: 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 61 6e 64  nSSL version and
6940: 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 20 66 6c   compile time fl
6950: 61 67 73 5c 26 2e 0a 54 68 69 73 20 63 6f 6d 6d  ags\&..This comm
6960: 61 6e 64 20 69 73 20 6e 65 77 20 66 6f 72 20 54  and is new for T
6970: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
6980: 54 50 0a 5c 66 42 74 6c 73 3a 3a 76 65 72 73 69  TP.\fBtls::versi
6990: 6f 6e 5c 66 52 0a 52 65 74 75 72 6e 73 20 74 68  on\fR.Returns th
69a0: 65 20 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f  e OpenSSL versio
69b0: 6e 20 73 74 72 69 6e 67 5c 26 2e 0a 2e 50 50 0a  n string\&...PP.
69c0: 2e 53 48 20 22 43 45 52 54 49 46 49 43 41 54 45  .SH "CERTIFICATE
69d0: 20 56 41 4c 49 44 41 54 49 4f 4e 22 0a 2e 53 53   VALIDATION"..SS
69e0: 20 22 50 4b 49 20 41 4e 44 20 43 45 52 54 49 46   "PKI AND CERTIF
69f0: 49 43 41 54 45 53 22 0a 55 73 69 6e 67 20 74 68  ICATES".Using th
6a00: 65 20 50 75 62 6c 69 63 20 4b 65 79 20 49 6e 66  e Public Key Inf
6a10: 72 61 73 74 72 75 63 74 75 72 65 20 28 50 4b 49  rastructure (PKI
6a20: 29 2c 20 65 61 63 68 20 75 73 65 72 20 63 72 65  ), each user cre
6a30: 61 74 65 73 20 61 20 70 72 69 76 61 74 65 20 6b  ates a private k
6a40: 65 79 20 74 68 61 74 0a 6f 6e 6c 79 20 74 68 65  ey that.only the
6a50: 79 20 6b 6e 6f 77 20 61 62 6f 75 74 20 61 6e 64  y know about and
6a60: 20 61 20 70 75 62 6c 69 63 20 6b 65 79 20 74 68   a public key th
6a70: 65 79 20 63 61 6e 20 65 78 63 68 61 6e 67 65 20  ey can exchange 
6a80: 77 69 74 68 20 6f 74 68 65 72 73 20 66 6f 72 20  with others for 
6a90: 75 73 65 20 69 6e 0a 65 6e 63 72 79 70 74 69 6e  use in.encryptin
6aa0: 67 20 61 6e 64 20 64 65 63 72 79 70 74 69 6e 67  g and decrypting
6ab0: 20 64 61 74 61 5c 26 2e 20 54 68 65 20 70 72 6f   data\&. The pro
6ac0: 63 65 73 73 20 69 73 20 74 68 65 20 73 65 6e 64  cess is the send
6ad0: 65 72 20 65 6e 63 72 79 70 74 73 20 74 68 65 69  er encrypts thei
6ae0: 72 20 64 61 74 61 0a 75 73 69 6e 67 20 74 68 65  r data.using the
6af0: 69 72 20 70 72 69 76 61 74 65 20 6b 65 79 20 61  ir private key a
6b00: 6e 64 20 74 68 65 20 72 65 63 65 69 76 65 72 27  nd the receiver'
6b10: 73 20 70 75 62 6c 69 63 20 6b 65 79 5c 26 2e 20  s public key\&. 
6b20: 54 68 65 20 64 61 74 61 20 69 73 20 74 68 65 6e  The data is then
6b30: 20 73 65 6e 74 0a 74 6f 20 74 68 65 20 72 65 63   sent.to the rec
6b40: 65 69 76 65 72 5c 26 2e 20 49 6e 20 61 20 73 69  eiver\&. In a si
6b50: 6d 69 6c 61 72 20 6d 61 6e 6e 65 72 2c 20 74 68  milar manner, th
6b60: 65 20 72 65 63 65 69 76 65 72 20 75 73 65 73 20  e receiver uses 
6b70: 74 68 65 69 72 20 70 72 69 76 61 74 65 20 6b 65  their private ke
6b80: 79 20 61 6e 64 0a 74 68 65 20 73 65 6e 64 65 72  y and.the sender
6b90: 27 73 20 70 75 62 6c 69 63 20 6b 65 79 20 74 6f  's public key to
6ba0: 20 64 65 63 72 79 70 74 20 74 68 65 20 64 61 74   decrypt the dat
6bb0: 61 5c 26 2e 20 54 68 69 73 20 70 72 6f 76 69 64  a\&. This provid
6bc0: 65 73 20 64 61 74 61 20 69 6e 74 65 67 72 69 74  es data integrit
6bd0: 79 2c 20 74 6f 0a 65 6e 73 75 72 65 20 74 68 65  y, to.ensure the
6be0: 20 64 61 74 61 20 63 61 6e 27 74 20 62 65 20 76   data can't be v
6bf0: 69 65 77 65 64 20 6f 72 20 61 6c 74 65 72 65 64  iewed or altered
6c00: 20 64 75 72 69 6e 67 20 74 72 61 6e 73 70 6f 72   during transpor
6c10: 74 5c 26 2e 20 53 65 65 20 74 68 65 0a 5c 66 42  t\&. See the.\fB
6c20: 2d 6b 65 79 5c 66 52 20 61 6e 64 20 5c 66 42 2d  -key\fR and \fB-
6c30: 6b 65 79 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f  keyfile\fR optio
6c40: 6e 73 20 66 6f 72 20 68 6f 77 20 74 6f 20 73 70  ns for how to sp
6c50: 65 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74  ecify the privat
6c60: 65 20 6b 65 79 5c 26 2e 0a 41 6c 73 6f 20 73 65  e key\&..Also se
6c70: 65 20 74 68 65 20 5c 66 42 2d 70 61 73 73 77 6f  e the \fB-passwo
6c80: 72 64 5c 66 52 20 6f 70 74 69 6f 6e 20 66 6f 72  rd\fR option for
6c90: 20 68 6f 77 20 74 6f 20 70 72 6f 76 69 64 65 20   how to provide 
6ca0: 74 68 65 20 70 61 73 73 77 6f 72 64 5c 26 2e 0a  the password\&..
6cb0: 2e 50 50 0a 49 6e 20 6f 72 64 65 72 20 74 6f 20  .PP.In order to 
6cc0: 70 72 6f 76 69 64 65 20 61 75 74 68 65 6e 74 69  provide authenti
6cd0: 63 61 74 69 6f 6e 2c 20 69 5c 26 2e 65 5c 26 2e  cation, i\&.e\&.
6ce0: 20 65 6e 73 75 72 69 6e 67 20 73 6f 6d 65 6f 6e   ensuring someon
6cf0: 65 20 69 73 20 77 68 6f 20 74 68 65 79 20 73 61  e is who they sa
6d00: 79 20 74 68 65 79 0a 61 72 65 2c 20 74 68 65 20  y they.are, the 
6d10: 70 75 62 6c 69 63 20 6b 65 79 20 61 6e 64 20 75  public key and u
6d20: 73 65 72 20 69 64 65 6e 74 69 66 69 63 61 74 69  ser identificati
6d30: 6f 6e 20 69 6e 66 6f 20 69 73 20 73 74 6f 72 65  on info is store
6d40: 64 20 69 6e 20 61 20 58 5c 26 2e 35 30 39 0a 63  d in a X\&.509.c
6d50: 65 72 74 69 66 69 63 61 74 65 20 61 6e 64 20 74  ertificate and t
6d60: 68 61 74 20 63 65 72 74 69 66 69 63 61 74 65 20  hat certificate 
6d70: 69 73 20 61 75 74 68 65 6e 74 69 63 61 74 65 64  is authenticated
6d80: 20 28 69 5c 26 2e 65 5c 26 2e 20 73 69 67 6e 65   (i\&.e\&. signe
6d90: 64 29 20 62 79 20 61 20 43 65 72 74 69 66 69 63  d) by a Certific
6da0: 61 74 65 0a 41 75 74 68 6f 72 69 74 79 20 28 43  ate.Authority (C
6db0: 41 29 5c 26 2e 20 55 73 65 72 73 20 63 61 6e 20  A)\&. Users can 
6dc0: 74 68 65 6e 20 65 78 63 68 61 6e 67 65 20 74 68  then exchange th
6dd0: 65 73 65 20 63 65 72 74 69 66 69 63 61 74 65 73  ese certificates
6de0: 20 64 75 72 69 6e 67 20 74 68 65 20 54 4c 53 0a   during the TLS.
6df0: 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 70  initialization p
6e00: 72 6f 63 65 73 73 20 61 6e 64 20 63 68 65 63 6b  rocess and check
6e10: 20 74 68 65 6d 20 61 67 61 69 6e 73 74 20 74 68   them against th
6e20: 65 20 72 6f 6f 74 20 43 41 20 63 65 72 74 69 66  e root CA certif
6e30: 69 63 61 74 65 73 20 74 6f 20 65 6e 73 75 72 65  icates to ensure
6e40: 0a 74 68 65 79 20 61 72 65 20 76 61 6c 69 64 5c  .they are valid\
6e50: 26 2e 20 54 68 69 73 20 69 73 20 68 61 6e 64 6c  &. This is handl
6e60: 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 20 76 69  ed by OpenSSL vi
6e70: 61 20 74 68 65 20 5c 66 42 2d 72 65 71 75 65 73  a the \fB-reques
6e80: 74 5c 66 52 20 61 6e 64 0a 5c 66 42 2d 72 65 71  t\fR and.\fB-req
6e90: 75 69 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 5c  uire\fR options\
6ea0: 26 2e 20 53 65 65 20 74 68 65 20 5c 66 42 2d 63  &. See the \fB-c
6eb0: 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 64  adir\fR, \fB-cad
6ec0: 69 72 5c 66 52 2c 20 61 6e 64 0a 5c 66 42 2d 63  ir\fR, and.\fB-c
6ed0: 61 73 74 6f 72 65 5c 66 52 20 6f 70 74 69 6f 6e  astore\fR option
6ee0: 73 20 66 6f 72 20 68 6f 77 20 74 6f 20 73 70 65  s for how to spe
6ef0: 63 69 66 79 20 77 68 65 72 65 20 74 6f 20 66 69  cify where to fi
6f00: 6e 64 20 74 68 65 20 43 41 20 63 65 72 74 69 66  nd the CA certif
6f10: 69 63 61 74 65 73 5c 26 2e 0a 4f 70 74 69 6f 6e  icates\&..Option
6f20: 61 6c 6c 79 2c 20 69 6e 20 61 20 66 75 74 75 72  ally, in a futur
6f30: 65 20 72 65 6c 65 61 73 65 2c 20 74 68 65 79 20  e release, they 
6f40: 63 61 6e 20 61 6c 73 6f 20 62 65 20 63 68 65 63  can also be chec
6f50: 6b 65 64 20 61 67 61 69 6e 73 74 20 74 68 65 20  ked against the 
6f60: 43 65 72 74 69 66 69 63 61 74 65 0a 52 65 76 6f  Certificate.Revo
6f70: 63 61 74 69 6f 6e 20 4c 69 73 74 20 28 43 52 4c  cation List (CRL
6f80: 29 20 6f 66 20 72 65 76 6f 6b 65 64 20 63 65 72  ) of revoked cer
6f90: 74 69 66 69 63 61 74 65 73 5c 26 2e 20 43 65 72  tificates\&. Cer
6fa0: 74 69 66 69 63 61 74 65 73 20 63 61 6e 20 61 6c  tificates can al
6fb0: 73 6f 20 62 65 0a 73 65 6c 66 2d 73 69 67 6e 65  so be.self-signe
6fc0: 64 2c 20 62 75 74 20 74 68 65 79 20 61 72 65 20  d, but they are 
6fd0: 62 79 20 64 65 66 61 75 6c 74 20 6e 6f 74 20 74  by default not t
6fe0: 72 75 73 74 65 64 20 75 6e 6c 65 73 73 20 79 6f  rusted unless yo
6ff0: 75 20 61 64 64 20 74 68 65 6d 20 74 6f 20 79 6f  u add them to yo
7000: 75 72 0a 63 65 72 74 69 66 69 63 61 74 65 20 73  ur.certificate s
7010: 74 6f 72 65 5c 26 2e 0a 2e 50 50 0a 54 79 70 69  tore\&...PP.Typi
7020: 63 61 6c 6c 79 20 77 68 65 6e 20 76 69 73 69 74  cally when visit
7030: 69 6e 67 20 77 65 62 20 73 69 74 65 73 2c 20 6f  ing web sites, o
7040: 6e 6c 79 20 74 68 65 20 63 6c 69 65 6e 74 20 6e  nly the client n
7050: 65 65 64 73 20 74 6f 20 63 68 65 63 6b 20 74 68  eeds to check th
7060: 65 20 73 65 72 76 65 72 27 73 0a 63 65 72 74 69  e server's.certi
7070: 66 69 63 61 74 65 20 74 6f 20 65 6e 73 75 72 65  ficate to ensure
7080: 20 69 74 20 69 73 20 76 61 6c 69 64 5c 26 2e 20   it is valid\&. 
7090: 54 68 65 20 73 65 72 76 65 72 20 64 6f 65 73 6e  The server doesn
70a0: 27 74 20 6e 65 65 64 20 74 6f 20 63 68 65 63 6b  't need to check
70b0: 20 74 68 65 20 63 6c 69 65 6e 74 0a 63 65 72 74   the client.cert
70c0: 69 66 69 63 61 74 65 20 75 6e 6c 65 73 73 20 79  ificate unless y
70d0: 6f 75 20 6e 65 65 64 20 74 6f 20 61 75 74 68 65  ou need to authe
70e0: 6e 74 69 63 61 74 65 20 77 69 74 68 20 74 68 65  nticate with the
70f0: 6d 20 74 6f 20 6c 6f 67 69 6e 2c 20 65 74 63 5c  m to login, etc\
7100: 26 2e 20 53 65 65 20 74 68 65 0a 5c 66 42 2d 63  &. See the.\fB-c
7110: 65 72 74 5c 66 52 20 61 6e 64 20 5c 66 42 2d 63  ert\fR and \fB-c
7120: 65 72 74 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f  ertfile\fR optio
7130: 6e 73 20 69 66 20 79 6f 75 20 6e 65 65 64 20 74  ns if you need t
7140: 6f 20 70 72 6f 76 69 64 65 20 61 20 63 65 72 74  o provide a cert
7150: 69 66 69 63 61 74 65 5c 26 2e 0a 2e 53 53 20 22  ificate\&...SS "
7160: 53 55 4d 4d 41 52 59 20 4f 46 20 43 4f 4d 4d 41  SUMMARY OF COMMA
7170: 4e 44 20 4c 49 4e 45 20 4f 50 54 49 4f 4e 53 22  ND LINE OPTIONS"
7180: 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6f  .The following o
7190: 70 74 69 6f 6e 73 20 61 72 65 20 75 73 65 64 20  ptions are used 
71a0: 66 6f 72 20 70 65 65 72 20 63 65 72 74 69 66 69  for peer certifi
71b0: 63 61 74 65 20 76 61 6c 69 64 61 74 69 6f 6e 3a  cate validation:
71c0: 0a 2e 54 50 0a 5c 66 42 2d 63 61 64 69 72 5c 66  ..TP.\fB-cadir\f
71d0: 52 20 5c 66 49 64 69 72 65 63 74 6f 72 79 5c 66  R \fIdirectory\f
71e0: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
71f0: 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20  directory where 
7200: 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20  the Certificate 
7210: 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 20 63  Authority (CA) c
7220: 65 72 74 69 66 69 63 61 74 65 73 20 61 72 65 0a  ertificates are.
7230: 73 74 6f 72 65 64 5c 26 2e 20 54 68 65 20 64 65  stored\&. The de
7240: 66 61 75 6c 74 20 69 73 20 70 6c 61 74 66 6f 72  fault is platfor
7250: 6d 20 73 70 65 63 69 66 69 63 2c 20 62 75 74 20  m specific, but 
7260: 69 73 20 75 73 75 61 6c 6c 79 20 22 5c 66 49 2f  is usually "\fI/
7270: 65 74 63 2f 73 73 6c 2f 63 65 72 74 73 5c 66 52  etc/ssl/certs\fR
7280: 22 20 6f 6e 0a 4c 69 6e 75 78 2f 55 6e 69 78 20  " on.Linux/Unix 
7290: 73 79 73 74 65 6d 73 5c 26 2e 20 54 68 65 20 64  systems\&. The d
72a0: 65 66 61 75 6c 74 20 6c 6f 63 61 74 69 6f 6e 20  efault location 
72b0: 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65  can be overridde
72c0: 6e 20 62 79 20 74 68 65 0a 5c 66 42 53 53 4c 5f  n by the.\fBSSL_
72d0: 43 45 52 54 5f 44 49 52 5c 66 52 20 65 6e 76 69  CERT_DIR\fR envi
72e0: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
72f0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 66 69  \&...TP.\fB-cafi
7300: 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e 61 6d  le\fR \fIfilenam
7310: 65 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  e\fR.Specifies t
7320: 68 65 20 66 69 6c 65 20 77 69 74 68 20 74 68 65  he file with the
7330: 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74   Certificate Aut
7340: 68 6f 72 69 74 79 20 28 43 41 29 20 63 65 72 74  hority (CA) cert
7350: 69 66 69 63 61 74 65 73 20 74 6f 20 75 73 65 20  ificates to use 
7360: 69 6e 0a 5c 66 42 50 45 4d 5c 66 52 20 66 69 6c  in.\fBPEM\fR fil
7370: 65 20 66 6f 72 6d 61 74 5c 26 2e 20 54 68 65 20  e format\&. The 
7380: 64 65 66 61 75 6c 74 20 69 73 20 22 5c 66 49 63  default is "\fIc
7390: 65 72 74 5c 26 2e 70 65 6d 5c 66 52 22 2c 20 69  ert\&.pem\fR", i
73a0: 6e 20 74 68 65 20 4f 70 65 6e 53 53 4c 0a 64 69  n the OpenSSL.di
73b0: 72 65 63 74 6f 72 79 5c 26 2e 20 4f 6e 20 4c 69  rectory\&. On Li
73c0: 6e 75 78 2f 55 6e 69 78 20 73 79 73 74 65 6d 73  nux/Unix systems
73d0: 2c 20 74 68 69 73 20 69 73 20 75 73 75 61 6c 6c  , this is usuall
73e0: 79 20 22 5c 66 49 2f 65 74 63 2f 73 73 6c 2f 63  y "\fI/etc/ssl/c
73f0: 61 2d 62 75 6e 64 6c 65 5c 26 2e 70 65 6d 5c 66  a-bundle\&.pem\f
7400: 52 22 5c 26 2e 0a 54 68 65 20 64 65 66 61 75 6c  R"\&..The defaul
7410: 74 20 66 69 6c 65 20 63 61 6e 20 62 65 20 6f 76  t file can be ov
7420: 65 72 72 69 64 64 65 6e 20 62 79 20 74 68 65 20  erridden by the 
7430: 5c 66 42 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45  \fBSSL_CERT_FILE
7440: 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a  \fR environment.
7450: 76 61 72 69 61 62 6c 65 5c 26 2e 0a 2e 54 50 0a  variable\&...TP.
7460: 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66 52 20 5c  \fB-castore\fR \
7470: 66 49 55 52 49 5c 66 52 0a 53 70 65 63 69 66 69  fIURI\fR.Specifi
7480: 65 73 20 74 68 65 20 55 6e 69 66 6f 72 6d 20 52  es the Uniform R
7490: 65 73 6f 75 72 63 65 20 49 64 65 6e 74 69 66 69  esource Identifi
74a0: 65 72 20 28 55 52 49 29 20 66 6f 72 20 74 68 65  er (URI) for the
74b0: 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74   Certificate Aut
74c0: 68 6f 72 69 74 79 0a 28 43 41 29 20 73 74 6f 72  hority.(CA) stor
74d0: 65 2c 20 77 68 69 63 68 20 6d 61 79 20 62 65 20  e, which may be 
74e0: 61 20 73 69 6e 67 6c 65 20 63 6f 6e 74 61 69 6e  a single contain
74f0: 65 72 20 6f 72 20 61 20 63 61 74 61 6c 6f 67 20  er or a catalog 
7500: 6f 66 20 63 6f 6e 74 61 69 6e 65 72 73 5c 26 2e  of containers\&.
7510: 0a 53 74 61 72 74 69 6e 67 20 77 69 74 68 20 4f  .Starting with O
7520: 70 65 6e 53 53 4c 20 33 5c 26 2e 32 20 6f 6e 20  penSSL 3\&.2 on 
7530: 4d 53 20 57 69 6e 64 6f 77 73 2c 20 73 65 74 20  MS Windows, set 
7540: 74 6f 20 22 5c 66 42 6f 72 67 5c 26 2e 6f 70 65  to "\fBorg\&.ope
7550: 6e 73 73 6c 5c 26 2e 77 69 6e 73 74 6f 72 65 3a  nssl\&.winstore:
7560: 2f 2f 5c 66 52 22 0a 74 6f 20 75 73 65 20 74 68  //\fR".to use th
7570: 65 20 62 75 69 6c 74 2d 69 6e 20 4d 53 20 57 69  e built-in MS Wi
7580: 6e 64 6f 77 73 20 43 65 72 74 69 66 69 63 61 74  ndows Certificat
7590: 65 20 53 74 6f 72 65 5c 26 2e 20 53 74 61 72 74  e Store\&. Start
75a0: 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c  ing in TclTLS 2\
75b0: 26 2e 30 2c 20 74 68 69 73 0a 69 73 20 74 68 65  &.0, this.is the
75c0: 20 64 65 66 61 75 6c 74 20 69 66 20 5c 66 42 2d   default if \fB-
75d0: 63 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61  cadir\fR, \fB-ca
75e0: 64 69 72 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d  dir\fR, and \fB-
75f0: 63 61 73 74 6f 72 65 5c 66 52 20 61 72 65 0a 6e  castore\fR are.n
7600: 6f 74 20 73 70 65 63 69 66 69 65 64 5c 26 2e 20  ot specified\&. 
7610: 54 68 69 73 20 73 74 6f 72 65 20 6f 6e 6c 79 20  This store only 
7620: 73 75 70 70 6f 72 74 73 20 72 6f 6f 74 20 63 65  supports root ce
7630: 72 74 69 66 69 63 61 74 65 20 73 74 6f 72 65 73  rtificate stores
7640: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75  \&...TP.\fB-requ
7650: 65 73 74 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66  est\fR \fIbool\f
7660: 52 0a 52 65 71 75 65 73 74 20 61 20 63 65 72 74  R.Request a cert
7670: 69 66 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65  ificate from the
7680: 20 70 65 65 72 20 64 75 72 69 6e 67 20 74 68 65   peer during the
7690: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26   SSL handshake\&
76a0: 2e 20 54 68 69 73 20 69 73 20 6e 65 65 64 65 64  . This is needed
76b0: 0a 74 6f 20 64 6f 20 43 65 72 74 69 66 69 63 61  .to do Certifica
76c0: 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 26 2e  te Validation\&.
76d0: 20 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c   Starting in Tcl
76e0: 54 4c 53 20 31 5c 26 2e 38 2c 20 74 68 65 20 64  TLS 1\&.8, the d
76f0: 65 66 61 75 6c 74 20 69 73 0a 5c 66 42 74 72 75  efault is.\fBtru
7700: 65 5c 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20  e\fR for client 
7710: 63 6f 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 20 53  connections\&. S
7720: 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c  tarting in TclTL
7730: 53 20 32 5c 26 2e 30 2c 20 69 66 20 73 65 74 20  S 2\&.0, if set 
7740: 74 6f 0a 5c 66 42 66 61 6c 73 65 5c 66 52 20 61  to.\fBfalse\fR a
7750: 6e 64 20 5c 66 42 2d 72 65 71 75 69 72 65 5c 66  nd \fB-require\f
7760: 52 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 2c  R is \fBtrue\fR,
7770: 20 74 68 65 6e 20 74 68 69 73 20 77 69 6c 6c 20   then this will 
7780: 62 65 0a 6f 76 65 72 72 69 64 64 65 6e 20 74 6f  be.overridden to
7790: 20 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 49   \fBtrue\fR\&. I
77a0: 6e 20 61 64 64 69 74 69 6f 6e 2c 20 74 68 65 20  n addition, the 
77b0: 63 6c 69 65 6e 74 20 63 61 6e 20 6d 61 6e 75 61  client can manua
77c0: 6c 6c 79 20 69 6e 73 70 65 63 74 20 61 6e 64 0a  lly inspect and.
77d0: 61 63 63 65 70 74 20 6f 72 20 72 65 6a 65 63 74  accept or reject
77e0: 20 65 61 63 68 20 63 65 72 74 69 66 69 63 61 74   each certificat
77f0: 65 20 75 73 69 6e 67 20 74 68 65 20 5c 66 42 2d  e using the \fB-
7800: 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c  validatecommand\
7810: 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50  fR option\&...TP
7820: 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52 20  .\fB-require\fR 
7830: 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75 69  \fIbool\fR.Requi
7840: 72 65 20 61 20 76 61 6c 69 64 20 63 65 72 74 69  re a valid certi
7850: 66 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65 20  ficate from the 
7860: 70 65 65 72 20 64 75 72 69 6e 67 20 74 68 65 20  peer during the 
7870: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e  SSL handshake\&.
7880: 20 49 66 20 74 68 69 73 20 69 73 0a 73 65 74 20   If this is.set 
7890: 74 6f 20 74 72 75 65 2c 20 74 68 65 6e 20 5c 66  to true, then \f
78a0: 42 2d 72 65 71 75 65 73 74 5c 66 52 20 6d 75 73  B-request\fR mus
78b0: 74 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 6f  t also be set to
78c0: 20 74 72 75 65 20 61 6e 64 20 61 20 65 69 74 68   true and a eith
78d0: 65 72 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c  er.\fB-cadir\fR,
78e0: 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52 2c 20   \fB-cafile\fR, 
78f0: 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66 52 2c 20  \fB-castore\fR, 
7900: 6f 72 20 61 20 70 6c 61 74 66 6f 72 6d 20 64 65  or a platform de
7910: 66 61 75 6c 74 0a 6d 75 73 74 20 62 65 20 70 72  fault.must be pr
7920: 6f 76 69 64 65 64 20 69 6e 20 6f 72 64 65 72 20  ovided in order 
7930: 74 6f 20 76 61 6c 69 64 61 74 65 20 61 67 61 69  to validate agai
7940: 6e 73 74 5c 26 2e 20 54 68 65 20 64 65 66 61 75  nst\&. The defau
7950: 6c 74 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26  lt in TclTLS 1\&
7960: 2e 38 20 61 6e 64 0a 65 61 72 6c 69 65 72 20 76  .8 and.earlier v
7970: 65 72 73 69 6f 6e 73 20 69 73 20 5c 66 42 66 61  ersions is \fBfa
7980: 6c 73 65 5c 66 52 20 73 69 6e 63 65 20 6e 6f 74  lse\fR since not
7990: 20 61 6c 6c 20 70 6c 61 74 66 6f 72 6d 73 20 68   all platforms h
79a0: 61 76 65 20 63 65 72 74 69 66 69 63 61 74 65 73  ave certificates
79b0: 20 74 6f 0a 76 61 6c 69 64 61 74 65 20 61 67 61   to.validate aga
79c0: 69 6e 73 74 20 69 6e 20 61 20 66 6f 72 6d 20 63  inst in a form c
79d0: 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68 20 4f  ompatible with O
79e0: 70 65 6e 53 53 4c 5c 26 2e 20 53 74 61 72 74 69  penSSL\&. Starti
79f0: 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c 26  ng in TclTLS 2\&
7a00: 2e 30 2c 0a 74 68 65 20 64 65 66 61 75 6c 74 20  .0,.the default 
7a10: 69 73 20 5c 66 42 74 72 75 65 5c 66 52 20 66 6f  is \fBtrue\fR fo
7a20: 72 20 63 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74  r client connect
7a30: 69 6f 6e 73 5c 26 2e 0a 2e 50 50 0a 2e 53 53 20  ions\&...PP..SS 
7a40: 22 57 48 45 4e 20 41 52 45 20 43 4f 4d 4d 41 4e  "WHEN ARE COMMAN
7a50: 44 20 4c 49 4e 45 20 4f 50 54 49 4f 4e 53 20 4e  D LINE OPTIONS N
7a60: 45 45 44 45 44 3f 22 0a 49 6e 20 54 63 6c 54 4c  EEDED?".In TclTL
7a70: 53 20 31 5c 26 2e 38 20 61 6e 64 20 65 61 72 6c  S 1\&.8 and earl
7a80: 69 65 72 20 76 65 72 73 69 6f 6e 73 2c 20 63 65  ier versions, ce
7a90: 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 61  rtificate valida
7aa0: 74 69 6f 6e 20 69 73 0a 5c 66 49 4e 4f 54 5c 66  tion is.\fINOT\f
7ab0: 52 20 65 6e 61 62 6c 65 64 20 62 79 20 64 65 66  R enabled by def
7ac0: 61 75 6c 74 5c 26 2e 20 54 68 69 73 20 6c 69 6d  ault\&. This lim
7ad0: 69 74 61 74 69 6f 6e 20 69 73 20 64 75 65 20 74  itation is due t
7ae0: 6f 20 74 68 65 20 6c 61 63 6b 20 6f 66 20 61 20  o the lack of a 
7af0: 63 6f 6d 6d 6f 6e 0a 63 72 6f 73 73 20 70 6c 61  common.cross pla
7b00: 74 66 6f 72 6d 20 64 61 74 61 62 61 73 65 20 6f  tform database o
7b10: 66 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75  f Certificate Au
7b20: 74 68 6f 72 69 74 79 20 28 43 41 29 20 70 72 6f  thority (CA) pro
7b30: 76 69 64 65 64 20 63 65 72 74 69 66 69 63 61 74  vided certificat
7b40: 65 73 20 74 6f 0a 76 61 6c 69 64 61 74 65 20 61  es to.validate a
7b50: 67 61 69 6e 73 74 5c 26 2e 20 4d 61 6e 79 20 4c  gainst\&. Many L
7b60: 69 6e 75 78 20 73 79 73 74 65 6d 73 20 6e 61 74  inux systems nat
7b70: 69 76 65 6c 79 20 73 75 70 70 6f 72 74 20 4f 70  ively support Op
7b80: 65 6e 53 53 4c 20 61 6e 64 20 74 68 75 73 20 68  enSSL and thus h
7b90: 61 76 65 0a 74 68 65 73 65 20 63 65 72 74 69 66  ave.these certif
7ba0: 69 63 61 74 65 73 20 69 6e 73 74 61 6c 6c 65 64  icates installed
7bb0: 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20   as part of the 
7bc0: 4f 53 2c 20 62 75 74 20 4d 61 63 4f 53 20 61 6e  OS, but MacOS an
7bd0: 64 20 4d 53 20 57 69 6e 64 6f 77 73 20 64 6f 20  d MS Windows do 
7be0: 6e 6f 74 5c 26 2e 0a 53 74 61 72 69 6e 67 20 69  not\&..Staring i
7bf0: 6e 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20  n TclTLS 2\&.0, 
7c00: 74 68 65 20 64 65 66 61 75 6c 74 20 66 6f 72 20  the default for 
7c10: 63 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74 69 6f  client connectio
7c20: 6e 73 20 68 61 73 20 62 65 65 6e 20 63 68 61 6e  ns has been chan
7c30: 67 65 64 20 74 6f 0a 72 65 71 75 69 72 65 20 63  ged to.require c
7c40: 65 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64  ertificate valid
7c50: 61 74 69 6f 6e 20 62 79 20 64 65 66 61 75 6c 74  ation by default
7c60: 5c 26 2e 20 49 6e 20 6f 72 64 65 72 20 74 6f 20  \&. In order to 
7c70: 75 73 65 20 74 68 65 20 5c 66 42 2d 72 65 71 75  use the \fB-requ
7c80: 69 72 65 5c 66 52 0a 6f 70 74 69 6f 6e 2c 20 6f  ire\fR.option, o
7c90: 6e 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77  ne of the follow
7ca0: 69 6e 67 20 6d 75 73 74 20 62 65 20 74 72 75 65  ing must be true
7cb0: 3a 0a 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4c 69  :..IP \(bu.On Li
7cc0: 6e 75 78 20 61 6e 64 20 55 6e 69 78 20 73 79 73  nux and Unix sys
7cd0: 74 65 6d 73 20 77 69 74 68 20 4f 70 65 6e 53 53  tems with OpenSS
7ce0: 4c 20 61 6c 72 65 61 64 79 20 69 6e 73 74 61 6c  L already instal
7cf0: 6c 65 64 20 6f 72 20 69 66 20 74 68 65 20 43 41  led or if the CA
7d00: 0a 63 65 72 74 69 66 69 63 61 74 65 73 20 61 72  .certificates ar
7d10: 65 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 50  e available in P
7d20: 45 4d 20 66 6f 72 6d 61 74 2c 20 61 6e 64 20 69  EM format, and i
7d30: 66 20 74 68 65 79 20 61 72 65 20 73 74 6f 72 65  f they are store
7d40: 64 20 69 6e 20 74 68 65 0a 73 74 61 6e 64 61 72  d in the.standar
7d50: 64 20 6c 6f 63 61 74 69 6f 6e 73 2c 20 6f 72 20  d locations, or 
7d60: 69 66 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45  if the \fBSSL_CE
7d70: 52 54 5f 44 49 52 5c 66 52 20 6f 72 20 5c 66 42  RT_DIR\fR or \fB
7d80: 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52  SSL_CERT_FILE\fR
7d90: 0a 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72  .environment var
7da0: 69 61 62 6c 65 73 20 61 72 65 20 73 65 74 2c 20  iables are set, 
7db0: 74 68 65 6e 20 5c 66 42 2d 63 61 64 69 72 5c 66  then \fB-cadir\f
7dc0: 52 2c 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c  R, \fB-cadir\fR,
7dd0: 0a 61 6e 64 20 5c 66 42 2d 63 61 73 74 6f 72 65  .and \fB-castore
7de0: 5c 66 52 20 61 72 65 6e 27 74 20 6e 65 65 64 65  \fR aren't neede
7df0: 64 5c 26 2e 0a 2e 49 50 20 5c 28 62 75 0a 49 66  d\&...IP \(bu.If
7e00: 20 4f 70 65 6e 53 53 4c 20 69 73 20 6e 6f 74 20   OpenSSL is not 
7e10: 69 6e 73 74 61 6c 6c 65 64 20 69 6e 20 74 68 65  installed in the
7e20: 20 64 65 66 61 75 6c 74 20 6c 6f 63 61 74 69 6f   default locatio
7e30: 6e 2c 20 6f 72 20 77 68 65 6e 20 75 73 69 6e 67  n, or when using
7e40: 20 4d 61 63 20 4f 53 0a 6f 72 20 4d 53 20 57 69   Mac OS.or MS Wi
7e50: 6e 64 6f 77 73 20 61 6e 64 20 4f 70 65 6e 53 53  ndows and OpenSS
7e60: 4c 20 69 73 20 69 6e 73 74 61 6c 6c 65 64 2c 20  L is installed, 
7e70: 74 68 65 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f  the \fBSSL_CERT_
7e80: 44 49 52 5c 66 52 20 61 6e 64 2f 6f 72 0a 5c 66  DIR\fR and/or.\f
7e90: 42 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66  BSSL_CERT_FILE\f
7ea0: 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61  R environment va
7eb0: 72 69 61 62 6c 65 73 20 6f 72 20 74 68 65 20 6f  riables or the o
7ec0: 6e 65 20 6f 66 20 74 68 65 20 5c 66 42 2d 63 61  ne of the \fB-ca
7ed0: 64 69 72 5c 66 52 2c 0a 5c 66 42 2d 63 61 64 69  dir\fR,.\fB-cadi
7ee0: 72 5c 66 52 2c 20 6f 72 20 5c 66 42 2d 63 61 73  r\fR, or \fB-cas
7ef0: 74 6f 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20  tore\fR options 
7f00: 6d 75 73 74 20 62 65 20 64 65 66 69 6e 65 64 5c  must be defined\
7f10: 26 2e 0a 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4d  &...IP \(bu.On M
7f20: 53 20 57 69 6e 64 6f 77 73 2c 20 73 74 61 72 74  S Windows, start
7f30: 69 6e 67 20 69 6e 20 4f 70 65 6e 53 53 4c 20 33  ing in OpenSSL 3
7f40: 5c 26 2e 32 2c 20 69 74 20 69 73 20 6e 6f 77 20  \&.2, it is now 
7f50: 70 6f 73 73 69 62 6c 65 20 74 6f 20 61 63 63 65  possible to acce
7f60: 73 73 20 74 68 65 0a 62 75 69 6c 74 2d 69 6e 20  ss the.built-in 
7f70: 57 69 6e 64 6f 77 73 20 43 65 72 74 69 66 69 63  Windows Certific
7f80: 61 74 65 20 53 74 6f 72 65 20 66 72 6f 6d 20 4f  ate Store from O
7f90: 70 65 6e 53 53 4c 5c 26 2e 20 54 68 69 73 20 63  penSSL\&. This c
7fa0: 61 6e 20 62 65 20 75 74 69 6c 69 7a 65 64 20 62  an be utilized b
7fb0: 79 0a 73 65 74 74 69 6e 67 20 74 68 65 20 5c 66  y.setting the \f
7fc0: 42 2d 63 61 73 74 6f 72 65 5c 66 52 20 6f 70 74  B-castore\fR opt
7fd0: 69 6f 6e 20 74 6f 20 22 5c 66 42 6f 72 67 5c 26  ion to "\fBorg\&
7fe0: 2e 6f 70 65 6e 73 73 6c 5c 26 2e 77 69 6e 73 74  .openssl\&.winst
7ff0: 6f 72 65 3a 2f 2f 5c 66 52 22 5c 26 2e 0a 49 6e  ore://\fR"\&..In
8000: 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74   TclTLS 2\&.0, t
8010: 68 69 73 20 69 73 20 74 68 65 20 64 65 66 61 75  his is the defau
8020: 6c 74 20 76 61 6c 75 65 20 69 66 20 5c 66 42 2d  lt value if \fB-
8030: 63 61 64 69 72 5c 66 52 2c 0a 5c 66 42 2d 63 61  cadir\fR,.\fB-ca
8040: 64 69 72 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d  dir\fR, and \fB-
8050: 63 61 73 74 6f 72 65 5c 66 52 20 61 72 65 20 6e  castore\fR are n
8060: 6f 74 20 73 70 65 63 69 66 69 65 64 5c 26 2e 0a  ot specified\&..
8070: 2e 49 50 20 5c 28 62 75 0a 49 66 20 4f 70 65 6e  .IP \(bu.If Open
8080: 53 53 4c 20 69 73 20 6e 6f 74 20 69 6e 73 74 61  SSL is not insta
8090: 6c 6c 65 64 20 6f 72 20 74 68 65 20 43 41 20 63  lled or the CA c
80a0: 65 72 74 69 66 69 63 61 74 65 73 20 61 72 65 20  ertificates are 
80b0: 6e 6f 74 20 61 76 61 69 6c 61 62 6c 65 20 69 6e  not available in
80c0: 20 50 45 4d 0a 66 6f 72 6d 61 74 2c 20 74 68 65   PEM.format, the
80d0: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73   CA certificates
80e0: 20 6d 75 73 74 20 62 65 20 64 6f 77 6e 6c 6f 61   must be downloa
80f0: 64 65 64 20 61 6e 64 20 69 6e 73 74 61 6c 6c 65  ded and installe
8100: 64 20 77 69 74 68 20 74 68 65 20 75 73 65 72 0a  d with the user.
8110: 73 6f 66 74 77 61 72 65 5c 26 2e 20 54 68 65 20  software\&. The 
8120: 43 55 52 4c 20 74 65 61 6d 20 6d 61 6b 65 73 20  CURL team makes 
8130: 74 68 65 6d 20 61 76 61 69 6c 61 62 6c 65 20 61  them available a
8140: 74 0a 5c 66 49 43 41 20 63 65 72 74 69 66 69 63  t.\fICA certific
8150: 61 74 65 73 20 65 78 74 72 61 63 74 65 64 0a 66  ates extracted.f
8160: 72 6f 6d 20 4d 6f 7a 69 6c 6c 61 5c 66 52 20 5b  rom Mozilla\fR [
8170: 68 74 74 70 73 3a 2f 2f 63 75 72 6c 5c 26 2e 73  https://curl\&.s
8180: 65 2f 64 6f 63 73 2f 63 61 65 78 74 72 61 63 74  e/docs/caextract
8190: 5c 26 2e 68 74 6d 6c 5d 20 69 6e 20 74 68 65 20  \&.html] in the 
81a0: 22 5c 66 49 63 61 63 65 72 74 5c 26 2e 70 65 6d  "\fIcacert\&.pem
81b0: 5c 66 52 22 20 66 69 6c 65 5c 26 2e 20 59 6f 75  \fR" file\&. You
81c0: 20 6d 75 73 74 20 74 68 65 6e 20 65 69 74 68 65   must then eithe
81d0: 72 20 73 65 74 20 74 68 65 0a 5c 66 42 53 53 4c  r set the.\fBSSL
81e0: 5f 43 45 52 54 5f 44 49 52 5c 66 52 20 61 6e 64  _CERT_DIR\fR and
81f0: 2f 6f 72 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f  /or \fBSSL_CERT_
8200: 46 49 4c 45 5c 66 52 20 65 6e 76 69 72 6f 6e 6d  FILE\fR environm
8210: 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 6f 72  ent variables or
8220: 20 74 68 65 0a 5c 66 42 2d 63 61 64 69 72 5c 66   the.\fB-cadir\f
8230: 52 20 6f 72 20 5c 66 42 2d 63 61 66 69 6c 65 5c  R or \fB-cafile\
8240: 66 52 20 6f 70 74 69 6f 6e 73 20 74 6f 20 74 68  fR options to th
8250: 65 20 43 41 20 63 65 72 74 20 66 69 6c 65 27 73  e CA cert file's
8260: 20 69 6e 73 74 61 6c 6c 0a 6c 6f 63 61 74 69 6f   install.locatio
8270: 6e 5c 26 2e 20 49 74 20 69 73 20 79 6f 75 72 20  n\&. It is your 
8280: 72 65 73 70 6f 6e 73 69 62 69 6c 69 74 79 20 74  responsibility t
8290: 6f 20 6b 65 65 70 20 74 68 69 73 20 66 69 6c 65  o keep this file
82a0: 20 75 70 20 74 6f 20 64 61 74 65 5c 26 2e 0a 2e   up to date\&...
82b0: 50 50 0a 2e 53 48 20 22 43 41 4c 4c 42 41 43 4b  PP..SH "CALLBACK
82c0: 20 4f 50 54 49 4f 4e 53 22 0a 41 73 20 70 72 65   OPTIONS".As pre
82d0: 76 69 6f 75 73 6c 79 20 64 65 73 63 72 69 62 65  viously describe
82e0: 64 2c 20 65 61 63 68 20 63 68 61 6e 6e 65 6c 20  d, each channel 
82f0: 63 61 6e 20 62 65 20 67 69 76 65 6e 20 74 68 65  can be given the
8300: 69 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 73  ir own callbacks
8310: 0a 74 6f 20 68 61 6e 64 6c 65 20 69 6e 74 65 72  .to handle inter
8320: 6d 65 64 69 61 74 65 20 70 72 6f 63 65 73 73 69  mediate processi
8330: 6e 67 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53  ng by the OpenSS
8340: 4c 20 6c 69 62 72 61 72 79 2c 20 75 73 69 6e 67  L library, using
8350: 20 74 68 65 0a 5c 66 42 2d 63 6f 6d 6d 61 6e 64   the.\fB-command
8360: 5c 66 52 2c 20 5c 66 42 2d 70 61 73 73 77 6f 72  \fR, \fB-passwor
8370: 64 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d 76 61  d\fR, and \fB-va
8380: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66  lidate_command\f
8390: 52 20 6f 70 74 69 6f 6e 73 0a 70 61 73 73 65 64  R options.passed
83a0: 20 74 6f 20 65 69 74 68 65 72 20 6f 66 20 5c 66   to either of \f
83b0: 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66 52 20  Btls::socket\fR 
83c0: 6f 72 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72  or \fBtls::impor
83d0: 74 5c 66 52 5c 26 2e 0a 55 6e 6c 69 6b 65 20 70  t\fR\&..Unlike p
83e0: 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 73  revious versions
83f0: 20 6f 66 20 54 63 6c 54 4c 53 2c 20 6f 6e 6c 79   of TclTLS, only
8400: 20 69 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b   if the callback
8410: 20 67 65 6e 65 72 61 74 65 73 20 61 6e 20 65 72   generates an er
8420: 72 6f 72 2c 0a 77 69 6c 6c 20 74 68 65 20 5c 66  ror,.will the \f
8430: 42 62 67 65 72 72 6f 72 5c 66 52 20 63 6f 6d 6d  Bbgerror\fR comm
8440: 61 6e 64 20 62 65 20 69 6e 76 6f 6b 65 64 20 77  and be invoked w
8450: 69 74 68 20 74 68 65 20 65 72 72 6f 72 20 69 6e  ith the error in
8460: 66 6f 72 6d 61 74 69 6f 6e 5c 26 2e 0a 2e 53 53  formation\&...SS
8470: 20 22 56 41 4c 55 45 53 20 46 4f 52 20 43 4f 4d   "VALUES FOR COM
8480: 4d 41 4e 44 20 43 41 4c 4c 42 41 43 4b 22 0a 54  MAND CALLBACK".T
8490: 68 65 20 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20  he callback for 
84a0: 74 68 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c  the \fB-command\
84b0: 66 52 20 6f 70 74 69 6f 6e 20 69 73 20 69 6e 76  fR option is inv
84c0: 6f 6b 65 64 20 61 74 20 73 65 76 65 72 61 6c 20  oked at several 
84d0: 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20 74 68  points during th
84e0: 65 0a 4f 70 65 6e 53 53 4c 20 68 61 6e 64 73 68  e.OpenSSL handsh
84f0: 61 6b 65 20 61 6e 64 20 64 75 72 69 6e 67 20 72  ake and during r
8500: 6f 75 74 69 6e 65 20 6f 70 65 72 61 74 69 6f 6e  outine operation
8510: 73 5c 26 2e 20 53 65 65 20 62 65 6c 6f 77 20 66  s\&. See below f
8520: 6f 72 20 74 68 65 20 70 6f 73 73 69 62 6c 65 0a  or the possible.
8530: 61 72 67 75 6d 65 6e 74 73 20 70 61 73 73 65 64  arguments passed
8540: 20 74 6f 20 74 68 65 20 63 61 6c 6c 62 61 63 6b   to the callback
8550: 20 73 63 72 69 70 74 5c 26 2e 20 56 61 6c 75 65   script\&. Value
8560: 73 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20  s returned from 
8570: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 61 72 65  the callback are
8580: 0a 69 67 6e 6f 72 65 64 5c 26 2e 0a 2e 54 50 0a  .ignored\&...TP.
8590: 5c 66 42 65 72 72 6f 72 5c 66 52 20 5c 66 49 63  \fBerror\fR \fIc
85a0: 68 61 6e 6e 65 6c 49 64 20 6d 65 73 73 61 67 65  hannelId message
85b0: 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66  \fR.This form of
85c0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76   callback is inv
85d0: 6f 6b 65 64 20 77 68 65 6e 65 76 65 72 20 61 6e  oked whenever an
85e0: 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 64 75   error occurs du
85f0: 72 69 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c  ring the initial
8600: 0a 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 68 61 6e  .connection, han
8610: 64 73 68 61 6b 65 2c 20 6f 72 20 49 2f 4f 20 6f  dshake, or I/O o
8620: 70 65 72 61 74 69 6f 6e 73 5c 26 2e 20 54 68 65  perations\&. The
8630: 20 5c 66 49 6d 65 73 73 61 67 65 5c 66 52 20 61   \fImessage\fR a
8640: 72 67 75 6d 65 6e 74 20 63 61 6e 20 62 65 0a 66  rgument can be.f
8650: 72 6f 6d 20 74 68 65 20 54 63 6c 5f 45 72 72 6e  rom the Tcl_Errn
8660: 6f 4d 73 67 2c 20 4f 70 65 6e 53 53 4c 20 66 75  oMsg, OpenSSL fu
8670: 6e 63 74 69 6f 6e 20 5c 66 42 45 52 52 5f 72 65  nction \fBERR_re
8680: 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 69 6e  ason_error_strin
8690: 67 28 29 5c 66 52 2c 0a 6f 72 20 61 20 63 75 73  g()\fR,.or a cus
86a0: 74 6f 6d 20 6d 65 73 73 61 67 65 5c 26 2e 20 54  tom message\&. T
86b0: 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20  his callback is 
86c0: 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31  new for TclTLS 1
86d0: 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69  \&.8\&...TP.\fBi
86e0: 6e 66 6f 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65  nfo\fR \fIchanne
86f0: 6c 49 64 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20  lId major minor 
8700: 6d 65 73 73 61 67 65 20 74 79 70 65 5c 66 52 0a  message type\fR.
8710: 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c  This form of cal
8720: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64  lback is invoked
8730: 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20   by the OpenSSL 
8740: 66 75 6e 63 74 69 6f 6e 0a 5c 66 42 53 53 4c 5f  function.\fBSSL_
8750: 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61 63  set_info_callbac
8760: 6b 28 29 5c 66 52 20 64 75 72 69 6e 67 20 74 68  k()\fR during th
8770: 65 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63  e initial connec
8780: 74 69 6f 6e 20 61 6e 64 20 68 61 6e 64 73 68 61  tion and handsha
8790: 6b 65 0a 6f 70 65 72 61 74 69 6f 6e 73 5c 26 2e  ke.operations\&.
87a0: 20 54 68 65 20 61 72 67 75 6d 65 6e 74 73 20 61   The arguments a
87b0: 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66 49 6d  re:..RS..TP.\fIm
87c0: 61 6a 6f 72 5c 66 52 0a 4d 61 6a 6f 72 20 63 61  ajor\fR.Major ca
87d0: 74 65 67 6f 72 79 20 66 6f 72 20 65 72 72 6f 72  tegory for error
87e0: 5c 26 2e 20 56 61 6c 69 64 20 65 6e 75 6d 73 20  \&. Valid enums 
87f0: 61 72 65 3a 20 5c 66 42 68 61 6e 64 73 68 61 6b  are: \fBhandshak
8800: 65 5c 66 52 2c 20 5c 66 42 61 6c 65 72 74 5c 66  e\fR, \fBalert\f
8810: 52 2c 0a 5c 66 42 63 6f 6e 6e 65 63 74 5c 66 52  R,.\fBconnect\fR
8820: 2c 20 5c 66 42 61 63 63 65 70 74 5c 66 52 5c 26  , \fBaccept\fR\&
8830: 2e 0a 2e 54 50 0a 5c 66 49 6d 69 6e 6f 72 5c 66  ...TP.\fIminor\f
8840: 52 0a 4d 69 6e 6f 72 20 63 61 74 65 67 6f 72 79  R.Minor category
8850: 20 66 6f 72 20 65 72 72 6f 72 5c 26 2e 20 56 61   for error\&. Va
8860: 6c 69 64 20 65 6e 75 6d 73 20 61 72 65 3a 20 5c  lid enums are: \
8870: 66 42 73 74 61 72 74 5c 66 52 2c 20 5c 66 42 64  fBstart\fR, \fBd
8880: 6f 6e 65 5c 66 52 2c 20 5c 66 42 72 65 61 64 5c  one\fR, \fBread\
8890: 66 52 2c 0a 5c 66 42 77 72 69 74 65 5c 66 52 2c  fR,.\fBwrite\fR,
88a0: 20 5c 66 42 6c 6f 6f 70 5c 66 52 2c 20 5c 66 42   \fBloop\fR, \fB
88b0: 65 78 69 74 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c  exit\fR\&...TP.\
88c0: 66 49 6d 65 73 73 61 67 65 5c 66 52 0a 44 65 73  fImessage\fR.Des
88d0: 63 72 69 70 74 69 76 65 20 6d 65 73 73 61 67 65  criptive message
88e0: 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61   string which ma
88f0: 79 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 65  y be generated e
8900: 69 74 68 65 72 20 62 79 0a 5c 66 42 53 53 4c 5f  ither by.\fBSSL_
8910: 73 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e  state_string_lon
8920: 67 28 29 5c 66 52 20 6f 72 20 5c 66 42 53 53 4c  g()\fR or \fBSSL
8930: 5f 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 72 69  _alert_desc_stri
8940: 6e 67 5f 6c 6f 6e 67 28 29 5c 66 52 2c 0a 64 65  ng_long()\fR,.de
8950: 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 63  pending on the c
8960: 6f 6e 74 65 78 74 5c 26 2e 0a 2e 54 50 0a 5c 66  ontext\&...TP.\f
8970: 49 74 79 70 65 5c 66 52 0a 46 6f 72 20 61 6c 65  Itype\fR.For ale
8980: 72 74 73 2c 20 74 68 65 20 70 6f 73 73 69 62 6c  rts, the possibl
8990: 65 20 76 61 6c 75 65 73 20 61 72 65 3a 20 5c 66  e values are: \f
89a0: 42 77 61 72 6e 69 6e 67 5c 66 52 2c 0a 5c 66 42  Bwarning\fR,.\fB
89b0: 66 61 74 61 6c 5c 66 52 2c 20 61 6e 64 20 5c 66  fatal\fR, and \f
89c0: 42 75 6e 6b 6e 6f 77 6e 5c 66 52 5c 26 2e 20 46  Bunknown\fR\&. F
89d0: 6f 72 20 6f 74 68 65 72 73 2c 20 5c 66 42 69 6e  or others, \fBin
89e0: 66 6f 5c 66 52 20 69 73 20 75 73 65 64 5c 26 2e  fo\fR is used\&.
89f0: 0a 54 68 69 73 20 61 72 67 75 6d 65 6e 74 20 69  .This argument i
8a00: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
8a10: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 54   1\&.8\&...RE..T
8a20: 50 0a 5c 66 42 6d 65 73 73 61 67 65 5c 66 52 20  P.\fBmessage\fR 
8a30: 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 64 69 72  \fIchannelId dir
8a40: 65 63 74 69 6f 6e 20 76 65 72 73 69 6f 6e 20 63  ection version c
8a50: 6f 6e 74 65 6e 74 5f 74 79 70 65 20 6d 65 73 73  ontent_type mess
8a60: 61 67 65 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d  age\fR.This form
8a70: 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20   of callback is 
8a80: 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f  invoked by the O
8a90: 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a  penSSL function.
8aa0: 5c 66 42 53 53 4c 5f 73 65 74 5f 6d 73 67 5f 63  \fBSSL_set_msg_c
8ab0: 61 6c 6c 62 61 63 6b 28 29 5c 66 52 20 77 68 65  allback()\fR whe
8ac0: 6e 65 76 65 72 20 61 20 6d 65 73 73 61 67 65 20  never a message 
8ad0: 69 73 20 73 65 6e 74 20 6f 72 20 72 65 63 65 69  is sent or recei
8ae0: 76 65 64 20 64 75 72 69 6e 67 20 74 68 65 0a 69  ved during the.i
8af0: 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f  nitial connectio
8b00: 6e 2c 20 68 61 6e 64 73 68 61 6b 65 2c 20 6f 72  n, handshake, or
8b10: 20 49 2f 4f 20 6f 70 65 72 61 74 69 6f 6e 73 5c   I/O operations\
8b20: 26 2e 20 49 74 20 69 73 20 6f 6e 6c 79 20 61 76  &. It is only av
8b30: 61 69 6c 61 62 6c 65 20 77 68 65 6e 0a 4f 70 65  ailable when.Ope
8b40: 6e 53 53 4c 20 69 73 20 63 6f 6d 70 6c 69 65 64  nSSL is complied
8b50: 20 77 69 74 68 20 74 68 65 20 5c 66 42 65 6e 61   with the \fBena
8b60: 62 6c 65 2d 73 73 6c 2d 74 72 61 63 65 5c 66 52  ble-ssl-trace\fR
8b70: 20 6f 70 74 69 6f 6e 5c 26 2e 20 54 68 69 73 20   option\&. This 
8b80: 63 61 6c 6c 62 61 63 6b 20 69 73 0a 6e 65 77 20  callback is.new 
8b90: 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for TclTLS 1\&.8
8ba0: 5c 26 2e 20 54 68 65 20 61 72 67 75 6d 65 6e 74  \&. The argument
8bb0: 73 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c  s are:..RS..TP.\
8bc0: 66 49 64 69 72 65 63 74 69 6f 6e 5c 66 52 0a 44  fIdirection\fR.D
8bd0: 69 72 65 63 74 69 6f 6e 20 69 73 20 65 69 74 68  irection is eith
8be0: 65 72 20 5c 66 42 53 65 6e 74 5c 66 52 20 6f 72  er \fBSent\fR or
8bf0: 20 5c 66 42 52 65 63 65 69 76 65 64 5c 66 52 5c   \fBReceived\fR\
8c00: 26 2e 0a 2e 54 50 0a 5c 66 49 76 65 72 73 69 6f  &...TP.\fIversio
8c10: 6e 5c 66 52 0a 56 65 72 73 69 6f 6e 20 69 73 20  n\fR.Version is 
8c20: 74 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72  the protocol ver
8c30: 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 49 63  sion\&...TP.\fIc
8c40: 6f 6e 74 65 6e 74 5f 74 79 70 65 5c 66 52 0a 43  ontent_type\fR.C
8c50: 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73 20 74  ontent type is t
8c60: 68 65 20 6d 65 73 73 61 67 65 20 63 6f 6e 74 65  he message conte
8c70: 6e 74 20 74 79 70 65 5c 26 2e 0a 2e 54 50 0a 5c  nt type\&...TP.\
8c80: 66 49 6d 65 73 73 61 67 65 5c 66 52 0a 4d 65 73  fImessage\fR.Mes
8c90: 73 61 67 65 20 69 73 20 6d 6f 72 65 20 69 6e 66  sage is more inf
8ca0: 6f 20 66 72 6f 6d 20 74 68 65 20 5c 66 42 53 53  o from the \fBSS
8cb0: 4c 5f 74 72 61 63 65 5c 66 52 20 41 50 49 5c 26  L_trace\fR API\&
8cc0: 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 73 65 73  ...RE..TP.\fBses
8cd0: 73 69 6f 6e 5c 66 52 20 5c 66 49 63 68 61 6e 6e  sion\fR \fIchann
8ce0: 65 6c 49 64 20 73 65 73 73 69 6f 6e 5f 69 64 20  elId session_id 
8cf0: 73 65 73 73 69 6f 6e 5f 74 69 63 6b 65 74 20 6c  session_ticket l
8d00: 69 66 65 74 69 6d 65 5c 66 52 0a 54 68 69 73 20  ifetime\fR.This 
8d10: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b  form of callback
8d20: 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74   is invoked by t
8d30: 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74  he OpenSSL funct
8d40: 69 6f 6e 0a 5c 66 42 53 53 4c 5f 43 54 58 5f 73  ion.\fBSSL_CTX_s
8d50: 65 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62 28 29  ess_set_new_cb()
8d60: 5c 66 52 20 77 68 65 6e 65 76 65 72 20 61 20 6e  \fR whenever a n
8d70: 65 77 20 73 65 73 73 69 6f 6e 20 69 64 20 69 73  ew session id is
8d80: 20 73 65 6e 74 20 62 79 20 74 68 65 0a 73 65 72   sent by the.ser
8d90: 76 65 72 20 64 75 72 69 6e 67 20 74 68 65 20 69  ver during the i
8da0: 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f  nitial connectio
8db0: 6e 20 61 6e 64 20 68 61 6e 64 73 68 61 6b 65 20  n and handshake 
8dc0: 61 6e 64 20 61 6c 73 6f 20 64 75 72 69 6e 67 20  and also during 
8dd0: 74 68 65 20 73 65 73 73 69 6f 6e 0a 69 66 20 74  the session.if t
8de0: 68 65 20 5c 66 42 2d 70 6f 73 74 5f 68 61 6e 64  he \fB-post_hand
8df0: 73 68 61 6b 65 5c 66 52 20 6f 70 74 69 6f 6e 20  shake\fR option 
8e00: 69 73 20 73 65 74 20 74 6f 20 74 72 75 65 5c 26  is set to true\&
8e10: 2e 20 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20  . This callback 
8e20: 69 73 20 6e 65 77 20 66 6f 72 0a 54 63 6c 54 4c  is new for.TclTL
8e30: 53 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65 20 61  S 1\&.8\&. The a
8e40: 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e 52  rguments are:..R
8e50: 53 0a 2e 54 50 0a 5c 66 49 73 65 73 73 69 6f 6e  S..TP.\fIsession
8e60: 5f 69 64 5c 66 52 0a 53 65 73 73 69 6f 6e 20 49  _id\fR.Session I
8e70: 64 20 69 73 20 74 68 65 20 63 75 72 72 65 6e 74  d is the current
8e80: 20 73 65 73 73 69 6f 6e 20 69 64 65 6e 74 69 66   session identif
8e90: 69 65 72 0a 2e 54 50 0a 5c 66 49 73 65 73 73 69  ier..TP.\fIsessi
8ea0: 6f 6e 5f 74 69 63 6b 65 74 5c 66 52 0a 54 69 63  on_ticket\fR.Tic
8eb0: 6b 65 74 20 69 73 20 74 68 65 20 73 65 73 73 69  ket is the sessi
8ec0: 6f 6e 20 74 69 63 6b 65 74 20 69 6e 66 6f 0a 2e  on ticket info..
8ed0: 54 50 0a 5c 66 49 6c 69 66 65 74 69 6d 65 5c 66  TP.\fIlifetime\f
8ee0: 52 0a 4c 69 66 65 74 69 6d 65 20 69 73 20 74 68  R.Lifetime is th
8ef0: 65 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d  e ticket lifetim
8f00: 65 20 69 6e 20 73 65 63 6f 6e 64 73 5c 26 2e 0a  e in seconds\&..
8f10: 2e 52 45 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66  .RE..TP.\fBverif
8f20: 79 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49  y\fR \fIchannelI
8f30: 64 20 64 65 70 74 68 20 63 65 72 74 20 73 74 61  d depth cert sta
8f40: 74 75 73 20 65 72 72 6f 72 5c 66 52 0a 54 68 69  tus error\fR.Thi
8f50: 73 20 63 61 6c 6c 62 61 63 6b 20 77 61 73 20 6d  s callback was m
8f60: 6f 76 65 64 20 74 6f 20 5c 66 42 2d 76 61 6c 69  oved to \fB-vali
8f70: 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66 52 20 69  datecommand\fR i
8f80: 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  n TclTLS 1\&.8\&
8f90: 2e 0a 2e 50 50 0a 2e 53 53 20 22 56 41 4c 55 45  ...PP..SS "VALUE
8fa0: 53 20 46 4f 52 20 50 41 53 53 57 4f 52 44 20 43  S FOR PASSWORD C
8fb0: 41 4c 4c 42 41 43 4b 22 0a 54 68 65 20 63 61 6c  ALLBACK".The cal
8fc0: 6c 62 61 63 6b 20 66 6f 72 20 74 68 65 20 5c 66  lback for the \f
8fd0: 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 20 6f 70  B-password\fR op
8fe0: 74 69 6f 6e 20 69 73 20 69 6e 76 6f 6b 65 64 20  tion is invoked 
8ff0: 62 79 20 54 63 6c 54 4c 53 20 77 68 65 6e 65 76  by TclTLS whenev
9000: 65 72 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73  er OpenSSL needs
9010: 0a 74 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 73  .to obtain a pas
9020: 73 77 6f 72 64 5c 26 2e 20 53 65 65 20 62 65 6c  sword\&. See bel
9030: 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69  ow for the possi
9040: 62 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 70 61  ble arguments pa
9050: 73 73 65 64 20 74 6f 20 74 68 65 0a 63 61 6c 6c  ssed to the.call
9060: 62 61 63 6b 20 73 63 72 69 70 74 5c 26 2e 20 54  back script\&. T
9070: 68 65 20 75 73 65 72 20 70 72 6f 76 69 64 65 64  he user provided
9080: 20 70 61 73 73 77 6f 72 64 20 69 73 20 65 78 70   password is exp
9090: 65 63 74 65 64 20 74 6f 20 62 65 20 72 65 74 75  ected to be retu
90a0: 72 6e 65 64 20 62 79 20 74 68 65 0a 63 61 6c 6c  rned by the.call
90b0: 62 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70  back\&...TP.\fBp
90c0: 61 73 73 77 6f 72 64 5c 66 52 20 5c 66 49 72 77  assword\fR \fIrw
90d0: 66 6c 61 67 20 73 69 7a 65 5c 66 52 0a 49 6e 76  flag size\fR.Inv
90e0: 6f 6b 65 64 20 77 68 65 6e 20 6c 6f 61 64 69 6e  oked when loadin
90f0: 67 20 6f 72 20 73 74 6f 72 69 6e 67 20 61 6e 20  g or storing an 
9100: 65 6e 63 72 79 70 74 65 64 20 50 45 4d 20 63 65  encrypted PEM ce
9110: 72 74 69 66 69 63 61 74 65 5c 26 2e 20 54 68 65  rtificate\&. The
9120: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a   arguments are:.
9130: 2e 52 53 0a 2e 54 50 0a 5c 66 49 72 77 66 6c 61  .RS..TP.\fIrwfla
9140: 67 5c 66 52 0a 54 68 65 20 72 65 61 64 2f 77 72  g\fR.The read/wr
9150: 69 74 65 20 66 6c 61 67 20 69 73 20 30 20 66 6f  ite flag is 0 fo
9160: 72 20 72 65 61 64 69 6e 67 2f 64 65 63 72 79 70  r reading/decryp
9170: 74 69 6f 6e 20 6f 72 20 31 20 66 6f 72 20 77 72  tion or 1 for wr
9180: 69 74 69 6e 67 2f 65 6e 63 72 79 70 74 69 6f 6e  iting/encryption
9190: 5c 26 2e 0a 54 68 65 20 6c 61 74 74 65 72 20 63  \&..The latter c
91a0: 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 64 65  an be used to de
91b0: 74 65 72 6d 69 6e 65 20 77 68 65 6e 20 74 6f 20  termine when to 
91c0: 70 72 6f 6d 70 74 20 74 68 65 20 75 73 65 72 20  prompt the user 
91d0: 74 6f 20 63 6f 6e 66 69 72 6d 5c 26 2e 0a 54 68  to confirm\&..Th
91e0: 69 73 20 61 72 67 75 6d 65 6e 74 20 69 73 20 6e  is argument is n
91f0: 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c  ew for TclTLS 1\
9200: 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 49 73 69  &.8\&...TP.\fIsi
9210: 7a 65 5c 66 52 0a 54 68 65 20 73 69 7a 65 20 69  ze\fR.The size i
9220: 73 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 6c 65  s the maximum le
9230: 6e 67 74 68 20 6f 66 20 74 68 65 20 70 61 73 73  ngth of the pass
9240: 77 6f 72 64 20 69 6e 20 62 79 74 65 73 5c 26 2e  word in bytes\&.
9250: 0a 54 68 69 73 20 61 72 67 75 6d 65 6e 74 20 69  .This argument i
9260: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
9270: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 50   1\&.8\&...RE..P
9280: 50 0a 2e 53 53 20 22 56 41 4c 55 45 53 20 46 4f  P..SS "VALUES FO
9290: 52 20 56 41 4c 49 44 41 54 45 20 43 4f 4d 4d 41  R VALIDATE COMMA
92a0: 4e 44 20 43 41 4c 4c 42 41 43 4b 22 0a 54 68 65  ND CALLBACK".The
92b0: 20 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20 74 68   callback for th
92c0: 65 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 63 6f  e \fB-validateco
92d0: 6d 6d 61 6e 64 5c 66 52 20 6f 70 74 69 6f 6e 20  mmand\fR option 
92e0: 69 73 20 69 6e 76 6f 6b 65 64 20 64 75 72 69 6e  is invoked durin
92f0: 67 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 0a  g the handshake.
9300: 70 72 6f 63 65 73 73 20 69 6e 20 6f 72 64 65 72  process in order
9310: 20 66 6f 72 20 74 68 65 20 61 70 70 6c 69 63 61   for the applica
9320: 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65  tion to validate
9330: 20 74 68 65 20 70 72 6f 76 69 64 65 64 20 76 61   the provided va
9340: 6c 75 65 28 73 29 5c 26 2e 20 53 65 65 0a 62 65  lue(s)\&. See.be
9350: 6c 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73  low for the poss
9360: 69 62 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 70  ible arguments p
9370: 61 73 73 65 64 20 74 6f 20 74 68 65 20 63 61 6c  assed to the cal
9380: 6c 62 61 63 6b 20 73 63 72 69 70 74 5c 26 2e 20  lback script\&. 
9390: 49 66 20 6e 6f 74 0a 73 70 65 63 69 66 69 65 64  If not.specified
93a0: 2c 20 4f 70 65 6e 53 53 4c 20 77 69 6c 6c 20 61  , OpenSSL will a
93b0: 63 63 65 70 74 20 61 6c 6c 20 76 61 6c 69 64 20  ccept all valid 
93c0: 63 65 72 74 69 66 69 63 61 74 65 73 20 61 6e 64  certificates and
93d0: 20 65 78 74 65 6e 73 69 6f 6e 73 5c 26 2e 20 54   extensions\&. T
93e0: 6f 20 72 65 6a 65 63 74 0a 74 68 65 20 76 61 6c  o reject.the val
93f0: 75 65 20 61 6e 64 20 61 62 6f 72 74 20 74 68 65  ue and abort the
9400: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 74 68 65   connection, the
9410: 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64   callback should
9420: 20 72 65 74 75 72 6e 20 30 5c 26 2e 20 54 6f 20   return 0\&. To 
9430: 61 63 63 65 70 74 20 74 68 65 0a 76 61 6c 75 65  accept the.value
9440: 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20 74 68   and continue th
9450: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69 74  e connection, it
9460: 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 31   should return 1
9470: 5c 26 2e 20 54 6f 20 72 65 6a 65 63 74 20 74 68  \&. To reject th
9480: 65 20 76 61 6c 75 65 2c 20 62 75 74 0a 63 6f 6e  e value, but.con
9490: 74 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65 63  tinue the connec
94a0: 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64 20  tion, it should 
94b0: 72 65 74 75 72 6e 20 32 5c 26 2e 20 54 68 69 73  return 2\&. This
94c0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77   callback is new
94d0: 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e   for TclTLS 1\&.
94e0: 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 61 6c 70 6e  8\&...TP.\fBalpn
94f0: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64  \fR \fIchannelId
9500: 20 70 72 6f 74 6f 63 6f 6c 20 6d 61 74 63 68 5c   protocol match\
9510: 66 52 0a 46 6f 72 20 73 65 72 76 65 72 73 2c 20  fR.For servers, 
9520: 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c  this form of cal
9530: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64  lback is invoked
9540: 20 77 68 65 6e 20 74 68 65 20 63 6c 69 65 6e 74   when the client
9550: 20 41 4c 50 4e 20 65 78 74 65 6e 73 69 6f 6e 20   ALPN extension 
9560: 69 73 0a 72 65 63 65 69 76 65 64 5c 26 2e 20 49  is.received\&. I
9570: 66 20 5c 66 49 6d 61 74 63 68 5c 66 52 20 69 73  f \fImatch\fR is
9580: 20 74 72 75 65 2c 20 74 68 65 6e 20 5c 66 49 70   true, then \fIp
9590: 72 6f 74 6f 63 6f 6c 5c 66 52 20 69 73 20 74 68  rotocol\fR is th
95a0: 65 20 66 69 72 73 74 0a 5c 66 42 2d 61 6c 70 6e  e first.\fB-alpn
95b0: 5c 66 52 20 70 72 6f 74 6f 63 6f 6c 20 6f 70 74  \fR protocol opt
95c0: 69 6f 6e 20 69 6e 20 63 6f 6d 6d 6f 6e 20 74 6f  ion in common to
95d0: 20 62 6f 74 68 20 74 68 65 20 63 6c 69 65 6e 74   both the client
95e0: 20 61 6e 64 20 73 65 72 76 65 72 5c 26 2e 0a 49   and server\&..I
95f0: 66 20 6e 6f 74 2c 20 74 68 65 20 66 69 72 73 74  f not, the first
9600: 20 63 6c 69 65 6e 74 20 73 70 65 63 69 66 69 65   client specifie
9610: 64 20 70 72 6f 74 6f 63 6f 6c 20 69 73 20 75 73  d protocol is us
9620: 65 64 5c 26 2e 20 54 68 69 73 20 63 61 6c 6c 62  ed\&. This callb
9630: 61 63 6b 20 69 73 20 63 61 6c 6c 65 64 0a 61 66  ack is called.af
9640: 74 65 72 20 74 68 65 20 48 65 6c 6c 6f 20 61 6e  ter the Hello an
9650: 64 20 53 4e 49 20 63 61 6c 6c 62 61 63 6b 73 5c  d SNI callbacks\
9660: 26 2e 0a 2e 54 50 0a 5c 66 42 68 65 6c 6c 6f 5c  &...TP.\fBhello\
9670: 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20  fR \fIchannelId 
9680: 73 65 72 76 65 72 6e 61 6d 65 20 73 65 73 73 69  servername sessi
9690: 6f 6e 5f 69 64 5c 66 52 0a 46 6f 72 20 73 65 72  on_id\fR.For ser
96a0: 76 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20  vers, this form 
96b0: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
96c0: 6e 76 6f 6b 65 64 20 64 75 72 69 6e 67 20 63 6c  nvoked during cl
96d0: 69 65 6e 74 20 68 65 6c 6c 6f 20 6d 65 73 73 61  ient hello messa
96e0: 67 65 0a 70 72 6f 63 65 73 73 69 6e 67 5c 26 2e  ge.processing\&.
96f0: 20 54 68 65 20 70 75 72 70 6f 73 65 20 69 73 20   The purpose is 
9700: 73 6f 20 74 68 65 20 73 65 72 76 65 72 20 63 61  so the server ca
9710: 6e 20 73 65 6c 65 63 74 20 74 68 65 20 61 70 70  n select the app
9720: 72 6f 70 72 69 61 74 65 20 63 65 72 74 69 66 69  ropriate certifi
9730: 63 61 74 65 0a 74 6f 20 70 72 65 73 65 6e 74 20  cate.to present 
9740: 74 6f 20 74 68 65 20 63 6c 69 65 6e 74 2c 20 61  to the client, a
9750: 6e 64 20 74 6f 20 6d 61 6b 65 20 6f 74 68 65 72  nd to make other
9760: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61   configuration a
9770: 64 6a 75 73 74 6d 65 6e 74 73 20 72 65 6c 65 76  djustments relev
9780: 61 6e 74 0a 74 6f 20 74 68 61 74 20 73 65 72 76  ant.to that serv
9790: 65 72 20 6e 61 6d 65 20 61 6e 64 20 69 74 73 20  er name and its 
97a0: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5c 26 2e  configuration\&.
97b0: 20 49 74 20 69 73 20 63 61 6c 6c 65 64 20 62 65   It is called be
97c0: 66 6f 72 65 20 74 68 65 20 53 4e 49 20 61 6e 64  fore the SNI and
97d0: 20 41 4c 50 4e 0a 63 61 6c 6c 62 61 63 6b 73 5c   ALPN.callbacks\
97e0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 6e 69 5c 66 52  &...TP.\fBsni\fR
97f0: 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 73 65   \fIchannelId se
9800: 72 76 65 72 6e 61 6d 65 5c 66 52 0a 46 6f 72 20  rvername\fR.For 
9810: 73 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 6f  servers, this fo
9820: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
9830: 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74  s invoked when t
9840: 68 65 20 53 65 72 76 65 72 20 4e 61 6d 65 20 49  he Server Name I
9850: 6e 64 69 63 61 74 69 6f 6e 0a 28 53 4e 49 29 20  ndication.(SNI) 
9860: 65 78 74 65 6e 73 69 6f 6e 20 69 73 20 72 65 63  extension is rec
9870: 65 69 76 65 64 5c 26 2e 20 54 68 65 20 5c 66 49  eived\&. The \fI
9880: 73 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 61 72  servername\fR ar
9890: 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 63 6c  gument is the cl
98a0: 69 65 6e 74 0a 70 72 6f 76 69 64 65 64 20 73 65  ient.provided se
98b0: 72 76 65 72 20 6e 61 6d 65 20 73 70 65 63 69 66  rver name specif
98c0: 69 65 64 20 69 6e 20 74 68 65 20 5c 66 42 2d 73  ied in the \fB-s
98d0: 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 6f 70 74  ervername\fR opt
98e0: 69 6f 6e 5c 26 2e 20 54 68 65 0a 70 75 72 70 6f  ion\&. The.purpo
98f0: 73 65 20 69 73 20 73 6f 20 77 68 65 6e 20 61 20  se is so when a 
9900: 73 65 72 76 65 72 20 73 75 70 70 6f 72 74 73 20  server supports 
9910: 6d 75 6c 74 69 70 6c 65 20 6e 61 6d 65 73 2c 20  multiple names, 
9920: 74 68 65 20 72 69 67 68 74 20 63 65 72 74 69 66  the right certif
9930: 69 63 61 74 65 0a 63 61 6e 20 62 65 20 75 73 65  icate.can be use
9940: 64 5c 26 2e 20 49 74 20 69 73 20 63 61 6c 6c 65  d\&. It is calle
9950: 64 20 61 66 74 65 72 20 74 68 65 20 48 65 6c 6c  d after the Hell
9960: 6f 20 63 61 6c 6c 62 61 63 6b 20 62 75 74 20 62  o callback but b
9970: 65 66 6f 72 65 20 74 68 65 20 41 4c 50 4e 0a 63  efore the ALPN.c
9980: 61 6c 6c 62 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c  allback\&...TP.\
9990: 66 42 76 65 72 69 66 79 5c 66 52 20 5c 66 49 63  fBverify\fR \fIc
99a0: 68 61 6e 6e 65 6c 49 64 20 64 65 70 74 68 20 63  hannelId depth c
99b0: 65 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72  ert status error
99c0: 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66  \fR.This form of
99d0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76   callback is inv
99e0: 6f 6b 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 20  oked by OpenSSL 
99f0: 77 68 65 6e 20 61 20 6e 65 77 20 63 65 72 74 69  when a new certi
9a00: 66 69 63 61 74 65 20 69 73 20 72 65 63 65 69 76  ficate is receiv
9a10: 65 64 0a 66 72 6f 6d 20 74 68 65 20 70 65 65 72  ed.from the peer
9a20: 5c 26 2e 20 49 74 20 61 6c 6c 6f 77 73 20 74 68  \&. It allows th
9a30: 65 20 63 6c 69 65 6e 74 20 74 6f 20 63 68 65 63  e client to chec
9a40: 6b 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  k the certificat
9a50: 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 0a 72  e verification.r
9a60: 65 73 75 6c 74 73 20 61 6e 64 20 63 68 6f 6f 73  esults and choos
9a70: 65 20 77 68 65 74 68 65 72 20 74 6f 20 63 6f 6e  e whether to con
9a80: 74 69 6e 75 65 20 6f 72 20 6e 6f 74 5c 26 2e 20  tinue or not\&. 
9a90: 49 74 20 69 73 20 63 61 6c 6c 65 64 20 66 6f 72  It is called for
9aa0: 20 65 61 63 68 0a 63 65 72 74 69 66 69 63 61 74   each.certificat
9ab0: 65 20 69 6e 20 74 68 65 20 63 65 72 74 69 66 69  e in the certifi
9ac0: 63 61 74 65 20 63 68 61 69 6e 5c 26 2e 20 54 68  cate chain\&. Th
9ad0: 69 73 20 63 61 6c 6c 62 61 63 6b 20 77 61 73 20  is callback was 
9ae0: 6d 6f 76 65 64 20 66 72 6f 6d 0a 5c 66 42 2d 63  moved from.\fB-c
9af0: 6f 6d 6d 61 6e 64 5c 66 52 20 69 6e 20 54 63 6c  ommand\fR in Tcl
9b00: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65  TLS 1\&.8\&. The
9b10: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a   arguments are:.
9b20: 2e 52 53 0a 2e 54 50 0a 5c 66 49 64 65 70 74 68  .RS..TP.\fIdepth
9b30: 5c 66 52 0a 54 68 65 20 64 65 70 74 68 20 69 73  \fR.The depth is
9b40: 20 74 68 65 20 69 6e 74 65 67 65 72 20 64 65 70   the integer dep
9b50: 74 68 20 6f 66 20 74 68 65 20 63 65 72 74 69 66  th of the certif
9b60: 69 63 61 74 65 20 69 6e 20 74 68 65 20 63 65 72  icate in the cer
9b70: 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c 0a  tificate chain,.
9b80: 77 68 65 72 65 20 30 20 69 73 20 74 68 65 20 70  where 0 is the p
9b90: 65 65 72 20 63 65 72 74 69 66 69 63 61 74 65 20  eer certificate 
9ba0: 61 6e 64 20 68 69 67 68 65 72 20 76 61 6c 75 65  and higher value
9bb0: 73 20 67 6f 69 6e 67 20 75 70 20 74 6f 20 74 68  s going up to th
9bc0: 65 20 43 65 72 74 69 66 69 63 61 74 65 0a 41 75  e Certificate.Au
9bd0: 74 68 6f 72 69 74 79 20 28 43 41 29 5c 26 2e 0a  thority (CA)\&..
9be0: 2e 54 50 0a 5c 66 49 63 65 72 74 5c 66 52 0a 54  .TP.\fIcert\fR.T
9bf0: 68 65 20 63 65 72 74 20 61 72 67 75 6d 65 6e 74  he cert argument
9c00: 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65   is a list of ke
9c10: 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 73 69  y-value pairs si
9c20: 6d 69 6c 61 72 20 74 6f 20 74 68 6f 73 65 20 72  milar to those r
9c30: 65 74 75 72 6e 65 64 20 62 79 0a 5c 66 42 74 6c  eturned by.\fBtl
9c40: 73 3a 3a 73 74 61 74 75 73 5c 66 52 5c 26 2e 0a  s::status\fR\&..
9c50: 2e 54 50 0a 5c 66 49 73 74 61 74 75 73 5c 66 52  .TP.\fIstatus\fR
9c60: 0a 54 68 65 20 73 74 61 74 75 73 20 61 72 67 75  .The status argu
9c70: 6d 65 6e 74 20 69 73 20 74 68 65 20 62 6f 6f 6c  ment is the bool
9c80: 65 61 6e 20 76 61 6c 69 64 69 74 79 20 6f 66 20  ean validity of 
9c90: 74 68 65 20 63 75 72 72 65 6e 74 20 63 65 72 74  the current cert
9ca0: 69 66 69 63 61 74 65 20 77 68 65 72 65 20 30 0a  ificate where 0.
9cb0: 69 73 20 69 6e 76 61 6c 69 64 20 61 6e 64 20 31  is invalid and 1
9cc0: 20 69 73 20 76 61 6c 69 64 5c 26 2e 0a 2e 54 50   is valid\&...TP
9cd0: 0a 5c 66 49 65 72 72 6f 72 5c 66 52 0a 54 68 65  .\fIerror\fR.The
9ce0: 20 65 72 72 6f 72 20 61 72 67 75 6d 65 6e 74 20   error argument 
9cf0: 69 73 20 74 68 65 20 65 72 72 6f 72 20 6d 65 73  is the error mes
9d00: 73 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 65  sage, if any, ge
9d10: 6e 65 72 61 74 65 64 20 62 79 0a 5c 66 42 58 35  nerated by.\fBX5
9d20: 30 39 5f 53 54 4f 52 45 5f 43 54 58 5f 67 65 74  09_STORE_CTX_get
9d30: 5f 65 72 72 6f 72 28 29 5c 66 52 5c 26 2e 0a 2e  _error()\fR\&...
9d40: 52 45 0a 2e 50 50 0a 52 65 66 65 72 65 6e 63 65  RE..PP.Reference
9d50: 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73   implementations
9d60: 20 6f 66 20 74 68 65 73 65 20 63 61 6c 6c 62 61   of these callba
9d70: 63 6b 73 20 61 72 65 20 70 72 6f 76 69 64 65 64  cks are provided
9d80: 20 69 6e 20 22 5c 66 49 74 6c 73 5c 26 2e 74 63   in "\fItls\&.tc
9d90: 6c 5c 66 52 22 0a 61 73 20 5c 66 42 74 6c 73 3a  l\fR".as \fBtls:
9da0: 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 2c 20 5c 66  :callback\fR, \f
9db0: 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 5c 66  Btls::password\f
9dc0: 52 2c 20 61 6e 64 20 5c 66 42 74 6c 73 3a 3a 76  R, and \fBtls::v
9dd0: 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c  alidate_command\
9de0: 66 52 0a 72 65 73 70 65 63 74 69 76 65 6c 79 5c  fR.respectively\
9df0: 26 2e 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65  &. Note that the
9e00: 73 65 20 61 72 65 20 6f 6e 6c 79 20 5c 66 49 73  se are only \fIs
9e10: 61 6d 70 6c 65 5c 66 52 20 69 6d 70 6c 65 6d 65  ample\fR impleme
9e20: 6e 74 61 74 69 6f 6e 73 5c 26 2e 20 49 6e 20 61  ntations\&. In a
9e30: 20 6d 6f 72 65 0a 72 65 61 6c 69 73 74 69 63 20   more.realistic 
9e40: 64 65 70 6c 6f 79 6d 65 6e 74 20 79 6f 75 20 77  deployment you w
9e50: 6f 75 6c 64 20 73 70 65 63 69 66 79 20 79 6f 75  ould specify you
9e60: 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 20 73  r own callback s
9e70: 63 72 69 70 74 73 20 6f 6e 20 65 61 63 68 20 54  cripts on each T
9e80: 4c 53 0a 63 68 61 6e 6e 65 6c 20 75 73 69 6e 67  LS.channel using
9e90: 20 74 68 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64   the \fB-command
9ea0: 5c 66 52 2c 20 5c 66 42 2d 70 61 73 73 77 6f 72  \fR, \fB-passwor
9eb0: 64 5c 66 52 2c 20 61 6e 64 0a 5c 66 42 2d 76 61  d\fR, and.\fB-va
9ec0: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66  lidate_command\f
9ed0: 52 20 6f 70 74 69 6f 6e 73 5c 26 2e 0a 2e 50 50  R options\&...PP
9ee0: 0a 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68  .The default beh
9ef0: 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 5c  avior when the \
9f00: 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20 61 6e  fB-command\fR an
9f10: 64 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 5f 63  d \fB-validate_c
9f20: 6f 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74 69 6f 6e  ommand\fR.option
9f30: 73 20 61 72 65 20 6e 6f 74 20 73 70 65 63 69 66  s are not specif
9f40: 69 65 64 2c 20 69 73 20 66 6f 72 20 54 63 6c 54  ied, is for TclT
9f50: 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68  LS to process th
9f60: 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62  e associated lib
9f70: 72 61 72 79 0a 63 61 6c 6c 62 61 63 6b 73 20 69  rary.callbacks i
9f80: 6e 74 65 72 6e 61 6c 6c 79 5c 26 2e 20 54 68 65  nternally\&. The
9f90: 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f   default behavio
9fa0: 72 20 77 68 65 6e 20 74 68 65 20 5c 66 42 2d 70  r when the \fB-p
9fb0: 61 73 73 77 6f 72 64 5c 66 52 20 6f 70 74 69 6f  assword\fR optio
9fc0: 6e 0a 69 73 20 6e 6f 74 20 73 70 65 63 69 66 69  n.is not specifi
9fd0: 65 64 20 69 73 20 66 6f 72 20 54 63 6c 54 4c 53  ed is for TclTLS
9fe0: 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20   to process the 
9ff0: 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61  associated libra
a000: 72 79 20 63 61 6c 6c 62 61 63 6b 73 20 62 79 0a  ry callbacks by.
a010: 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 63 61  attempting to ca
a020: 6c 6c 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77  ll \fBtls::passw
a030: 6f 72 64 5c 66 52 5c 26 2e 20 54 68 65 20 64 69  ord\fR\&. The di
a040: 66 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e  fference between
a050: 20 74 68 65 73 65 20 74 77 6f 0a 62 65 68 61 76   these two.behav
a060: 69 6f 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71  iors is a conseq
a070: 75 65 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69  uence of maintai
a080: 6e 69 6e 67 20 63 6f 6d 70 61 74 69 62 69 6c 69  ning compatibili
a090: 74 79 20 77 69 74 68 20 65 61 72 6c 69 65 72 0a  ty with earlier.
a0a0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 5c  implementations\
a0b0: 26 2e 0a 2e 50 50 0a 5c 66 49 54 68 65 20 75 73  &...PP.\fIThe us
a0c0: 65 20 6f 66 20 74 68 65 20 72 65 66 65 72 65 6e  e of the referen
a0d0: 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 5c 66 42  ce callbacks \fB
a0e0: 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c 66 52  tls::callback\fR
a0f0: 2c 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f  , \fBtls::passwo
a100: 72 64 5c 66 52 2c 0a 61 6e 64 20 5c 66 42 74 6c  rd\fR,.and \fBtl
a110: 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d  s::validate_comm
a120: 61 6e 64 5c 66 52 20 69 73 20 6e 6f 74 20 72 65  and\fR is not re
a130: 63 6f 6d 6d 65 6e 64 65 64 5c 26 2e 20 54 68 65  commended\&. The
a140: 79 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64  y may be removed
a150: 20 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c   from future rel
a160: 65 61 73 65 73 5c 26 2e 5c 66 52 0a 2e 53 48 20  eases\&.\fR..SH 
a170: 44 45 42 55 47 0a 46 6f 72 20 6d 6f 73 74 20 64  DEBUG.For most d
a180: 65 62 75 67 67 69 6e 67 20 6e 65 65 64 73 2c 20  ebugging needs, 
a190: 74 68 65 20 5c 66 42 2d 63 61 6c 6c 62 61 63 6b  the \fB-callback
a1a0: 5c 66 52 20 6f 70 74 69 6f 6e 20 63 61 6e 20 62  \fR option can b
a1b0: 65 20 75 73 65 64 20 74 6f 20 70 72 6f 76 69 64  e used to provid
a1c0: 65 0a 73 75 66 66 69 63 69 65 6e 74 20 69 6e 73  e.sufficient ins
a1d0: 69 67 68 74 20 61 6e 64 20 69 6e 66 6f 72 6d 61  ight and informa
a1e0: 74 69 6f 6e 20 6f 6e 20 74 68 65 20 54 4c 53 20  tion on the TLS 
a1f0: 68 61 6e 64 73 68 61 6b 65 20 61 6e 64 20 70 72  handshake and pr
a200: 6f 67 72 65 73 73 5c 26 2e 20 49 66 0a 66 75 72  ogress\&. If.fur
a210: 74 68 65 72 20 74 72 6f 75 62 6c 65 73 68 6f 6f  ther troubleshoo
a220: 74 69 6e 67 20 69 6e 73 69 67 68 74 20 69 73 20  ting insight is 
a230: 6e 65 65 64 65 64 2c 20 74 68 65 20 63 6f 6d 70  needed, the comp
a240: 69 6c 65 20 74 69 6d 65 20 6f 70 74 69 6f 6e 0a  ile time option.
a250: 5c 66 42 2d 2d 65 6e 61 62 6c 65 2d 64 65 62 75  \fB--enable-debu
a260: 67 5c 66 52 20 63 61 6e 20 62 65 20 75 73 65 64  g\fR can be used
a270: 20 74 6f 20 67 65 74 20 64 65 74 61 69 6c 65 64   to get detailed
a280: 20 65 78 65 63 75 74 69 6f 6e 20 66 6c 6f 77 20   execution flow 
a290: 73 74 61 74 75 73 5c 26 2e 0a 2e 50 50 0a 54 4c  status\&...PP.TL
a2a0: 53 20 6b 65 79 20 6c 6f 67 67 69 6e 67 20 63 61  S key logging ca
a2b0: 6e 20 62 65 20 65 6e 61 62 6c 65 64 20 62 79 20  n be enabled by 
a2c0: 73 65 74 74 69 6e 67 20 74 68 65 20 65 6e 76 69  setting the envi
a2d0: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
a2e0: 0a 5c 66 42 53 53 4c 4b 45 59 4c 4f 47 46 49 4c  .\fBSSLKEYLOGFIL
a2f0: 45 5c 66 52 20 74 6f 20 74 68 65 20 6e 61 6d 65  E\fR to the name
a300: 20 6f 66 20 74 68 65 20 66 69 6c 65 20 74 6f 20   of the file to 
a310: 6c 6f 67 20 74 6f 5c 26 2e 20 54 68 65 6e 20 77  log to\&. Then w
a320: 68 65 6e 65 76 65 72 20 54 4c 53 20 6b 65 79 0a  henever TLS key.
a330: 6d 61 74 65 72 69 61 6c 20 69 73 20 67 65 6e 65  material is gene
a340: 72 61 74 65 64 20 6f 72 20 72 65 63 65 69 76 65  rated or receive
a350: 64 20 69 74 20 77 69 6c 6c 20 62 65 20 6c 6f 67  d it will be log
a360: 67 65 64 20 74 6f 20 74 68 65 20 66 69 6c 65 5c  ged to the file\
a370: 26 2e 20 54 68 69 73 20 69 73 20 75 73 65 66 75  &. This is usefu
a380: 6c 0a 66 6f 72 20 6c 6f 67 67 69 6e 67 20 6b 65  l.for logging ke
a390: 79 20 64 61 74 61 20 66 6f 72 20 6e 65 74 77 6f  y data for netwo
a3a0: 72 6b 20 6c 6f 67 67 69 6e 67 20 74 6f 6f 6c 73  rk logging tools
a3b0: 20 74 6f 20 75 73 65 20 74 6f 20 64 65 63 72 79   to use to decry
a3c0: 70 74 20 74 68 65 20 64 61 74 61 5c 26 2e 0a 2e  pt the data\&...
a3d0: 50 50 0a 54 68 65 20 5c 66 42 74 6c 73 3a 3a 64  PP.The \fBtls::d
a3e0: 65 62 75 67 5c 66 52 20 76 61 72 69 61 62 6c 65  ebug\fR variable
a3f0: 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 61   provides some a
a400: 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6e 74 72 6f  dditional contro
a410: 6c 20 6f 76 65 72 20 74 68 65 0a 64 65 62 75 67  l over the.debug
a420: 20 6c 6f 67 67 69 6e 67 20 69 6e 20 74 68 65 20   logging in the 
a430: 5c 66 42 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b  \fBtls::callback
a440: 5c 66 52 2c 20 5c 66 42 74 6c 73 3a 3a 70 61 73  \fR, \fBtls::pas
a450: 73 77 6f 72 64 5c 66 52 2c 20 61 6e 64 0a 5c 66  sword\fR, and.\f
a460: 42 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63  Btls::validate_c
a470: 6f 6d 6d 61 6e 64 5c 66 52 20 64 65 66 61 75 6c  ommand\fR defaul
a480: 74 20 68 61 6e 64 6c 65 72 73 20 69 6e 20 22 5c  t handlers in "\
a490: 66 49 74 6c 73 5c 26 2e 74 63 6c 5c 66 52 22 5c  fItls\&.tcl\fR"\
a4a0: 26 2e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 76  &..The default v
a4b0: 61 6c 75 65 20 69 73 20 30 20 77 69 74 68 20 68  alue is 0 with h
a4c0: 69 67 68 65 72 20 76 61 6c 75 65 73 20 70 72 6f  igher values pro
a4d0: 64 75 63 69 6e 67 20 6d 6f 72 65 20 64 69 61 67  ducing more diag
a4e0: 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 0a 61  nostic output,.a
a4f0: 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72  nd will also for
a500: 63 65 20 74 68 65 20 76 65 72 69 66 79 20 6d 65  ce the verify me
a510: 74 68 6f 64 20 69 6e 20 5c 66 42 74 6c 73 3a 3a  thod in \fBtls::
a520: 63 61 6c 6c 62 61 63 6b 5c 66 52 20 74 6f 20 61  callback\fR to a
a530: 63 63 65 70 74 20 74 68 65 0a 63 65 72 74 69 66  ccept the.certif
a540: 69 63 61 74 65 2c 20 65 76 65 6e 20 69 66 20 69  icate, even if i
a550: 74 20 69 73 20 69 6e 76 61 6c 69 64 20 77 68 65  t is invalid whe
a560: 6e 20 74 68 65 20 5c 66 42 2d 76 61 6c 69 64 61  n the \fB-valida
a570: 74 65 63 6f 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74  tecommand\fR.opt
a580: 69 6f 6e 20 69 73 20 73 65 74 20 74 6f 20 5c 66  ion is set to \f
a590: 42 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63  Btls::validate_c
a5a0: 6f 6d 6d 61 6e 64 5c 66 52 5c 26 2e 0a 2e 50 50  ommand\fR\&...PP
a5b0: 0a 5c 66 49 54 68 65 20 75 73 65 20 6f 66 20 74  .\fIThe use of t
a5c0: 68 65 20 76 61 72 69 61 62 6c 65 20 5c 66 42 74  he variable \fBt
a5d0: 6c 73 3a 3a 64 65 62 75 67 5c 66 52 20 69 73 20  ls::debug\fR is 
a5e0: 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 5c  not recommended\
a5f0: 26 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65 6d  &..It may be rem
a600: 6f 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65  oved from future
a610: 20 72 65 6c 65 61 73 65 73 5c 26 2e 5c 66 52 0a   releases\&.\fR.
a620: 2e 53 48 20 45 58 41 4d 50 4c 45 53 0a 54 68 65  .SH EXAMPLES.The
a630: 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 65 20 65   following are e
a640: 78 61 6d 70 6c 65 20 73 63 72 69 70 74 73 20 74  xample scripts t
a650: 6f 20 64 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62  o download a web
a660: 70 61 67 65 20 61 6e 64 20 66 69 6c 65 20 75 73  page and file us
a670: 69 6e 67 20 74 68 65 0a 68 74 74 70 20 70 61 63  ing the.http pac
a680: 6b 61 67 65 5c 26 2e 20 53 65 65 20 5c 66 42 43  kage\&. See \fBC
a690: 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64  ertificate Valid
a6a0: 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 77 68 65  ation\fR for whe
a6b0: 6e 20 74 68 65 0a 5c 66 42 2d 63 61 64 69 72 5c  n the.\fB-cadir\
a6c0: 66 52 2c 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66  fR, \fB-cafile\f
a6d0: 52 2c 20 61 6e 64 20 5c 66 42 2d 63 61 73 74 6f  R, and \fB-casto
a6e0: 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 61 72  re\fR options ar
a6f0: 65 20 61 6c 73 6f 0a 6e 65 65 64 65 64 5c 26 2e  e also.needed\&.
a700: 20 53 65 65 20 74 68 65 20 22 5c 66 49 64 65 6d   See the "\fIdem
a710: 6f 73 5c 66 52 22 20 64 69 72 65 63 74 6f 72 79  os\fR" directory
a720: 20 66 6f 72 20 6d 6f 72 65 20 65 78 61 6d 70 6c   for more exampl
a730: 65 20 73 63 72 69 70 74 73 5c 26 2e 0a 2e 50 50  e scripts\&...PP
a740: 0a 45 78 61 6d 70 6c 65 20 23 31 3a 20 44 6f 77  .Example #1: Dow
a750: 6e 6c 6f 61 64 20 61 20 77 65 62 20 70 61 67 65  nload a web page
a760: 0a 2e 43 53 0a 0a 0a 0a 70 61 63 6b 61 67 65 20  ..CS....package 
a770: 72 65 71 75 69 72 65 20 68 74 74 70 0a 70 61 63  require http.pac
a780: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73  kage require tls
a790: 0a 0a 73 65 74 20 75 72 6c 20 22 68 74 74 70 73  ..set url "https
a7a0: 3a 2f 2f 77 77 77 5c 26 2e 74 63 6c 5c 26 2e 74  ://www\&.tcl\&.t
a7b0: 6b 2f 22 0a 68 74 74 70 3a 3a 72 65 67 69 73 74  k/".http::regist
a7c0: 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69  er https 443 [li
a7d0: 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74  st ::tls::socket
a7e0: 20 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65   -autoservername
a7f0: 20 31 20 2d 72 65 71 75 69 72 65 20 31 5d 0a 0a   1 -require 1]..
a800: 23 20 47 65 74 20 55 52 4c 0a 73 65 74 20 74 6f  # Get URL.set to
a810: 6b 65 6e 20 5b 68 74 74 70 3a 3a 67 65 74 75 72  ken [http::getur
a820: 6c 20 24 75 72 6c 5d 0a 0a 23 20 43 68 65 63 6b  l $url]..# Check
a830: 20 66 6f 72 20 65 72 72 6f 72 0a 69 66 20 7b 5b   for error.if {[
a840: 68 74 74 70 3a 3a 73 74 61 74 75 73 20 24 74 6f  http::status $to
a850: 6b 65 6e 5d 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a  ken] ne "ok"} {.
a860: 20 20 20 20 70 75 74 73 20 5b 66 6f 72 6d 61 74      puts [format
a870: 20 22 45 72 72 6f 72 20 25 73 22 20 5b 68 74 74   "Error %s" [htt
a880: 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e  p::status $token
a890: 5d 5d 0a 7d 0a 0a 23 20 53 61 76 65 20 77 65 62  ]].}..# Save web
a8a0: 20 70 61 67 65 20 74 6f 20 66 69 6c 65 0a 73 65   page to file.se
a8b0: 74 20 63 68 20 5b 6f 70 65 6e 20 65 78 61 6d 70  t ch [open examp
a8c0: 6c 65 5c 26 2e 68 74 6d 6c 20 77 62 5d 0a 70 75  le\&.html wb].pu
a8d0: 74 73 20 24 63 68 20 5b 68 74 74 70 3a 3a 64 61  ts $ch [http::da
a8e0: 74 61 20 24 74 6f 6b 65 6e 5d 0a 63 6c 6f 73 65  ta $token].close
a8f0: 20 24 63 68 0a 0a 23 20 43 6c 65 61 6e 75 70 0a   $ch..# Cleanup.
a900: 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20  ::http::cleanup 
a910: 24 74 6f 6b 65 6e 0a 0a 2e 43 45 0a 45 78 61 6d  $token...CE.Exam
a920: 70 6c 65 20 23 32 3a 20 44 6f 77 6e 6c 6f 61 64  ple #2: Download
a930: 20 61 20 66 69 6c 65 0a 2e 43 53 0a 0a 0a 0a 70   a file..CS....p
a940: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 68  ackage require h
a950: 74 74 70 0a 70 61 63 6b 61 67 65 20 72 65 71 75  ttp.package requ
a960: 69 72 65 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c  ire tls..set url
a970: 20 22 68 74 74 70 73 3a 2f 2f 77 69 6b 69 5c 26   "https://wiki\&
a980: 2e 74 63 6c 2d 6c 61 6e 67 5c 26 2e 6f 72 67 2f  .tcl-lang\&.org/
a990: 73 69 74 65 6d 61 70 5c 26 2e 78 6d 6c 22 0a 68  sitemap\&.xml".h
a9a0: 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 74  ttp::register ht
a9b0: 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a  tps 443 [list ::
a9c0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74  tls::socket -aut
a9d0: 6f 73 65 72 76 65 72 6e 61 6d 65 20 31 20 2d 72  oservername 1 -r
a9e0: 65 71 75 69 72 65 20 31 5d 0a 0a 23 20 4f 70 65  equire 1]..# Ope
a9f0: 6e 20 6f 75 74 70 75 74 20 66 69 6c 65 0a 73 65  n output file.se
aa00: 74 20 66 69 6c 65 6e 61 6d 65 20 5b 66 69 6c 65  t filename [file
aa10: 20 74 61 69 6c 20 24 75 72 6c 5d 0a 73 65 74 20   tail $url].set 
aa20: 63 68 20 5b 6f 70 65 6e 20 24 66 69 6c 65 6e 61  ch [open $filena
aa30: 6d 65 20 77 62 5d 0a 0a 23 20 47 65 74 20 66 69  me wb]..# Get fi
aa40: 6c 65 0a 73 65 74 20 74 6f 6b 65 6e 20 5b 3a 3a  le.set token [::
aa50: 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 24 75 72  http::geturl $ur
aa60: 6c 20 2d 62 6c 6f 63 6b 73 69 7a 65 20 36 35 35  l -blocksize 655
aa70: 33 36 20 2d 63 68 61 6e 6e 65 6c 20 24 63 68 5d  36 -channel $ch]
aa80: 0a 0a 23 20 43 68 65 63 6b 20 66 6f 72 20 65 72  ..# Check for er
aa90: 72 6f 72 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73  ror.if {[http::s
aaa0: 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65  tatus $token] ne
aab0: 20 22 6f 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74   "ok"} {.    put
aac0: 73 20 5b 66 6f 72 6d 61 74 20 22 45 72 72 6f 72  s [format "Error
aad0: 20 25 73 22 20 5b 68 74 74 70 3a 3a 73 74 61 74   %s" [http::stat
aae0: 75 73 20 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23  us $token]].}..#
aaf0: 20 43 6c 65 61 6e 75 70 0a 63 6c 6f 73 65 20 24   Cleanup.close $
ab00: 63 68 0a 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e  ch.::http::clean
ab10: 75 70 20 24 74 6f 6b 65 6e 0a 0a 2e 43 45 0a 2e  up $token...CE..
ab20: 53 48 20 22 53 50 45 43 49 41 4c 20 43 4f 4e 53  SH "SPECIAL CONS
ab30: 49 44 45 52 41 54 49 4f 4e 53 22 0a 54 68 65 20  IDERATIONS".The 
ab40: 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20  capabilities of 
ab50: 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e  this package can
ab60: 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79   vary enormously
ab70: 20 62 61 73 65 64 20 75 70 6f 6e 20 68 6f 77 20   based upon how 
ab80: 74 68 65 0a 6c 69 6e 6b 65 64 20 74 6f 20 4f 70  the.linked to Op
ab90: 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 20 77 61  enSSL library wa
aba0: 73 20 63 6f 6e 66 69 67 75 72 65 64 20 61 6e 64  s configured and
abb0: 20 62 75 69 6c 74 5c 26 2e 20 4e 65 77 20 76 65   built\&. New ve
abc0: 72 73 69 6f 6e 73 20 6d 61 79 20 6f 62 73 6f 6c  rsions may obsol
abd0: 65 74 65 0a 6f 6c 64 65 72 20 70 72 6f 74 6f 63  ete.older protoc
abe0: 6f 6c 20 76 65 72 73 69 6f 6e 73 2c 20 61 64 64  ol versions, add
abf0: 20 6f 72 20 72 65 6d 6f 76 65 20 63 69 70 68 65   or remove ciphe
ac00: 72 73 2c 20 63 68 61 6e 67 65 20 64 65 66 61 75  rs, change defau
ac10: 6c 74 20 76 61 6c 75 65 73 2c 20 65 74 63 5c 26  lt values, etc\&
ac20: 2e 0a 55 73 65 20 74 68 65 20 5c 66 42 74 6c 73  ..Use the \fBtls
ac30: 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63  ::protocols\fR c
ac40: 6f 6d 6d 61 6e 64 20 74 6f 20 6f 62 74 61 69 6e  ommand to obtain
ac50: 20 74 68 65 20 73 75 70 70 6f 72 74 65 64 0a 70   the supported.p
ac60: 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 73  rotocol versions
ac70: 5c 26 2e 0a 2e 53 48 20 22 45 52 52 4f 52 20 4d  \&...SH "ERROR M
ac80: 45 53 53 41 47 45 53 22 0a 53 6f 6d 65 20 4f 70  ESSAGES".Some Op
ac90: 73 6e 53 53 6c 20 65 72 72 6f 72 20 6d 65 73 73  snSSl error mess
aca0: 61 67 65 73 20 68 61 76 65 20 63 72 79 70 74 69  ages have crypti
acb0: 63 20 6d 65 61 6e 69 6e 67 73 5c 26 2e 20 54 68  c meanings\&. Th
acc0: 69 73 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20  is is a list of 
acd0: 6d 65 73 73 61 67 65 73 0a 61 6c 6f 6e 67 20 77  messages.along w
ace0: 69 74 68 20 74 68 65 69 72 20 74 72 75 65 20 6d  ith their true m
acf0: 65 61 6e 69 6e 67 5c 26 2e 0a 2e 54 50 0a 5c 66  eaning\&...TP.\f
ad00: 49 68 61 6e 64 73 68 61 6b 65 20 66 61 69 6c 65  Ihandshake faile
ad10: 64 3a 20 63 65 72 74 69 66 69 63 61 74 65 20 76  d: certificate v
ad20: 65 72 69 66 79 20 66 61 69 6c 65 64 20 64 75 65  erify failed due
ad30: 20 74 6f 20 22 75 6e 61 62 6c 65 20 74 6f 20 67   to "unable to g
ad40: 65 74 20 6c 6f 63 61 6c 20 69 73 73 75 65 72 20  et local issuer 
ad50: 63 65 72 74 69 66 69 63 61 74 65 22 5c 66 52 0a  certificate"\fR.
ad60: 54 68 65 20 63 65 72 74 69 66 69 63 61 74 65 73  The certificates
ad70: 20 69 6e 20 74 68 65 20 43 41 20 66 69 6c 65 20   in the CA file 
ad80: 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73  or certificate s
ad90: 74 6f 72 65 20 65 69 74 68 65 72 20 64 6f 20 6e  tore either do n
ada0: 6f 74 20 68 61 76 65 20 6f 6e 65 20 6f 72 0a 6d  ot have one or.m
adb0: 6f 72 65 20 69 73 73 75 65 72 73 20 6f 66 20 74  ore issuers of t
adc0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 73 20  he certificates 
add0: 79 6f 75 20 61 72 65 20 76 61 6c 69 64 61 74 69  you are validati
ade0: 6e 67 20 6f 72 20 74 68 65 79 20 68 61 76 65 20  ng or they have 
adf0: 65 78 70 69 72 65 64 5c 26 2e 0a 55 73 75 61 6c  expired\&..Usual
ae00: 6c 79 20 74 68 69 73 20 6d 65 61 6e 73 20 79 6f  ly this means yo
ae10: 75 20 6e 65 65 64 20 61 6e 20 75 70 64 61 74 65  u need an update
ae20: 64 20 43 41 63 65 72 74 20 66 69 6c 65 5c 26 2e  d CAcert file\&.
ae30: 0a 2e 54 50 0a 5c 66 49 70 61 63 6b 65 74 20 6c  ..TP.\fIpacket l
ae40: 65 6e 67 74 68 20 74 6f 6f 20 6c 6f 6e 67 5c 66  ength too long\f
ae50: 52 0a 43 6c 69 65 6e 74 20 68 61 73 20 74 72 69  R.Client has tri
ae60: 65 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f  ed to connect to
ae70: 20 61 20 48 54 54 50 20 73 65 72 76 65 72 20 6f   a HTTP server o
ae80: 6e 20 74 68 65 20 70 6c 61 69 6e 2d 74 65 78 74  n the plain-text
ae90: 20 70 6f 72 74 20 69 6e 73 74 65 61 64 20 6f 66   port instead of
aea0: 0a 74 68 65 20 53 53 4c 2f 54 4c 53 20 70 6f 72  .the SSL/TLS por
aeb0: 74 5c 26 2e 0a 2e 54 50 0a 5c 66 49 75 6e 65 78  t\&...TP.\fIunex
aec0: 70 65 63 74 65 64 20 65 6f 66 20 77 68 69 6c 65  pected eof while
aed0: 20 72 65 61 64 69 6e 67 5c 66 52 0a 54 68 65 20   reading\fR.The 
aee0: 70 65 65 72 20 68 61 73 20 63 6c 6f 73 65 64 20  peer has closed 
aef0: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 77  the connection w
af00: 69 74 68 6f 75 74 20 73 65 6e 64 69 6e 67 20 74  ithout sending t
af10: 68 65 20 22 63 6c 6f 73 65 20 6e 6f 74 69 66 79  he "close notify
af20: 22 20 73 68 75 74 64 6f 77 6e 0a 61 6c 65 72 74  " shutdown.alert
af30: 5c 26 2e 20 53 6f 6d 65 20 73 65 72 76 65 72 73  \&. Some servers
af40: 20 77 69 6c 6c 20 74 65 72 6d 69 6e 61 74 65 20   will terminate 
af50: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 61  the connection a
af60: 66 74 65 72 20 74 68 65 20 66 69 6c 65 20 6f 72  fter the file or
af70: 20 77 65 62 70 61 67 65 20 68 61 73 0a 62 65 65   webpage has.bee
af80: 6e 20 73 65 6e 74 20 77 69 74 68 6f 75 74 20 73  n sent without s
af90: 65 6e 64 69 6e 67 20 74 68 65 20 22 63 6c 6f 73  ending the "clos
afa0: 65 20 6e 6f 74 69 66 79 22 20 6d 65 73 73 61 67  e notify" messag
afb0: 65 5c 26 2e 20 49 6e 20 74 68 69 73 20 63 61 73  e\&. In this cas
afc0: 65 2c 20 69 74 20 73 68 6f 75 6c 64 0a 6e 6f 74  e, it should.not
afd0: 20 72 65 73 75 6c 74 20 69 6e 20 61 20 6c 6f 73   result in a los
afe0: 73 20 6f 66 20 64 61 74 61 5c 26 2e 0a 2e 54 50  s of data\&...TP
aff0: 0a 5c 66 49 77 72 6f 6e 67 20 76 65 72 73 69 6f  .\fIwrong versio
b000: 6e 20 6e 75 6d 62 65 72 5c 66 52 0a 43 6c 69 65  n number\fR.Clie
b010: 6e 74 20 68 61 73 20 74 72 69 65 64 20 74 6f 20  nt has tried to 
b020: 63 6f 6e 6e 65 63 74 20 74 6f 20 61 20 6e 6f 6e  connect to a non
b030: 2d 48 54 54 50 20 73 65 72 76 65 72 20 6f 6e 20  -HTTP server on 
b040: 61 20 6e 6f 6e 2d 54 4c 53 20 28 69 5c 26 2e 65  a non-TLS (i\&.e
b050: 5c 26 2e 20 70 6c 61 69 6e 20 74 65 78 74 29 20  \&. plain text) 
b060: 70 6f 72 74 5c 26 2e 0a 2e 50 50 0a 2e 53 48 20  port\&...PP..SH 
b070: 22 53 45 45 20 41 4c 53 4f 22 0a 5c 66 49 4f 70  "SEE ALSO".\fIOp
b080: 65 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a  enSSL\fR [https:
b090: 2f 2f 77 77 77 5c 26 2e 6f 70 65 6e 73 73 6c 5c  //www\&.openssl\
b0a0: 26 2e 6f 72 67 2f 5d 2c 20 68 74 74 70 2c 20 73  &.org/], http, s
b0b0: 6f 63 6b 65 74 0a 2e 53 48 20 4b 45 59 57 4f 52  ocket..SH KEYWOR
b0c0: 44 53 0a 49 2f 4f 2c 20 49 50 20 41 64 64 72 65  DS.I/O, IP Addre
b0d0: 73 73 2c 20 4f 70 65 6e 53 53 4c 2c 20 53 53 4c  ss, OpenSSL, SSL
b0e0: 2c 20 54 43 50 2c 20 54 4c 53 2c 20 54 63 6c 54  , TCP, TLS, TclT
b0f0: 4c 53 2c 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73  LS, asynchronous
b100: 20 49 2f 4f 2c 20 62 69 6e 64 2c 20 63 65 72 74   I/O, bind, cert
b110: 69 66 69 63 61 74 65 2c 20 63 68 61 6e 6e 65 6c  ificate, channel
b120: 2c 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 64 6f  , connection, do
b130: 6d 61 69 6e 20 6e 61 6d 65 2c 20 68 6f 73 74 2c  main name, host,
b140: 20 68 74 74 70 73 2c 20 6e 65 74 77 6f 72 6b 2c   https, network,
b150: 20 6e 65 74 77 6f 72 6b 20 61 64 64 72 65 73 73   network address
b160: 2c 20 73 6f 63 6b 65 74 2c 20 74 6c 73 0a 2e 53  , socket, tls..S
b170: 48 20 43 41 54 45 47 4f 52 59 0a 74 6c 73 0a 2e  H CATEGORY.tls..
b180: 53 48 20 43 4f 50 59 52 49 47 48 54 0a 2e 6e 66  SH COPYRIGHT..nf
b190: 0a 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 31  .Copyright (c) 1
b1a0: 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 0a  999 Matt Newman.
b1b0: 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30  Copyright (c) 20
b1c0: 30 34 20 53 74 61 72 66 69 73 68 20 53 79 73 74  04 Starfish Syst
b1d0: 65 6d 73 0a 43 6f 70 79 72 69 67 68 74 20 28 63  ems.Copyright (c
b1e0: 29 20 32 30 32 34 20 42 72 69 61 6e 20 4f 27 48  ) 2024 Brian O'H
b1f0: 61 67 61 6e 0a 0a 2e 66 69 0a                    agan...fi.