Hex Artifact Content

Artifact 54bf0dc4b19dcc4cabb068f433d211d1a4fe3f362ed82ee091b9a5655388299d:


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 20 74 6c 73 20 22 54 63 6c 20 54 4c  \&.0 tls "Tcl TL
00e0: 53 20 65 78 74 65 6e 73 69 6f 6e 22 0a 2e 5c 22  S extension"..\"
00f0: 20 54 68 65 20 2d 2a 2d 20 6e 72 6f 66 66 20 2d   The -*- nroff -
0100: 2a 2d 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 62  *- definitions b
0110: 65 6c 6f 77 20 61 72 65 20 66 6f 72 20 73 75 70  elow are for sup
0120: 70 6c 65 6d 65 6e 74 61 6c 20 6d 61 63 72 6f 73  plemental macros
0130: 20 75 73 65 64 0a 2e 5c 22 20 69 6e 20 54 63 6c   used..\" in Tcl
0140: 2f 54 6b 20 6d 61 6e 75 61 6c 20 65 6e 74 72 69  /Tk manual entri
0150: 65 73 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 41 50 20  es...\"..\" .AP 
0160: 74 79 70 65 20 6e 61 6d 65 20 69 6e 2f 6f 75 74  type name in/out
0170: 20 3f 69 6e 64 65 6e 74 3f 0a 2e 5c 22 09 53 74   ?indent?..\".St
0180: 61 72 74 20 70 61 72 61 67 72 61 70 68 20 64 65  art paragraph de
0190: 73 63 72 69 62 69 6e 67 20 61 6e 20 61 72 67 75  scribing an argu
01a0: 6d 65 6e 74 20 74 6f 20 61 20 6c 69 62 72 61 72  ment to a librar
01b0: 79 20 70 72 6f 63 65 64 75 72 65 2e 0a 2e 5c 22  y procedure...\"
01c0: 09 74 79 70 65 20 69 73 20 74 79 70 65 20 6f 66  .type is type of
01d0: 20 61 72 67 75 6d 65 6e 74 20 28 69 6e 74 2c 20   argument (int, 
01e0: 65 74 63 2e 29 2c 20 69 6e 2f 6f 75 74 20 69 73  etc.), in/out is
01f0: 20 65 69 74 68 65 72 20 22 69 6e 22 2c 20 22 6f   either "in", "o
0200: 75 74 22 2c 0a 2e 5c 22 09 6f 72 20 22 69 6e 2f  ut",..\".or "in/
0210: 6f 75 74 22 20 74 6f 20 64 65 73 63 72 69 62 65  out" to describe
0220: 20 77 68 65 74 68 65 72 20 70 72 6f 63 65 64 75   whether procedu
0230: 72 65 20 72 65 61 64 73 20 6f 72 20 6d 6f 64 69  re reads or modi
0240: 66 69 65 73 20 61 72 67 2c 0a 2e 5c 22 09 61 6e  fies arg,..\".an
0250: 64 20 69 6e 64 65 6e 74 20 69 73 20 65 71 75 69  d indent is equi
0260: 76 61 6c 65 6e 74 20 74 6f 20 73 65 63 6f 6e 64  valent to second
0270: 20 61 72 67 20 6f 66 20 2e 49 50 20 28 73 68 6f   arg of .IP (sho
0280: 75 6c 64 6e 27 74 20 65 76 65 72 20 62 65 0a 2e  uldn't ever be..
0290: 5c 22 09 6e 65 65 64 65 64 3b 20 20 75 73 65 20  \".needed;  use 
02a0: 2e 41 53 20 62 65 6c 6f 77 20 69 6e 73 74 65 61  .AS below instea
02b0: 64 29 0a 2e 5c 22 0a 2e 5c 22 20 2e 41 53 20 3f  d)..\"..\" .AS ?
02c0: 74 79 70 65 3f 20 3f 6e 61 6d 65 3f 0a 2e 5c 22  type? ?name?..\"
02d0: 09 47 69 76 65 20 6d 61 78 69 6d 75 6d 20 73 69  .Give maximum si
02e0: 7a 65 73 20 6f 66 20 61 72 67 75 6d 65 6e 74 73  zes of arguments
02f0: 20 66 6f 72 20 73 65 74 74 69 6e 67 20 74 61 62   for setting tab
0300: 20 73 74 6f 70 73 2e 20 20 54 79 70 65 20 61 6e   stops.  Type an
0310: 64 0a 2e 5c 22 09 6e 61 6d 65 20 61 72 65 20 65  d..\".name are e
0320: 78 61 6d 70 6c 65 73 20 6f 66 20 6c 61 72 67 65  xamples of large
0330: 73 74 20 70 6f 73 73 69 62 6c 65 20 61 72 67 75  st possible argu
0340: 6d 65 6e 74 73 20 74 68 61 74 20 77 69 6c 6c 20  ments that will 
0350: 62 65 20 70 61 73 73 65 64 0a 2e 5c 22 09 74 6f  be passed..\".to
0360: 20 2e 41 50 20 6c 61 74 65 72 2e 20 20 49 66 20   .AP later.  If 
0370: 61 72 67 73 20 61 72 65 20 6f 6d 69 74 74 65 64  args are omitted
0380: 2c 20 64 65 66 61 75 6c 74 20 74 61 62 20 73 74  , default tab st
0390: 6f 70 73 20 61 72 65 20 75 73 65 64 2e 0a 2e 5c  ops are used...\
03a0: 22 0a 2e 5c 22 20 2e 42 53 0a 2e 5c 22 09 53 74  "..\" .BS..\".St
03b0: 61 72 74 20 62 6f 78 20 65 6e 63 6c 6f 73 75 72  art box enclosur
03c0: 65 2e 20 20 46 72 6f 6d 20 68 65 72 65 20 75 6e  e.  From here un
03d0: 74 69 6c 20 6e 65 78 74 20 2e 42 45 2c 20 65 76  til next .BE, ev
03e0: 65 72 79 74 68 69 6e 67 20 77 69 6c 6c 20 62 65  erything will be
03f0: 0a 2e 5c 22 09 65 6e 63 6c 6f 73 65 64 20 69 6e  ..\".enclosed in
0400: 20 6f 6e 65 20 6c 61 72 67 65 20 62 6f 78 2e 0a   one large box..
0410: 2e 5c 22 0a 2e 5c 22 20 2e 42 45 0a 2e 5c 22 09  .\"..\" .BE..\".
0420: 45 6e 64 20 6f 66 20 62 6f 78 20 65 6e 63 6c 6f  End of box enclo
0430: 73 75 72 65 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 43  sure...\"..\" .C
0440: 53 0a 2e 5c 22 09 42 65 67 69 6e 20 63 6f 64 65  S..\".Begin code
0450: 20 65 78 63 65 72 70 74 2e 0a 2e 5c 22 0a 2e 5c   excerpt...\"..\
0460: 22 20 2e 43 45 0a 2e 5c 22 09 45 6e 64 20 63 6f  " .CE..\".End co
0470: 64 65 20 65 78 63 65 72 70 74 2e 0a 2e 5c 22 0a  de excerpt...\".
0480: 2e 5c 22 20 2e 56 53 20 3f 76 65 72 73 69 6f 6e  .\" .VS ?version
0490: 3f 20 3f 62 72 3f 0a 2e 5c 22 09 42 65 67 69 6e  ? ?br?..\".Begin
04a0: 20 76 65 72 74 69 63 61 6c 20 73 69 64 65 62 61   vertical sideba
04b0: 72 2c 20 66 6f 72 20 75 73 65 20 69 6e 20 6d 61  r, for use in ma
04c0: 72 6b 69 6e 67 20 6e 65 77 6c 79 2d 63 68 61 6e  rking newly-chan
04d0: 67 65 64 20 70 61 72 74 73 0a 2e 5c 22 09 6f 66  ged parts..\".of
04e0: 20 6d 61 6e 20 70 61 67 65 73 2e 20 20 54 68 65   man pages.  The
04f0: 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74 20   first argument 
0500: 69 73 20 69 67 6e 6f 72 65 64 20 61 6e 64 20 75  is ignored and u
0510: 73 65 64 20 66 6f 72 20 72 65 63 6f 72 64 69 6e  sed for recordin
0520: 67 0a 2e 5c 22 09 74 68 65 20 76 65 72 73 69 6f  g..\".the versio
0530: 6e 20 77 68 65 6e 20 74 68 65 20 2e 56 53 20 77  n when the .VS w
0540: 61 73 20 61 64 64 65 64 2c 20 73 6f 20 74 68 61  as added, so tha
0550: 74 20 74 68 65 20 73 69 64 65 62 61 72 73 20 63  t the sidebars c
0560: 61 6e 20 62 65 0a 2e 5c 22 09 66 6f 75 6e 64 20  an be..\".found 
0570: 61 6e 64 20 72 65 6d 6f 76 65 64 20 77 68 65 6e  and removed when
0580: 20 74 68 65 79 20 72 65 61 63 68 20 61 20 63 65   they reach a ce
0590: 72 74 61 69 6e 20 61 67 65 2e 20 20 49 66 20 61  rtain age.  If a
05a0: 6e 6f 74 68 65 72 20 61 72 67 75 6d 65 6e 74 0a  nother argument.
05b0: 2e 5c 22 09 69 73 20 70 72 65 73 65 6e 74 2c 20  .\".is present, 
05c0: 74 68 65 6e 20 61 20 6c 69 6e 65 20 62 72 65 61  then a line brea
05d0: 6b 20 69 73 20 66 6f 72 63 65 64 20 62 65 66 6f  k is forced befo
05e0: 72 65 20 73 74 61 72 74 69 6e 67 20 74 68 65 20  re starting the 
05f0: 73 69 64 65 62 61 72 2e 0a 2e 5c 22 0a 2e 5c 22  sidebar...\"..\"
0600: 20 2e 56 45 0a 2e 5c 22 09 45 6e 64 20 6f 66 20   .VE..\".End of 
0610: 76 65 72 74 69 63 61 6c 20 73 69 64 65 62 61 72  vertical sidebar
0620: 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 44 53 0a 2e 5c  ...\"..\" .DS..\
0630: 22 09 42 65 67 69 6e 20 61 6e 20 69 6e 64 65 6e  ".Begin an inden
0640: 74 65 64 20 75 6e 66 69 6c 6c 65 64 20 64 69 73  ted unfilled dis
0650: 70 6c 61 79 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 44  play...\"..\" .D
0660: 45 0a 2e 5c 22 09 45 6e 64 20 6f 66 20 69 6e 64  E..\".End of ind
0670: 65 6e 74 65 64 20 75 6e 66 69 6c 6c 65 64 20 64  ented unfilled d
0680: 69 73 70 6c 61 79 2e 0a 2e 5c 22 0a 2e 5c 22 20  isplay...\"..\" 
0690: 2e 53 4f 20 3f 6d 61 6e 70 61 67 65 3f 0a 2e 5c  .SO ?manpage?..\
06a0: 22 09 53 74 61 72 74 20 6f 66 20 6c 69 73 74 20  ".Start of list 
06b0: 6f 66 20 73 74 61 6e 64 61 72 64 20 6f 70 74 69  of standard opti
06c0: 6f 6e 73 20 66 6f 72 20 61 20 54 6b 20 77 69 64  ons for a Tk wid
06d0: 67 65 74 2e 20 54 68 65 20 6d 61 6e 70 61 67 65  get. The manpage
06e0: 0a 2e 5c 22 09 61 72 67 75 6d 65 6e 74 20 64 65  ..\".argument de
06f0: 66 69 6e 65 73 20 77 68 65 72 65 20 74 6f 20 6c  fines where to l
0700: 6f 6f 6b 20 75 70 20 74 68 65 20 73 74 61 6e 64  ook up the stand
0710: 61 72 64 20 6f 70 74 69 6f 6e 73 3b 20 69 66 0a  ard options; if.
0720: 2e 5c 22 09 6f 6d 69 74 74 65 64 2c 20 64 65 66  .\".omitted, def
0730: 61 75 6c 74 73 20 74 6f 20 22 6f 70 74 69 6f 6e  aults to "option
0740: 73 22 2e 20 54 68 65 20 6f 70 74 69 6f 6e 73 20  s". The options 
0750: 66 6f 6c 6c 6f 77 20 6f 6e 20 73 75 63 63 65 73  follow on succes
0760: 73 69 76 65 0a 2e 5c 22 09 6c 69 6e 65 73 2c 20  sive..\".lines, 
0770: 69 6e 20 74 68 72 65 65 20 63 6f 6c 75 6d 6e 73  in three columns
0780: 20 73 65 70 61 72 61 74 65 64 20 62 79 20 74 61   separated by ta
0790: 62 73 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 53 45 0a  bs...\"..\" .SE.
07a0: 2e 5c 22 09 45 6e 64 20 6f 66 20 6c 69 73 74 20  .\".End of list 
07b0: 6f 66 20 73 74 61 6e 64 61 72 64 20 6f 70 74 69  of standard opti
07c0: 6f 6e 73 20 66 6f 72 20 61 20 54 6b 20 77 69 64  ons for a Tk wid
07d0: 67 65 74 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 4f 50  get...\"..\" .OP
07e0: 20 63 6d 64 4e 61 6d 65 20 64 62 4e 61 6d 65 20   cmdName dbName 
07f0: 64 62 43 6c 61 73 73 0a 2e 5c 22 09 53 74 61 72  dbClass..\".Star
0800: 74 20 6f 66 20 64 65 73 63 72 69 70 74 69 6f 6e  t of description
0810: 20 6f 66 20 61 20 73 70 65 63 69 66 69 63 20 6f   of a specific o
0820: 70 74 69 6f 6e 2e 20 20 63 6d 64 4e 61 6d 65 20  ption.  cmdName 
0830: 67 69 76 65 73 20 74 68 65 0a 2e 5c 22 09 6f 70  gives the..\".op
0840: 74 69 6f 6e 27 73 20 6e 61 6d 65 20 61 73 20 73  tion's name as s
0850: 70 65 63 69 66 69 65 64 20 69 6e 20 74 68 65 20  pecified in the 
0860: 63 6c 61 73 73 20 63 6f 6d 6d 61 6e 64 2c 20 64  class command, d
0870: 62 4e 61 6d 65 20 67 69 76 65 73 0a 2e 5c 22 09  bName gives..\".
0880: 74 68 65 20 6f 70 74 69 6f 6e 27 73 20 6e 61 6d  the option's nam
0890: 65 20 69 6e 20 74 68 65 20 6f 70 74 69 6f 6e 20  e in the option 
08a0: 64 61 74 61 62 61 73 65 2c 20 61 6e 64 20 64 62  database, and db
08b0: 43 6c 61 73 73 20 67 69 76 65 73 0a 2e 5c 22 09  Class gives..\".
08c0: 74 68 65 20 6f 70 74 69 6f 6e 27 73 20 63 6c 61  the option's cla
08d0: 73 73 20 69 6e 20 74 68 65 20 6f 70 74 69 6f 6e  ss in the option
08e0: 20 64 61 74 61 62 61 73 65 2e 0a 2e 5c 22 0a 2e   database...\"..
08f0: 5c 22 20 2e 55 4c 20 61 72 67 31 20 61 72 67 32  \" .UL arg1 arg2
0900: 0a 2e 5c 22 09 50 72 69 6e 74 20 61 72 67 31 20  ..\".Print arg1 
0910: 75 6e 64 65 72 6c 69 6e 65 64 2c 20 74 68 65 6e  underlined, then
0920: 20 70 72 69 6e 74 20 61 72 67 32 20 6e 6f 72 6d   print arg2 norm
0930: 61 6c 6c 79 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 51  ally...\"..\" .Q
0940: 57 20 61 72 67 31 20 3f 61 72 67 32 3f 0a 2e 5c  W arg1 ?arg2?..\
0950: 22 09 50 72 69 6e 74 20 61 72 67 31 20 69 6e 20  ".Print arg1 in 
0960: 71 75 6f 74 65 73 2c 20 74 68 65 6e 20 61 72 67  quotes, then arg
0970: 32 20 6e 6f 72 6d 61 6c 6c 79 20 28 66 6f 72 20  2 normally (for 
0980: 74 72 61 69 6c 69 6e 67 20 70 75 6e 63 74 75 61  trailing punctua
0990: 74 69 6f 6e 29 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e  tion)...\"..\" .
09a0: 50 51 20 61 72 67 31 20 3f 61 72 67 32 3f 0a 2e  PQ arg1 ?arg2?..
09b0: 5c 22 09 50 72 69 6e 74 20 61 6e 20 6f 70 65 6e  \".Print an open
09c0: 20 70 61 72 65 6e 74 68 65 73 69 73 2c 20 61 72   parenthesis, ar
09d0: 67 31 20 69 6e 20 71 75 6f 74 65 73 2c 20 74 68  g1 in quotes, th
09e0: 65 6e 20 61 72 67 32 20 6e 6f 72 6d 61 6c 6c 79  en arg2 normally
09f0: 0a 2e 5c 22 09 28 66 6f 72 20 74 72 61 69 6c 69  ..\".(for traili
0a00: 6e 67 20 70 75 6e 63 74 75 61 74 69 6f 6e 29 20  ng punctuation) 
0a10: 61 6e 64 20 74 68 65 6e 20 61 20 63 6c 6f 73 69  and then a closi
0a20: 6e 67 20 70 61 72 65 6e 74 68 65 73 69 73 2e 0a  ng parenthesis..
0a30: 2e 5c 22 0a 2e 5c 22 09 23 20 53 65 74 20 75 70  .\"..\".# Set up
0a40: 20 74 72 61 70 73 20 61 6e 64 20 6f 74 68 65 72   traps and other
0a50: 20 6d 69 73 63 65 6c 6c 61 6e 65 6f 75 73 20 73   miscellaneous s
0a60: 74 75 66 66 20 66 6f 72 20 54 63 6c 2f 54 6b 20  tuff for Tcl/Tk 
0a70: 6d 61 6e 20 70 61 67 65 73 2e 0a 2e 69 66 20 74  man pages...if t
0a80: 20 2e 77 68 20 2d 31 2e 33 69 20 5e 42 0a 2e 6e   .wh -1.3i ^B..n
0a90: 72 20 5e 6c 20 5c 6e 28 2e 6c 0a 2e 61 64 20 62  r ^l \n(.l..ad b
0aa0: 0a 2e 5c 22 09 23 20 53 74 61 72 74 20 61 6e 20  ..\".# Start an 
0ab0: 61 72 67 75 6d 65 6e 74 20 64 65 73 63 72 69 70  argument descrip
0ac0: 74 69 6f 6e 0a 2e 64 65 20 41 50 0a 2e 69 65 20  tion..de AP..ie 
0ad0: 21 22 5c 5c 24 34 22 22 20 2e 54 50 20 5c 5c 24  !"\\$4"" .TP \\$
0ae0: 34 0a 2e 65 6c 20 5c 7b 5c 0a 2e 20 20 20 69 65  4..el \{\..   ie
0af0: 20 21 22 5c 5c 24 32 22 22 20 2e 54 50 20 5c 5c   !"\\$2"" .TP \\
0b00: 6e 28 29 43 75 0a 2e 20 20 20 65 6c 20 20 20 20  n()Cu..   el    
0b10: 20 20 20 20 20 20 2e 54 50 20 31 35 0a 2e 5c 7d        .TP 15..\}
0b20: 0a 2e 74 61 20 5c 5c 6e 28 29 41 75 20 5c 5c 6e  ..ta \\n()Au \\n
0b30: 28 29 42 75 0a 2e 69 65 20 21 22 5c 5c 24 33 22  ()Bu..ie !"\\$3"
0b40: 22 20 5c 7b 5c 0a 5c 26 5c 5c 24 31 20 5c 5c 66  " \{\.\&\\$1 \\f
0b50: 49 5c 5c 24 32 5c 5c 66 50 20 28 5c 5c 24 33 29  I\\$2\\fP (\\$3)
0b60: 0a 2e 5c 22 2e 62 0a 2e 5c 7d 0a 2e 65 6c 20 5c  ..\".b..\}..el \
0b70: 7b 5c 0a 2e 62 72 0a 2e 69 65 20 21 22 5c 5c 24  {\..br..ie !"\\$
0b80: 32 22 22 20 5c 7b 5c 0a 5c 26 5c 5c 24 31 09 5c  2"" \{\.\&\\$1.\
0b90: 5c 66 49 5c 5c 24 32 5c 5c 66 50 0a 2e 5c 7d 0a  \fI\\$2\\fP..\}.
0ba0: 2e 65 6c 20 5c 7b 5c 0a 5c 26 5c 5c 66 49 5c 5c  .el \{\.\&\\fI\\
0bb0: 24 31 5c 5c 66 50 0a 2e 5c 7d 0a 2e 5c 7d 0a 2e  $1\\fP..\}..\}..
0bc0: 2e 0a 2e 5c 22 09 23 20 64 65 66 69 6e 65 20 74  ...\".# define t
0bd0: 61 62 62 69 6e 67 20 76 61 6c 75 65 73 20 66 6f  abbing values fo
0be0: 72 20 2e 41 50 0a 2e 64 65 20 41 53 0a 2e 6e 72  r .AP..de AS..nr
0bf0: 20 29 41 20 31 30 6e 0a 2e 69 66 20 21 22 5c 5c   )A 10n..if !"\\
0c00: 24 31 22 22 20 2e 6e 72 20 29 41 20 5c 5c 77 27  $1"" .nr )A \\w'
0c10: 5c 5c 24 31 27 75 2b 33 6e 0a 2e 6e 72 20 29 42  \\$1'u+3n..nr )B
0c20: 20 5c 5c 6e 28 29 41 75 2b 31 35 6e 0a 2e 5c 22   \\n()Au+15n..\"
0c30: 0a 2e 69 66 20 21 22 5c 5c 24 32 22 22 20 2e 6e  ..if !"\\$2"" .n
0c40: 72 20 29 42 20 5c 5c 77 27 5c 5c 24 32 27 75 2b  r )B \\w'\\$2'u+
0c50: 5c 5c 6e 28 29 41 75 2b 33 6e 0a 2e 6e 72 20 29  \\n()Au+3n..nr )
0c60: 43 20 5c 5c 6e 28 29 42 75 2b 5c 5c 77 27 28 69  C \\n()Bu+\\w'(i
0c70: 6e 2f 6f 75 74 29 27 75 2b 32 6e 0a 2e 2e 0a 2e  n/out)'u+2n.....
0c80: 41 53 20 54 63 6c 5f 49 6e 74 65 72 70 20 54 63  AS Tcl_Interp Tc
0c90: 6c 5f 43 72 65 61 74 65 49 6e 74 65 72 70 20 69  l_CreateInterp i
0ca0: 6e 2f 6f 75 74 0a 2e 5c 22 09 23 20 42 53 20 2d  n/out..\".# BS -
0cb0: 20 73 74 61 72 74 20 62 6f 78 65 64 20 74 65 78   start boxed tex
0cc0: 74 0a 2e 5c 22 09 23 20 5e 79 20 3d 20 73 74 61  t..\".# ^y = sta
0cd0: 72 74 69 6e 67 20 79 20 6c 6f 63 61 74 69 6f 6e  rting y location
0ce0: 0a 2e 5c 22 09 23 20 5e 62 20 3d 20 31 0a 2e 64  ..\".# ^b = 1..d
0cf0: 65 20 42 53 0a 2e 62 72 0a 2e 6d 6b 20 5e 79 0a  e BS..br..mk ^y.
0d00: 2e 6e 72 20 5e 62 20 31 75 0a 2e 69 66 20 6e 20  .nr ^b 1u..if n 
0d10: 2e 6e 66 0a 2e 69 66 20 6e 20 2e 74 69 20 30 0a  .nf..if n .ti 0.
0d20: 2e 69 66 20 6e 20 5c 6c 27 5c 5c 6e 28 2e 6c 75  .if n \l'\\n(.lu
0d30: 5c 28 75 6c 27 0a 2e 69 66 20 6e 20 2e 66 69 0a  \(ul'..if n .fi.
0d40: 2e 2e 0a 2e 5c 22 09 23 20 42 45 20 2d 20 65 6e  ....\".# BE - en
0d50: 64 20 62 6f 78 65 64 20 74 65 78 74 20 28 64 72  d boxed text (dr
0d60: 61 77 20 62 6f 78 20 6e 6f 77 29 0a 2e 64 65 20  aw box now)..de 
0d70: 42 45 0a 2e 6e 66 0a 2e 74 69 20 30 0a 2e 6d 6b  BE..nf..ti 0..mk
0d80: 20 5e 74 0a 2e 69 65 20 6e 20 5c 6c 27 5c 5c 6e   ^t..ie n \l'\\n
0d90: 28 5e 6c 75 5c 28 75 6c 27 0a 2e 65 6c 20 5c 7b  (^lu\(ul'..el \{
0da0: 5c 0a 2e 5c 22 09 44 72 61 77 20 66 6f 75 72 2d  \..\".Draw four-
0db0: 73 69 64 65 64 20 62 6f 78 20 6e 6f 72 6d 61 6c  sided box normal
0dc0: 6c 79 2c 20 62 75 74 20 64 6f 6e 27 74 20 64 72  ly, but don't dr
0dd0: 61 77 20 74 6f 70 20 6f 66 0a 2e 5c 22 09 62 6f  aw top of..\".bo
0de0: 78 20 69 66 20 74 68 65 20 62 6f 78 20 73 74 61  x if the box sta
0df0: 72 74 65 64 20 6f 6e 20 61 6e 20 65 61 72 6c 69  rted on an earli
0e00: 65 72 20 70 61 67 65 2e 0a 2e 69 65 20 21 5c 5c  er page...ie !\\
0e10: 6e 28 5e 62 2d 31 20 5c 7b 5c 0a 5c 68 27 2d 31  n(^b-1 \{\.\h'-1
0e20: 2e 35 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 79 75 2d  .5n'\L'|\\n(^yu-
0e30: 31 76 27 5c 6c 27 5c 5c 6e 28 5e 6c 75 2b 33 6e  1v'\l'\\n(^lu+3n
0e40: 5c 28 75 6c 27 5c 4c 27 5c 5c 6e 28 5e 74 75 2b  \(ul'\L'\\n(^tu+
0e50: 31 76 2d 5c 5c 6e 28 5e 79 75 27 5c 6c 27 7c 30  1v-\\n(^yu'\l'|0
0e60: 75 2d 31 2e 35 6e 5c 28 75 6c 27 0a 2e 5c 7d 0a  u-1.5n\(ul'..\}.
0e70: 2e 65 6c 20 5c 7d 5c 0a 5c 68 27 2d 31 2e 35 6e  .el \}\.\h'-1.5n
0e80: 27 5c 4c 27 7c 5c 5c 6e 28 5e 79 75 2d 31 76 27  '\L'|\\n(^yu-1v'
0e90: 5c 68 27 5c 5c 6e 28 5e 6c 75 2b 33 6e 27 5c 4c  \h'\\n(^lu+3n'\L
0ea0: 27 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28  '\\n(^tu+1v-\\n(
0eb0: 5e 79 75 27 5c 6c 27 7c 30 75 2d 31 2e 35 6e 5c  ^yu'\l'|0u-1.5n\
0ec0: 28 75 6c 27 0a 2e 5c 7d 0a 2e 5c 7d 0a 2e 66 69  (ul'..\}..\}..fi
0ed0: 0a 2e 62 72 0a 2e 6e 72 20 5e 62 20 30 0a 2e 2e  ..br..nr ^b 0...
0ee0: 0a 2e 5c 22 09 23 20 56 53 20 2d 20 73 74 61 72  ..\".# VS - star
0ef0: 74 20 76 65 72 74 69 63 61 6c 20 73 69 64 65 62  t vertical sideb
0f00: 61 72 0a 2e 5c 22 09 23 20 5e 59 20 3d 20 73 74  ar..\".# ^Y = st
0f10: 61 72 74 69 6e 67 20 79 20 6c 6f 63 61 74 69 6f  arting y locatio
0f20: 6e 0a 2e 5c 22 09 23 20 5e 76 20 3d 20 31 20 28  n..\".# ^v = 1 (
0f30: 66 6f 72 20 74 72 6f 66 66 3b 20 20 66 6f 72 20  for troff;  for 
0f40: 6e 72 6f 66 66 20 74 68 69 73 20 64 6f 65 73 6e  nroff this doesn
0f50: 27 74 20 6d 61 74 74 65 72 29 0a 2e 64 65 20 56  't matter)..de V
0f60: 53 0a 2e 69 66 20 21 22 5c 5c 24 32 22 22 20 2e  S..if !"\\$2"" .
0f70: 62 72 0a 2e 6d 6b 20 5e 59 0a 2e 69 65 20 6e 20  br..mk ^Y..ie n 
0f80: 27 6d 63 20 5c 73 31 32 5c 28 62 72 5c 73 30 0a  'mc \s12\(br\s0.
0f90: 2e 65 6c 20 2e 6e 72 20 5e 76 20 31 75 0a 2e 2e  .el .nr ^v 1u...
0fa0: 0a 2e 5c 22 09 23 20 56 45 20 2d 20 65 6e 64 20  ..\".# VE - end 
0fb0: 6f 66 20 76 65 72 74 69 63 61 6c 20 73 69 64 65  of vertical side
0fc0: 62 61 72 0a 2e 64 65 20 56 45 0a 2e 69 65 20 6e  bar..de VE..ie n
0fd0: 20 27 6d 63 0a 2e 65 6c 20 5c 7b 5c 0a 2e 65 76   'mc..el \{\..ev
0fe0: 20 32 0a 2e 6e 66 0a 2e 74 69 20 30 0a 2e 6d 6b   2..nf..ti 0..mk
0ff0: 20 5e 74 0a 5c 68 27 7c 5c 5c 6e 28 5e 6c 75 2b   ^t.\h'|\\n(^lu+
1000: 33 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 59 75 2d 31  3n'\L'|\\n(^Yu-1
1010: 76 5c 28 62 76 27 5c 76 27 5c 5c 6e 28 5e 74 75  v\(bv'\v'\\n(^tu
1020: 2b 31 76 2d 5c 5c 6e 28 5e 59 75 27 5c 68 27 2d  +1v-\\n(^Yu'\h'-
1030: 7c 5c 5c 6e 28 5e 6c 75 2b 33 6e 27 0a 2e 73 70  |\\n(^lu+3n'..sp
1040: 20 2d 31 0a 2e 66 69 0a 2e 65 76 0a 2e 5c 7d 0a   -1..fi..ev..\}.
1050: 2e 6e 72 20 5e 76 20 30 0a 2e 2e 0a 2e 5c 22 09  .nr ^v 0.....\".
1060: 23 20 53 70 65 63 69 61 6c 20 6d 61 63 72 6f 20  # Special macro 
1070: 74 6f 20 68 61 6e 64 6c 65 20 70 61 67 65 20 62  to handle page b
1080: 6f 74 74 6f 6d 3a 20 20 66 69 6e 69 73 68 20 6f  ottom:  finish o
1090: 66 66 20 63 75 72 72 65 6e 74 0a 2e 5c 22 09 23  ff current..\".#
10a0: 20 62 6f 78 2f 73 69 64 65 62 61 72 20 69 66 20   box/sidebar if 
10b0: 69 6e 20 62 6f 78 2f 73 69 64 65 62 61 72 20 6d  in box/sidebar m
10c0: 6f 64 65 2c 20 74 68 65 6e 20 69 6e 76 6f 6b 65  ode, then invoke
10d0: 64 20 73 74 61 6e 64 61 72 64 0a 2e 5c 22 09 23  d standard..\".#
10e0: 20 70 61 67 65 20 62 6f 74 74 6f 6d 20 6d 61 63   page bottom mac
10f0: 72 6f 2e 0a 2e 64 65 20 5e 42 0a 2e 65 76 20 32  ro...de ^B..ev 2
1100: 0a 27 74 69 20 30 0a 27 6e 66 0a 2e 6d 6b 20 5e  .'ti 0.'nf..mk ^
1110: 74 0a 2e 69 66 20 5c 5c 6e 28 5e 62 20 5c 7b 5c  t..if \\n(^b \{\
1120: 0a 2e 5c 22 09 44 72 61 77 20 74 68 72 65 65 2d  ..\".Draw three-
1130: 73 69 64 65 64 20 62 6f 78 20 69 66 20 74 68 69  sided box if thi
1140: 73 20 69 73 20 74 68 65 20 62 6f 78 27 73 20 66  s is the box's f
1150: 69 72 73 74 20 70 61 67 65 2c 0a 2e 5c 22 09 64  irst page,..\".d
1160: 72 61 77 20 74 77 6f 20 73 69 64 65 73 20 62 75  raw two sides bu
1170: 74 20 6e 6f 20 74 6f 70 20 6f 74 68 65 72 77 69  t no top otherwi
1180: 73 65 2e 0a 2e 69 65 20 21 5c 5c 6e 28 5e 62 2d  se...ie !\\n(^b-
1190: 31 20 5c 68 27 2d 31 2e 35 6e 27 5c 4c 27 7c 5c  1 \h'-1.5n'\L'|\
11a0: 5c 6e 28 5e 79 75 2d 31 76 27 5c 6c 27 5c 5c 6e  \n(^yu-1v'\l'\\n
11b0: 28 5e 6c 75 2b 33 6e 5c 28 75 6c 27 5c 4c 27 5c  (^lu+3n\(ul'\L'\
11c0: 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28 5e 79  \n(^tu+1v-\\n(^y
11d0: 75 27 5c 68 27 7c 30 75 27 5c 63 0a 2e 65 6c 20  u'\h'|0u'\c..el 
11e0: 5c 68 27 2d 31 2e 35 6e 27 5c 4c 27 7c 5c 5c 6e  \h'-1.5n'\L'|\\n
11f0: 28 5e 79 75 2d 31 76 27 5c 68 27 5c 5c 6e 28 5e  (^yu-1v'\h'\\n(^
1200: 6c 75 2b 33 6e 27 5c 4c 27 5c 5c 6e 28 5e 74 75  lu+3n'\L'\\n(^tu
1210: 2b 31 76 2d 5c 5c 6e 28 5e 79 75 27 5c 68 27 7c  +1v-\\n(^yu'\h'|
1220: 30 75 27 5c 63 0a 2e 5c 7d 0a 2e 69 66 20 5c 5c  0u'\c..\}..if \\
1230: 6e 28 5e 76 20 5c 7b 5c 0a 2e 6e 72 20 5e 78 20  n(^v \{\..nr ^x 
1240: 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28 5e  \\n(^tu+1v-\\n(^
1250: 59 75 0a 5c 6b 78 5c 68 27 2d 5c 5c 6e 78 75 27  Yu.\kx\h'-\\nxu'
1260: 5c 68 27 7c 5c 5c 6e 28 5e 6c 75 2b 33 6e 27 5c  \h'|\\n(^lu+3n'\
1270: 6b 79 5c 4c 27 2d 5c 5c 6e 28 5e 78 75 27 5c 76  ky\L'-\\n(^xu'\v
1280: 27 5c 5c 6e 28 5e 78 75 27 5c 68 27 7c 30 75 27  '\\n(^xu'\h'|0u'
1290: 5c 63 0a 2e 5c 7d 0a 2e 62 70 0a 27 66 69 0a 2e  \c..\}..bp.'fi..
12a0: 65 76 0a 2e 69 66 20 5c 5c 6e 28 5e 62 20 5c 7b  ev..if \\n(^b \{
12b0: 5c 0a 2e 6d 6b 20 5e 79 0a 2e 6e 72 20 5e 62 20  \..mk ^y..nr ^b 
12c0: 32 0a 2e 5c 7d 0a 2e 69 66 20 5c 5c 6e 28 5e 76  2..\}..if \\n(^v
12d0: 20 5c 7b 5c 0a 2e 6d 6b 20 5e 59 0a 2e 5c 7d 0a   \{\..mk ^Y..\}.
12e0: 2e 2e 0a 2e 5c 22 09 23 20 44 53 20 2d 20 62 65  ....\".# DS - be
12f0: 67 69 6e 20 64 69 73 70 6c 61 79 0a 2e 64 65 20  gin display..de 
1300: 44 53 0a 2e 52 53 0a 2e 6e 66 0a 2e 73 70 0a 2e  DS..RS..nf..sp..
1310: 2e 0a 2e 5c 22 09 23 20 44 45 20 2d 20 65 6e 64  ...\".# DE - end
1320: 20 64 69 73 70 6c 61 79 0a 2e 64 65 20 44 45 0a   display..de DE.
1330: 2e 66 69 0a 2e 52 45 0a 2e 73 70 0a 2e 2e 0a 2e  .fi..RE..sp.....
1340: 5c 22 09 23 20 53 4f 20 2d 20 73 74 61 72 74 20  \".# SO - start 
1350: 6f 66 20 6c 69 73 74 20 6f 66 20 73 74 61 6e 64  of list of stand
1360: 61 72 64 20 6f 70 74 69 6f 6e 73 0a 2e 64 65 20  ard options..de 
1370: 53 4f 0a 27 69 65 20 27 5c 5c 24 31 27 27 20 2e  SO.'ie '\\$1'' .
1380: 64 73 20 53 6f 20 5c 5c 66 42 6f 70 74 69 6f 6e  ds So \\fBoption
1390: 73 5c 5c 66 52 0a 27 65 6c 20 2e 64 73 20 53 6f  s\\fR.'el .ds So
13a0: 20 5c 5c 66 42 5c 5c 24 31 5c 5c 66 52 0a 2e 53   \\fB\\$1\\fR..S
13b0: 48 20 22 53 54 41 4e 44 41 52 44 20 4f 50 54 49  H "STANDARD OPTI
13c0: 4f 4e 53 22 0a 2e 4c 50 0a 2e 6e 66 0a 2e 74 61  ONS"..LP..nf..ta
13d0: 20 35 2e 35 63 20 31 31 63 0a 2e 66 74 20 42 0a   5.5c 11c..ft B.
13e0: 2e 2e 0a 2e 5c 22 09 23 20 53 45 20 2d 20 65 6e  ....\".# SE - en
13f0: 64 20 6f 66 20 6c 69 73 74 20 6f 66 20 73 74 61  d of list of sta
1400: 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 0a 2e 64  ndard options..d
1410: 65 20 53 45 0a 2e 66 69 0a 2e 66 74 20 52 0a 2e  e SE..fi..ft R..
1420: 4c 50 0a 53 65 65 20 74 68 65 20 5c 5c 2a 28 53  LP.See the \\*(S
1430: 6f 20 6d 61 6e 75 61 6c 20 65 6e 74 72 79 20 66  o manual entry f
1440: 6f 72 20 64 65 74 61 69 6c 73 20 6f 6e 20 74 68  or details on th
1450: 65 20 73 74 61 6e 64 61 72 64 20 6f 70 74 69 6f  e standard optio
1460: 6e 73 2e 0a 2e 2e 0a 2e 5c 22 09 23 20 4f 50 20  ns......\".# OP 
1470: 2d 20 73 74 61 72 74 20 6f 66 20 66 75 6c 6c 20  - start of full 
1480: 64 65 73 63 72 69 70 74 69 6f 6e 20 66 6f 72 20  description for 
1490: 61 20 73 69 6e 67 6c 65 20 6f 70 74 69 6f 6e 0a  a single option.
14a0: 2e 64 65 20 4f 50 0a 2e 4c 50 0a 2e 6e 66 0a 2e  .de OP..LP..nf..
14b0: 74 61 20 34 63 0a 43 6f 6d 6d 61 6e 64 2d 4c 69  ta 4c.Command-Li
14c0: 6e 65 20 4e 61 6d 65 3a 09 5c 5c 66 42 5c 5c 24  ne Name:.\\fB\\$
14d0: 31 5c 5c 66 52 0a 44 61 74 61 62 61 73 65 20 4e  1\\fR.Database N
14e0: 61 6d 65 3a 09 5c 5c 66 42 5c 5c 24 32 5c 5c 66  ame:.\\fB\\$2\\f
14f0: 52 0a 44 61 74 61 62 61 73 65 20 43 6c 61 73 73  R.Database Class
1500: 3a 09 5c 5c 66 42 5c 5c 24 33 5c 5c 66 52 0a 2e  :.\\fB\\$3\\fR..
1510: 66 69 0a 2e 49 50 0a 2e 2e 0a 2e 5c 22 09 23 20  fi..IP.....\".# 
1520: 43 53 20 2d 20 62 65 67 69 6e 20 63 6f 64 65 20  CS - begin code 
1530: 65 78 63 65 72 70 74 0a 2e 64 65 20 43 53 0a 2e  excerpt..de CS..
1540: 52 53 0a 2e 6e 66 0a 2e 74 61 20 2e 32 35 69 20  RS..nf..ta .25i 
1550: 2e 35 69 20 2e 37 35 69 20 31 69 0a 2e 2e 0a 2e  .5i .75i 1i.....
1560: 5c 22 09 23 20 43 45 20 2d 20 65 6e 64 20 63 6f  \".# CE - end co
1570: 64 65 20 65 78 63 65 72 70 74 0a 2e 64 65 20 43  de excerpt..de C
1580: 45 0a 2e 66 69 0a 2e 52 45 0a 2e 2e 0a 2e 5c 22  E..fi..RE.....\"
1590: 09 23 20 55 4c 20 2d 20 75 6e 64 65 72 6c 69 6e  .# UL - underlin
15a0: 65 20 77 6f 72 64 0a 2e 64 65 20 55 4c 0a 5c 5c  e word..de UL.\\
15b0: 24 31 5c 6c 27 7c 30 5c 28 75 6c 27 5c 5c 24 32  $1\l'|0\(ul'\\$2
15c0: 0a 2e 2e 0a 2e 5c 22 09 23 20 51 57 20 2d 20 61  .....\".# QW - a
15d0: 70 70 6c 79 20 71 75 6f 74 61 74 69 6f 6e 20 6d  pply quotation m
15e0: 61 72 6b 73 20 74 6f 20 77 6f 72 64 0a 2e 64 65  arks to word..de
15f0: 20 51 57 0a 2e 69 65 20 27 5c 5c 2a 28 6c 71 27   QW..ie '\\*(lq'
1600: 22 27 20 60 60 5c 5c 24 31 27 27 5c 5c 24 32 0a  "' ``\\$1''\\$2.
1610: 2e 5c 22 22 20 66 69 78 20 65 6d 61 63 73 20 68  .\"" fix emacs h
1620: 69 67 68 6c 69 67 68 74 69 6e 67 0a 2e 65 6c 20  ighlighting..el 
1630: 5c 5c 2a 28 6c 71 5c 5c 24 31 5c 5c 2a 28 72 71  \\*(lq\\$1\\*(rq
1640: 5c 5c 24 32 0a 2e 2e 0a 2e 5c 22 09 23 20 50 51  \\$2.....\".# PQ
1650: 20 2d 20 61 70 70 6c 79 20 70 61 72 65 6e 73 20   - apply parens 
1660: 61 6e 64 20 71 75 6f 74 61 74 69 6f 6e 20 6d 61  and quotation ma
1670: 72 6b 73 20 74 6f 20 77 6f 72 64 0a 2e 64 65 20  rks to word..de 
1680: 50 51 0a 2e 69 65 20 27 5c 5c 2a 28 6c 71 27 22  PQ..ie '\\*(lq'"
1690: 27 20 28 60 60 5c 5c 24 31 27 27 5c 5c 24 32 29  ' (``\\$1''\\$2)
16a0: 5c 5c 24 33 0a 2e 5c 22 22 20 66 69 78 20 65 6d  \\$3..\"" fix em
16b0: 61 63 73 20 68 69 67 68 6c 69 67 68 74 69 6e 67  acs highlighting
16c0: 0a 2e 65 6c 20 28 5c 5c 2a 28 6c 71 5c 5c 24 31  ..el (\\*(lq\\$1
16d0: 5c 5c 2a 28 72 71 5c 5c 24 32 29 5c 5c 24 33 0a  \\*(rq\\$2)\\$3.
16e0: 2e 2e 0a 2e 5c 22 09 23 20 51 52 20 2d 20 71 75  ....\".# QR - qu
16f0: 6f 74 65 64 20 72 61 6e 67 65 0a 2e 64 65 20 51  oted range..de Q
1700: 52 0a 2e 69 65 20 27 5c 5c 2a 28 6c 71 27 22 27  R..ie '\\*(lq'"'
1710: 20 60 60 5c 5c 24 31 27 27 5c 5c 2d 60 60 5c 5c   ``\\$1''\\-``\\
1720: 24 32 27 27 5c 5c 24 33 0a 2e 5c 22 22 20 66 69  $2''\\$3..\"" fi
1730: 78 20 65 6d 61 63 73 20 68 69 67 68 6c 69 67 68  x emacs highligh
1740: 74 69 6e 67 0a 2e 65 6c 20 5c 5c 2a 28 6c 71 5c  ting..el \\*(lq\
1750: 5c 24 31 5c 5c 2a 28 72 71 5c 5c 2d 5c 5c 2a 28  \$1\\*(rq\\-\\*(
1760: 6c 71 5c 5c 24 32 5c 5c 2a 28 72 71 5c 5c 24 33  lq\\$2\\*(rq\\$3
1770: 0a 2e 2e 0a 2e 5c 22 09 23 20 4d 54 20 2d 20 22  .....\".# MT - "
1780: 65 6d 70 74 79 22 20 73 74 72 69 6e 67 0a 2e 64  empty" string..d
1790: 65 20 4d 54 0a 2e 51 57 20 22 22 0a 2e 2e 0a 2e  e MT..QW "".....
17a0: 42 53 0a 2e 53 48 20 4e 41 4d 45 0a 74 6c 73 20  BS..SH NAME.tls 
17b0: 5c 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20 74 68  \- binding to th
17c0: 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72  e OpenSSL librar
17d0: 79 20 66 6f 72 20 65 6e 63 72 79 70 74 65 64 20  y for encrypted 
17e0: 73 6f 63 6b 65 74 20 61 6e 64 20 49 2f 4f 20 63  socket and I/O c
17f0: 68 61 6e 6e 65 6c 20 63 6f 6d 6d 75 6e 69 63 61  hannel communica
1800: 74 69 6f 6e 73 0a 2e 53 48 20 53 59 4e 4f 50 53  tions..SH SYNOPS
1810: 49 53 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  IS.package requi
1820: 72 65 20 5c 66 42 54 63 6c 20 38 5c 26 2e 35 2d  re \fBTcl 8\&.5-
1830: 5c 66 52 0a 2e 73 70 0a 70 61 63 6b 61 67 65 20  \fR..sp.package 
1840: 72 65 71 75 69 72 65 20 5c 66 42 74 6c 73 20 32  require \fBtls 2
1850: 5c 26 2e 30 5c 66 52 0a 2e 73 70 0a 5c 66 42 74  \&.0\fR..sp.\fBt
1860: 6c 73 3a 3a 69 6e 69 74 5c 66 52 20 3f 5c 66 49  ls::init\fR ?\fI
1870: 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49  -option\fR? ?\fI
1880: 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f  value\fR? ?\fI-o
1890: 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e 5c  ption value \&.\
18a0: 26 2e 5c 26 2e 5c 66 52 3f 0a 2e 73 70 0a 5c 66  &.\&.\fR?..sp.\f
18b0: 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66 52 20  Btls::socket\fR 
18c0: 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20  ?\fI-option\fR? 
18d0: 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c  ?\fIvalue\fR? ?\
18e0: 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20  fI-option value 
18f0: 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 20 5c 66  \&.\&.\&.\fR? \f
1900: 49 68 6f 73 74 5c 66 52 20 5c 66 49 70 6f 72 74  Ihost\fR \fIport
1910: 5c 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a  \fR..sp.\fBtls::
1920: 73 6f 63 6b 65 74 5c 66 52 20 5c 66 42 2d 73 65  socket\fR \fB-se
1930: 72 76 65 72 5c 66 52 20 5c 66 49 63 6f 6d 6d 61  rver\fR \fIcomma
1940: 6e 64 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f  nd\fR ?\fI-optio
1950: 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c  n\fR? ?\fIvalue\
1960: 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20  fR? ?\fI-option 
1970: 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c  value \&.\&.\&.\
1980: 66 52 3f 20 5c 66 49 70 6f 72 74 5c 66 52 0a 2e  fR? \fIport\fR..
1990: 73 70 0a 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72  sp.\fBtls::impor
19a0: 74 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c  t\fR \fIchannel\
19b0: 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66  fR ?\fI-option\f
19c0: 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f  R? ?\fIvalue\fR?
19d0: 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c   ?\fI-option val
19e0: 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f  ue \&.\&.\&.\fR?
19f0: 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 73 74 61  ..sp.\fBtls::sta
1a00: 72 74 74 6c 73 5c 66 52 20 5c 66 49 63 68 61 6e  rttls\fR \fIchan
1a10: 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69  nel\fR ?\fI-opti
1a20: 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65  on\fR? ?\fIvalue
1a30: 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e  \fR? ?\fI-option
1a40: 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e   value \&.\&.\&.
1a50: 5c 66 52 3f 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a  \fR?..sp.\fBtls:
1a60: 3a 68 61 6e 64 73 68 61 6b 65 5c 66 52 20 5c 66  :handshake\fR \f
1a70: 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a  Ichannel\fR..sp.
1a80: 5c 66 42 74 6c 73 3a 3a 73 68 75 74 64 6f 77 6e  \fBtls::shutdown
1a90: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66  \fR \fIchannel\f
1aa0: 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 75 6e  R..sp.\fBtls::un
1ab0: 69 6d 70 6f 72 74 5c 66 52 20 5c 66 49 63 68 61  import\fR \fIcha
1ac0: 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a 5c 66 42 74  nnel\fR..sp.\fBt
1ad0: 6c 73 3a 3a 75 6e 73 74 61 63 6b 5c 66 52 20 5c  ls::unstack\fR \
1ae0: 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 2e 73 70  fIchannel\fR..sp
1af0: 0a 5c 66 42 74 6c 73 3a 3a 73 74 61 74 75 73 5c  .\fBtls::status\
1b00: 66 52 20 3f 5c 66 42 2d 6c 6f 63 61 6c 5c 66 52  fR ?\fB-local\fR
1b10: 3f 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a  ? \fIchannel\fR.
1b20: 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 63 6f 6e 6e  .sp.\fBtls::conn
1b30: 65 63 74 69 6f 6e 5c 66 52 20 5c 66 49 63 68 61  ection\fR \fIcha
1b40: 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a 5c 66 42 74  nnel\fR..sp.\fBt
1b50: 6c 73 3a 3a 63 69 70 68 65 72 73 5c 66 52 20 3f  ls::ciphers\fR ?
1b60: 5c 66 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 3f 20  \fIprotocol\fR? 
1b70: 3f 5c 66 49 76 65 72 62 6f 73 65 5c 66 52 3f 20  ?\fIverbose\fR? 
1b80: 3f 5c 66 49 73 75 70 70 6f 72 74 65 64 5c 66 52  ?\fIsupported\fR
1b90: 3f 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 70 72  ?..sp.\fBtls::pr
1ba0: 6f 74 6f 63 6f 6c 73 5c 66 52 0a 2e 73 70 0a 5c  otocols\fR..sp.\
1bb0: 66 42 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 5c 66  fBtls::version\f
1bc0: 52 0a 2e 73 70 0a 2e 42 45 0a 2e 53 48 20 44 45  R..sp..BE..SH DE
1bd0: 53 43 52 49 50 54 49 4f 4e 0a 54 68 69 73 20 65  SCRIPTION.This e
1be0: 78 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64 65  xtension provide
1bf0: 73 20 54 43 4c 20 73 63 72 69 70 74 20 61 63 63  s TCL script acc
1c00: 65 73 73 20 74 6f 20 53 65 63 75 72 65 20 53 6f  ess to Secure So
1c10: 63 6b 65 74 20 4c 61 79 65 72 20 28 53 53 4c 29  cket Layer (SSL)
1c20: 0a 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 73 20  .communications 
1c30: 75 73 69 6e 67 20 74 68 65 20 54 72 61 6e 73 70  using the Transp
1c40: 6f 72 74 20 4c 61 79 65 72 20 53 65 63 75 72 69  ort Layer Securi
1c50: 74 79 20 28 54 4c 53 29 20 70 72 6f 74 6f 63 6f  ty (TLS) protoco
1c60: 6c 5c 26 2e 20 49 74 20 70 72 6f 76 69 64 65 73  l\&. It provides
1c70: 20 61 0a 67 65 6e 65 72 69 63 20 62 69 6e 64 69   a.generic bindi
1c80: 6e 67 20 74 6f 20 5c 66 49 4f 70 65 6e 53 53 4c  ng to \fIOpenSSL
1c90: 5c 66 52 20 5b 68 74 74 70 73 3a 2f 2f 77 77 77  \fR [https://www
1ca0: 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e 6f 72 67  \&.openssl\&.org
1cb0: 2f 5d 2c 20 75 74 69 6c 69 7a 69 6e 67 20 74 68  /], utilizing th
1cc0: 65 0a 5c 66 42 54 63 6c 5f 53 74 61 63 6b 43 68  e.\fBTcl_StackCh
1cd0: 61 6e 6e 65 6c 5c 66 52 20 41 50 49 20 69 6e 20  annel\fR API in 
1ce0: 54 43 4c 20 38 5c 26 2e 34 20 6f 72 20 6c 61 74  TCL 8\&.4 or lat
1cf0: 65 72 5c 26 2e 20 54 68 65 73 65 20 73 6f 63 6b  er\&. These sock
1d00: 65 74 73 20 62 65 68 61 76 65 20 65 78 61 63 74  ets behave exact
1d10: 6c 79 0a 74 68 65 20 73 61 6d 65 20 61 73 20 63  ly.the same as c
1d20: 68 61 6e 6e 65 6c 73 20 63 72 65 61 74 65 64 20  hannels created 
1d30: 75 73 69 6e 67 20 74 68 65 20 62 75 69 6c 74 2d  using the built-
1d40: 69 6e 20 5c 66 42 73 6f 63 6b 65 74 5c 66 52 20  in \fBsocket\fR 
1d50: 63 6f 6d 6d 61 6e 64 2c 20 62 75 74 0a 70 72 6f  command, but.pro
1d60: 76 69 64 65 20 61 64 64 69 74 69 6f 6e 61 6c 20  vide additional 
1d70: 6f 70 74 69 6f 6e 73 20 66 6f 72 20 63 6f 6e 74  options for cont
1d80: 72 6f 6c 6c 69 6e 67 20 74 68 65 20 53 53 4c 2f  rolling the SSL/
1d90: 54 4c 53 20 73 65 73 73 69 6f 6e 5c 26 2e 0a 2e  TLS session\&...
1da0: 53 48 20 43 4f 4d 50 41 54 49 42 49 4c 49 54 59  SH COMPATIBILITY
1db0: 0a 54 68 69 73 20 65 78 74 65 6e 73 69 6f 6e 20  .This extension 
1dc0: 69 73 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69  is compatible wi
1dd0: 74 68 20 4f 70 65 6e 53 53 4c 20 31 5c 26 2e 31  th OpenSSL 1\&.1
1de0: 5c 26 2e 31 20 6f 72 20 6c 61 74 65 72 5c 26 20  \&.1 or later\& 
1df0: 69 6e 63 6c 75 64 69 6e 67 20 74 68 65 20 33 5c  including the 3\
1e00: 26 2e 78 20 61 6e 64 0a 34 5c 26 2e 30 20 72 65  &.x and.4\&.0 re
1e10: 6c 65 61 73 65 73 2e 20 49 74 20 72 65 71 75 69  leases. It requi
1e20: 72 65 73 20 54 63 6c 20 76 65 72 73 69 6f 6e 20  res Tcl version 
1e30: 38 5c 26 2e 35 20 6f 72 20 6c 61 74 65 72 20 61  8\&.5 or later a
1e40: 6e 64 20 77 69 6c 6c 20 77 6f 72 6b 20 77 69 74  nd will work wit
1e50: 68 20 54 63 6c 20 39 5c 26 2e 30 5c 26 2e 0a 2e  h Tcl 9\&.0\&...
1e60: 53 48 20 43 4f 4d 4d 41 4e 44 53 0a 54 68 65 20  SH COMMANDS.The 
1e70: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 65 20 74 68  following are th
1e80: 65 20 63 6f 6d 6d 61 6e 64 73 20 70 72 6f 76 69  e commands provi
1e90: 64 65 64 20 62 79 20 74 68 65 20 54 63 4c 54 4c  ded by the TcLTL
1ea0: 53 20 70 61 63 6b 61 67 65 5c 26 2e 20 53 65 65  S package\&. See
1eb0: 0a 5c 66 42 45 78 61 6d 70 6c 65 73 5c 66 52 20  .\fBExamples\fR 
1ec0: 66 6f 72 20 65 78 61 6d 70 6c 65 20 75 73 61 67  for example usag
1ed0: 65 20 61 6e 64 20 74 68 65 20 22 5c 66 49 64 65  e and the "\fIde
1ee0: 6d 6f 73 5c 66 52 22 20 64 69 72 65 63 74 6f 72  mos\fR" director
1ef0: 79 20 66 6f 72 0a 6d 6f 72 65 20 65 78 61 6d 70  y for.more examp
1f00: 6c 65 20 75 73 61 67 65 5c 26 2e 0a 2e 54 50 0a  le usage\&...TP.
1f10: 5c 66 42 74 6c 73 3a 3a 69 6e 69 74 5c 66 52 20  \fBtls::init\fR 
1f20: 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20  ?\fI-option\fR? 
1f30: 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c  ?\fIvalue\fR? ?\
1f40: 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20  fI-option value 
1f50: 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 0a 4f 70  \&.\&.\&.\fR?.Op
1f60: 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 20  tional function 
1f70: 74 6f 20 73 65 74 20 74 68 65 20 64 65 66 61 75  to set the defau
1f80: 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65 64 20  lt options used 
1f90: 62 79 20 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65  by \fBtls::socke
1fa0: 74 5c 66 52 5c 26 2e 20 49 66 20 79 6f 75 0a 63  t\fR\&. If you.c
1fb0: 61 6c 6c 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f  all \fBtls::impo
1fc0: 72 74 5c 66 52 20 64 69 72 65 63 74 6c 79 2c 20  rt\fR directly, 
1fd0: 74 68 65 20 76 61 6c 75 65 73 20 73 65 74 20 62  the values set b
1fe0: 79 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 20 68  y this command h
1ff0: 61 76 65 20 6e 6f 20 65 66 66 65 63 74 5c 26 2e  ave no effect\&.
2000: 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 73 75  .This command su
2010: 70 70 6f 72 74 73 20 61 6c 6c 20 6f 66 20 74 68  pports all of th
2020: 65 20 73 61 6d 65 20 6f 70 74 69 6f 6e 73 20 61  e same options a
2030: 73 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 73 6f  s the \fBtls::so
2040: 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 2c  cket\fR command,
2050: 0a 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75  .though you shou
2060: 6c 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70  ld limit your op
2070: 74 69 6f 6e 73 20 74 6f 20 6f 6e 6c 79 20 74 68  tions to only th
2080: 65 20 54 4c 53 20 72 65 6c 61 74 65 64 20 6f 6e  e TLS related on
2090: 65 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73  es\&...TP.\fBtls
20a0: 3a 3a 73 6f 63 6b 65 74 5c 66 52 20 3f 5c 66 49  ::socket\fR ?\fI
20b0: 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49  -option\fR? ?\fI
20c0: 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f  value\fR? ?\fI-o
20d0: 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e 5c  ption value \&.\
20e0: 26 2e 5c 26 2e 5c 66 52 3f 20 5c 66 49 68 6f 73  &.\&.\fR? \fIhos
20f0: 74 5c 66 52 20 5c 66 49 70 6f 72 74 5c 66 52 0a  t\fR \fIport\fR.
2100: 54 68 69 73 20 69 73 20 61 20 68 65 6c 70 65 72  This is a helper
2110: 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20 75   function that u
2120: 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e 64 65  tilizes the unde
2130: 72 6c 79 69 6e 67 20 63 6f 6d 6d 61 6e 64 73 20  rlying commands 
2140: 5c 66 42 73 6f 63 6b 65 74 5c 66 52 0a 61 6e 64  \fBsocket\fR.and
2150: 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c   \fBtls::import\
2160: 66 52 20 74 6f 20 63 72 65 61 74 65 20 74 68 65  fR to create the
2170: 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 20 49   connection\&. I
2180: 74 20 62 65 68 61 76 65 73 20 74 68 65 20 73 61  t behaves the sa
2190: 6d 65 20 61 73 20 74 68 65 0a 6e 61 74 69 76 65  me as the.native
21a0: 20 54 43 4c 20 5c 66 42 73 6f 63 6b 65 74 5c 66   TCL \fBsocket\f
21b0: 52 20 63 6f 6d 6d 61 6e 64 2c 20 62 75 74 20 61  R command, but a
21c0: 6c 73 6f 20 73 75 70 70 6f 72 74 73 20 74 68 65  lso supports the
21d0: 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c   \fBtls::import\
21e0: 66 52 0a 63 6f 6d 6d 61 6e 64 20 6f 70 74 69 6f  fR.command optio
21f0: 6e 73 20 77 69 74 68 20 6f 6e 65 20 61 64 64 69  ns with one addi
2200: 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 5c 26 2e  tional option\&.
2210: 20 49 74 20 72 65 74 75 72 6e 73 20 74 68 65 20   It returns the 
2220: 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 20 69  channel handle i
2230: 64 0a 66 6f 72 20 74 68 65 20 6e 65 77 20 73 6f  d.for the new so
2240: 63 6b 65 74 5c 26 2e 20 41 64 64 69 74 69 6f 6e  cket\&. Addition
2250: 61 6c 20 6f 70 74 69 6f 6e 73 20 61 72 65 3a 0a  al options are:.
2260: 2e 52 53 0a 2e 54 50 0a 5c 66 42 2d 61 75 74 6f  .RS..TP.\fB-auto
2270: 73 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 5c 66  servername\fR \f
2280: 49 62 6f 6f 6c 5c 66 52 0a 49 66 20 5c 66 42 74  Ibool\fR.If \fBt
2290: 72 75 65 5c 66 52 2c 20 61 75 74 6f 6d 61 74 69  rue\fR, automati
22a0: 63 61 6c 6c 79 20 73 65 74 20 74 68 65 20 5c 66  cally set the \f
22b0: 42 2d 73 65 72 76 65 72 6e 61 6d 65 5c 66 52 20  B-servername\fR 
22c0: 61 72 67 75 6d 65 6e 74 20 74 6f 20 74 68 65 0a  argument to the.
22d0: 5c 66 49 68 6f 73 74 5c 66 52 20 61 72 67 75 6d  \fIhost\fR argum
22e0: 65 6e 74 5c 26 2e 20 50 72 69 6f 72 20 74 6f 20  ent\&. Prior to 
22f0: 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68  TclTLS 2\&.0, th
2300: 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42  e default is \fB
2310: 66 61 6c 73 65 5c 66 52 5c 26 2e 0a 53 74 61 72  false\fR\&..Star
2320: 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 32  ting in TclTLS 2
2330: 5c 26 2e 30 2c 20 74 68 65 20 64 65 66 61 75 6c  \&.0, the defaul
2340: 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 20  t is \fBtrue\fR 
2350: 75 6e 6c 65 73 73 20 5c 66 42 2d 73 65 72 76 65  unless \fB-serve
2360: 72 6e 61 6d 65 5c 66 52 0a 69 73 20 61 6c 73 6f  rname\fR.is also
2370: 20 73 70 65 63 69 66 69 65 64 5c 26 2e 0a 2e 52   specified\&...R
2380: 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 73 6f  E..TP.\fBtls::so
2390: 63 6b 65 74 5c 66 52 20 5c 66 42 2d 73 65 72 76  cket\fR \fB-serv
23a0: 65 72 5c 66 52 20 5c 66 49 63 6f 6d 6d 61 6e 64  er\fR \fIcommand
23b0: 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c  \fR ?\fI-option\
23c0: 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52  fR? ?\fIvalue\fR
23d0: 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61  ? ?\fI-option va
23e0: 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52  lue \&.\&.\&.\fR
23f0: 3f 20 5c 66 49 70 6f 72 74 5c 66 52 0a 53 61 6d  ? \fIport\fR.Sam
2400: 65 20 61 73 20 70 72 65 76 69 6f 75 73 20 63 6f  e as previous co
2410: 6d 6d 61 6e 64 2c 20 62 75 74 20 69 6e 73 74 65  mmand, but inste
2420: 61 64 20 63 72 65 61 74 65 73 20 61 20 73 65 72  ad creates a ser
2430: 76 65 72 20 73 6f 63 6b 65 74 20 66 6f 72 20 63  ver socket for c
2440: 6c 69 65 6e 74 73 20 74 6f 0a 63 6f 6e 6e 65 63  lients to.connec
2450: 74 20 74 6f 20 6a 75 73 74 20 6c 69 6b 65 20 74  t to just like t
2460: 68 65 20 54 63 6c 20 5c 66 42 73 6f 63 6b 65 74  he Tcl \fBsocket
2470: 20 2d 73 65 72 76 65 72 5c 66 52 20 63 6f 6d 6d   -server\fR comm
2480: 61 6e 64 5c 26 2e 20 49 74 20 72 65 74 75 72 6e  and\&. It return
2490: 73 20 74 68 65 0a 63 68 61 6e 6e 65 6c 20 68 61  s the.channel ha
24a0: 6e 64 6c 65 20 69 64 20 66 6f 72 20 74 68 65 20  ndle id for the 
24b0: 6e 65 77 20 73 6f 63 6b 65 74 5c 26 2e 0a 2e 54  new socket\&...T
24c0: 50 0a 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74  P.\fBtls::import
24d0: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66  \fR \fIchannel\f
24e0: 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52  R ?\fI-option\fR
24f0: 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20  ? ?\fIvalue\fR? 
2500: 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75  ?\fI-option valu
2510: 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 0a  e \&.\&.\&.\fR?.
2520: 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 73 74 61 72  .TP.\fBtls::star
2530: 74 74 6c 73 5c 66 52 20 5c 66 49 63 68 61 6e 6e  ttls\fR \fIchann
2540: 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f  el\fR ?\fI-optio
2550: 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c  n\fR? ?\fIvalue\
2560: 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20  fR? ?\fI-option 
2570: 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c  value \&.\&.\&.\
2580: 66 52 3f 0a 53 74 61 72 74 20 54 4c 53 20 65 6e  fR?.Start TLS en
2590: 63 72 79 70 74 69 6f 6e 20 6f 6e 20 54 43 4c 20  cryption on TCL 
25a0: 63 68 61 6e 6e 65 6c 20 5c 66 49 63 68 61 6e 6e  channel \fIchann
25b0: 65 6c 5c 66 52 20 76 69 61 20 61 20 73 74 61 63  el\fR via a stac
25c0: 6b 65 64 20 63 68 61 6e 6e 65 6c 5c 26 2e 20 49  ked channel\&. I
25d0: 74 0a 6e 65 65 64 20 6e 6f 74 20 62 65 20 61 20  t.need not be a 
25e0: 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73 74  socket, but must
25f0: 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72 65   provide bi-dire
2600: 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 5c 26 2e 20  ctional flow\&. 
2610: 41 6c 73 6f 20 73 65 74 73 20 73 65 73 73 69 6f  Also sets sessio
2620: 6e 0a 70 61 72 61 6d 65 74 65 72 73 20 66 6f 72  n.parameters for
2630: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26   SSL handshake\&
2640: 2e 20 56 61 6c 69 64 20 6f 70 74 69 6f 6e 73 20  . Valid options 
2650: 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66 42  are:..RS..TP.\fB
2660: 2d 61 6c 70 6e 5c 66 52 20 5c 66 49 6c 69 73 74  -alpn\fR \fIlist
2670: 5c 66 52 0a 4c 69 73 74 20 6f 66 20 70 72 6f 74  \fR.List of prot
2680: 6f 63 6f 6c 73 20 74 6f 20 6f 66 66 65 72 20 64  ocols to offer d
2690: 75 72 69 6e 67 20 41 70 70 6c 69 63 61 74 69 6f  uring Applicatio
26a0: 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c  n-Layer Protocol
26b0: 20 4e 65 67 6f 74 69 61 74 69 6f 6e 0a 28 41 4c   Negotiation.(AL
26c0: 50 4e 29 5c 26 2e 20 46 6f 72 20 65 78 61 6d 70  PN)\&. For examp
26d0: 6c 65 3a 20 5c 66 42 68 32 5c 66 52 20 61 6e 64  le: \fBh2\fR and
26e0: 20 5c 66 42 68 74 74 70 2f 31 5c 26 2e 31 5c 66   \fBhttp/1\&.1\f
26f0: 52 2c 20 62 75 74 20 6e 6f 74 20 5c 66 42 68 33  R, but not \fBh3
2700: 5c 66 52 20 6f 72 0a 5c 66 42 71 75 69 63 5c 66  \fR or.\fBquic\f
2710: 52 5c 26 2e 20 54 68 69 73 20 6f 70 74 69 6f 6e  R\&. This option
2720: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
2730: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a  LS 1\&.8\&...TP.
2740: 5c 66 42 2d 63 61 64 69 72 5c 66 52 20 5c 66 49  \fB-cadir\fR \fI
2750: 64 69 72 65 63 74 6f 72 79 5c 66 52 0a 53 70 65  directory\fR.Spe
2760: 63 69 66 69 65 73 20 74 68 65 20 64 69 72 65 63  cifies the direc
2770: 74 6f 72 79 20 77 68 65 72 65 20 74 68 65 20 43  tory where the C
2780: 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f  ertificate Autho
2790: 72 69 74 79 20 28 43 41 29 20 63 65 72 74 69 66  rity (CA) certif
27a0: 69 63 61 74 65 73 20 61 72 65 0a 73 74 6f 72 65  icates are.store
27b0: 64 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  d\&. The default
27c0: 20 69 73 20 70 6c 61 74 66 6f 72 6d 20 73 70 65   is platform spe
27d0: 63 69 66 69 63 20 61 6e 64 20 63 61 6e 20 62 65  cific and can be
27e0: 20 73 65 74 20 61 74 20 63 6f 6d 70 69 6c 65 20   set at compile 
27f0: 74 69 6d 65 5c 26 2e 20 54 68 65 0a 64 65 66 61  time\&. The.defa
2800: 75 6c 74 20 6c 6f 63 61 74 69 6f 6e 20 63 61 6e  ult location can
2810: 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e 20 62   be overridden b
2820: 79 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45 52  y the \fBSSL_CER
2830: 54 5f 44 49 52 5c 66 52 20 65 6e 76 69 72 6f 6e  T_DIR\fR environ
2840: 6d 65 6e 74 0a 76 61 72 69 61 62 6c 65 5c 26 2e  ment.variable\&.
2850: 20 53 65 65 20 5c 66 42 43 65 72 74 69 66 69 63   See \fBCertific
2860: 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66  ate Validation\f
2870: 52 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69  R for more detai
2880: 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61  ls\&...TP.\fB-ca
2890: 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e  file\fR \fIfilen
28a0: 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ame\fR.Specifies
28b0: 20 74 68 65 20 66 69 6c 65 20 77 69 74 68 20 74   the file with t
28c0: 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20 41  he Certificate A
28d0: 75 74 68 6f 72 69 74 79 20 28 43 41 29 20 63 65  uthority (CA) ce
28e0: 72 74 69 66 69 63 61 74 65 73 20 74 6f 20 75 73  rtificates to us
28f0: 65 20 69 6e 0a 5c 66 42 50 45 4d 5c 66 52 20 66  e in.\fBPEM\fR f
2900: 69 6c 65 20 66 6f 72 6d 61 74 5c 26 2e 20 54 68  ile format\&. Th
2910: 65 20 64 65 66 61 75 6c 74 20 69 73 20 22 5c 66  e default is "\f
2920: 49 63 65 72 74 5c 26 2e 70 65 6d 5c 66 52 22 2c  Icert\&.pem\fR",
2930: 20 69 6e 20 74 68 65 20 4f 70 65 6e 53 53 4c 0a   in the OpenSSL.
2940: 64 69 72 65 63 74 6f 72 79 5c 26 2e 20 54 68 65  directory\&. The
2950: 20 64 65 66 61 75 6c 74 20 66 69 6c 65 20 63 61   default file ca
2960: 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e 20  n be overridden 
2970: 62 79 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45  by the \fBSSL_CE
2980: 52 54 5f 46 49 4c 45 5c 66 52 20 65 6e 76 69 72  RT_FILE\fR envir
2990: 6f 6e 6d 65 6e 74 0a 76 61 72 69 61 62 6c 65 5c  onment.variable\
29a0: 26 2e 20 53 65 65 20 5c 66 42 43 65 72 74 69 66  &. See \fBCertif
29b0: 69 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e  icate Validation
29c0: 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65 74  \fR for more det
29d0: 61 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  ails\&...TP.\fB-
29e0: 63 61 73 74 6f 72 65 5c 66 52 20 5c 66 49 55 52  castore\fR \fIUR
29f0: 49 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  I\fR.Specifies t
2a00: 68 65 20 55 6e 69 66 6f 72 6d 20 52 65 73 6f 75  he Uniform Resou
2a10: 72 63 65 20 49 64 65 6e 74 69 66 69 65 72 20 28  rce Identifier (
2a20: 55 52 49 29 20 66 6f 72 20 74 68 65 20 43 65 72  URI) for the Cer
2a30: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69  tificate Authori
2a40: 74 79 0a 28 43 41 29 20 73 74 6f 72 65 2c 20 77  ty.(CA) store, w
2a50: 68 69 63 68 20 6d 61 79 20 62 65 20 61 20 73 69  hich may be a si
2a60: 6e 67 6c 65 20 63 6f 6e 74 61 69 6e 65 72 20 6f  ngle container o
2a70: 72 20 61 20 63 61 74 61 6c 6f 67 20 6f 66 20 63  r a catalog of c
2a80: 6f 6e 74 61 69 6e 65 72 73 5c 26 2e 0a 53 74 61  ontainers\&..Sta
2a90: 72 74 69 6e 67 20 77 69 74 68 20 4f 70 65 6e 53  rting with OpenS
2aa0: 53 4c 20 33 5c 26 2e 32 20 6f 6e 20 4d 53 20 57  SL 3\&.2 on MS W
2ab0: 69 6e 64 6f 77 73 2c 20 73 65 74 20 74 6f 20 22  indows, set to "
2ac0: 5c 66 42 6f 72 67 5c 26 2e 6f 70 65 6e 73 73 6c  \fBorg\&.openssl
2ad0: 5c 26 2e 77 69 6e 73 74 6f 72 65 3a 2f 2f 5c 66  \&.winstore://\f
2ae0: 52 22 0a 74 6f 20 75 73 65 20 74 68 65 20 62 75  R".to use the bu
2af0: 69 6c 74 2d 69 6e 20 4d 53 20 57 69 6e 64 6f 77  ilt-in MS Window
2b00: 73 20 43 65 72 74 69 66 69 63 61 74 65 20 53 74  s Certificate St
2b10: 6f 72 65 5c 26 2e 0a 53 65 65 20 5c 66 42 43 65  ore\&..See \fBCe
2b20: 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64 61  rtificate Valida
2b30: 74 69 6f 6e 5c 66 52 20 66 6f 72 20 6d 6f 72 65  tion\fR for more
2b40: 20 64 65 74 61 69 6c 73 5c 26 2e 0a 54 68 69 73   details\&..This
2b50: 20 6f 70 74 69 6f 6e 20 69 73 20 6e 65 77 20 66   option is new f
2b60: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
2b70: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 65 72 74 66  &...TP.\fB-certf
2b80: 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e 61  ile\fR \fIfilena
2b90: 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20  me\fR.Specifies 
2ba0: 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20  the name of the 
2bb0: 66 69 6c 65 20 77 69 74 68 20 74 68 65 20 63 65  file with the ce
2bc0: 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65  rtificate to use
2bd0: 20 69 6e 20 50 45 4d 20 66 6f 72 6d 61 74 0a 61   in PEM format.a
2be0: 73 20 74 68 65 20 6c 6f 63 61 6c 20 28 63 6c 69  s the local (cli
2bf0: 65 6e 74 20 6f 72 20 73 65 72 76 65 72 29 20 63  ent or server) c
2c00: 65 72 74 69 66 69 63 61 74 65 5c 26 2e 20 49 74  ertificate\&. It
2c10: 20 61 6c 73 6f 20 63 6f 6e 74 61 69 6e 73 20 74   also contains t
2c20: 68 65 20 70 75 62 6c 69 63 20 6b 65 79 5c 26 2e  he public key\&.
2c30: 0a 2e 54 50 0a 5c 66 42 2d 63 65 72 74 5c 66 52  ..TP.\fB-cert\fR
2c40: 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 53 70   \fIstring\fR.Sp
2c50: 65 63 69 66 69 65 73 20 74 68 65 20 63 65 72 74  ecifies the cert
2c60: 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 20 61  ificate to use a
2c70: 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64 20  s a DER encoded 
2c80: 73 74 72 69 6e 67 20 28 58 5c 26 2e 35 30 39 20  string (X\&.509 
2c90: 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  DER)\&...TP.\fB-
2ca0: 63 69 70 68 65 72 5c 66 52 20 5c 66 49 73 74 72  cipher\fR \fIstr
2cb0: 69 6e 67 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ing\fR.Specifies
2cc0: 20 74 68 65 20 6c 69 73 74 20 6f 66 20 63 69 70   the list of cip
2cd0: 68 65 72 73 20 74 6f 20 75 73 65 20 66 6f 72 20  hers to use for 
2ce0: 54 4c 53 20 31 5c 26 2e 32 20 61 6e 64 20 65 61  TLS 1\&.2 and ea
2cf0: 72 6c 69 65 72 20 63 6f 6e 6e 65 63 74 69 6f 6e  rlier connection
2d00: 73 5c 26 2e 0a 53 74 72 69 6e 67 20 69 73 20 61  s\&..String is a
2d10: 20 63 6f 6c 6f 6e 20 22 5c 66 42 3a 5c 66 52 22   colon "\fB:\fR"
2d20: 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74 20   separated list 
2d30: 6f 66 20 63 69 70 68 65 72 73 5c 26 2e 0a 43 69  of ciphers\&..Ci
2d40: 70 68 65 72 73 20 63 61 6e 20 62 65 20 63 6f 6d  phers can be com
2d50: 62 69 6e 65 64 20 75 73 69 6e 67 20 74 68 65 20  bined using the 
2d60: 22 5c 66 42 2b 5c 66 52 22 20 63 68 61 72 61 63  "\fB+\fR" charac
2d70: 74 65 72 5c 26 2e 0a 50 72 65 66 69 78 65 73 20  ter\&..Prefixes 
2d80: 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 70  can be used to p
2d90: 65 72 6d 61 6e 65 6e 74 6c 79 20 72 65 6d 6f 76  ermanently remov
2da0: 65 20 22 5c 66 42 21 5c 66 52 22 2c 20 64 65 6c  e "\fB!\fR", del
2db0: 65 74 65 20 22 5c 66 42 2d 5c 66 52 22 2c 20 6f  ete "\fB-\fR", o
2dc0: 72 0a 6d 6f 76 65 20 74 6f 20 74 68 65 20 65 6e  r.move to the en
2dd0: 64 20 22 5c 66 42 2b 5c 66 52 22 20 61 20 73 70  d "\fB+\fR" a sp
2de0: 65 63 69 66 69 65 64 20 63 69 70 68 65 72 5c 26  ecified cipher\&
2df0: 2e 0a 4b 65 79 77 6f 72 64 73 20 5c 66 42 40 53  ..Keywords \fB@S
2e00: 54 52 45 4e 47 54 48 5c 66 52 20 28 73 6f 72 74  TRENGTH\fR (sort
2e10: 20 62 79 20 61 6c 67 6f 72 69 74 68 6d 20 6b 65   by algorithm ke
2e20: 79 20 6c 65 6e 67 74 68 29 2c 0a 5c 66 42 40 53  y length),.\fB@S
2e30: 45 43 4c 45 56 45 4c 3d 5c 66 52 5c 66 49 6e 5c  ECLEVEL=\fR\fIn\
2e40: 66 52 20 28 73 65 74 20 73 65 63 75 72 69 74 79  fR (set security
2e50: 20 6c 65 76 65 6c 20 74 6f 20 6e 29 2c 20 61 6e   level to n), an
2e60: 64 0a 5c 66 42 44 45 46 41 55 4c 54 5c 66 52 20  d.\fBDEFAULT\fR 
2e70: 28 75 73 65 20 64 65 66 61 75 6c 74 20 63 69 70  (use default cip
2e80: 68 65 72 20 6c 69 73 74 2c 20 61 74 20 73 74 61  her list, at sta
2e90: 72 74 20 6f 6e 6c 79 29 20 63 61 6e 20 61 6c 73  rt only) can als
2ea0: 6f 20 62 65 20 73 70 65 63 69 66 69 65 64 5c 26  o be specified\&
2eb0: 2e 0a 53 65 65 20 74 68 65 20 5c 66 49 4f 70 65  ..See the \fIOpe
2ec0: 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a 2f  nSSL\fR [https:/
2ed0: 2f 64 6f 63 73 5c 26 2e 6f 70 65 6e 73 73 6c 5c  /docs\&.openssl\
2ee0: 26 2e 6f 72 67 2f 6d 61 73 74 65 72 2f 6d 61 6e  &.org/master/man
2ef0: 31 2f 6f 70 65 6e 73 73 6c 2d 63 69 70 68 65 72  1/openssl-cipher
2f00: 73 2f 23 6f 70 74 69 6f 6e 73 5d 0a 64 6f 63 75  s/#options].docu
2f10: 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72 20 74 68  mentation for th
2f20: 65 20 66 75 6c 6c 20 6c 69 73 74 20 6f 66 20 76  e full list of v
2f30: 61 6c 69 64 20 76 61 6c 75 65 73 5c 26 2e 0a 2e  alid values\&...
2f40: 54 50 0a 5c 66 42 2d 63 69 70 68 65 72 73 75 69  TP.\fB-ciphersui
2f50: 74 65 73 5c 66 52 20 5c 66 49 73 74 72 69 6e 67  tes\fR \fIstring
2f60: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
2f70: 65 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72  e list of cipher
2f80: 20 73 75 69 74 65 73 20 74 6f 20 75 73 65 20 66   suites to use f
2f90: 6f 72 20 54 4c 53 20 31 5c 26 2e 33 20 61 73 20  or TLS 1\&.3 as 
2fa0: 61 20 63 6f 6c 6f 6e 0a 22 5c 66 42 3a 5c 66 52  a colon."\fB:\fR
2fb0: 22 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74  " separated list
2fc0: 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74 65   of cipher suite
2fd0: 20 6e 61 6d 65 73 5c 26 2e 20 53 65 65 20 74 68   names\&. See th
2fe0: 65 0a 5c 66 49 4f 70 65 6e 53 53 4c 5c 66 52 20  e.\fIOpenSSL\fR 
2ff0: 5b 68 74 74 70 73 3a 2f 2f 64 6f 63 73 5c 26 2e  [https://docs\&.
3000: 6f 70 65 6e 73 73 6c 5c 26 2e 6f 72 67 2f 6d 61  openssl\&.org/ma
3010: 73 74 65 72 2f 6d 61 6e 31 2f 6f 70 65 6e 73 73  ster/man1/openss
3020: 6c 2d 63 69 70 68 65 72 73 2f 23 6f 70 74 69 6f  l-ciphers/#optio
3030: 6e 73 5d 0a 64 6f 63 75 6d 65 6e 74 61 74 69 6f  ns].documentatio
3040: 6e 20 66 6f 72 20 74 68 65 20 66 75 6c 6c 20 6c  n for the full l
3050: 69 73 74 20 6f 66 20 76 61 6c 69 64 20 76 61 6c  ist of valid val
3060: 75 65 73 5c 26 2e 0a 54 68 69 73 20 6f 70 74 69  ues\&..This opti
3070: 6f 6e 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  on is new for Tc
3080: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
3090: 50 0a 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52  P.\fB-command\fR
30a0: 20 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66 52 0a   \fIcallback\fR.
30b0: 53 70 65 63 69 66 69 65 73 20 74 68 65 20 63 61  Specifies the ca
30c0: 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74  llback command t
30d0: 6f 20 62 65 20 69 6e 76 6f 6b 65 64 20 61 74 20  o be invoked at 
30e0: 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64  several points d
30f0: 75 72 69 6e 67 20 74 68 65 0a 68 61 6e 64 73 68  uring the.handsh
3100: 61 6b 65 20 74 6f 20 70 61 73 73 20 65 72 72 6f  ake to pass erro
3110: 72 73 2c 20 74 72 61 63 69 6e 67 20 69 6e 66 6f  rs, tracing info
3120: 72 6d 61 74 69 6f 6e 2c 20 61 6e 64 20 70 72 6f  rmation, and pro
3130: 74 6f 63 6f 6c 20 6d 65 73 73 61 67 65 73 5c 26  tocol messages\&
3140: 2e 0a 53 65 65 20 5c 66 42 43 61 6c 6c 62 61 63  ..See \fBCallbac
3150: 6b 20 4f 70 74 69 6f 6e 73 5c 66 52 20 66 6f 72  k Options\fR for
3160: 20 6d 6f 72 65 20 69 6e 66 6f 5c 26 2e 0a 2e 54   more info\&...T
3170: 50 0a 5c 66 42 2d 64 68 70 61 72 61 6d 73 5c 66  P.\fB-dhparams\f
3180: 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65 5c 66 52  R \fIfilename\fR
3190: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 44  .Specifies the D
31a0: 69 66 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 28 44  iffie-Hellman (D
31b0: 48 29 20 70 61 72 61 6d 65 74 65 72 73 20 66 69  H) parameters fi
31c0: 6c 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65  le\&...TP.\fB-ke
31d0: 79 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65  yfile\fR \fIfile
31e0: 6e 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65  name\fR.Specifie
31f0: 73 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65  s the private ke
3200: 79 20 66 69 6c 65 5c 26 2e 20 54 68 65 20 64 65  y file\&. The de
3210: 66 61 75 6c 74 20 69 73 20 74 6f 20 75 73 65 20  fault is to use 
3220: 74 68 65 20 66 69 6c 65 0a 73 70 65 63 69 66 69  the file.specifi
3230: 65 64 20 62 79 20 74 68 65 20 5c 66 42 2d 63 65  ed by the \fB-ce
3240: 72 74 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f 6e  rtfile\fR option
3250: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65 79 5c  \&...TP.\fB-key\
3260: 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a  fR \fIstring\fR.
3270: 53 70 65 63 69 66 69 65 73 20 74 68 65 20 70 72  Specifies the pr
3280: 69 76 61 74 65 20 6b 65 79 20 74 6f 20 75 73 65  ivate key to use
3290: 20 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65   as a DER encode
32a0: 64 20 73 74 72 69 6e 67 20 28 50 4b 43 53 23 31  d string (PKCS#1
32b0: 20 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42   DER)\&...TP.\fB
32c0: 2d 6d 6f 64 65 6c 5c 66 52 20 5c 66 49 63 68 61  -model\fR \fIcha
32d0: 6e 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 20 74 68  nnel\fR.Force th
32e0: 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f 20 73 68  is channel to sh
32f0: 61 72 65 20 74 68 65 20 73 61 6d 65 20 5c 66 49  are the same \fI
3300: 53 53 4c 5f 43 54 58 5c 66 52 20 73 74 72 75 63  SSL_CTX\fR struc
3310: 74 75 72 65 20 61 73 20 74 68 65 0a 73 70 65 63  ture as the.spec
3320: 69 66 69 65 64 20 5c 66 49 63 68 61 6e 6e 65 6c  ified \fIchannel
3330: 5c 66 52 2c 20 61 6e 64 20 74 68 65 72 65 66 6f  \fR, and therefo
3340: 72 65 20 73 68 61 72 65 20 63 6f 6e 66 69 67 2c  re share config,
3350: 20 63 61 6c 6c 62 61 63 6b 73 2c 20 65 74 63 5c   callbacks, etc\
3360: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 70 61 73 73 77  &...TP.\fB-passw
3370: 6f 72 64 5c 66 52 20 5c 66 49 63 61 6c 6c 62 61  ord\fR \fIcallba
3380: 63 6b 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20  ck\fR.Specifies 
3390: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 63 6f 6d  the callback com
33a0: 6d 61 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20 77  mand to invoke w
33b0: 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64  hen OpenSSL need
33c0: 73 20 74 6f 20 6f 62 74 61 69 6e 20 61 0a 70 61  s to obtain a.pa
33d0: 73 73 77 6f 72 64 5c 26 2e 20 54 68 69 73 20 69  ssword\&. This i
33e0: 73 20 74 79 70 69 63 61 6c 6c 79 20 75 73 65 64  s typically used
33f0: 20 74 6f 20 75 6e 6c 6f 63 6b 20 74 68 65 20 70   to unlock the p
3400: 72 69 76 61 74 65 20 6b 65 79 20 6f 66 20 61 20  rivate key of a 
3410: 63 65 72 74 69 66 69 63 61 74 65 5c 26 2e 0a 54  certificate\&..T
3420: 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75  he callback shou
3430: 6c 64 20 72 65 74 75 72 6e 20 61 20 70 61 73 73  ld return a pass
3440: 77 6f 72 64 20 73 74 72 69 6e 67 5c 26 2e 20 54  word string\&. T
3450: 68 69 73 20 6f 70 74 69 6f 6e 20 68 61 73 20 63  his option has c
3460: 68 61 6e 67 65 64 20 66 6f 72 0a 54 63 6c 54 4c  hanged for.TclTL
3470: 53 20 31 5c 26 2e 38 5c 26 2e 20 53 65 65 20 5c  S 1\&.8\&. See \
3480: 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69 6f  fBCallback Optio
3490: 6e 73 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 69  ns\fR for more i
34a0: 6e 66 6f 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 70  nfo\&...TP.\fB-p
34b0: 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 5c 66 52  ost_handshake\fR
34c0: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 41 6c 6c 6f   \fIbool\fR.Allo
34d0: 77 20 70 6f 73 74 2d 68 61 6e 64 73 68 61 6b 65  w post-handshake
34e0: 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20   session ticket 
34f0: 75 70 64 61 74 65 73 5c 26 2e 20 54 68 69 73 20  updates\&. This 
3500: 6f 70 74 69 6f 6e 20 69 73 20 6e 65 77 20 66 6f  option is new fo
3510: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
3520: 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75 65 73  ...TP.\fB-reques
3530: 74 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a  t\fR \fIbool\fR.
3540: 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69 66  Request a certif
3550: 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65 20 70  icate from the p
3560: 65 65 72 20 64 75 72 69 6e 67 20 74 68 65 20 53  eer during the S
3570: 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e 20  SL handshake\&. 
3580: 54 68 69 73 20 69 73 20 6e 65 65 64 65 64 0a 74  This is needed.t
3590: 6f 20 64 6f 20 43 65 72 74 69 66 69 63 61 74 65  o do Certificate
35a0: 20 56 61 6c 69 64 61 74 69 6f 6e 5c 26 2e 20 53   Validation\&. S
35b0: 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c  tarting in TclTL
35c0: 53 20 31 5c 26 2e 38 2c 20 74 68 65 20 64 65 66  S 1\&.8, the def
35d0: 61 75 6c 74 20 69 73 0a 5c 66 42 74 72 75 65 5c  ault is.\fBtrue\
35e0: 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20 63 6f  fR for client co
35f0: 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 20 53 74 61  nnections\&. Sta
3600: 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20  rting in TclTLS 
3610: 32 5c 26 2e 30 2c 20 69 66 20 73 65 74 20 74 6f  2\&.0, if set to
3620: 0a 5c 66 42 66 61 6c 73 65 5c 66 52 20 61 6e 64  .\fBfalse\fR and
3630: 20 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52 20   \fB-require\fR 
3640: 69 73 20 5c 66 42 74 72 75 65 5c 66 52 2c 20 74  is \fBtrue\fR, t
3650: 68 65 6e 20 74 68 69 73 20 77 69 6c 6c 20 62 65  hen this will be
3660: 0a 6f 76 65 72 72 69 64 64 65 6e 20 74 6f 20 5c  .overridden to \
3670: 66 42 74 72 75 65 5c 66 52 5c 26 2e 0a 53 65 65  fBtrue\fR\&..See
3680: 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65 20   \fBCertificate 
3690: 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66 6f  Validation\fR fo
36a0: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c 26  r more details\&
36b0: 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75 69 72  ...TP.\fB-requir
36c0: 65 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a  e\fR \fIbool\fR.
36d0: 52 65 71 75 69 72 65 20 61 20 76 61 6c 69 64 20  Require a valid 
36e0: 63 65 72 74 69 66 69 63 61 74 65 20 66 72 6f 6d  certificate from
36f0: 20 74 68 65 20 70 65 65 72 20 64 75 72 69 6e 67   the peer during
3700: 20 74 68 65 20 53 53 4c 20 68 61 6e 64 73 68 61   the SSL handsha
3710: 6b 65 5c 26 2e 20 49 66 20 74 68 69 73 20 69 73  ke\&. If this is
3720: 0a 73 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68  .set to true, th
3730: 65 6e 20 5c 66 42 2d 72 65 71 75 65 73 74 5c 66  en \fB-request\f
3740: 52 20 6d 75 73 74 20 61 6c 73 6f 20 62 65 20 73  R must also be s
3750: 65 74 20 74 6f 20 74 72 75 65 20 61 6e 64 20 61  et to true and a
3760: 20 65 69 74 68 65 72 0a 5c 66 42 2d 63 61 64 69   either.\fB-cadi
3770: 72 5c 66 52 2c 20 5c 66 42 2d 63 61 66 69 6c 65  r\fR, \fB-cafile
3780: 5c 66 52 2c 20 5c 66 42 2d 63 61 73 74 6f 72 65  \fR, \fB-castore
3790: 5c 66 52 2c 20 6f 72 20 61 20 70 6c 61 74 66 6f  \fR, or a platfo
37a0: 72 6d 20 64 65 66 61 75 6c 74 0a 6d 75 73 74 20  rm default.must 
37b0: 62 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20 6f  be provided in o
37c0: 72 64 65 72 20 74 6f 20 76 61 6c 69 64 61 74 65  rder to validate
37d0: 20 61 67 61 69 6e 73 74 5c 26 2e 20 54 68 65 20   against\&. The 
37e0: 64 65 66 61 75 6c 74 20 69 6e 20 54 63 6c 54 4c  default in TclTL
37f0: 53 20 31 5c 26 2e 38 20 61 6e 64 0a 65 61 72 6c  S 1\&.8 and.earl
3800: 69 65 72 20 76 65 72 73 69 6f 6e 73 20 69 73 20  ier versions is 
3810: 5c 66 42 66 61 6c 73 65 5c 66 52 20 73 69 6e 63  \fBfalse\fR sinc
3820: 65 20 6e 6f 74 20 61 6c 6c 20 70 6c 61 74 66 6f  e not all platfo
3830: 72 6d 73 20 68 61 76 65 20 63 65 72 74 69 66 69  rms have certifi
3840: 63 61 74 65 73 20 74 6f 0a 76 61 6c 69 64 61 74  cates to.validat
3850: 65 20 61 67 61 69 6e 73 74 20 69 6e 20 61 20 66  e against in a f
3860: 6f 72 6d 20 63 6f 6d 70 61 74 69 62 6c 65 20 77  orm compatible w
3870: 69 74 68 20 4f 70 65 6e 53 53 4c 5c 26 2e 20 53  ith OpenSSL\&. S
3880: 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c  tarting in TclTL
3890: 53 20 32 5c 26 2e 30 2c 0a 74 68 65 20 64 65 66  S 2\&.0,.the def
38a0: 61 75 6c 74 20 69 73 20 5c 66 42 74 72 75 65 5c  ault is \fBtrue\
38b0: 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20 63 6f  fR for client co
38c0: 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 0a 53 65 65  nnections\&..See
38d0: 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65 20   \fBCertificate 
38e0: 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66 6f  Validation\fR fo
38f0: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c 26  r more details\&
3900: 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 63 75 72 69  ...TP.\fB-securi
3910: 74 79 5f 6c 65 76 65 6c 5c 66 52 20 5c 66 49 69  ty_level\fR \fIi
3920: 6e 74 65 67 65 72 5c 66 52 0a 53 70 65 63 69 66  nteger\fR.Specif
3930: 69 65 73 20 74 68 65 20 73 65 63 75 72 69 74 79  ies the security
3940: 20 6c 65 76 65 6c 20 28 76 61 6c 75 65 20 66 72   level (value fr
3950: 6f 6d 20 30 20 74 6f 20 35 29 5c 26 2e 20 54 68  om 0 to 5)\&. Th
3960: 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c  e security level
3970: 20 61 66 66 65 63 74 73 0a 74 68 65 20 61 6c 6c   affects.the all
3980: 6f 77 65 64 20 63 69 70 68 65 72 20 73 75 69 74  owed cipher suit
3990: 65 20 65 6e 63 72 79 70 74 69 6f 6e 20 61 6c 67  e encryption alg
39a0: 6f 72 69 74 68 6d 73 2c 20 73 75 70 70 6f 72 74  orithms, support
39b0: 65 64 20 45 43 43 20 63 75 72 76 65 73 2c 0a 73  ed ECC curves,.s
39c0: 75 70 70 6f 72 74 65 64 20 73 69 67 6e 61 74 75  upported signatu
39d0: 72 65 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20 44  re algorithms, D
39e0: 48 20 70 61 72 61 6d 65 74 65 72 20 73 69 7a 65  H parameter size
39f0: 73 2c 20 63 65 72 74 69 66 69 63 61 74 65 20 6b  s, certificate k
3a00: 65 79 20 73 69 7a 65 73 0a 61 6e 64 20 73 69 67  ey sizes.and sig
3a10: 6e 61 74 75 72 65 20 61 6c 67 6f 72 69 74 68 6d  nature algorithm
3a20: 73 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  s\&. The default
3a30: 20 69 73 20 31 20 70 72 69 6f 72 20 74 6f 20 4f   is 1 prior to O
3a40: 70 65 6e 53 53 4c 20 33 5c 26 2e 32 20 61 6e 64  penSSL 3\&.2 and
3a50: 20 32 0a 74 68 65 72 65 61 66 74 65 72 5c 26 2e   2.thereafter\&.
3a60: 20 4c 65 76 65 6c 20 33 20 61 6e 64 20 68 69 67   Level 3 and hig
3a70: 68 65 72 20 64 69 73 61 62 6c 65 20 73 75 70 70  her disable supp
3a80: 6f 72 74 20 66 6f 72 20 73 65 73 73 69 6f 6e 20  ort for session 
3a90: 74 69 63 6b 65 74 73 20 61 6e 64 0a 6f 6e 6c 79  tickets and.only
3aa0: 20 61 63 63 65 70 74 20 63 69 70 68 65 72 20 73   accept cipher s
3ab0: 75 69 74 65 73 20 74 68 61 74 20 70 72 6f 76 69  uites that provi
3ac0: 64 65 20 66 6f 72 77 61 72 64 20 73 65 63 72 65  de forward secre
3ad0: 63 79 5c 26 2e 0a 54 68 69 73 20 6f 70 74 69 6f  cy\&..This optio
3ae0: 6e 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  n is new for Tcl
3af0: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
3b00: 0a 5c 66 42 2d 73 65 72 76 65 72 5c 66 52 20 5c  .\fB-server\fR \
3b10: 66 49 62 6f 6f 6c 5c 66 52 0a 53 70 65 63 69 66  fIbool\fR.Specif
3b20: 69 65 73 20 77 68 65 74 68 65 72 20 74 6f 20 61  ies whether to a
3b30: 63 74 20 61 73 20 61 20 73 65 72 76 65 72 20 61  ct as a server a
3b40: 6e 64 20 72 65 73 70 6f 6e 64 20 77 69 74 68 20  nd respond with 
3b50: 61 20 73 65 72 76 65 72 20 68 61 6e 64 73 68 61  a server handsha
3b60: 6b 65 20 77 68 65 6e 20 61 0a 63 6c 69 65 6e 74  ke when a.client
3b70: 20 63 6f 6e 6e 65 63 74 73 20 61 6e 64 20 70 72   connects and pr
3b80: 6f 76 69 64 65 73 20 61 20 63 6c 69 65 6e 74 20  ovides a client 
3b90: 68 61 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68 65  handshake\&. The
3ba0: 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66   default is \fBf
3bb0: 61 6c 73 65 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c  alse\fR\&...TP.\
3bc0: 66 42 2d 73 65 72 76 65 72 6e 61 6d 65 5c 66 52  fB-servername\fR
3bd0: 20 5c 66 49 68 6f 73 74 6e 61 6d 65 5c 66 52 0a   \fIhostname\fR.
3be0: 53 70 65 63 69 66 79 20 74 68 65 20 70 65 65 72  Specify the peer
3bf0: 27 73 20 68 6f 73 74 6e 61 6d 65 5c 26 2e 20 54  's hostname\&. T
3c00: 68 69 73 20 69 73 20 75 73 65 64 20 74 6f 20 73  his is used to s
3c10: 65 74 20 74 68 65 20 54 4c 53 20 53 65 72 76 65  et the TLS Serve
3c20: 72 20 4e 61 6d 65 20 49 6e 64 69 63 61 74 69 6f  r Name Indicatio
3c30: 6e 0a 28 53 4e 49 29 20 65 78 74 65 6e 73 69 6f  n.(SNI) extensio
3c40: 6e 5c 26 2e 20 53 65 74 20 74 68 69 73 20 74 6f  n\&. Set this to
3c50: 20 74 68 65 20 65 78 70 65 63 74 65 64 20 73 65   the expected se
3c60: 72 76 65 72 6e 61 6d 65 20 69 6e 20 74 68 65 20  rvername in the 
3c70: 73 65 72 76 65 72 27 73 20 63 65 72 74 69 66 69  server's certifi
3c80: 63 61 74 65 0a 6f 72 20 6f 6e 65 20 6f 66 20 74  cate.or one of t
3c90: 68 65 20 53 75 62 6a 65 63 74 20 41 6c 74 65 72  he Subject Alter
3ca0: 6e 61 74 65 20 4e 61 6d 65 73 20 28 53 41 4e 29  nate Names (SAN)
3cb0: 5c 26 2e 20 53 74 61 72 74 69 6e 67 20 69 6e 20  \&. Starting in 
3cc0: 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68  TclTLS 2\&.0, th
3cd0: 69 73 20 77 69 6c 6c 0a 64 65 66 61 75 6c 74 20  is will.default 
3ce0: 74 6f 20 74 68 65 20 68 6f 73 74 20 66 72 6f 6d  to the host from
3cf0: 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 73 6f 63   the \fBtls::soc
3d00: 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 5c 26  ket\fR command\&
3d10: 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 73 73 69 6f  ...TP.\fB-sessio
3d20: 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69 6e 61 72  n_id\fR \fIbinar
3d30: 79 5f 73 74 72 69 6e 67 5c 66 52 0a 53 70 65 63  y_string\fR.Spec
3d40: 69 66 69 65 73 20 74 68 65 20 73 65 73 73 69 6f  ifies the sessio
3d50: 6e 20 69 64 20 74 6f 20 72 65 73 75 6d 65 20 61  n id to resume a
3d60: 20 73 65 73 73 69 6f 6e 5c 26 2e 20 4e 6f 74 20   session\&. Not 
3d70: 73 75 70 70 6f 72 74 65 64 20 79 65 74 5c 26 2e  supported yet\&.
3d80: 0a 54 68 69 73 20 6f 70 74 69 6f 6e 20 69 73 20  .This option is 
3d90: 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31  new for TclTLS 1
3da0: 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  \&.8\&...TP.\fB-
3db0: 73 73 6c 32 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c  ssl2\fR \fIbool\
3dc0: 66 52 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f 66  fR.Enable use of
3dd0: 20 53 53 4c 20 76 32 5c 26 2e 54 68 65 20 64 65   SSL v2\&.The de
3de0: 66 61 75 6c 74 20 69 73 20 5c 66 42 66 61 6c 73  fault is \fBfals
3df0: 65 5c 66 52 5c 26 2e 0a 4f 70 65 6e 53 53 4c 20  e\fR\&..OpenSSL 
3e00: 31 5c 26 2e 31 2b 20 6e 6f 20 6c 6f 6e 67 65 72  1\&.1+ no longer
3e10: 20 73 75 70 70 6f 72 74 73 20 53 53 4c 20 76 32   supports SSL v2
3e20: 2c 20 73 6f 20 74 68 69 73 20 6d 61 79 20 6e 6f  , so this may no
3e30: 74 20 68 61 76 65 20 61 6e 79 20 65 66 66 65 63  t have any effec
3e40: 74 5c 26 2e 0a 53 65 65 20 74 68 65 20 5c 66 42  t\&..See the \fB
3e50: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66  tls::protocols\f
3e60: 52 20 63 6f 6d 6d 61 6e 64 20 66 6f 72 20 73 75  R command for su
3e70: 70 70 6f 72 74 65 64 20 70 72 6f 74 6f 63 6f 6c  pported protocol
3e80: 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 73 6c  s\&...TP.\fB-ssl
3e90: 33 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a  3\fR \fIbool\fR.
3ea0: 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53  Enable use of SS
3eb0: 4c 20 76 33 5c 26 2e 20 54 68 65 20 64 65 66 61  L v3\&. The defa
3ec0: 75 6c 74 20 69 73 20 5c 66 42 66 61 6c 73 65 5c  ult is \fBfalse\
3ed0: 66 52 5c 26 2e 20 53 74 61 72 74 69 6e 67 20 69  fR\&. Starting i
3ee0: 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 2c 0a  n TclTLS 1\&.8,.
3ef0: 75 73 65 20 6f 66 20 53 53 4c 20 76 33 20 69 66  use of SSL v3 if
3f00: 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20   only available 
3f10: 76 69 61 20 61 20 63 6f 6d 70 69 6c 65 20 74 69  via a compile ti
3f20: 6d 65 20 6f 70 74 69 6f 6e 5c 26 2e 0a 4f 70 65  me option\&..Ope
3f30: 6e 53 53 4c 20 34 5c 26 2e 30 2b 20 6e 6f 20 6c  nSSL 4\&.0+ no l
3f40: 6f 6e 67 65 72 20 73 75 70 70 6f 72 74 73 20 53  onger supports S
3f50: 53 4c 20 76 33 2c 20 73 6f 20 74 68 69 73 20 6d  SL v3, so this m
3f60: 61 79 20 6e 6f 74 20 68 61 76 65 20 61 6e 79 20  ay not have any 
3f70: 65 66 66 65 63 74 5c 26 2e 0a 53 65 65 20 74 68  effect\&..See th
3f80: 65 20 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63  e \fBtls::protoc
3f90: 6f 6c 73 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 66  ols\fR command f
3fa0: 6f 72 20 73 75 70 70 6f 72 74 65 64 20 70 72 6f  or supported pro
3fb0: 74 6f 63 6f 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66  tocols\&...TP.\f
3fc0: 42 2d 74 6c 73 31 5c 66 52 20 5c 66 49 62 6f 6f  B-tls1\fR \fIboo
3fd0: 6c 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73 65 20  l\fR.Enable use 
3fe0: 6f 66 20 54 4c 53 20 76 31 5c 26 2e 20 53 74 61  of TLS v1\&. Sta
3ff0: 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20  rting in TclTLS 
4000: 32 5c 26 2e 30 2c 20 74 68 65 20 64 65 66 61 75  2\&.0, the defau
4010: 6c 74 20 69 73 20 5c 66 42 66 61 6c 73 65 5c 66  lt is \fBfalse\f
4020: 52 5c 26 2e 0a 4e 6f 74 65 3a 20 54 4c 53 20 31  R\&..Note: TLS 1
4030: 5c 26 2e 30 20 6e 65 65 64 73 20 53 48 41 31 20  \&.0 needs SHA1 
4040: 74 6f 20 6f 70 65 72 61 74 65 2c 20 77 68 69 63  to operate, whic
4050: 68 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61  h is only availa
4060: 62 6c 65 20 69 6e 20 73 65 63 75 72 69 74 79 20  ble in security 
4070: 6c 65 76 65 6c 0a 30 20 66 6f 72 20 4f 70 65 6e  level.0 for Open
4080: 20 53 53 4c 20 33 5c 26 2e 30 2b 5c 26 2e 20 53   SSL 3\&.0+\&. S
4090: 65 65 20 74 68 65 20 5c 66 42 2d 73 65 63 75 72  ee the \fB-secur
40a0: 69 74 79 5f 6c 65 76 65 6c 5c 66 52 20 6f 70 74  ity_level\fR opt
40b0: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 74  ion\&...TP.\fB-t
40c0: 6c 73 31 5c 26 2e 31 5c 66 52 20 5c 66 49 62 6f  ls1\&.1\fR \fIbo
40d0: 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65 20 75 73 65  ol\fR.Enable use
40e0: 20 6f 66 20 54 4c 53 20 76 31 5c 26 2e 31 5c 26   of TLS v1\&.1\&
40f0: 2e 20 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63  . Starting in Tc
4100: 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68 65 20  lTLS 2\&.0, the 
4110: 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66 61  default is \fBfa
4120: 6c 73 65 5c 66 52 5c 26 2e 0a 4e 6f 74 65 3a 20  lse\fR\&..Note: 
4130: 54 4c 53 20 31 5c 26 2e 31 20 6e 65 65 64 73 20  TLS 1\&.1 needs 
4140: 53 48 41 31 20 74 6f 20 6f 70 65 72 61 74 65 2c  SHA1 to operate,
4150: 20 77 68 69 63 68 20 69 73 20 6f 6e 6c 79 20 61   which is only a
4160: 76 61 69 6c 61 62 6c 65 20 69 6e 20 73 65 63 75  vailable in secu
4170: 72 69 74 79 20 6c 65 76 65 6c 0a 30 20 66 6f 72  rity level.0 for
4180: 20 4f 70 65 6e 20 53 53 4c 20 33 5c 26 2e 30 2b   Open SSL 3\&.0+
4190: 5c 26 2e 20 53 65 65 20 74 68 65 20 5c 66 42 2d  \&. See the \fB-
41a0: 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c 66  security_level\f
41b0: 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a  R option\&...TP.
41c0: 5c 66 42 2d 74 6c 73 31 5c 26 2e 32 5c 66 52 20  \fB-tls1\&.2\fR 
41d0: 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c  \fIbool\fR.Enabl
41e0: 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 5c  e use of TLS v1\
41f0: 26 2e 32 5c 26 2e 20 54 68 65 20 64 65 66 61 75  &.2\&. The defau
4200: 6c 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52  lt is \fBtrue\fR
4210: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 74 6c 73 31  \&...TP.\fB-tls1
4220: 5c 26 2e 33 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c  \&.3\fR \fIbool\
4230: 66 52 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f 66  fR.Enable use of
4240: 20 54 4c 53 20 76 31 5c 26 2e 33 5c 26 2e 20 54   TLS v1\&.3\&. T
4250: 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66  he default is \f
4260: 42 74 72 75 65 5c 66 52 5c 26 2e 20 54 68 69 73  Btrue\fR\&. This
4270: 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62   is only availab
4280: 6c 65 0a 73 74 61 72 74 69 6e 67 20 77 69 74 68  le.starting with
4290: 20 4f 70 65 6e 53 53 4c 20 31 5c 26 2e 31 5c 26   OpenSSL 1\&.1\&
42a0: 2e 31 20 61 6e 64 20 54 63 6c 54 4c 53 20 31 5c  .1 and TclTLS 1\
42b0: 26 2e 37 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 76  &.7\&...TP.\fB-v
42c0: 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66  alidatecommand\f
42d0: 52 20 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66 52  R \fIcallback\fR
42e0: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 63  .Specifies the c
42f0: 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20  allback command 
4300: 74 6f 20 69 6e 76 6f 6b 65 20 74 6f 20 76 61 6c  to invoke to val
4310: 69 64 61 74 65 20 74 68 65 20 70 65 65 72 20 63  idate the peer c
4320: 65 72 74 69 66 69 63 61 74 65 73 0a 61 6e 64 20  ertificates.and 
4330: 6f 74 68 65 72 20 63 6f 6e 66 69 67 20 69 6e 66  other config inf
4340: 6f 20 64 75 72 69 6e 67 20 74 68 65 20 70 72 6f  o during the pro
4350: 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61 74 69 6f  tocol negotiatio
4360: 6e 20 70 68 61 73 65 5c 26 2e 20 54 68 69 73 20  n phase\&. This 
4370: 63 61 6e 20 62 65 20 75 73 65 64 0a 62 79 20 54  can be used.by T
4380: 43 4c 20 73 63 72 69 70 74 73 20 74 6f 20 70 65  CL scripts to pe
4390: 72 66 6f 72 6d 20 74 68 65 69 72 20 6f 77 6e 20  rform their own 
43a0: 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69  Certificate Vali
43b0: 64 61 74 69 6f 6e 20 74 6f 20 73 75 70 70 6c 65  dation to supple
43c0: 6d 65 6e 74 20 74 68 65 0a 64 65 66 61 75 6c 74  ment the.default
43d0: 20 76 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f 76   validation prov
43e0: 69 64 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 5c  ided by OpenSSL\
43f0: 26 2e 20 54 68 65 20 73 63 72 69 70 74 20 6d 75  &. The script mu
4400: 73 74 20 72 65 74 75 72 6e 20 61 20 62 6f 6f 6c  st return a bool
4410: 65 61 6e 20 74 72 75 65 0a 74 6f 20 63 6f 6e 74  ean true.to cont
4420: 69 6e 75 65 20 74 68 65 20 6e 65 67 6f 74 69 61  inue the negotia
4430: 74 69 6f 6e 5c 26 2e 20 53 65 65 20 5c 66 42 43  tion\&. See \fBC
4440: 61 6c 6c 62 61 63 6b 20 4f 70 74 69 6f 6e 73 5c  allback Options\
4450: 66 52 20 66 6f 72 20 6d 6f 72 65 20 69 6e 66 6f  fR for more info
4460: 5c 26 2e 0a 54 68 69 73 20 6f 70 74 69 6f 6e 20  \&..This option 
4470: 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c  is new for TclTL
4480: 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e  S 1\&.8\&...RE..
4490: 54 50 0a 5c 66 42 74 6c 73 3a 3a 68 61 6e 64 73  TP.\fBtls::hands
44a0: 68 61 6b 65 5c 66 52 20 5c 66 49 63 68 61 6e 6e  hake\fR \fIchann
44b0: 65 6c 5c 66 52 0a 46 6f 72 63 65 73 20 74 68 65  el\fR.Forces the
44c0: 20 54 4c 53 20 6e 65 67 6f 74 69 61 74 69 6f 6e   TLS negotiation
44d0: 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 74 61   handshake to ta
44e0: 6b 65 20 70 6c 61 63 65 20 69 6d 6d 65 64 69 61  ke place immedia
44f0: 74 65 6c 79 2c 20 61 6e 64 20 72 65 74 75 72 6e  tely, and return
4500: 73 20 30 0a 69 66 20 68 61 6e 64 73 68 61 6b 65  s 0.if handshake
4510: 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f   is still in pro
4520: 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63 6b  gress (non-block
4530: 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 20 74 68  ing), or 1 if th
4540: 65 20 68 61 6e 64 73 68 61 6b 65 20 77 61 73 0a  e handshake was.
4550: 73 75 63 63 65 73 73 66 75 6c 5c 26 2e 20 49 66  successful\&. If
4560: 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 66   the handshake f
4570: 61 69 6c 65 64 2c 20 61 6e 20 65 72 72 6f 72 20  ailed, an error 
4580: 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64  will be returned
4590: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a  \&...TP.\fBtls::
45a0: 73 68 75 74 64 6f 77 6e 5c 66 52 20 5c 66 49 63  shutdown\fR \fIc
45b0: 68 61 6e 6e 65 6c 5c 66 52 0a 2e 54 50 0a 5c 66  hannel\fR..TP.\f
45c0: 42 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 5c 66  Btls::unimport\f
45d0: 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a  R \fIchannel\fR.
45e0: 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 75 6e 73 74  .TP.\fBtls::unst
45f0: 61 63 6b 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65  ack\fR \fIchanne
4600: 6c 5c 66 52 0a 54 68 69 73 20 74 65 72 6d 69 6e  l\fR.This termin
4610: 61 74 65 73 20 74 68 65 20 53 53 4c 2f 54 4c 53  ates the SSL/TLS
4620: 20 73 65 73 73 69 6f 6e 20 62 79 20 73 65 6e 64   session by send
4630: 69 6e 67 20 74 68 65 20 22 63 6c 6f 73 65 5f 6e  ing the "close_n
4640: 6f 74 69 66 79 22 20 6d 65 73 73 61 67 65 20 61  otify" message a
4650: 6e 64 0a 72 65 6d 6f 76 65 73 20 74 68 65 20 74  nd.removes the t
4660: 6f 70 20 6c 65 76 65 6c 20 73 74 61 63 6b 65 64  op level stacked
4670: 20 63 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 5c 66   channel from \f
4680: 49 63 68 61 6e 6e 65 6c 5c 66 52 2c 20 62 75 74  Ichannel\fR, but
4690: 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 63 6c 6f   it does not clo
46a0: 73 65 0a 74 68 65 20 73 6f 63 6b 65 74 5c 26 2e  se.the socket\&.
46b0: 20 49 74 20 69 73 20 74 68 65 20 63 6f 6d 70 6c   It is the compl
46c0: 69 6d 65 6e 74 20 74 6f 20 5c 66 42 74 6c 73 3a  iment to \fBtls:
46d0: 3a 69 6d 70 6f 72 74 5c 66 52 20 62 79 20 65 6e  :import\fR by en
46e0: 64 69 6e 67 20 65 6e 63 72 79 70 74 69 6f 6e 20  ding encryption 
46f0: 6f 66 0a 61 20 54 43 4c 20 63 68 61 6e 6e 65 6c  of.a TCL channel
4700: 5c 26 2e 20 41 6e 20 65 72 72 6f 72 20 69 73 20  \&. An error is 
4710: 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 20 69 73  thrown if TLS is
4720: 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 73 74 61   not the top sta
4730: 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 74 79 70  cked channel typ
4740: 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a  e\&...TP.\fBtls:
4750: 3a 73 74 61 74 75 73 5c 66 52 20 3f 5c 66 42 2d  :status\fR ?\fB-
4760: 6c 6f 63 61 6c 5c 66 52 3f 20 5c 66 49 63 68 61  local\fR? \fIcha
4770: 6e 6e 65 6c 5c 66 52 0a 52 65 74 75 72 6e 73 20  nnel\fR.Returns 
4780: 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61 74  the current stat
4790: 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61  us of an SSL cha
47a0: 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65 73 75  nnel\&. The resu
47b0: 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20  lt is a list of 
47c0: 6b 65 79 2d 76 61 6c 75 65 0a 70 61 69 72 73 20  key-value.pairs 
47d0: 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 53  describing the S
47e0: 53 4c 2c 20 63 65 72 74 69 66 69 63 61 74 65 2c  SL, certificate,
47f0: 20 61 6e 64 20 63 65 72 74 69 66 69 63 61 74 65   and certificate
4800: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 73 74   verification st
4810: 61 74 75 73 5c 26 2e 20 49 66 0a 74 68 65 20 53  atus\&. If.the S
4820: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73  SL handshake has
4830: 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74   not yet complet
4840: 65 64 2c 20 61 6e 20 65 6d 70 74 79 20 6c 69 73  ed, an empty lis
4850: 74 20 69 73 20 72 65 74 75 72 6e 65 64 5c 26 2e  t is returned\&.
4860: 20 49 66 20 74 68 65 0a 5c 66 42 2d 6c 6f 63 61   If the.\fB-loca
4870: 6c 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73 20 73  l\fR option is s
4880: 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 74  pecified, then t
4890: 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69 66 69  he local certifi
48a0: 63 61 74 65 20 69 73 20 75 73 65 64 5c 26 2e 0a  cate is used\&..
48b0: 52 65 74 75 72 6e 65 64 20 76 61 6c 75 65 73 20  Returned values 
48c0: 69 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a 53 53 4c  include:..sp.SSL
48d0: 20 53 74 61 74 75 73 0a 2e 52 53 0a 2e 54 50 0a   Status..RS..TP.
48e0: 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66 49 70 72  \fBalpn\fR \fIpr
48f0: 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68 65 20 70 72  otocol\fR.The pr
4900: 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64 20  otocol selected 
4910: 61 66 74 65 72 20 41 70 70 6c 69 63 61 74 69 6f  after Applicatio
4920: 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c  n-Layer Protocol
4930: 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 41 4c   Negotiation (AL
4940: 50 4e 29 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75  PN)\&..This valu
4950: 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  e is new for Tcl
4960: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
4970: 0a 5c 66 42 63 69 70 68 65 72 5c 66 52 20 5c 66  .\fBcipher\fR \f
4980: 49 63 69 70 68 65 72 5c 66 52 0a 54 68 65 20 63  Icipher\fR.The c
4990: 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e  urrent cipher in
49a0: 20 75 73 65 20 66 6f 72 20 74 68 65 20 73 65 73   use for the ses
49b0: 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70  sion\&...TP.\fBp
49c0: 65 65 72 6e 61 6d 65 5c 66 52 20 5c 66 49 6e 61  eername\fR \fIna
49d0: 6d 65 5c 66 52 0a 54 68 65 20 70 65 65 72 6e 61  me\fR.The peerna
49e0: 6d 65 20 66 72 6f 6d 20 74 68 65 20 63 65 72 74  me from the cert
49f0: 69 66 69 63 61 74 65 5c 26 2e 0a 54 68 69 73 20  ificate\&..This 
4a00: 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72  value is new for
4a10: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
4a20: 0a 2e 54 50 0a 5c 66 42 70 72 6f 74 6f 63 6f 6c  ..TP.\fBprotocol
4a30: 5c 66 52 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66  \fR \fIversion\f
4a40: 52 0a 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76  R.The protocol v
4a50: 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20  ersion used for 
4a60: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 20  the connection: 
4a70: 53 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31  SSL2, SSL3, TLS1
4a80: 2c 20 54 4c 53 31 5c 26 2e 31 2c 20 54 4c 53 31  , TLS1\&.1, TLS1
4a90: 5c 26 2e 32 2c 0a 54 4c 53 31 5c 26 2e 33 2c 20  \&.2,.TLS1\&.3, 
4aa0: 6f 72 20 75 6e 6b 6e 6f 77 6e 5c 26 2e 20 54 68  or unknown\&. Th
4ab0: 69 73 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20  is value is new 
4ac0: 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for TclTLS 1\&.8
4ad0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 62 69 74 73  \&...TP.\fBsbits
4ae0: 5c 66 52 20 5c 66 49 6e 5c 66 52 0a 54 68 65 20  \fR \fIn\fR.The 
4af0: 6e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75  number of bits u
4b00: 73 65 64 20 66 6f 72 20 74 68 65 20 73 65 73 73  sed for the sess
4b10: 69 6f 6e 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c  ion key\&...TP.\
4b20: 66 42 73 69 67 6e 61 74 75 72 65 48 61 73 68 41  fBsignatureHashA
4b30: 6c 67 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49 61  lgorithm\fR \fIa
4b40: 6c 67 6f 72 69 74 68 6d 5c 66 52 0a 54 68 65 20  lgorithm\fR.The 
4b50: 73 69 67 6e 61 74 75 72 65 20 68 61 73 68 20 61  signature hash a
4b60: 6c 67 6f 72 69 74 68 6d 5c 26 2e 0a 54 68 69 73  lgorithm\&..This
4b70: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
4b80: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
4b90: 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74 75  ...TP.\fBsignatu
4ba0: 72 65 54 79 70 65 5c 66 52 20 5c 66 49 74 79 70  reType\fR \fItyp
4bb0: 65 5c 66 52 0a 54 68 65 20 73 69 67 6e 61 74 75  e\fR.The signatu
4bc0: 72 65 20 74 79 70 65 20 76 61 6c 75 65 5c 26 2e  re type value\&.
4bd0: 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73 20 6e  .This value is n
4be0: 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c  ew for TclTLS 1\
4bf0: 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 76 65  &.8\&...TP.\fBve
4c00: 72 69 66 79 44 65 70 74 68 5c 66 52 20 5c 66 49  rifyDepth\fR \fI
4c10: 6e 5c 66 52 0a 4d 61 78 69 6d 75 6d 20 64 65 70  n\fR.Maximum dep
4c20: 74 68 20 66 6f 72 20 74 68 65 20 63 65 72 74 69  th for the certi
4c30: 66 69 63 61 74 65 20 63 68 61 69 6e 20 76 65 72  ficate chain ver
4c40: 69 66 69 63 61 74 69 6f 6e 5c 26 2e 20 44 65 66  ification\&. Def
4c50: 61 75 6c 74 20 69 73 20 2d 31 2c 20 74 6f 20 63  ault is -1, to c
4c60: 68 65 63 6b 20 61 6c 6c 5c 26 2e 0a 54 68 69 73  heck all\&..This
4c70: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
4c80: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
4c90: 2e 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66 79 4d  ...TP.\fBverifyM
4ca0: 6f 64 65 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66  ode\fR \fIlist\f
4cb0: 52 0a 4c 69 73 74 20 6f 66 20 63 65 72 74 69 66  R.List of certif
4cc0: 69 63 61 74 65 20 76 65 72 69 66 69 63 61 74 69  icate verificati
4cd0: 6f 6e 20 6d 6f 64 65 73 5c 26 2e 0a 54 68 69 73  on modes\&..This
4ce0: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
4cf0: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
4d00: 2e 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66 79 52  ...TP.\fBverifyR
4d10: 65 73 75 6c 74 5c 66 52 20 5c 66 49 72 65 73 75  esult\fR \fIresu
4d20: 6c 74 5c 66 52 0a 43 65 72 74 69 66 69 63 61 74  lt\fR.Certificat
4d30: 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 72  e verification r
4d40: 65 73 75 6c 74 5c 26 2e 0a 54 68 69 73 20 76 61  esult\&..This va
4d50: 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54  lue is new for T
4d60: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
4d70: 54 50 0a 5c 66 42 63 61 5f 6e 61 6d 65 73 5c 66  TP.\fBca_names\f
4d80: 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a 4c 69 73  R \fIlist\fR.Lis
4d90: 74 20 6f 66 20 74 68 65 20 43 65 72 74 69 66 69  t of the Certifi
4da0: 63 61 74 65 20 41 75 74 68 6f 72 69 74 69 65 73  cate Authorities
4db0: 20 75 73 65 64 20 74 6f 20 63 72 65 61 74 65 20   used to create 
4dc0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 5c  the certificate\
4dd0: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
4de0: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
4df0: 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 49 50  1\&.8\&...RE..IP
4e00: 0a 43 65 72 74 69 66 69 63 61 74 65 20 53 74 61  .Certificate Sta
4e10: 74 75 73 0a 2e 52 53 0a 2e 54 50 0a 5c 66 42 61  tus..RS..TP.\fBa
4e20: 6c 6c 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c  ll\fR \fIstring\
4e30: 66 52 0a 44 75 6d 70 20 6f 66 20 61 6c 6c 20 63  fR.Dump of all c
4e40: 65 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f 5c  ertificate info\
4e50: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
4e60: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
4e70: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
4e80: 76 65 72 73 69 6f 6e 5c 66 52 20 5c 66 49 76 61  version\fR \fIva
4e90: 6c 75 65 5c 66 52 0a 54 68 65 20 63 65 72 74 69  lue\fR.The certi
4ea0: 66 69 63 61 74 65 20 76 65 72 73 69 6f 6e 5c 26  ficate version\&
4eb0: 2e 0a 2e 54 50 0a 5c 66 42 73 65 72 69 61 6c 4e  ...TP.\fBserialN
4ec0: 75 6d 62 65 72 5c 66 52 20 5c 66 49 73 74 72 69  umber\fR \fIstri
4ed0: 6e 67 5c 66 52 0a 54 68 65 20 73 65 72 69 61 6c  ng\fR.The serial
4ee0: 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63   number of the c
4ef0: 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20  ertificate as a 
4f00: 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 0a 54 68  hex string\&..Th
4f10: 69 73 20 76 61 6c 75 65 20 77 61 73 20 63 68 61  is value was cha
4f20: 6e 67 65 64 20 66 72 6f 6d 20 73 65 72 69 61 6c  nged from serial
4f30: 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38   in TclTLS 1\&.8
4f40: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61  \&...TP.\fBsigna
4f50: 74 75 72 65 5c 66 52 20 5c 66 49 61 6c 67 6f 72  ture\fR \fIalgor
4f60: 69 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20 61  ithm\fR.Cipher a
4f70: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f  lgorithm used fo
4f80: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69  r certificate si
4f90: 67 6e 61 74 75 72 65 5c 26 2e 0a 54 68 69 73 20  gnature\&..This 
4fa0: 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72  value is new for
4fb0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
4fc0: 0a 2e 54 50 0a 5c 66 42 69 73 73 75 65 72 5c 66  ..TP.\fBissuer\f
4fd0: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 54  R \fIstring\fR.T
4fe0: 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 64  he distinguished
4ff0: 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68   name (DN) of th
5000: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69 73  e certificate is
5010: 73 75 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6e  suer\&...TP.\fBn
5020: 6f 74 42 65 66 6f 72 65 5c 66 52 20 5c 66 49 64  otBefore\fR \fId
5030: 61 74 65 5c 66 52 0a 54 68 65 20 62 65 67 69 6e  ate\fR.The begin
5040: 6e 69 6e 67 20 64 61 74 65 20 6f 66 20 74 68 65  ning date of the
5050: 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61 6c   certificate val
5060: 69 64 69 74 79 5c 26 2e 0a 2e 54 50 0a 5c 66 42  idity\&...TP.\fB
5070: 6e 6f 74 41 66 74 65 72 5c 66 52 20 5c 66 49 64  notAfter\fR \fId
5080: 61 74 65 5c 66 52 0a 54 68 65 20 65 78 70 69 72  ate\fR.The expir
5090: 61 74 69 6f 6e 20 64 61 74 65 20 6f 66 20 74 68  ation date of th
50a0: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61  e certificate va
50b0: 6c 69 64 69 74 79 5c 26 2e 0a 2e 54 50 0a 5c 66  lidity\&...TP.\f
50c0: 42 73 75 62 6a 65 63 74 5c 66 52 20 5c 66 49 73  Bsubject\fR \fIs
50d0: 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 64 69 73  tring\fR.The dis
50e0: 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20  tinguished name 
50f0: 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74  (DN) of the cert
5100: 69 66 69 63 61 74 65 20 73 75 62 6a 65 63 74 5c  ificate subject\
5110: 26 2e 20 46 69 65 6c 64 73 20 69 6e 63 6c 75 64  &. Fields includ
5120: 65 3a 20 43 6f 6d 6d 6f 6e 0a 4e 61 6d 65 20 28  e: Common.Name (
5130: 43 4e 29 2c 20 4f 72 67 61 6e 69 7a 61 74 69 6f  CN), Organizatio
5140: 6e 20 28 4f 29 2c 20 4c 6f 63 61 6c 69 74 79 20  n (O), Locality 
5150: 6f 72 20 43 69 74 79 20 28 4c 29 2c 20 53 74 61  or City (L), Sta
5160: 74 65 20 6f 72 20 50 72 6f 76 69 6e 63 65 20 28  te or Province (
5170: 53 29 2c 20 61 6e 64 0a 43 6f 75 6e 74 72 79 20  S), and.Country 
5180: 4e 61 6d 65 20 28 43 29 5c 26 2e 0a 2e 54 50 0a  Name (C)\&...TP.
5190: 5c 66 42 69 73 73 75 65 72 55 6e 69 71 75 65 49  \fBissuerUniqueI
51a0: 44 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66  D\fR \fIstring\f
51b0: 52 0a 54 68 65 20 69 73 73 75 65 72 20 75 6e 69  R.The issuer uni
51c0: 71 75 65 20 69 64 5c 26 2e 0a 54 68 69 73 20 76  que id\&..This v
51d0: 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20  alue is new for 
51e0: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a  TclTLS 1\&.8\&..
51f0: 2e 54 50 0a 5c 66 42 73 75 62 6a 65 63 74 55 6e  .TP.\fBsubjectUn
5200: 69 71 75 65 49 44 5c 66 52 20 5c 66 49 73 74 72  iqueID\fR \fIstr
5210: 69 6e 67 5c 66 52 0a 54 68 65 20 73 75 62 6a 65  ing\fR.The subje
5220: 63 74 20 75 6e 69 71 75 65 20 69 64 5c 26 2e 0a  ct unique id\&..
5230: 54 68 69 73 20 76 61 6c 75 65 20 69 73 20 6e 65  This value is ne
5240: 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26  w for TclTLS 1\&
5250: 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6e 75 6d  .8\&...TP.\fBnum
5260: 5f 65 78 74 65 6e 73 69 6f 6e 73 5c 66 52 20 5c  _extensions\fR \
5270: 66 49 6e 5c 66 52 0a 4e 75 6d 62 65 72 20 6f 66  fIn\fR.Number of
5280: 20 63 65 72 74 69 66 69 63 61 74 65 20 65 78 74   certificate ext
5290: 65 6e 73 69 6f 6e 73 5c 26 2e 0a 54 68 69 73 20  ensions\&..This 
52a0: 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72  value is new for
52b0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
52c0: 0a 2e 54 50 0a 5c 66 42 65 78 74 65 6e 73 69 6f  ..TP.\fBextensio
52d0: 6e 73 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66 52  ns\fR \fIlist\fR
52e0: 0a 4c 69 73 74 20 6f 66 20 63 65 72 74 69 66 69  .List of certifi
52f0: 63 61 74 65 20 65 78 74 65 6e 73 69 6f 6e 20 6e  cate extension n
5300: 61 6d 65 73 5c 26 2e 0a 54 68 69 73 20 76 61 6c  ames\&..This val
5310: 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  ue is new for Tc
5320: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
5330: 50 0a 5c 66 42 61 75 74 68 6f 72 69 74 79 4b 65  P.\fBauthorityKe
5340: 79 49 64 65 6e 74 69 66 69 65 72 5c 66 52 20 5c  yIdentifier\fR \
5350: 66 49 73 74 72 69 6e 67 5c 66 52 0a 41 75 74 68  fIstring\fR.Auth
5360: 6f 72 69 74 79 20 4b 65 79 20 49 64 65 6e 74 69  ority Key Identi
5370: 66 69 65 72 20 28 41 4b 49 29 20 6f 66 20 74 68  fier (AKI) of th
5380: 65 20 49 73 73 75 69 6e 67 20 43 41 20 63 65 72  e Issuing CA cer
5390: 74 69 66 69 63 61 74 65 20 74 68 61 74 20 73 69  tificate that si
53a0: 67 6e 65 64 20 74 68 65 0a 53 53 4c 20 63 65 72  gned the.SSL cer
53b0: 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68 65  tificate as a he
53c0: 78 20 73 74 72 69 6e 67 5c 26 2e 20 54 68 69 73  x string\&. This
53d0: 20 76 61 6c 75 65 20 6d 61 74 63 68 65 73 20 74   value matches t
53e0: 68 65 20 53 4b 49 20 76 61 6c 75 65 20 6f 66 20  he SKI value of 
53f0: 74 68 65 0a 49 6e 74 65 72 6d 65 64 69 61 74 65  the.Intermediate
5400: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 5c   CA certificate\
5410: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
5420: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
5430: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
5440: 73 75 62 6a 65 63 74 4b 65 79 49 64 65 6e 74 69  subjectKeyIdenti
5450: 66 69 65 72 5c 66 52 20 5c 66 49 73 74 72 69 6e  fier\fR \fIstrin
5460: 67 5c 66 52 0a 53 75 62 6a 65 63 74 20 4b 65 79  g\fR.Subject Key
5470: 20 49 64 65 6e 74 69 66 69 65 72 20 28 53 4b 49   Identifier (SKI
5480: 29 20 68 61 73 68 20 6f 66 20 74 68 65 20 70 75  ) hash of the pu
5490: 62 6c 69 63 20 6b 65 79 20 69 6e 73 69 64 65 20  blic key inside 
54a0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20  the certificate 
54b0: 61 73 20 61 0a 68 65 78 20 73 74 72 69 6e 67 5c  as a.hex string\
54c0: 26 2e 20 55 73 65 64 20 74 6f 20 69 64 65 6e 74  &. Used to ident
54d0: 69 66 79 20 63 65 72 74 69 66 69 63 61 74 65 73  ify certificates
54e0: 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 20 61 20   that contain a 
54f0: 70 61 72 74 69 63 75 6c 61 72 20 70 75 62 6c 69  particular publi
5500: 63 20 6b 65 79 5c 26 2e 0a 54 68 69 73 20 76 61  c key\&..This va
5510: 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54  lue is new for T
5520: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
5530: 54 50 0a 5c 66 42 73 75 62 6a 65 63 74 41 6c 74  TP.\fBsubjectAlt
5540: 4e 61 6d 65 5c 66 52 20 5c 66 49 6c 69 73 74 5c  Name\fR \fIlist\
5550: 66 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20 6f  fR.List of all o
5560: 66 20 74 68 65 20 53 75 62 6a 65 63 74 20 41 6c  f the Subject Al
5570: 74 65 72 6e 61 74 69 76 65 20 4e 61 6d 65 73 20  ternative Names 
5580: 28 53 41 4e 29 20 69 6e 63 6c 75 64 69 6e 67 20  (SAN) including 
5590: 64 6f 6d 61 69 6e 20 6e 61 6d 65 73 2c 20 73 75  domain names, su
55a0: 62 0a 64 6f 6d 61 69 6e 73 2c 20 61 6e 64 20 49  b.domains, and I
55b0: 50 20 61 64 64 72 65 73 73 65 73 20 74 68 61 74  P addresses that
55c0: 20 61 72 65 20 73 65 63 75 72 65 64 20 62 79 20   are secured by 
55d0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 5c  the certificate\
55e0: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
55f0: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
5600: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
5610: 6f 63 73 70 5c 66 52 20 5c 66 49 6c 69 73 74 5c  ocsp\fR \fIlist\
5620: 66 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20 4f  fR.List of all O
5630: 6e 6c 69 6e 65 20 43 65 72 74 69 66 69 63 61 74  nline Certificat
5640: 65 20 53 74 61 74 75 73 20 50 72 6f 74 6f 63 6f  e Status Protoco
5650: 6c 20 28 4f 43 53 50 29 20 55 52 4c 73 20 74 68  l (OCSP) URLs th
5660: 61 74 20 63 61 6e 20 62 65 20 75 73 65 64 20 74  at can be used t
5670: 6f 0a 63 68 65 63 6b 20 74 68 65 20 76 61 6c 69  o.check the vali
5680: 64 69 74 79 20 6f 66 20 74 68 69 73 20 63 65 72  dity of this cer
5690: 74 69 66 69 63 61 74 65 5c 26 2e 0a 54 68 69 73  tificate\&..This
56a0: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
56b0: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
56c0: 2e 0a 2e 54 50 0a 5c 66 42 63 65 72 74 69 66 69  ...TP.\fBcertifi
56d0: 63 61 74 65 5c 66 52 20 5c 66 49 63 65 72 74 5c  cate\fR \fIcert\
56e0: 66 52 0a 54 68 65 20 50 45 4d 20 65 6e 63 6f 64  fR.The PEM encod
56f0: 65 64 20 63 65 72 74 69 66 69 63 61 74 65 5c 26  ed certificate\&
5700: 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74 75  ...TP.\fBsignatu
5710: 72 65 41 6c 67 6f 72 69 74 68 6d 5c 66 52 20 5c  reAlgorithm\fR \
5720: 66 49 61 6c 67 6f 72 69 74 68 6d 5c 66 52 0a 43  fIalgorithm\fR.C
5730: 69 70 68 65 72 20 61 6c 67 6f 72 69 74 68 6d 20  ipher algorithm 
5740: 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 65 72  used for the cer
5750: 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75  tificate signatu
5760: 72 65 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65  re\&..This value
5770: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
5780: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a  LS 1\&.8\&...TP.
5790: 5c 66 42 73 69 67 6e 61 74 75 72 65 56 61 6c 75  \fBsignatureValu
57a0: 65 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66  e\fR \fIstring\f
57b0: 52 0a 43 65 72 74 69 66 69 63 61 74 65 20 73 69  R.Certificate si
57c0: 67 6e 61 74 75 72 65 20 61 73 20 61 20 68 65 78  gnature as a hex
57d0: 20 73 74 72 69 6e 67 5c 26 2e 0a 54 68 69 73 20   string\&..This 
57e0: 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72  value is new for
57f0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
5800: 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74 75 72  ..TP.\fBsignatur
5810: 65 44 69 67 65 73 74 5c 66 52 20 5c 66 49 76 65  eDigest\fR \fIve
5820: 72 73 69 6f 6e 5c 66 52 0a 43 65 72 74 69 66 69  rsion\fR.Certifi
5830: 63 61 74 65 20 73 69 67 6e 69 6e 67 20 64 69 67  cate signing dig
5840: 65 73 74 20 61 73 20 61 20 68 65 78 20 73 74 72  est as a hex str
5850: 69 6e 67 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75  ing\&..This valu
5860: 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c  e is new for Tcl
5870: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50  TLS 1\&.8\&...TP
5880: 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79 41 6c 67  .\fBpublicKeyAlg
5890: 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49 61 6c 67  orithm\fR \fIalg
58a0: 6f 72 69 74 68 6d 5c 66 52 0a 43 65 72 74 69 66  orithm\fR.Certif
58b0: 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20  icate signature 
58c0: 70 75 62 6c 69 63 20 6b 65 79 20 61 6c 67 6f 72  public key algor
58d0: 69 74 68 6d 5c 26 2e 0a 54 68 69 73 20 76 61 6c  ithm\&..This val
58e0: 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  ue is new for Tc
58f0: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
5900: 50 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79 5c 66  P.\fBpublicKey\f
5910: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 43  R \fIstring\fR.C
5920: 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61  ertificate signa
5930: 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65 79 20  ture public key 
5940: 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 5c  as a hex string\
5950: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
5960: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
5970: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
5980: 62 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66 52 0a  bits\fR \fIn\fR.
5990: 4e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75  Number of bits u
59a0: 73 65 64 20 66 6f 72 20 63 65 72 74 69 66 69 63  sed for certific
59b0: 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 6b 65  ate signature ke
59c0: 79 5c 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20  y\&..This value 
59d0: 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c  is new for TclTL
59e0: 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c  S 1\&.8\&...TP.\
59f0: 66 42 73 65 6c 66 5f 73 69 67 6e 65 64 5c 66 52  fBself_signed\fR
5a00: 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57   \fIboolean\fR.W
5a10: 68 65 74 68 65 72 20 74 68 65 20 63 65 72 74 69  hether the certi
5a20: 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65  ficate signature
5a30: 20 69 73 20 73 65 6c 66 20 73 69 67 6e 65 64 5c   is self signed\
5a40: 26 2e 0a 54 68 69 73 20 76 61 6c 75 65 20 69 73  &..This value is
5a50: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
5a60: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42  1\&.8\&...TP.\fB
5a70: 73 68 61 31 5f 68 61 73 68 5c 66 52 20 5c 66 49  sha1_hash\fR \fI
5a80: 68 61 73 68 5c 66 52 0a 54 68 65 20 53 48 41 31  hash\fR.The SHA1
5a90: 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 65 72   hash of the cer
5aa0: 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68 65  tificate as a he
5ab0: 78 20 73 74 72 69 6e 67 5c 26 2e 0a 54 68 69 73  x string\&..This
5ac0: 20 76 61 6c 75 65 20 69 73 20 6e 65 77 20 66 6f   value is new fo
5ad0: 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26  r TclTLS 1\&.8\&
5ae0: 2e 0a 2e 54 50 0a 5c 66 42 73 68 61 32 35 36 5f  ...TP.\fBsha256_
5af0: 68 61 73 68 5c 66 52 20 5c 66 49 68 61 73 68 5c  hash\fR \fIhash\
5b00: 66 52 0a 54 68 65 20 53 48 41 32 35 36 20 68 61  fR.The SHA256 ha
5b10: 73 68 20 6f 66 20 74 68 65 20 63 65 72 74 69 66  sh of the certif
5b20: 69 63 61 74 65 20 61 73 20 61 20 68 65 78 20 73  icate as a hex s
5b30: 74 72 69 6e 67 5c 26 2e 0a 54 68 69 73 20 76 61  tring\&..This va
5b40: 6c 75 65 20 69 73 20 6e 65 77 20 66 6f 72 20 54  lue is new for T
5b50: 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e  clTLS 1\&.8\&...
5b60: 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 63  RE..TP.\fBtls::c
5b70: 6f 6e 6e 65 63 74 69 6f 6e 5c 66 52 20 5c 66 49  onnection\fR \fI
5b80: 63 68 61 6e 6e 65 6c 5c 66 52 0a 52 65 74 75 72  channel\fR.Retur
5b90: 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 63  ns the current c
5ba0: 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 61 74 75 73  onnection status
5bb0: 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e 6e   of an SSL chann
5bc0: 65 6c 5c 26 2e 20 54 68 65 20 72 65 73 75 6c 74  el\&. The result
5bd0: 20 69 73 20 61 20 6c 69 73 74 0a 6f 66 20 6b 65   is a list.of ke
5be0: 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 65  y-value pairs de
5bf0: 73 63 72 69 62 69 6e 67 20 74 68 65 20 63 6f 6e  scribing the con
5c00: 6e 65 63 74 69 6f 6e 5c 26 2e 0a 54 68 69 73 20  nection\&..This 
5c10: 63 6f 6d 6d 61 6e 64 20 69 73 20 6e 65 77 20 66  command is new f
5c20: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
5c30: 26 2e 20 52 65 74 75 72 6e 65 64 20 76 61 6c 75  &. Returned valu
5c40: 65 73 20 69 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a  es include:..sp.
5c50: 53 53 4c 20 53 74 61 74 75 73 0a 2e 52 53 0a 2e  SSL Status..RS..
5c60: 54 50 0a 5c 66 42 73 74 61 74 65 5c 66 52 20 5c  TP.\fBstate\fR \
5c70: 66 49 73 74 61 74 65 5c 66 52 0a 53 74 61 74 65  fIstate\fR.State
5c80: 20 6f 66 20 74 68 65 20 63 6f 6e 6e 65 63 74 69   of the connecti
5c90: 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 72  on\&...TP.\fBser
5ca0: 76 65 72 6e 61 6d 65 5c 66 52 20 5c 66 49 6e 61  vername\fR \fIna
5cb0: 6d 65 5c 66 52 0a 54 68 65 20 6e 61 6d 65 20 6f  me\fR.The name o
5cc0: 66 20 74 68 65 20 63 6f 6e 6e 65 63 74 65 64 20  f the connected 
5cd0: 74 6f 20 73 65 72 76 65 72 5c 26 2e 0a 2e 54 50  to server\&...TP
5ce0: 0a 5c 66 42 70 72 6f 74 6f 63 6f 6c 5c 66 52 20  .\fBprotocol\fR 
5cf0: 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a 54 68  \fIversion\fR.Th
5d00: 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69  e protocol versi
5d10: 6f 6e 20 75 73 65 64 20 66 6f 72 20 74 68 65 20  on used for the 
5d20: 63 6f 6e 6e 65 63 74 69 6f 6e 3a 20 53 53 4c 32  connection: SSL2
5d30: 2c 20 53 53 4c 33 2c 20 54 4c 53 31 2c 20 54 4c  , SSL3, TLS1, TL
5d40: 53 31 5c 26 2e 31 2c 20 54 4c 53 31 5c 26 2e 32  S1\&.1, TLS1\&.2
5d50: 2c 20 54 4c 53 31 5c 26 2e 33 2c 20 6f 72 20 75  , TLS1\&.3, or u
5d60: 6e 6b 6e 6f 77 6e 5c 26 2e 0a 2e 54 50 0a 5c 66  nknown\&...TP.\f
5d70: 42 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e 5f 61  Brenegotiation_a
5d80: 6c 6c 6f 77 65 64 5c 66 52 20 5c 66 49 62 6f 6f  llowed\fR \fIboo
5d90: 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72 20  lean\fR.Whether 
5da0: 70 72 6f 74 6f 63 6f 6c 20 72 65 6e 65 67 6f 74  protocol renegot
5db0: 69 61 74 69 6f 6e 20 69 73 20 73 75 70 70 6f 72  iation is suppor
5dc0: 74 65 64 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54  ted or not\&...T
5dd0: 50 0a 5c 66 42 73 65 63 75 72 69 74 79 5f 6c 65  P.\fBsecurity_le
5de0: 76 65 6c 5c 66 52 20 5c 66 49 6c 65 76 65 6c 5c  vel\fR \fIlevel\
5df0: 66 52 0a 54 68 65 20 73 65 63 75 72 69 74 79 20  fR.The security 
5e00: 6c 65 76 65 6c 20 75 73 65 64 20 66 6f 72 20 73  level used for s
5e10: 65 6c 65 63 74 69 6f 6e 20 6f 66 20 63 69 70 68  election of ciph
5e20: 65 72 73 2c 20 6b 65 79 20 73 69 7a 65 2c 20 65  ers, key size, e
5e30: 74 63 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73  tc\&...TP.\fBses
5e40: 73 69 6f 6e 5f 72 65 75 73 65 64 5c 66 52 20 5c  sion_reused\fR \
5e50: 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68 65  fIboolean\fR.Whe
5e60: 74 68 65 72 20 74 68 65 20 73 65 73 73 69 6f 6e  ther the session
5e70: 20 68 61 73 20 62 65 65 6e 20 72 65 75 73 65 64   has been reused
5e80: 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c   or not\&...TP.\
5e90: 66 42 69 73 5f 73 65 72 76 65 72 5c 66 52 20 5c  fBis_server\fR \
5ea0: 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68 65  fIboolean\fR.Whe
5eb0: 74 68 65 72 20 74 68 65 20 63 6f 6e 6e 65 63 74  ther the connect
5ec0: 69 6f 6e 20 69 73 20 63 6f 6e 66 69 67 75 72 65  ion is configure
5ed0: 64 20 61 73 20 61 20 73 65 72 76 65 72 20 28 31  d as a server (1
5ee0: 29 20 6f 72 20 63 6c 69 65 6e 74 20 28 30 29 5c  ) or client (0)\
5ef0: 26 2e 0a 2e 54 50 0a 5c 66 42 63 6f 6d 70 72 65  &...TP.\fBcompre
5f00: 73 73 69 6f 6e 5c 66 52 20 5c 66 49 6d 6f 64 65  ssion\fR \fImode
5f10: 5c 66 52 0a 43 6f 6d 70 72 65 73 73 69 6f 6e 20  \fR.Compression 
5f20: 6d 65 74 68 6f 64 5c 26 2e 0a 2e 54 50 0a 5c 66  method\&...TP.\f
5f30: 42 65 78 70 61 6e 73 69 6f 6e 5c 66 52 20 5c 66  Bexpansion\fR \f
5f40: 49 6d 6f 64 65 5c 66 52 0a 45 78 70 61 6e 73 69  Imode\fR.Expansi
5f50: 6f 6e 20 6d 65 74 68 6f 64 5c 26 2e 0a 2e 54 50  on method\&...TP
5f60: 0a 5c 66 42 63 61 4c 69 73 74 5c 66 52 20 5c 66  .\fBcaList\fR \f
5f70: 49 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66  Ilist\fR.List of
5f80: 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74   Certificate Aut
5f90: 68 6f 72 69 74 69 65 73 20 28 43 41 29 20 66 6f  horities (CA) fo
5fa0: 72 20 58 5c 26 2e 35 30 39 20 63 65 72 74 69 66  r X\&.509 certif
5fb0: 69 63 61 74 65 5c 26 2e 0a 2e 52 45 0a 2e 49 50  icate\&...RE..IP
5fc0: 0a 43 69 70 68 65 72 20 49 6e 66 6f 0a 2e 52 53  .Cipher Info..RS
5fd0: 0a 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5c 66  ..TP.\fBcipher\f
5fe0: 52 20 5c 66 49 63 69 70 68 65 72 5c 66 52 0a 54  R \fIcipher\fR.T
5ff0: 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 65  he current ciphe
6000: 72 20 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65  r in use for the
6010: 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 0a 2e   connection\&...
6020: 54 50 0a 5c 66 42 73 74 61 6e 64 61 72 64 5f 6e  TP.\fBstandard_n
6030: 61 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c 66  ame\fR \fIname\f
6040: 52 0a 54 68 65 20 73 74 61 6e 64 61 72 64 20 52  R.The standard R
6050: 46 43 20 6e 61 6d 65 20 6f 66 20 63 69 70 68 65  FC name of ciphe
6060: 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 61 6c 67 6f  r\&...TP.\fBalgo
6070: 72 69 74 68 6d 5f 62 69 74 73 5c 66 52 20 5c 66  rithm_bits\fR \f
6080: 49 6e 5c 66 52 0a 54 68 65 20 6e 75 6d 62 65 72  In\fR.The number
6090: 20 6f 66 20 70 72 6f 63 65 73 73 65 64 20 62 69   of processed bi
60a0: 74 73 20 75 73 65 64 20 66 6f 72 20 63 69 70 68  ts used for ciph
60b0: 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 63  er\&...TP.\fBsec
60c0: 72 65 74 5f 62 69 74 73 5c 66 52 20 5c 66 49 6e  ret_bits\fR \fIn
60d0: 5c 66 52 0a 54 68 65 20 6e 75 6d 62 65 72 20 6f  \fR.The number o
60e0: 66 20 73 65 63 72 65 74 20 62 69 74 73 20 75 73  f secret bits us
60f0: 65 64 20 66 6f 72 20 63 69 70 68 65 72 5c 26 2e  ed for cipher\&.
6100: 0a 2e 54 50 0a 5c 66 42 6d 69 6e 5f 76 65 72 73  ..TP.\fBmin_vers
6110: 69 6f 6e 5c 66 52 20 5c 66 49 76 65 72 73 69 6f  ion\fR \fIversio
6120: 6e 5c 66 52 0a 54 68 65 20 6d 69 6e 69 6d 75 6d  n\fR.The minimum
6130: 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f   protocol versio
6140: 6e 20 66 6f 72 20 63 69 70 68 65 72 5c 26 2e 0a  n for cipher\&..
6150: 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5f 69 73  .TP.\fBcipher_is
6160: 5f 61 65 61 64 5c 66 52 20 5c 66 49 62 6f 6f 6c  _aead\fR \fIbool
6170: 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72 20 74  ean\fR.Whether t
6180: 68 65 20 63 69 70 68 65 72 20 69 73 20 41 75 74  he cipher is Aut
6190: 68 65 6e 74 69 63 61 74 65 64 20 45 6e 63 72 79  henticated Encry
61a0: 70 74 69 6f 6e 20 77 69 74 68 20 41 73 73 6f 63  ption with Assoc
61b0: 69 61 74 65 64 20 44 61 74 61 20 28 41 45 41 44  iated Data (AEAD
61c0: 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 63 69 70 68  )\&...TP.\fBciph
61d0: 65 72 5f 69 64 5c 66 52 20 5c 66 49 69 64 5c 66  er_id\fR \fIid\f
61e0: 52 0a 54 68 65 20 4f 70 65 6e 53 53 4c 20 63 69  R.The OpenSSL ci
61f0: 70 68 65 72 20 69 64 5c 26 2e 0a 2e 54 50 0a 5c  pher id\&...TP.\
6200: 66 42 64 65 73 63 72 69 70 74 69 6f 6e 5c 66 52  fBdescription\fR
6210: 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 41 20   \fIstring\fR.A 
6220: 74 65 78 74 20 64 65 73 63 72 69 70 74 69 6f 6e  text description
6230: 20 6f 66 20 74 68 65 20 63 69 70 68 65 72 5c 26   of the cipher\&
6240: 2e 0a 2e 54 50 0a 5c 66 42 68 61 6e 64 73 68 61  ...TP.\fBhandsha
6250: 6b 65 5f 64 69 67 65 73 74 5c 66 52 20 5c 66 49  ke_digest\fR \fI
6260: 62 6f 6f 6c 65 61 6e 5c 66 52 0a 44 69 67 65 73  boolean\fR.Diges
6270: 74 20 75 73 65 64 20 64 75 72 69 6e 67 20 68 61  t used during ha
6280: 6e 64 73 68 61 6b 65 5c 26 2e 0a 2e 52 45 0a 2e  ndshake\&...RE..
6290: 49 50 0a 53 65 73 73 69 6f 6e 20 49 6e 66 6f 0a  IP.Session Info.
62a0: 2e 52 53 0a 2e 54 50 0a 5c 66 42 61 6c 70 6e 5c  .RS..TP.\fBalpn\
62b0: 66 52 20 5c 66 49 70 72 6f 74 6f 63 6f 6c 5c 66  fR \fIprotocol\f
62c0: 52 0a 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73  R.The protocol s
62d0: 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 70  elected after Ap
62e0: 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20  plication-Layer 
62f0: 50 72 6f 74 6f 63 6f 6c 20 4e 65 67 6f 74 69 61  Protocol Negotia
6300: 74 69 6f 6e 20 28 41 4c 50 4e 29 5c 26 2e 0a 2e  tion (ALPN)\&...
6310: 54 50 0a 5c 66 42 72 65 73 75 6d 61 62 6c 65 5c  TP.\fBresumable\
6320: 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52  fR \fIboolean\fR
6330: 0a 57 68 65 74 68 65 72 20 74 68 65 20 73 65 73  .Whether the ses
6340: 73 69 6f 6e 20 63 61 6e 20 62 65 20 72 65 73 75  sion can be resu
6350: 6d 65 64 20 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54  med or not\&...T
6360: 50 0a 5c 66 42 73 74 61 72 74 5f 74 69 6d 65 5c  P.\fBstart_time\
6370: 66 52 20 5c 66 49 73 65 63 6f 6e 64 73 5c 66 52  fR \fIseconds\fR
6380: 0a 54 69 6d 65 20 73 69 6e 63 65 20 73 65 73 73  .Time since sess
6390: 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e 20 73  ion started in s
63a0: 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65 70 6f  econds since epo
63b0: 63 68 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 69 6d  ch\&...TP.\fBtim
63c0: 65 6f 75 74 5c 66 52 20 5c 66 49 73 65 63 6f 6e  eout\fR \fIsecon
63d0: 64 73 5c 66 52 0a 4d 61 78 20 64 75 72 61 74 69  ds\fR.Max durati
63e0: 6f 6e 20 6f 66 20 73 65 73 73 69 6f 6e 20 69 6e  on of session in
63f0: 20 73 65 63 6f 6e 64 73 20 62 65 66 6f 72 65 20   seconds before 
6400: 74 69 6d 65 2d 6f 75 74 5c 26 2e 0a 2e 54 50 0a  time-out\&...TP.
6410: 5c 66 42 6c 69 66 65 74 69 6d 65 5c 66 52 20 5c  \fBlifetime\fR \
6420: 66 49 73 65 63 6f 6e 64 73 5c 66 52 0a 53 65 73  fIseconds\fR.Ses
6430: 73 69 6f 6e 20 74 69 63 6b 65 74 20 6c 69 66 65  sion ticket life
6440: 74 69 6d 65 20 68 69 6e 74 20 69 6e 20 73 65 63  time hint in sec
6450: 6f 6e 64 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73  onds\&...TP.\fBs
6460: 65 73 73 69 6f 6e 5f 69 64 5c 66 52 20 5c 66 49  ession_id\fR \fI
6470: 62 69 6e 61 72 79 5f 73 74 72 69 6e 67 5c 66 52  binary_string\fR
6480: 0a 55 6e 69 71 75 65 20 73 65 73 73 69 6f 6e 20  .Unique session 
6490: 69 64 20 66 6f 72 20 75 73 65 20 69 6e 20 72 65  id for use in re
64a0: 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73 73 69  suming the sessi
64b0: 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73  on\&...TP.\fBses
64c0: 73 69 6f 6e 5f 74 69 63 6b 65 74 5c 66 52 20 5c  sion_ticket\fR \
64d0: 66 49 62 69 6e 61 72 79 5f 73 74 72 69 6e 67 5c  fIbinary_string\
64e0: 66 52 0a 55 6e 69 71 75 65 20 73 65 73 73 69 6f  fR.Unique sessio
64f0: 6e 20 74 69 63 6b 65 74 20 66 6f 72 20 75 73 65  n ticket for use
6500: 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65   in resuming the
6510: 20 73 65 73 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a   session\&...TP.
6520: 5c 66 42 74 69 63 6b 65 74 5f 61 70 70 5f 64 61  \fBticket_app_da
6530: 74 61 5c 66 52 20 5c 66 49 62 69 6e 61 72 79 5f  ta\fR \fIbinary_
6540: 73 74 72 69 6e 67 5c 66 52 0a 55 6e 69 71 75 65  string\fR.Unique
6550: 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20   session ticket 
6560: 61 70 70 6c 69 63 61 74 69 6f 6e 20 64 61 74 61  application data
6570: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6d 61 73 74 65  \&...TP.\fBmaste
6580: 72 5f 6b 65 79 5c 66 52 20 5c 66 49 62 69 6e 61  r_key\fR \fIbina
6590: 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e 69  ry_string\fR.Uni
65a0: 71 75 65 20 73 65 73 73 69 6f 6e 20 6d 61 73 74  que session mast
65b0: 65 72 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c 66  er key\&...TP.\f
65c0: 42 73 65 73 73 69 6f 6e 5f 63 61 63 68 65 5f 6d  Bsession_cache_m
65d0: 6f 64 65 5c 66 52 20 5c 66 49 6d 6f 64 65 5c 66  ode\fR \fImode\f
65e0: 52 0a 53 65 72 76 65 72 20 63 61 63 68 65 20 6d  R.Server cache m
65f0: 6f 64 65 20 28 63 6c 69 65 6e 74 2c 20 73 65 72  ode (client, ser
6600: 76 65 72 2c 20 6f 72 20 62 6f 74 68 29 5c 26 2e  ver, or both)\&.
6610: 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a  ..RE..TP.\fBtls:
6620: 3a 63 69 70 68 65 72 73 5c 66 52 20 3f 5c 66 49  :ciphers\fR ?\fI
6630: 70 72 6f 74 6f 63 6f 6c 5c 66 52 3f 20 3f 5c 66  protocol\fR? ?\f
6640: 49 76 65 72 62 6f 73 65 5c 66 52 3f 20 3f 5c 66  Iverbose\fR? ?\f
6650: 49 73 75 70 70 6f 72 74 65 64 5c 66 52 3f 0a 57  Isupported\fR?.W
6660: 69 74 68 6f 75 74 20 61 6e 79 20 6f 70 74 69 6f  ithout any optio
6670: 6e 73 2c 20 69 74 20 72 65 74 75 72 6e 73 20 61  ns, it returns a
6680: 20 6c 69 73 74 20 6f 66 20 61 6c 6c 20 73 79 6d   list of all sym
6690: 6d 65 74 72 69 63 20 63 69 70 68 65 72 73 20 66  metric ciphers f
66a0: 6f 72 20 75 73 65 20 77 69 74 68 20 74 68 65 0a  or use with the.
66b0: 5c 66 49 2d 63 69 70 68 65 72 5c 66 52 20 6f 70  \fI-cipher\fR op
66c0: 74 69 6f 6e 5c 26 2e 20 57 69 74 68 20 5c 66 49  tion\&. With \fI
66d0: 70 72 6f 74 6f 63 6f 6c 5c 66 52 2c 20 6f 6e 6c  protocol\fR, onl
66e0: 79 20 74 68 65 20 63 69 70 68 65 72 73 20 73 75  y the ciphers su
66f0: 70 70 6f 72 74 65 64 20 66 6f 72 20 74 68 61 74  pported for that
6700: 0a 70 72 6f 74 6f 63 6f 6c 20 61 72 65 20 72 65  .protocol are re
6710: 74 75 72 6e 65 64 5c 26 2e 20 53 65 65 20 74 68  turned\&. See th
6720: 65 20 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63  e \fBtls::protoc
6730: 6f 6c 73 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 66  ols\fR command f
6740: 6f 72 20 74 68 65 20 73 75 70 70 6f 72 74 65 64  or the supported
6750: 0a 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e 20 49 66  .protocols\&. If
6760: 20 5c 66 49 76 65 72 62 6f 73 65 5c 66 52 20 69   \fIverbose\fR i
6770: 73 20 73 70 65 63 69 66 69 65 64 20 61 73 20 74  s specified as t
6780: 72 75 65 20 74 68 65 6e 20 61 20 76 65 72 62 6f  rue then a verbo
6790: 73 65 2c 20 68 75 6d 61 6e 20 72 65 61 64 61 62  se, human readab
67a0: 6c 65 0a 6c 69 73 74 20 69 73 20 72 65 74 75 72  le.list is retur
67b0: 6e 65 64 20 77 69 74 68 20 61 64 64 69 74 69 6f  ned with additio
67c0: 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  nal information 
67d0: 6f 6e 20 74 68 65 20 63 69 70 68 65 72 5c 26 2e  on the cipher\&.
67e0: 20 49 66 20 5c 66 49 73 75 70 70 6f 72 74 65 64   If \fIsupported
67f0: 5c 66 52 0a 69 73 20 73 70 65 63 69 66 69 65 64  \fR.is specified
6800: 20 61 73 20 74 72 75 65 2c 20 74 68 65 6e 20 6f   as true, then o
6810: 6e 6c 79 20 74 68 65 20 63 69 70 68 65 72 73 20  nly the ciphers 
6820: 73 75 70 70 6f 72 74 65 64 20 66 6f 72 20 70 72  supported for pr
6830: 6f 74 6f 63 6f 6c 20 77 69 6c 6c 20 62 65 20 6c  otocol will be l
6840: 69 73 74 65 64 5c 26 2e 0a 54 68 65 20 5c 66 49  isted\&..The \fI
6850: 73 75 70 70 6f 72 74 65 64 5c 66 52 20 61 72 67  supported\fR arg
6860: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
6870: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a  LS 1\&.8\&...TP.
6880: 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c  \fBtls::protocol
6890: 73 5c 66 52 0a 52 65 74 75 72 6e 73 20 61 20 6c  s\fR.Returns a l
68a0: 69 73 74 20 6f 66 20 74 68 65 20 73 75 70 70 6f  ist of the suppo
68b0: 72 74 65 64 20 53 53 4c 2f 54 4c 53 20 70 72 6f  rted SSL/TLS pro
68c0: 74 6f 63 6f 6c 73 5c 26 2e 20 56 61 6c 69 64 20  tocols\&. Valid 
68d0: 76 61 6c 75 65 73 20 61 72 65 3a 0a 5c 66 42 73  values are:.\fBs
68e0: 73 6c 32 5c 66 52 2c 20 5c 66 42 73 73 6c 33 5c  sl2\fR, \fBssl3\
68f0: 66 52 2c 20 5c 66 42 74 6c 73 31 5c 66 52 2c 20  fR, \fBtls1\fR, 
6900: 5c 66 42 74 6c 73 31 5c 26 2e 31 5c 66 52 2c 20  \fBtls1\&.1\fR, 
6910: 5c 66 42 74 6c 73 31 5c 26 2e 32 5c 66 52 2c 20  \fBtls1\&.2\fR, 
6920: 61 6e 64 0a 5c 66 42 74 6c 73 31 5c 26 2e 33 5c  and.\fBtls1\&.3\
6930: 66 52 5c 26 2e 20 45 78 61 63 74 20 6c 69 73 74  fR\&. Exact list
6940: 20 64 65 70 65 6e 64 73 20 6f 6e 20 4f 70 65 6e   depends on Open
6950: 53 53 4c 20 76 65 72 73 69 6f 6e 20 61 6e 64 20  SSL version and 
6960: 63 6f 6d 70 69 6c 65 20 74 69 6d 65 20 66 6c 61  compile time fla
6970: 67 73 5c 26 2e 0a 54 68 69 73 20 63 6f 6d 6d 61  gs\&..This comma
6980: 6e 64 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  nd is new for Tc
6990: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
69a0: 50 0a 5c 66 42 74 6c 73 3a 3a 76 65 72 73 69 6f  P.\fBtls::versio
69b0: 6e 5c 66 52 0a 52 65 74 75 72 6e 73 20 74 68 65  n\fR.Returns the
69c0: 20 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e   OpenSSL version
69d0: 20 73 74 72 69 6e 67 5c 26 2e 0a 2e 50 50 0a 2e   string\&...PP..
69e0: 53 48 20 22 43 45 52 54 49 46 49 43 41 54 45 20  SH "CERTIFICATE 
69f0: 56 41 4c 49 44 41 54 49 4f 4e 22 0a 2e 53 53 20  VALIDATION"..SS 
6a00: 22 50 4b 49 20 41 4e 44 20 43 45 52 54 49 46 49  "PKI AND CERTIFI
6a10: 43 41 54 45 53 22 0a 55 73 69 6e 67 20 74 68 65  CATES".Using the
6a20: 20 50 75 62 6c 69 63 20 4b 65 79 20 49 6e 66 72   Public Key Infr
6a30: 61 73 74 72 75 63 74 75 72 65 20 28 50 4b 49 29  astructure (PKI)
6a40: 2c 20 65 61 63 68 20 75 73 65 72 20 63 72 65 61  , each user crea
6a50: 74 65 73 20 61 20 70 72 69 76 61 74 65 20 6b 65  tes a private ke
6a60: 79 20 74 68 61 74 0a 6f 6e 6c 79 20 74 68 65 79  y that.only they
6a70: 20 6b 6e 6f 77 20 61 62 6f 75 74 20 61 6e 64 20   know about and 
6a80: 61 20 70 75 62 6c 69 63 20 6b 65 79 20 74 68 65  a public key the
6a90: 79 20 63 61 6e 20 65 78 63 68 61 6e 67 65 20 77  y can exchange w
6aa0: 69 74 68 20 6f 74 68 65 72 73 20 66 6f 72 20 75  ith others for u
6ab0: 73 65 20 69 6e 0a 65 6e 63 72 79 70 74 69 6e 67  se in.encrypting
6ac0: 20 61 6e 64 20 64 65 63 72 79 70 74 69 6e 67 20   and decrypting 
6ad0: 64 61 74 61 5c 26 2e 20 54 68 65 20 70 72 6f 63  data\&. The proc
6ae0: 65 73 73 20 69 73 20 74 68 65 20 73 65 6e 64 65  ess is the sende
6af0: 72 20 65 6e 63 72 79 70 74 73 20 74 68 65 69 72  r encrypts their
6b00: 20 64 61 74 61 0a 75 73 69 6e 67 20 74 68 65 69   data.using thei
6b10: 72 20 70 72 69 76 61 74 65 20 6b 65 79 20 61 6e  r private key an
6b20: 64 20 74 68 65 20 72 65 63 65 69 76 65 72 27 73  d the receiver's
6b30: 20 70 75 62 6c 69 63 20 6b 65 79 5c 26 2e 20 54   public key\&. T
6b40: 68 65 20 64 61 74 61 20 69 73 20 74 68 65 6e 20  he data is then 
6b50: 73 65 6e 74 0a 74 6f 20 74 68 65 20 72 65 63 65  sent.to the rece
6b60: 69 76 65 72 5c 26 2e 20 49 6e 20 61 20 73 69 6d  iver\&. In a sim
6b70: 69 6c 61 72 20 6d 61 6e 6e 65 72 2c 20 74 68 65  ilar manner, the
6b80: 20 72 65 63 65 69 76 65 72 20 75 73 65 73 20 74   receiver uses t
6b90: 68 65 69 72 20 70 72 69 76 61 74 65 20 6b 65 79  heir private key
6ba0: 20 61 6e 64 0a 74 68 65 20 73 65 6e 64 65 72 27   and.the sender'
6bb0: 73 20 70 75 62 6c 69 63 20 6b 65 79 20 74 6f 20  s public key to 
6bc0: 64 65 63 72 79 70 74 20 74 68 65 20 64 61 74 61  decrypt the data
6bd0: 5c 26 2e 20 54 68 69 73 20 70 72 6f 76 69 64 65  \&. This provide
6be0: 73 20 64 61 74 61 20 69 6e 74 65 67 72 69 74 79  s data integrity
6bf0: 2c 20 74 6f 0a 65 6e 73 75 72 65 20 74 68 65 20  , to.ensure the 
6c00: 64 61 74 61 20 63 61 6e 27 74 20 62 65 20 76 69  data can't be vi
6c10: 65 77 65 64 20 6f 72 20 61 6c 74 65 72 65 64 20  ewed or altered 
6c20: 64 75 72 69 6e 67 20 74 72 61 6e 73 70 6f 72 74  during transport
6c30: 5c 26 2e 20 53 65 65 20 74 68 65 0a 5c 66 42 2d  \&. See the.\fB-
6c40: 6b 65 79 5c 66 52 20 61 6e 64 20 5c 66 42 2d 6b  key\fR and \fB-k
6c50: 65 79 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f 6e  eyfile\fR option
6c60: 73 20 66 6f 72 20 68 6f 77 20 74 6f 20 73 70 65  s for how to spe
6c70: 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74 65  cify the private
6c80: 20 6b 65 79 5c 26 2e 0a 41 6c 73 6f 20 73 65 65   key\&..Also see
6c90: 20 74 68 65 20 5c 66 42 2d 70 61 73 73 77 6f 72   the \fB-passwor
6ca0: 64 5c 66 52 20 6f 70 74 69 6f 6e 20 66 6f 72 20  d\fR option for 
6cb0: 68 6f 77 20 74 6f 20 70 72 6f 76 69 64 65 20 74  how to provide t
6cc0: 68 65 20 70 61 73 73 77 6f 72 64 5c 26 2e 0a 2e  he password\&...
6cd0: 50 50 0a 49 6e 20 6f 72 64 65 72 20 74 6f 20 70  PP.In order to p
6ce0: 72 6f 76 69 64 65 20 61 75 74 68 65 6e 74 69 63  rovide authentic
6cf0: 61 74 69 6f 6e 2c 20 69 5c 26 2e 65 5c 26 2e 20  ation, i\&.e\&. 
6d00: 65 6e 73 75 72 69 6e 67 20 73 6f 6d 65 6f 6e 65  ensuring someone
6d10: 20 69 73 20 77 68 6f 20 74 68 65 79 20 73 61 79   is who they say
6d20: 20 74 68 65 79 0a 61 72 65 2c 20 74 68 65 20 70   they.are, the p
6d30: 75 62 6c 69 63 20 6b 65 79 20 61 6e 64 20 75 73  ublic key and us
6d40: 65 72 20 69 64 65 6e 74 69 66 69 63 61 74 69 6f  er identificatio
6d50: 6e 20 69 6e 66 6f 20 69 73 20 73 74 6f 72 65 64  n info is stored
6d60: 20 69 6e 20 61 20 58 5c 26 2e 35 30 39 0a 63 65   in a X\&.509.ce
6d70: 72 74 69 66 69 63 61 74 65 20 61 6e 64 20 74 68  rtificate and th
6d80: 61 74 20 63 65 72 74 69 66 69 63 61 74 65 20 69  at certificate i
6d90: 73 20 61 75 74 68 65 6e 74 69 63 61 74 65 64 20  s authenticated 
6da0: 28 69 5c 26 2e 65 5c 26 2e 20 73 69 67 6e 65 64  (i\&.e\&. signed
6db0: 29 20 62 79 20 61 20 43 65 72 74 69 66 69 63 61  ) by a Certifica
6dc0: 74 65 0a 41 75 74 68 6f 72 69 74 79 20 28 43 41  te.Authority (CA
6dd0: 29 5c 26 2e 20 55 73 65 72 73 20 63 61 6e 20 74  )\&. Users can t
6de0: 68 65 6e 20 65 78 63 68 61 6e 67 65 20 74 68 65  hen exchange the
6df0: 73 65 20 63 65 72 74 69 66 69 63 61 74 65 73 20  se certificates 
6e00: 64 75 72 69 6e 67 20 74 68 65 20 54 4c 53 0a 69  during the TLS.i
6e10: 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 70 72  nitialization pr
6e20: 6f 63 65 73 73 20 61 6e 64 20 63 68 65 63 6b 20  ocess and check 
6e30: 74 68 65 6d 20 61 67 61 69 6e 73 74 20 74 68 65  them against the
6e40: 20 72 6f 6f 74 20 43 41 20 63 65 72 74 69 66 69   root CA certifi
6e50: 63 61 74 65 73 20 74 6f 20 65 6e 73 75 72 65 0a  cates to ensure.
6e60: 74 68 65 79 20 61 72 65 20 76 61 6c 69 64 5c 26  they are valid\&
6e70: 2e 20 54 68 69 73 20 69 73 20 68 61 6e 64 6c 65  . This is handle
6e80: 64 20 62 79 20 4f 70 65 6e 53 53 4c 20 76 69 61  d by OpenSSL via
6e90: 20 74 68 65 20 5c 66 42 2d 72 65 71 75 65 73 74   the \fB-request
6ea0: 5c 66 52 20 61 6e 64 0a 5c 66 42 2d 72 65 71 75  \fR and.\fB-requ
6eb0: 69 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 5c 26  ire\fR options\&
6ec0: 2e 20 53 65 65 20 74 68 65 20 5c 66 42 2d 63 61  . See the \fB-ca
6ed0: 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 64 69  dir\fR, \fB-cadi
6ee0: 72 5c 66 52 2c 20 61 6e 64 0a 5c 66 42 2d 63 61  r\fR, and.\fB-ca
6ef0: 73 74 6f 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73  store\fR options
6f00: 20 66 6f 72 20 68 6f 77 20 74 6f 20 73 70 65 63   for how to spec
6f10: 69 66 79 20 77 68 65 72 65 20 74 6f 20 66 69 6e  ify where to fin
6f20: 64 20 74 68 65 20 43 41 20 63 65 72 74 69 66 69  d the CA certifi
6f30: 63 61 74 65 73 5c 26 2e 0a 4f 70 74 69 6f 6e 61  cates\&..Optiona
6f40: 6c 6c 79 2c 20 69 6e 20 61 20 66 75 74 75 72 65  lly, in a future
6f50: 20 72 65 6c 65 61 73 65 2c 20 74 68 65 79 20 63   release, they c
6f60: 61 6e 20 61 6c 73 6f 20 62 65 20 63 68 65 63 6b  an also be check
6f70: 65 64 20 61 67 61 69 6e 73 74 20 74 68 65 20 43  ed against the C
6f80: 65 72 74 69 66 69 63 61 74 65 0a 52 65 76 6f 63  ertificate.Revoc
6f90: 61 74 69 6f 6e 20 4c 69 73 74 20 28 43 52 4c 29  ation List (CRL)
6fa0: 20 6f 66 20 72 65 76 6f 6b 65 64 20 63 65 72 74   of revoked cert
6fb0: 69 66 69 63 61 74 65 73 5c 26 2e 20 43 65 72 74  ificates\&. Cert
6fc0: 69 66 69 63 61 74 65 73 20 63 61 6e 20 61 6c 73  ificates can als
6fd0: 6f 20 62 65 0a 73 65 6c 66 2d 73 69 67 6e 65 64  o be.self-signed
6fe0: 2c 20 62 75 74 20 74 68 65 79 20 61 72 65 20 62  , but they are b
6ff0: 79 20 64 65 66 61 75 6c 74 20 6e 6f 74 20 74 72  y default not tr
7000: 75 73 74 65 64 20 75 6e 6c 65 73 73 20 79 6f 75  usted unless you
7010: 20 61 64 64 20 74 68 65 6d 20 74 6f 20 79 6f 75   add them to you
7020: 72 0a 63 65 72 74 69 66 69 63 61 74 65 20 73 74  r.certificate st
7030: 6f 72 65 5c 26 2e 0a 2e 50 50 0a 54 79 70 69 63  ore\&...PP.Typic
7040: 61 6c 6c 79 20 77 68 65 6e 20 76 69 73 69 74 69  ally when visiti
7050: 6e 67 20 77 65 62 20 73 69 74 65 73 2c 20 6f 6e  ng web sites, on
7060: 6c 79 20 74 68 65 20 63 6c 69 65 6e 74 20 6e 65  ly the client ne
7070: 65 64 73 20 74 6f 20 63 68 65 63 6b 20 74 68 65  eds to check the
7080: 20 73 65 72 76 65 72 27 73 0a 63 65 72 74 69 66   server's.certif
7090: 69 63 61 74 65 20 74 6f 20 65 6e 73 75 72 65 20  icate to ensure 
70a0: 69 74 20 69 73 20 76 61 6c 69 64 5c 26 2e 20 54  it is valid\&. T
70b0: 68 65 20 73 65 72 76 65 72 20 64 6f 65 73 6e 27  he server doesn'
70c0: 74 20 6e 65 65 64 20 74 6f 20 63 68 65 63 6b 20  t need to check 
70d0: 74 68 65 20 63 6c 69 65 6e 74 0a 63 65 72 74 69  the client.certi
70e0: 66 69 63 61 74 65 20 75 6e 6c 65 73 73 20 79 6f  ficate unless yo
70f0: 75 20 6e 65 65 64 20 74 6f 20 61 75 74 68 65 6e  u need to authen
7100: 74 69 63 61 74 65 20 77 69 74 68 20 74 68 65 6d  ticate with them
7110: 20 74 6f 20 6c 6f 67 69 6e 2c 20 65 74 63 5c 26   to login, etc\&
7120: 2e 20 53 65 65 20 74 68 65 0a 5c 66 42 2d 63 65  . See the.\fB-ce
7130: 72 74 5c 66 52 20 61 6e 64 20 5c 66 42 2d 63 65  rt\fR and \fB-ce
7140: 72 74 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f 6e  rtfile\fR option
7150: 73 20 69 66 20 79 6f 75 20 6e 65 65 64 20 74 6f  s if you need to
7160: 20 70 72 6f 76 69 64 65 20 61 20 63 65 72 74 69   provide a certi
7170: 66 69 63 61 74 65 5c 26 2e 0a 2e 53 53 20 22 53  ficate\&...SS "S
7180: 55 4d 4d 41 52 59 20 4f 46 20 43 4f 4d 4d 41 4e  UMMARY OF COMMAN
7190: 44 20 4c 49 4e 45 20 4f 50 54 49 4f 4e 53 22 0a  D LINE OPTIONS".
71a0: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6f 70  The following op
71b0: 74 69 6f 6e 73 20 61 72 65 20 75 73 65 64 20 66  tions are used f
71c0: 6f 72 20 70 65 65 72 20 63 65 72 74 69 66 69 63  or peer certific
71d0: 61 74 65 20 76 61 6c 69 64 61 74 69 6f 6e 3a 0a  ate validation:.
71e0: 2e 54 50 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52  .TP.\fB-cadir\fR
71f0: 20 5c 66 49 64 69 72 65 63 74 6f 72 79 5c 66 52   \fIdirectory\fR
7200: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 64  .Specifies the d
7210: 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 74  irectory where t
7220: 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20 41  he Certificate A
7230: 75 74 68 6f 72 69 74 79 20 28 43 41 29 20 63 65  uthority (CA) ce
7240: 72 74 69 66 69 63 61 74 65 73 20 61 72 65 0a 73  rtificates are.s
7250: 74 6f 72 65 64 5c 26 2e 20 54 68 65 20 64 65 66  tored\&. The def
7260: 61 75 6c 74 20 69 73 20 70 6c 61 74 66 6f 72 6d  ault is platform
7270: 20 73 70 65 63 69 66 69 63 2c 20 62 75 74 20 69   specific, but i
7280: 73 20 75 73 75 61 6c 6c 79 20 22 5c 66 49 2f 65  s usually "\fI/e
7290: 74 63 2f 73 73 6c 2f 63 65 72 74 73 5c 66 52 22  tc/ssl/certs\fR"
72a0: 20 6f 6e 0a 4c 69 6e 75 78 2f 55 6e 69 78 20 73   on.Linux/Unix s
72b0: 79 73 74 65 6d 73 5c 26 2e 20 54 68 65 20 64 65  ystems\&. The de
72c0: 66 61 75 6c 74 20 6c 6f 63 61 74 69 6f 6e 20 63  fault location c
72d0: 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e  an be overridden
72e0: 20 62 79 20 74 68 65 0a 5c 66 42 53 53 4c 5f 43   by the.\fBSSL_C
72f0: 45 52 54 5f 44 49 52 5c 66 52 20 65 6e 76 69 72  ERT_DIR\fR envir
7300: 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 5c  onment variable\
7310: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 66 69 6c  &...TP.\fB-cafil
7320: 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65  e\fR \fIfilename
7330: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
7340: 65 20 66 69 6c 65 20 77 69 74 68 20 74 68 65 20  e file with the 
7350: 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68  Certificate Auth
7360: 6f 72 69 74 79 20 28 43 41 29 20 63 65 72 74 69  ority (CA) certi
7370: 66 69 63 61 74 65 73 20 74 6f 20 75 73 65 20 69  ficates to use i
7380: 6e 0a 5c 66 42 50 45 4d 5c 66 52 20 66 69 6c 65  n.\fBPEM\fR file
7390: 20 66 6f 72 6d 61 74 5c 26 2e 20 54 68 65 20 64   format\&. The d
73a0: 65 66 61 75 6c 74 20 69 73 20 22 5c 66 49 63 65  efault is "\fIce
73b0: 72 74 5c 26 2e 70 65 6d 5c 66 52 22 2c 20 69 6e  rt\&.pem\fR", in
73c0: 20 74 68 65 20 4f 70 65 6e 53 53 4c 0a 64 69 72   the OpenSSL.dir
73d0: 65 63 74 6f 72 79 5c 26 2e 20 4f 6e 20 4c 69 6e  ectory\&. On Lin
73e0: 75 78 2f 55 6e 69 78 20 73 79 73 74 65 6d 73 2c  ux/Unix systems,
73f0: 20 74 68 69 73 20 69 73 20 75 73 75 61 6c 6c 79   this is usually
7400: 20 22 5c 66 49 2f 65 74 63 2f 73 73 6c 2f 63 61   "\fI/etc/ssl/ca
7410: 2d 62 75 6e 64 6c 65 5c 26 2e 70 65 6d 5c 66 52  -bundle\&.pem\fR
7420: 22 5c 26 2e 0a 54 68 65 20 64 65 66 61 75 6c 74  "\&..The default
7430: 20 66 69 6c 65 20 63 61 6e 20 62 65 20 6f 76 65   file can be ove
7440: 72 72 69 64 64 65 6e 20 62 79 20 74 68 65 20 5c  rridden by the \
7450: 66 42 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c  fBSSL_CERT_FILE\
7460: 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 76  fR environment.v
7470: 61 72 69 61 62 6c 65 5c 26 2e 0a 2e 54 50 0a 5c  ariable\&...TP.\
7480: 66 42 2d 63 61 73 74 6f 72 65 5c 66 52 20 5c 66  fB-castore\fR \f
7490: 49 55 52 49 5c 66 52 0a 53 70 65 63 69 66 69 65  IURI\fR.Specifie
74a0: 73 20 74 68 65 20 55 6e 69 66 6f 72 6d 20 52 65  s the Uniform Re
74b0: 73 6f 75 72 63 65 20 49 64 65 6e 74 69 66 69 65  source Identifie
74c0: 72 20 28 55 52 49 29 20 66 6f 72 20 74 68 65 20  r (URI) for the 
74d0: 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68  Certificate Auth
74e0: 6f 72 69 74 79 0a 28 43 41 29 20 73 74 6f 72 65  ority.(CA) store
74f0: 2c 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61  , which may be a
7500: 20 73 69 6e 67 6c 65 20 63 6f 6e 74 61 69 6e 65   single containe
7510: 72 20 6f 72 20 61 20 63 61 74 61 6c 6f 67 20 6f  r or a catalog o
7520: 66 20 63 6f 6e 74 61 69 6e 65 72 73 5c 26 2e 0a  f containers\&..
7530: 53 74 61 72 74 69 6e 67 20 77 69 74 68 20 4f 70  Starting with Op
7540: 65 6e 53 53 4c 20 33 5c 26 2e 32 20 6f 6e 20 4d  enSSL 3\&.2 on M
7550: 53 20 57 69 6e 64 6f 77 73 2c 20 73 65 74 20 74  S Windows, set t
7560: 6f 20 22 5c 66 42 6f 72 67 5c 26 2e 6f 70 65 6e  o "\fBorg\&.open
7570: 73 73 6c 5c 26 2e 77 69 6e 73 74 6f 72 65 3a 2f  ssl\&.winstore:/
7580: 2f 5c 66 52 22 0a 74 6f 20 75 73 65 20 74 68 65  /\fR".to use the
7590: 20 62 75 69 6c 74 2d 69 6e 20 4d 53 20 57 69 6e   built-in MS Win
75a0: 64 6f 77 73 20 43 65 72 74 69 66 69 63 61 74 65  dows Certificate
75b0: 20 53 74 6f 72 65 5c 26 2e 20 53 74 61 72 74 69   Store\&. Starti
75c0: 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c 26  ng in TclTLS 2\&
75d0: 2e 30 2c 20 74 68 69 73 0a 69 73 20 74 68 65 20  .0, this.is the 
75e0: 64 65 66 61 75 6c 74 20 69 66 20 5c 66 42 2d 63  default if \fB-c
75f0: 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 64  adir\fR, \fB-cad
7600: 69 72 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d 63  ir\fR, and \fB-c
7610: 61 73 74 6f 72 65 5c 66 52 20 61 72 65 0a 6e 6f  astore\fR are.no
7620: 74 20 73 70 65 63 69 66 69 65 64 5c 26 2e 20 54  t specified\&. T
7630: 68 69 73 20 73 74 6f 72 65 20 6f 6e 6c 79 20 73  his store only s
7640: 75 70 70 6f 72 74 73 20 72 6f 6f 74 20 63 65 72  upports root cer
7650: 74 69 66 69 63 61 74 65 20 73 74 6f 72 65 73 5c  tificate stores\
7660: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75 65  &...TP.\fB-reque
7670: 73 74 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52  st\fR \fIbool\fR
7680: 0a 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69  .Request a certi
7690: 66 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65 20  ficate from the 
76a0: 70 65 65 72 20 64 75 72 69 6e 67 20 74 68 65 20  peer during the 
76b0: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e  SSL handshake\&.
76c0: 20 54 68 69 73 20 69 73 20 6e 65 65 64 65 64 0a   This is needed.
76d0: 74 6f 20 64 6f 20 43 65 72 74 69 66 69 63 61 74  to do Certificat
76e0: 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 26 2e 20  e Validation\&. 
76f0: 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54  Starting in TclT
7700: 4c 53 20 31 5c 26 2e 38 2c 20 74 68 65 20 64 65  LS 1\&.8, the de
7710: 66 61 75 6c 74 20 69 73 0a 5c 66 42 74 72 75 65  fault is.\fBtrue
7720: 5c 66 52 20 66 6f 72 20 63 6c 69 65 6e 74 20 63  \fR for client c
7730: 6f 6e 6e 65 63 74 69 6f 6e 73 5c 26 2e 20 53 74  onnections\&. St
7740: 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53  arting in TclTLS
7750: 20 32 5c 26 2e 30 2c 20 69 66 20 73 65 74 20 74   2\&.0, if set t
7760: 6f 0a 5c 66 42 66 61 6c 73 65 5c 66 52 20 61 6e  o.\fBfalse\fR an
7770: 64 20 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52  d \fB-require\fR
7780: 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 2c 20   is \fBtrue\fR, 
7790: 74 68 65 6e 20 74 68 69 73 20 77 69 6c 6c 20 62  then this will b
77a0: 65 0a 6f 76 65 72 72 69 64 64 65 6e 20 74 6f 20  e.overridden to 
77b0: 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 49 6e  \fBtrue\fR\&. In
77c0: 20 61 64 64 69 74 69 6f 6e 2c 20 74 68 65 20 63   addition, the c
77d0: 6c 69 65 6e 74 20 63 61 6e 20 6d 61 6e 75 61 6c  lient can manual
77e0: 6c 79 20 69 6e 73 70 65 63 74 20 61 6e 64 0a 61  ly inspect and.a
77f0: 63 63 65 70 74 20 6f 72 20 72 65 6a 65 63 74 20  ccept or reject 
7800: 65 61 63 68 20 63 65 72 74 69 66 69 63 61 74 65  each certificate
7810: 20 75 73 69 6e 67 20 74 68 65 20 5c 66 42 2d 76   using the \fB-v
7820: 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66  alidatecommand\f
7830: 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a  R option\&...TP.
7840: 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52 20 5c  \fB-require\fR \
7850: 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75 69 72  fIbool\fR.Requir
7860: 65 20 61 20 76 61 6c 69 64 20 63 65 72 74 69 66  e a valid certif
7870: 69 63 61 74 65 20 66 72 6f 6d 20 74 68 65 20 70  icate from the p
7880: 65 65 72 20 64 75 72 69 6e 67 20 74 68 65 20 53  eer during the S
7890: 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e 20  SL handshake\&. 
78a0: 49 66 20 74 68 69 73 20 69 73 0a 73 65 74 20 74  If this is.set t
78b0: 6f 20 74 72 75 65 2c 20 74 68 65 6e 20 5c 66 42  o true, then \fB
78c0: 2d 72 65 71 75 65 73 74 5c 66 52 20 6d 75 73 74  -request\fR must
78d0: 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 6f 20   also be set to 
78e0: 74 72 75 65 20 61 6e 64 20 61 20 65 69 74 68 65  true and a eithe
78f0: 72 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c 20  r.\fB-cadir\fR, 
7900: 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52 2c 20 5c  \fB-cafile\fR, \
7910: 66 42 2d 63 61 73 74 6f 72 65 5c 66 52 2c 20 6f  fB-castore\fR, o
7920: 72 20 61 20 70 6c 61 74 66 6f 72 6d 20 64 65 66  r a platform def
7930: 61 75 6c 74 0a 6d 75 73 74 20 62 65 20 70 72 6f  ault.must be pro
7940: 76 69 64 65 64 20 69 6e 20 6f 72 64 65 72 20 74  vided in order t
7950: 6f 20 76 61 6c 69 64 61 74 65 20 61 67 61 69 6e  o validate again
7960: 73 74 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  st\&. The defaul
7970: 74 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e  t in TclTLS 1\&.
7980: 38 20 61 6e 64 0a 65 61 72 6c 69 65 72 20 76 65  8 and.earlier ve
7990: 72 73 69 6f 6e 73 20 69 73 20 5c 66 42 66 61 6c  rsions is \fBfal
79a0: 73 65 5c 66 52 20 73 69 6e 63 65 20 6e 6f 74 20  se\fR since not 
79b0: 61 6c 6c 20 70 6c 61 74 66 6f 72 6d 73 20 68 61  all platforms ha
79c0: 76 65 20 63 65 72 74 69 66 69 63 61 74 65 73 20  ve certificates 
79d0: 74 6f 0a 76 61 6c 69 64 61 74 65 20 61 67 61 69  to.validate agai
79e0: 6e 73 74 20 69 6e 20 61 20 66 6f 72 6d 20 63 6f  nst in a form co
79f0: 6d 70 61 74 69 62 6c 65 20 77 69 74 68 20 4f 70  mpatible with Op
7a00: 65 6e 53 53 4c 5c 26 2e 20 53 74 61 72 74 69 6e  enSSL\&. Startin
7a10: 67 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c 26 2e  g in TclTLS 2\&.
7a20: 30 2c 0a 74 68 65 20 64 65 66 61 75 6c 74 20 69  0,.the default i
7a30: 73 20 5c 66 42 74 72 75 65 5c 66 52 20 66 6f 72  s \fBtrue\fR for
7a40: 20 63 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74 69   client connecti
7a50: 6f 6e 73 5c 26 2e 0a 2e 50 50 0a 2e 53 53 20 22  ons\&...PP..SS "
7a60: 57 48 45 4e 20 41 52 45 20 43 4f 4d 4d 41 4e 44  WHEN ARE COMMAND
7a70: 20 4c 49 4e 45 20 4f 50 54 49 4f 4e 53 20 4e 45   LINE OPTIONS NE
7a80: 45 44 45 44 3f 22 0a 49 6e 20 54 63 6c 54 4c 53  EDED?".In TclTLS
7a90: 20 31 5c 26 2e 38 20 61 6e 64 20 65 61 72 6c 69   1\&.8 and earli
7aa0: 65 72 20 76 65 72 73 69 6f 6e 73 2c 20 63 65 72  er versions, cer
7ab0: 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 61 74  tificate validat
7ac0: 69 6f 6e 20 69 73 0a 5c 66 49 4e 4f 54 5c 66 52  ion is.\fINOT\fR
7ad0: 20 65 6e 61 62 6c 65 64 20 62 79 20 64 65 66 61   enabled by defa
7ae0: 75 6c 74 5c 26 2e 20 54 68 69 73 20 6c 69 6d 69  ult\&. This limi
7af0: 74 61 74 69 6f 6e 20 69 73 20 64 75 65 20 74 6f  tation is due to
7b00: 20 74 68 65 20 6c 61 63 6b 20 6f 66 20 61 20 63   the lack of a c
7b10: 6f 6d 6d 6f 6e 0a 63 72 6f 73 73 20 70 6c 61 74  ommon.cross plat
7b20: 66 6f 72 6d 20 64 61 74 61 62 61 73 65 20 6f 66  form database of
7b30: 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74   Certificate Aut
7b40: 68 6f 72 69 74 79 20 28 43 41 29 20 70 72 6f 76  hority (CA) prov
7b50: 69 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65  ided certificate
7b60: 73 20 74 6f 0a 76 61 6c 69 64 61 74 65 20 61 67  s to.validate ag
7b70: 61 69 6e 73 74 5c 26 2e 20 4d 61 6e 79 20 4c 69  ainst\&. Many Li
7b80: 6e 75 78 20 73 79 73 74 65 6d 73 20 6e 61 74 69  nux systems nati
7b90: 76 65 6c 79 20 73 75 70 70 6f 72 74 20 4f 70 65  vely support Ope
7ba0: 6e 53 53 4c 20 61 6e 64 20 74 68 75 73 20 68 61  nSSL and thus ha
7bb0: 76 65 0a 74 68 65 73 65 20 63 65 72 74 69 66 69  ve.these certifi
7bc0: 63 61 74 65 73 20 69 6e 73 74 61 6c 6c 65 64 20  cates installed 
7bd0: 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 4f  as part of the O
7be0: 53 2c 20 62 75 74 20 4d 61 63 4f 53 20 61 6e 64  S, but MacOS and
7bf0: 20 4d 53 20 57 69 6e 64 6f 77 73 20 64 6f 20 6e   MS Windows do n
7c00: 6f 74 5c 26 2e 0a 53 74 61 72 69 6e 67 20 69 6e  ot\&..Staring in
7c10: 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74   TclTLS 2\&.0, t
7c20: 68 65 20 64 65 66 61 75 6c 74 20 66 6f 72 20 63  he default for c
7c30: 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e  lient connection
7c40: 73 20 68 61 73 20 62 65 65 6e 20 63 68 61 6e 67  s has been chang
7c50: 65 64 20 74 6f 0a 72 65 71 75 69 72 65 20 63 65  ed to.require ce
7c60: 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 61  rtificate valida
7c70: 74 69 6f 6e 20 62 79 20 64 65 66 61 75 6c 74 5c  tion by default\
7c80: 26 2e 20 49 6e 20 6f 72 64 65 72 20 74 6f 20 75  &. In order to u
7c90: 73 65 20 74 68 65 20 5c 66 42 2d 72 65 71 75 69  se the \fB-requi
7ca0: 72 65 5c 66 52 0a 6f 70 74 69 6f 6e 2c 20 6f 6e  re\fR.option, on
7cb0: 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77 69  e of the followi
7cc0: 6e 67 20 6d 75 73 74 20 62 65 20 74 72 75 65 3a  ng must be true:
7cd0: 0a 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4c 69 6e  ..IP \(bu.On Lin
7ce0: 75 78 20 61 6e 64 20 55 6e 69 78 20 73 79 73 74  ux and Unix syst
7cf0: 65 6d 73 20 77 69 74 68 20 4f 70 65 6e 53 53 4c  ems with OpenSSL
7d00: 20 61 6c 72 65 61 64 79 20 69 6e 73 74 61 6c 6c   already install
7d10: 65 64 20 6f 72 20 69 66 20 74 68 65 20 43 41 0a  ed or if the CA.
7d20: 63 65 72 74 69 66 69 63 61 74 65 73 20 61 72 65  certificates are
7d30: 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 50 45   available in PE
7d40: 4d 20 66 6f 72 6d 61 74 2c 20 61 6e 64 20 69 66  M format, and if
7d50: 20 74 68 65 79 20 61 72 65 20 73 74 6f 72 65 64   they are stored
7d60: 20 69 6e 20 74 68 65 0a 73 74 61 6e 64 61 72 64   in the.standard
7d70: 20 6c 6f 63 61 74 69 6f 6e 73 2c 20 6f 72 20 69   locations, or i
7d80: 66 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45 52  f the \fBSSL_CER
7d90: 54 5f 44 49 52 5c 66 52 20 6f 72 20 5c 66 42 53  T_DIR\fR or \fBS
7da0: 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52 0a  SL_CERT_FILE\fR.
7db0: 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69  environment vari
7dc0: 61 62 6c 65 73 20 61 72 65 20 73 65 74 2c 20 74  ables are set, t
7dd0: 68 65 6e 20 5c 66 42 2d 63 61 64 69 72 5c 66 52  hen \fB-cadir\fR
7de0: 2c 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c 0a  , \fB-cadir\fR,.
7df0: 61 6e 64 20 5c 66 42 2d 63 61 73 74 6f 72 65 5c  and \fB-castore\
7e00: 66 52 20 61 72 65 6e 27 74 20 6e 65 65 64 65 64  fR aren't needed
7e10: 5c 26 2e 0a 2e 49 50 20 5c 28 62 75 0a 49 66 20  \&...IP \(bu.If 
7e20: 4f 70 65 6e 53 53 4c 20 69 73 20 6e 6f 74 20 69  OpenSSL is not i
7e30: 6e 73 74 61 6c 6c 65 64 20 69 6e 20 74 68 65 20  nstalled in the 
7e40: 64 65 66 61 75 6c 74 20 6c 6f 63 61 74 69 6f 6e  default location
7e50: 2c 20 6f 72 20 77 68 65 6e 20 75 73 69 6e 67 20  , or when using 
7e60: 4d 61 63 20 4f 53 0a 6f 72 20 4d 53 20 57 69 6e  Mac OS.or MS Win
7e70: 64 6f 77 73 20 61 6e 64 20 4f 70 65 6e 53 53 4c  dows and OpenSSL
7e80: 20 69 73 20 69 6e 73 74 61 6c 6c 65 64 2c 20 74   is installed, t
7e90: 68 65 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44  he \fBSSL_CERT_D
7ea0: 49 52 5c 66 52 20 61 6e 64 2f 6f 72 0a 5c 66 42  IR\fR and/or.\fB
7eb0: 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52  SSL_CERT_FILE\fR
7ec0: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72   environment var
7ed0: 69 61 62 6c 65 73 20 6f 72 20 74 68 65 20 6f 6e  iables or the on
7ee0: 65 20 6f 66 20 74 68 65 20 5c 66 42 2d 63 61 64  e of the \fB-cad
7ef0: 69 72 5c 66 52 2c 0a 5c 66 42 2d 63 61 64 69 72  ir\fR,.\fB-cadir
7f00: 5c 66 52 2c 20 6f 72 20 5c 66 42 2d 63 61 73 74  \fR, or \fB-cast
7f10: 6f 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 6d  ore\fR options m
7f20: 75 73 74 20 62 65 20 64 65 66 69 6e 65 64 5c 26  ust be defined\&
7f30: 2e 0a 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4d 53  ...IP \(bu.On MS
7f40: 20 57 69 6e 64 6f 77 73 2c 20 73 74 61 72 74 69   Windows, starti
7f50: 6e 67 20 69 6e 20 4f 70 65 6e 53 53 4c 20 33 5c  ng in OpenSSL 3\
7f60: 26 2e 32 2c 20 69 74 20 69 73 20 6e 6f 77 20 70  &.2, it is now p
7f70: 6f 73 73 69 62 6c 65 20 74 6f 20 61 63 63 65 73  ossible to acces
7f80: 73 20 74 68 65 0a 62 75 69 6c 74 2d 69 6e 20 57  s the.built-in W
7f90: 69 6e 64 6f 77 73 20 43 65 72 74 69 66 69 63 61  indows Certifica
7fa0: 74 65 20 53 74 6f 72 65 20 66 72 6f 6d 20 4f 70  te Store from Op
7fb0: 65 6e 53 53 4c 5c 26 2e 20 54 68 69 73 20 63 61  enSSL\&. This ca
7fc0: 6e 20 62 65 20 75 74 69 6c 69 7a 65 64 20 62 79  n be utilized by
7fd0: 0a 73 65 74 74 69 6e 67 20 74 68 65 20 5c 66 42  .setting the \fB
7fe0: 2d 63 61 73 74 6f 72 65 5c 66 52 20 6f 70 74 69  -castore\fR opti
7ff0: 6f 6e 20 74 6f 20 22 5c 66 42 6f 72 67 5c 26 2e  on to "\fBorg\&.
8000: 6f 70 65 6e 73 73 6c 5c 26 2e 77 69 6e 73 74 6f  openssl\&.winsto
8010: 72 65 3a 2f 2f 5c 66 52 22 5c 26 2e 0a 49 6e 20  re://\fR"\&..In 
8020: 54 63 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68  TclTLS 2\&.0, th
8030: 69 73 20 69 73 20 74 68 65 20 64 65 66 61 75 6c  is is the defaul
8040: 74 20 76 61 6c 75 65 20 69 66 20 5c 66 42 2d 63  t value if \fB-c
8050: 61 64 69 72 5c 66 52 2c 0a 5c 66 42 2d 63 61 64  adir\fR,.\fB-cad
8060: 69 72 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d 63  ir\fR, and \fB-c
8070: 61 73 74 6f 72 65 5c 66 52 20 61 72 65 20 6e 6f  astore\fR are no
8080: 74 20 73 70 65 63 69 66 69 65 64 5c 26 2e 0a 2e  t specified\&...
8090: 49 50 20 5c 28 62 75 0a 49 66 20 4f 70 65 6e 53  IP \(bu.If OpenS
80a0: 53 4c 20 69 73 20 6e 6f 74 20 69 6e 73 74 61 6c  SL is not instal
80b0: 6c 65 64 20 6f 72 20 74 68 65 20 43 41 20 63 65  led or the CA ce
80c0: 72 74 69 66 69 63 61 74 65 73 20 61 72 65 20 6e  rtificates are n
80d0: 6f 74 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20  ot available in 
80e0: 50 45 4d 0a 66 6f 72 6d 61 74 2c 20 74 68 65 20  PEM.format, the 
80f0: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73 20  CA certificates 
8100: 6d 75 73 74 20 62 65 20 64 6f 77 6e 6c 6f 61 64  must be download
8110: 65 64 20 61 6e 64 20 69 6e 73 74 61 6c 6c 65 64  ed and installed
8120: 20 77 69 74 68 20 74 68 65 20 75 73 65 72 0a 73   with the user.s
8130: 6f 66 74 77 61 72 65 5c 26 2e 20 54 68 65 20 43  oftware\&. The C
8140: 55 52 4c 20 74 65 61 6d 20 6d 61 6b 65 73 20 74  URL team makes t
8150: 68 65 6d 20 61 76 61 69 6c 61 62 6c 65 20 61 74  hem available at
8160: 0a 5c 66 49 43 41 20 63 65 72 74 69 66 69 63 61  .\fICA certifica
8170: 74 65 73 20 65 78 74 72 61 63 74 65 64 0a 66 72  tes extracted.fr
8180: 6f 6d 20 4d 6f 7a 69 6c 6c 61 5c 66 52 20 5b 68  om Mozilla\fR [h
8190: 74 74 70 73 3a 2f 2f 63 75 72 6c 5c 26 2e 73 65  ttps://curl\&.se
81a0: 2f 64 6f 63 73 2f 63 61 65 78 74 72 61 63 74 5c  /docs/caextract\
81b0: 26 2e 68 74 6d 6c 5d 20 69 6e 20 74 68 65 20 22  &.html] in the "
81c0: 5c 66 49 63 61 63 65 72 74 5c 26 2e 70 65 6d 5c  \fIcacert\&.pem\
81d0: 66 52 22 20 66 69 6c 65 5c 26 2e 20 59 6f 75 20  fR" file\&. You 
81e0: 6d 75 73 74 20 74 68 65 6e 20 65 69 74 68 65 72  must then either
81f0: 20 73 65 74 20 74 68 65 0a 5c 66 42 53 53 4c 5f   set the.\fBSSL_
8200: 43 45 52 54 5f 44 49 52 5c 66 52 20 61 6e 64 2f  CERT_DIR\fR and/
8210: 6f 72 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f 46  or \fBSSL_CERT_F
8220: 49 4c 45 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65  ILE\fR environme
8230: 6e 74 20 76 61 72 69 61 62 6c 65 73 20 6f 72 20  nt variables or 
8240: 74 68 65 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52  the.\fB-cadir\fR
8250: 20 6f 72 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66   or \fB-cafile\f
8260: 52 20 6f 70 74 69 6f 6e 73 20 74 6f 20 74 68 65  R options to the
8270: 20 43 41 20 63 65 72 74 20 66 69 6c 65 27 73 20   CA cert file's 
8280: 69 6e 73 74 61 6c 6c 0a 6c 6f 63 61 74 69 6f 6e  install.location
8290: 5c 26 2e 20 49 74 20 69 73 20 79 6f 75 72 20 72  \&. It is your r
82a0: 65 73 70 6f 6e 73 69 62 69 6c 69 74 79 20 74 6f  esponsibility to
82b0: 20 6b 65 65 70 20 74 68 69 73 20 66 69 6c 65 20   keep this file 
82c0: 75 70 20 74 6f 20 64 61 74 65 5c 26 2e 0a 2e 50  up to date\&...P
82d0: 50 0a 2e 53 48 20 22 43 41 4c 4c 42 41 43 4b 20  P..SH "CALLBACK 
82e0: 4f 50 54 49 4f 4e 53 22 0a 41 73 20 70 72 65 76  OPTIONS".As prev
82f0: 69 6f 75 73 6c 79 20 64 65 73 63 72 69 62 65 64  iously described
8300: 2c 20 65 61 63 68 20 63 68 61 6e 6e 65 6c 20 63  , each channel c
8310: 61 6e 20 62 65 20 67 69 76 65 6e 20 74 68 65 69  an be given thei
8320: 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 73 0a  r own callbacks.
8330: 74 6f 20 68 61 6e 64 6c 65 20 69 6e 74 65 72 6d  to handle interm
8340: 65 64 69 61 74 65 20 70 72 6f 63 65 73 73 69 6e  ediate processin
8350: 67 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c  g by the OpenSSL
8360: 20 6c 69 62 72 61 72 79 2c 20 75 73 69 6e 67 20   library, using 
8370: 74 68 65 0a 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c  the.\fB-command\
8380: 66 52 2c 20 5c 66 42 2d 70 61 73 73 77 6f 72 64  fR, \fB-password
8390: 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d 76 61 6c  \fR, and \fB-val
83a0: 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52  idate_command\fR
83b0: 20 6f 70 74 69 6f 6e 73 0a 70 61 73 73 65 64 20   options.passed 
83c0: 74 6f 20 65 69 74 68 65 72 20 6f 66 20 5c 66 42  to either of \fB
83d0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66 52 20 6f  tls::socket\fR o
83e0: 72 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74  r \fBtls::import
83f0: 5c 66 52 5c 26 2e 0a 55 6e 6c 69 6b 65 20 70 72  \fR\&..Unlike pr
8400: 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 73 20  evious versions 
8410: 6f 66 20 54 63 6c 54 4c 53 2c 20 6f 6e 6c 79 20  of TclTLS, only 
8420: 69 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20  if the callback 
8430: 67 65 6e 65 72 61 74 65 73 20 61 6e 20 65 72 72  generates an err
8440: 6f 72 2c 0a 77 69 6c 6c 20 74 68 65 20 5c 66 42  or,.will the \fB
8450: 62 67 65 72 72 6f 72 5c 66 52 20 63 6f 6d 6d 61  bgerror\fR comma
8460: 6e 64 20 62 65 20 69 6e 76 6f 6b 65 64 20 77 69  nd be invoked wi
8470: 74 68 20 74 68 65 20 65 72 72 6f 72 20 69 6e 66  th the error inf
8480: 6f 72 6d 61 74 69 6f 6e 5c 26 2e 0a 2e 53 53 20  ormation\&...SS 
8490: 22 56 41 4c 55 45 53 20 46 4f 52 20 43 4f 4d 4d  "VALUES FOR COMM
84a0: 41 4e 44 20 43 41 4c 4c 42 41 43 4b 22 0a 54 68  AND CALLBACK".Th
84b0: 65 20 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20 74  e callback for t
84c0: 68 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66  he \fB-command\f
84d0: 52 20 6f 70 74 69 6f 6e 20 69 73 20 69 6e 76 6f  R option is invo
84e0: 6b 65 64 20 61 74 20 73 65 76 65 72 61 6c 20 70  ked at several p
84f0: 6f 69 6e 74 73 20 64 75 72 69 6e 67 20 74 68 65  oints during the
8500: 0a 4f 70 65 6e 53 53 4c 20 68 61 6e 64 73 68 61  .OpenSSL handsha
8510: 6b 65 20 61 6e 64 20 64 75 72 69 6e 67 20 72 6f  ke and during ro
8520: 75 74 69 6e 65 20 6f 70 65 72 61 74 69 6f 6e 73  utine operations
8530: 5c 26 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f  \&. See below fo
8540: 72 20 74 68 65 20 70 6f 73 73 69 62 6c 65 0a 61  r the possible.a
8550: 72 67 75 6d 65 6e 74 73 20 70 61 73 73 65 64 20  rguments passed 
8560: 74 6f 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20  to the callback 
8570: 73 63 72 69 70 74 5c 26 2e 20 56 61 6c 75 65 73  script\&. Values
8580: 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 74   returned from t
8590: 68 65 20 63 61 6c 6c 62 61 63 6b 20 61 72 65 0a  he callback are.
85a0: 69 67 6e 6f 72 65 64 5c 26 2e 0a 2e 54 50 0a 5c  ignored\&...TP.\
85b0: 66 42 65 72 72 6f 72 5c 66 52 20 5c 66 49 63 68  fBerror\fR \fIch
85c0: 61 6e 6e 65 6c 49 64 20 6d 65 73 73 61 67 65 5c  annelId message\
85d0: 66 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66 20  fR.This form of 
85e0: 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f  callback is invo
85f0: 6b 65 64 20 77 68 65 6e 65 76 65 72 20 61 6e 20  ked whenever an 
8600: 65 72 72 6f 72 20 6f 63 63 75 72 73 20 64 75 72  error occurs dur
8610: 69 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c 0a  ing the initial.
8620: 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 68 61 6e 64  connection, hand
8630: 73 68 61 6b 65 2c 20 6f 72 20 49 2f 4f 20 6f 70  shake, or I/O op
8640: 65 72 61 74 69 6f 6e 73 5c 26 2e 20 54 68 65 20  erations\&. The 
8650: 5c 66 49 6d 65 73 73 61 67 65 5c 66 52 20 61 72  \fImessage\fR ar
8660: 67 75 6d 65 6e 74 20 63 61 6e 20 62 65 0a 66 72  gument can be.fr
8670: 6f 6d 20 74 68 65 20 54 63 6c 5f 45 72 72 6e 6f  om the Tcl_Errno
8680: 4d 73 67 2c 20 4f 70 65 6e 53 53 4c 20 66 75 6e  Msg, OpenSSL fun
8690: 63 74 69 6f 6e 20 5c 66 42 45 52 52 5f 72 65 61  ction \fBERR_rea
86a0: 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 69 6e 67  son_error_string
86b0: 28 29 5c 66 52 2c 0a 6f 72 20 61 20 63 75 73 74  ()\fR,.or a cust
86c0: 6f 6d 20 6d 65 73 73 61 67 65 5c 26 2e 20 54 68  om message\&. Th
86d0: 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e  is callback is n
86e0: 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c  ew for TclTLS 1\
86f0: 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69 6e  &.8\&...TP.\fBin
8700: 66 6f 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  fo\fR \fIchannel
8710: 49 64 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 6d  Id major minor m
8720: 65 73 73 61 67 65 20 74 79 70 65 5c 66 52 0a 54  essage type\fR.T
8730: 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c  his form of call
8740: 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20  back is invoked 
8750: 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66  by the OpenSSL f
8760: 75 6e 63 74 69 6f 6e 0a 5c 66 42 53 53 4c 5f 73  unction.\fBSSL_s
8770: 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b  et_info_callback
8780: 28 29 5c 66 52 20 64 75 72 69 6e 67 20 74 68 65  ()\fR during the
8790: 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74   initial connect
87a0: 69 6f 6e 20 61 6e 64 20 68 61 6e 64 73 68 61 6b  ion and handshak
87b0: 65 0a 6f 70 65 72 61 74 69 6f 6e 73 5c 26 2e 20  e.operations\&. 
87c0: 54 68 65 20 61 72 67 75 6d 65 6e 74 73 20 61 72  The arguments ar
87d0: 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66 49 6d 61  e:..RS..TP.\fIma
87e0: 6a 6f 72 5c 66 52 0a 4d 61 6a 6f 72 20 63 61 74  jor\fR.Major cat
87f0: 65 67 6f 72 79 20 66 6f 72 20 65 72 72 6f 72 5c  egory for error\
8800: 26 2e 20 56 61 6c 69 64 20 65 6e 75 6d 73 20 61  &. Valid enums a
8810: 72 65 3a 20 5c 66 42 68 61 6e 64 73 68 61 6b 65  re: \fBhandshake
8820: 5c 66 52 2c 20 5c 66 42 61 6c 65 72 74 5c 66 52  \fR, \fBalert\fR
8830: 2c 0a 5c 66 42 63 6f 6e 6e 65 63 74 5c 66 52 2c  ,.\fBconnect\fR,
8840: 20 5c 66 42 61 63 63 65 70 74 5c 66 52 5c 26 2e   \fBaccept\fR\&.
8850: 0a 2e 54 50 0a 5c 66 49 6d 69 6e 6f 72 5c 66 52  ..TP.\fIminor\fR
8860: 0a 4d 69 6e 6f 72 20 63 61 74 65 67 6f 72 79 20  .Minor category 
8870: 66 6f 72 20 65 72 72 6f 72 5c 26 2e 20 56 61 6c  for error\&. Val
8880: 69 64 20 65 6e 75 6d 73 20 61 72 65 3a 20 5c 66  id enums are: \f
8890: 42 73 74 61 72 74 5c 66 52 2c 20 5c 66 42 64 6f  Bstart\fR, \fBdo
88a0: 6e 65 5c 66 52 2c 20 5c 66 42 72 65 61 64 5c 66  ne\fR, \fBread\f
88b0: 52 2c 0a 5c 66 42 77 72 69 74 65 5c 66 52 2c 20  R,.\fBwrite\fR, 
88c0: 5c 66 42 6c 6f 6f 70 5c 66 52 2c 20 5c 66 42 65  \fBloop\fR, \fBe
88d0: 78 69 74 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c 66  xit\fR\&...TP.\f
88e0: 49 6d 65 73 73 61 67 65 5c 66 52 0a 44 65 73 63  Imessage\fR.Desc
88f0: 72 69 70 74 69 76 65 20 6d 65 73 73 61 67 65 20  riptive message 
8900: 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61 79  string which may
8910: 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 65 69   be generated ei
8920: 74 68 65 72 20 62 79 0a 5c 66 42 53 53 4c 5f 73  ther by.\fBSSL_s
8930: 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67  tate_string_long
8940: 28 29 5c 66 52 20 6f 72 20 5c 66 42 53 53 4c 5f  ()\fR or \fBSSL_
8950: 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 72 69 6e  alert_desc_strin
8960: 67 5f 6c 6f 6e 67 28 29 5c 66 52 2c 0a 64 65 70  g_long()\fR,.dep
8970: 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 63 6f  ending on the co
8980: 6e 74 65 78 74 5c 26 2e 0a 2e 54 50 0a 5c 66 49  ntext\&...TP.\fI
8990: 74 79 70 65 5c 66 52 0a 46 6f 72 20 61 6c 65 72  type\fR.For aler
89a0: 74 73 2c 20 74 68 65 20 70 6f 73 73 69 62 6c 65  ts, the possible
89b0: 20 76 61 6c 75 65 73 20 61 72 65 3a 20 5c 66 42   values are: \fB
89c0: 77 61 72 6e 69 6e 67 5c 66 52 2c 0a 5c 66 42 66  warning\fR,.\fBf
89d0: 61 74 61 6c 5c 66 52 2c 20 61 6e 64 20 5c 66 42  atal\fR, and \fB
89e0: 75 6e 6b 6e 6f 77 6e 5c 66 52 5c 26 2e 20 46 6f  unknown\fR\&. Fo
89f0: 72 20 6f 74 68 65 72 73 2c 20 5c 66 42 69 6e 66  r others, \fBinf
8a00: 6f 5c 66 52 20 69 73 20 75 73 65 64 5c 26 2e 0a  o\fR is used\&..
8a10: 54 68 69 73 20 61 72 67 75 6d 65 6e 74 20 69 73  This argument is
8a20: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
8a30: 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 54 50  1\&.8\&...RE..TP
8a40: 0a 5c 66 42 6d 65 73 73 61 67 65 5c 66 52 20 5c  .\fBmessage\fR \
8a50: 66 49 63 68 61 6e 6e 65 6c 49 64 20 64 69 72 65  fIchannelId dire
8a60: 63 74 69 6f 6e 20 76 65 72 73 69 6f 6e 20 63 6f  ction version co
8a70: 6e 74 65 6e 74 5f 74 79 70 65 20 6d 65 73 73 61  ntent_type messa
8a80: 67 65 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d 20  ge\fR.This form 
8a90: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
8aa0: 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70  nvoked by the Op
8ab0: 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 5c  enSSL function.\
8ac0: 66 42 53 53 4c 5f 73 65 74 5f 6d 73 67 5f 63 61  fBSSL_set_msg_ca
8ad0: 6c 6c 62 61 63 6b 28 29 5c 66 52 20 77 68 65 6e  llback()\fR when
8ae0: 65 76 65 72 20 61 20 6d 65 73 73 61 67 65 20 69  ever a message i
8af0: 73 20 73 65 6e 74 20 6f 72 20 72 65 63 65 69 76  s sent or receiv
8b00: 65 64 20 64 75 72 69 6e 67 20 74 68 65 0a 69 6e  ed during the.in
8b10: 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e  itial connection
8b20: 2c 20 68 61 6e 64 73 68 61 6b 65 2c 20 6f 72 20  , handshake, or 
8b30: 49 2f 4f 20 6f 70 65 72 61 74 69 6f 6e 73 5c 26  I/O operations\&
8b40: 2e 20 49 74 20 69 73 20 6f 6e 6c 79 20 61 76 61  . It is only ava
8b50: 69 6c 61 62 6c 65 20 77 68 65 6e 0a 4f 70 65 6e  ilable when.Open
8b60: 53 53 4c 20 69 73 20 63 6f 6d 70 6c 69 65 64 20  SSL is complied 
8b70: 77 69 74 68 20 74 68 65 20 5c 66 42 65 6e 61 62  with the \fBenab
8b80: 6c 65 2d 73 73 6c 2d 74 72 61 63 65 5c 66 52 20  le-ssl-trace\fR 
8b90: 6f 70 74 69 6f 6e 5c 26 2e 20 54 68 69 73 20 63  option\&. This c
8ba0: 61 6c 6c 62 61 63 6b 20 69 73 0a 6e 65 77 20 66  allback is.new f
8bb0: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
8bc0: 26 2e 20 54 68 65 20 61 72 67 75 6d 65 6e 74 73  &. The arguments
8bd0: 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66   are:..RS..TP.\f
8be0: 49 64 69 72 65 63 74 69 6f 6e 5c 66 52 0a 44 69  Idirection\fR.Di
8bf0: 72 65 63 74 69 6f 6e 20 69 73 20 65 69 74 68 65  rection is eithe
8c00: 72 20 5c 66 42 53 65 6e 74 5c 66 52 20 6f 72 20  r \fBSent\fR or 
8c10: 5c 66 42 52 65 63 65 69 76 65 64 5c 66 52 5c 26  \fBReceived\fR\&
8c20: 2e 0a 2e 54 50 0a 5c 66 49 76 65 72 73 69 6f 6e  ...TP.\fIversion
8c30: 5c 66 52 0a 56 65 72 73 69 6f 6e 20 69 73 20 74  \fR.Version is t
8c40: 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73  he protocol vers
8c50: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 49 63 6f  ion\&...TP.\fIco
8c60: 6e 74 65 6e 74 5f 74 79 70 65 5c 66 52 0a 43 6f  ntent_type\fR.Co
8c70: 6e 74 65 6e 74 20 74 79 70 65 20 69 73 20 74 68  ntent type is th
8c80: 65 20 6d 65 73 73 61 67 65 20 63 6f 6e 74 65 6e  e message conten
8c90: 74 20 74 79 70 65 5c 26 2e 0a 2e 54 50 0a 5c 66  t type\&...TP.\f
8ca0: 49 6d 65 73 73 61 67 65 5c 66 52 0a 4d 65 73 73  Imessage\fR.Mess
8cb0: 61 67 65 20 69 73 20 6d 6f 72 65 20 69 6e 66 6f  age is more info
8cc0: 20 66 72 6f 6d 20 74 68 65 20 5c 66 42 53 53 4c   from the \fBSSL
8cd0: 5f 74 72 61 63 65 5c 66 52 20 41 50 49 5c 26 2e  _trace\fR API\&.
8ce0: 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 73 65 73 73  ..RE..TP.\fBsess
8cf0: 69 6f 6e 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65  ion\fR \fIchanne
8d00: 6c 49 64 20 73 65 73 73 69 6f 6e 5f 69 64 20 73  lId session_id s
8d10: 65 73 73 69 6f 6e 5f 74 69 63 6b 65 74 20 6c 69  ession_ticket li
8d20: 66 65 74 69 6d 65 5c 66 52 0a 54 68 69 73 20 66  fetime\fR.This f
8d30: 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20  orm of callback 
8d40: 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68  is invoked by th
8d50: 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69  e OpenSSL functi
8d60: 6f 6e 0a 5c 66 42 53 53 4c 5f 43 54 58 5f 73 65  on.\fBSSL_CTX_se
8d70: 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62 28 29 5c  ss_set_new_cb()\
8d80: 66 52 20 77 68 65 6e 65 76 65 72 20 61 20 6e 65  fR whenever a ne
8d90: 77 20 73 65 73 73 69 6f 6e 20 69 64 20 69 73 20  w session id is 
8da0: 73 65 6e 74 20 62 79 20 74 68 65 0a 73 65 72 76  sent by the.serv
8db0: 65 72 20 64 75 72 69 6e 67 20 74 68 65 20 69 6e  er during the in
8dc0: 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e  itial connection
8dd0: 20 61 6e 64 20 68 61 6e 64 73 68 61 6b 65 20 61   and handshake a
8de0: 6e 64 20 61 6c 73 6f 20 64 75 72 69 6e 67 20 74  nd also during t
8df0: 68 65 20 73 65 73 73 69 6f 6e 0a 69 66 20 74 68  he session.if th
8e00: 65 20 5c 66 42 2d 70 6f 73 74 5f 68 61 6e 64 73  e \fB-post_hands
8e10: 68 61 6b 65 5c 66 52 20 6f 70 74 69 6f 6e 20 69  hake\fR option i
8e20: 73 20 73 65 74 20 74 6f 20 74 72 75 65 5c 26 2e  s set to true\&.
8e30: 20 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69   This callback i
8e40: 73 20 6e 65 77 20 66 6f 72 0a 54 63 6c 54 4c 53  s new for.TclTLS
8e50: 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65 20 61 72   1\&.8\&. The ar
8e60: 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e 52 53  guments are:..RS
8e70: 0a 2e 54 50 0a 5c 66 49 73 65 73 73 69 6f 6e 5f  ..TP.\fIsession_
8e80: 69 64 5c 66 52 0a 53 65 73 73 69 6f 6e 20 49 64  id\fR.Session Id
8e90: 20 69 73 20 74 68 65 20 63 75 72 72 65 6e 74 20   is the current 
8ea0: 73 65 73 73 69 6f 6e 20 69 64 65 6e 74 69 66 69  session identifi
8eb0: 65 72 0a 2e 54 50 0a 5c 66 49 73 65 73 73 69 6f  er..TP.\fIsessio
8ec0: 6e 5f 74 69 63 6b 65 74 5c 66 52 0a 54 69 63 6b  n_ticket\fR.Tick
8ed0: 65 74 20 69 73 20 74 68 65 20 73 65 73 73 69 6f  et is the sessio
8ee0: 6e 20 74 69 63 6b 65 74 20 69 6e 66 6f 0a 2e 54  n ticket info..T
8ef0: 50 0a 5c 66 49 6c 69 66 65 74 69 6d 65 5c 66 52  P.\fIlifetime\fR
8f00: 0a 4c 69 66 65 74 69 6d 65 20 69 73 20 74 68 65  .Lifetime is the
8f10: 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65   ticket lifetime
8f20: 20 69 6e 20 73 65 63 6f 6e 64 73 5c 26 2e 0a 2e   in seconds\&...
8f30: 52 45 0a 2e 54 50 0a 5c 66 42 76 65 72 69 66 79  RE..TP.\fBverify
8f40: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64  \fR \fIchannelId
8f50: 20 64 65 70 74 68 20 63 65 72 74 20 73 74 61 74   depth cert stat
8f60: 75 73 20 65 72 72 6f 72 5c 66 52 0a 54 68 69 73  us error\fR.This
8f70: 20 63 61 6c 6c 62 61 63 6b 20 77 61 73 20 6d 6f   callback was mo
8f80: 76 65 64 20 74 6f 20 5c 66 42 2d 76 61 6c 69 64  ved to \fB-valid
8f90: 61 74 65 63 6f 6d 6d 61 6e 64 5c 66 52 20 69 6e  atecommand\fR in
8fa0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
8fb0: 0a 2e 50 50 0a 2e 53 53 20 22 56 41 4c 55 45 53  ..PP..SS "VALUES
8fc0: 20 46 4f 52 20 50 41 53 53 57 4f 52 44 20 43 41   FOR PASSWORD CA
8fd0: 4c 4c 42 41 43 4b 22 0a 54 68 65 20 63 61 6c 6c  LLBACK".The call
8fe0: 62 61 63 6b 20 66 6f 72 20 74 68 65 20 5c 66 42  back for the \fB
8ff0: 2d 70 61 73 73 77 6f 72 64 5c 66 52 20 6f 70 74  -password\fR opt
9000: 69 6f 6e 20 69 73 20 69 6e 76 6f 6b 65 64 20 62  ion is invoked b
9010: 79 20 54 63 6c 54 4c 53 20 77 68 65 6e 65 76 65  y TclTLS wheneve
9020: 72 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 0a  r OpenSSL needs.
9030: 74 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73  to obtain a pass
9040: 77 6f 72 64 5c 26 2e 20 53 65 65 20 62 65 6c 6f  word\&. See belo
9050: 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62  w for the possib
9060: 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 70 61 73  le arguments pas
9070: 73 65 64 20 74 6f 20 74 68 65 0a 63 61 6c 6c 62  sed to the.callb
9080: 61 63 6b 20 73 63 72 69 70 74 5c 26 2e 20 54 68  ack script\&. Th
9090: 65 20 75 73 65 72 20 70 72 6f 76 69 64 65 64 20  e user provided 
90a0: 70 61 73 73 77 6f 72 64 20 69 73 20 65 78 70 65  password is expe
90b0: 63 74 65 64 20 74 6f 20 62 65 20 72 65 74 75 72  cted to be retur
90c0: 6e 65 64 20 62 79 20 74 68 65 0a 63 61 6c 6c 62  ned by the.callb
90d0: 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 61  ack\&...TP.\fBpa
90e0: 73 73 77 6f 72 64 5c 66 52 20 5c 66 49 72 77 66  ssword\fR \fIrwf
90f0: 6c 61 67 20 73 69 7a 65 5c 66 52 0a 49 6e 76 6f  lag size\fR.Invo
9100: 6b 65 64 20 77 68 65 6e 20 6c 6f 61 64 69 6e 67  ked when loading
9110: 20 6f 72 20 73 74 6f 72 69 6e 67 20 61 6e 20 65   or storing an e
9120: 6e 63 72 79 70 74 65 64 20 50 45 4d 20 63 65 72  ncrypted PEM cer
9130: 74 69 66 69 63 61 74 65 5c 26 2e 20 54 68 65 20  tificate\&. The 
9140: 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e  arguments are:..
9150: 52 53 0a 2e 54 50 0a 5c 66 49 72 77 66 6c 61 67  RS..TP.\fIrwflag
9160: 5c 66 52 0a 54 68 65 20 72 65 61 64 2f 77 72 69  \fR.The read/wri
9170: 74 65 20 66 6c 61 67 20 69 73 20 30 20 66 6f 72  te flag is 0 for
9180: 20 72 65 61 64 69 6e 67 2f 64 65 63 72 79 70 74   reading/decrypt
9190: 69 6f 6e 20 6f 72 20 31 20 66 6f 72 20 77 72 69  ion or 1 for wri
91a0: 74 69 6e 67 2f 65 6e 63 72 79 70 74 69 6f 6e 5c  ting/encryption\
91b0: 26 2e 0a 54 68 65 20 6c 61 74 74 65 72 20 63 61  &..The latter ca
91c0: 6e 20 62 65 20 75 73 65 64 20 74 6f 20 64 65 74  n be used to det
91d0: 65 72 6d 69 6e 65 20 77 68 65 6e 20 74 6f 20 70  ermine when to p
91e0: 72 6f 6d 70 74 20 74 68 65 20 75 73 65 72 20 74  rompt the user t
91f0: 6f 20 63 6f 6e 66 69 72 6d 5c 26 2e 0a 54 68 69  o confirm\&..Thi
9200: 73 20 61 72 67 75 6d 65 6e 74 20 69 73 20 6e 65  s argument is ne
9210: 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26  w for TclTLS 1\&
9220: 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 49 73 69 7a  .8\&...TP.\fIsiz
9230: 65 5c 66 52 0a 54 68 65 20 73 69 7a 65 20 69 73  e\fR.The size is
9240: 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 6c 65 6e   the maximum len
9250: 67 74 68 20 6f 66 20 74 68 65 20 70 61 73 73 77  gth of the passw
9260: 6f 72 64 20 69 6e 20 62 79 74 65 73 5c 26 2e 0a  ord in bytes\&..
9270: 54 68 69 73 20 61 72 67 75 6d 65 6e 74 20 69 73  This argument is
9280: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
9290: 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a 2e 50 50  1\&.8\&...RE..PP
92a0: 0a 2e 53 53 20 22 56 41 4c 55 45 53 20 46 4f 52  ..SS "VALUES FOR
92b0: 20 56 41 4c 49 44 41 54 45 20 43 4f 4d 4d 41 4e   VALIDATE COMMAN
92c0: 44 20 43 41 4c 4c 42 41 43 4b 22 0a 54 68 65 20  D CALLBACK".The 
92d0: 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20 74 68 65  callback for the
92e0: 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 63 6f 6d   \fB-validatecom
92f0: 6d 61 6e 64 5c 66 52 20 6f 70 74 69 6f 6e 20 69  mand\fR option i
9300: 73 20 69 6e 76 6f 6b 65 64 20 64 75 72 69 6e 67  s invoked during
9310: 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 0a 70   the handshake.p
9320: 72 6f 63 65 73 73 20 69 6e 20 6f 72 64 65 72 20  rocess in order 
9330: 66 6f 72 20 74 68 65 20 61 70 70 6c 69 63 61 74  for the applicat
9340: 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20  ion to validate 
9350: 74 68 65 20 70 72 6f 76 69 64 65 64 20 76 61 6c  the provided val
9360: 75 65 28 73 29 5c 26 2e 20 53 65 65 0a 62 65 6c  ue(s)\&. See.bel
9370: 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69  ow for the possi
9380: 62 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 70 61  ble arguments pa
9390: 73 73 65 64 20 74 6f 20 74 68 65 20 63 61 6c 6c  ssed to the call
93a0: 62 61 63 6b 20 73 63 72 69 70 74 5c 26 2e 20 49  back script\&. I
93b0: 66 20 6e 6f 74 0a 73 70 65 63 69 66 69 65 64 2c  f not.specified,
93c0: 20 4f 70 65 6e 53 53 4c 20 77 69 6c 6c 20 61 63   OpenSSL will ac
93d0: 63 65 70 74 20 61 6c 6c 20 76 61 6c 69 64 20 63  cept all valid c
93e0: 65 72 74 69 66 69 63 61 74 65 73 20 61 6e 64 20  ertificates and 
93f0: 65 78 74 65 6e 73 69 6f 6e 73 5c 26 2e 20 54 6f  extensions\&. To
9400: 20 72 65 6a 65 63 74 0a 74 68 65 20 76 61 6c 75   reject.the valu
9410: 65 20 61 6e 64 20 61 62 6f 72 74 20 74 68 65 20  e and abort the 
9420: 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 74 68 65 20  connection, the 
9430: 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20  callback should 
9440: 72 65 74 75 72 6e 20 30 5c 26 2e 20 54 6f 20 61  return 0\&. To a
9450: 63 63 65 70 74 20 74 68 65 0a 76 61 6c 75 65 20  ccept the.value 
9460: 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20 74 68 65  and continue the
9470: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69 74 20   connection, it 
9480: 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 31 5c  should return 1\
9490: 26 2e 20 54 6f 20 72 65 6a 65 63 74 20 74 68 65  &. To reject the
94a0: 20 76 61 6c 75 65 2c 20 62 75 74 0a 63 6f 6e 74   value, but.cont
94b0: 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65 63 74  inue the connect
94c0: 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64 20 72  ion, it should r
94d0: 65 74 75 72 6e 20 32 5c 26 2e 20 54 68 69 73 20  eturn 2\&. This 
94e0: 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 20  callback is new 
94f0: 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for TclTLS 1\&.8
9500: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 61 6c 70 6e 5c  \&...TP.\fBalpn\
9510: 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20  fR \fIchannelId 
9520: 70 72 6f 74 6f 63 6f 6c 20 6d 61 74 63 68 5c 66  protocol match\f
9530: 52 0a 46 6f 72 20 73 65 72 76 65 72 73 2c 20 74  R.For servers, t
9540: 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c  his form of call
9550: 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20  back is invoked 
9560: 77 68 65 6e 20 74 68 65 20 63 6c 69 65 6e 74 20  when the client 
9570: 41 4c 50 4e 20 65 78 74 65 6e 73 69 6f 6e 20 69  ALPN extension i
9580: 73 0a 72 65 63 65 69 76 65 64 5c 26 2e 20 49 66  s.received\&. If
9590: 20 5c 66 49 6d 61 74 63 68 5c 66 52 20 69 73 20   \fImatch\fR is 
95a0: 74 72 75 65 2c 20 74 68 65 6e 20 5c 66 49 70 72  true, then \fIpr
95b0: 6f 74 6f 63 6f 6c 5c 66 52 20 69 73 20 74 68 65  otocol\fR is the
95c0: 20 66 69 72 73 74 0a 5c 66 42 2d 61 6c 70 6e 5c   first.\fB-alpn\
95d0: 66 52 20 70 72 6f 74 6f 63 6f 6c 20 6f 70 74 69  fR protocol opti
95e0: 6f 6e 20 69 6e 20 63 6f 6d 6d 6f 6e 20 74 6f 20  on in common to 
95f0: 62 6f 74 68 20 74 68 65 20 63 6c 69 65 6e 74 20  both the client 
9600: 61 6e 64 20 73 65 72 76 65 72 5c 26 2e 0a 49 66  and server\&..If
9610: 20 6e 6f 74 2c 20 74 68 65 20 66 69 72 73 74 20   not, the first 
9620: 63 6c 69 65 6e 74 20 73 70 65 63 69 66 69 65 64  client specified
9630: 20 70 72 6f 74 6f 63 6f 6c 20 69 73 20 75 73 65   protocol is use
9640: 64 5c 26 2e 20 54 68 69 73 20 63 61 6c 6c 62 61  d\&. This callba
9650: 63 6b 20 69 73 20 63 61 6c 6c 65 64 0a 61 66 74  ck is called.aft
9660: 65 72 20 74 68 65 20 48 65 6c 6c 6f 20 61 6e 64  er the Hello and
9670: 20 53 4e 49 20 63 61 6c 6c 62 61 63 6b 73 5c 26   SNI callbacks\&
9680: 2e 0a 2e 54 50 0a 5c 66 42 68 65 6c 6c 6f 5c 66  ...TP.\fBhello\f
9690: 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 73  R \fIchannelId s
96a0: 65 72 76 65 72 6e 61 6d 65 20 73 65 73 73 69 6f  ervername sessio
96b0: 6e 5f 69 64 5c 66 52 0a 46 6f 72 20 73 65 72 76  n_id\fR.For serv
96c0: 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f  ers, this form o
96d0: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e  f callback is in
96e0: 76 6f 6b 65 64 20 64 75 72 69 6e 67 20 63 6c 69  voked during cli
96f0: 65 6e 74 20 68 65 6c 6c 6f 20 6d 65 73 73 61 67  ent hello messag
9700: 65 0a 70 72 6f 63 65 73 73 69 6e 67 5c 26 2e 20  e.processing\&. 
9710: 54 68 65 20 70 75 72 70 6f 73 65 20 69 73 20 73  The purpose is s
9720: 6f 20 74 68 65 20 73 65 72 76 65 72 20 63 61 6e  o the server can
9730: 20 73 65 6c 65 63 74 20 74 68 65 20 61 70 70 72   select the appr
9740: 6f 70 72 69 61 74 65 20 63 65 72 74 69 66 69 63  opriate certific
9750: 61 74 65 0a 74 6f 20 70 72 65 73 65 6e 74 20 74  ate.to present t
9760: 6f 20 74 68 65 20 63 6c 69 65 6e 74 2c 20 61 6e  o the client, an
9770: 64 20 74 6f 20 6d 61 6b 65 20 6f 74 68 65 72 20  d to make other 
9780: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 64  configuration ad
9790: 6a 75 73 74 6d 65 6e 74 73 20 72 65 6c 65 76 61  justments releva
97a0: 6e 74 0a 74 6f 20 74 68 61 74 20 73 65 72 76 65  nt.to that serve
97b0: 72 20 6e 61 6d 65 20 61 6e 64 20 69 74 73 20 63  r name and its c
97c0: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5c 26 2e 20  onfiguration\&. 
97d0: 49 74 20 69 73 20 63 61 6c 6c 65 64 20 62 65 66  It is called bef
97e0: 6f 72 65 20 74 68 65 20 53 4e 49 20 61 6e 64 20  ore the SNI and 
97f0: 41 4c 50 4e 0a 63 61 6c 6c 62 61 63 6b 73 5c 26  ALPN.callbacks\&
9800: 2e 0a 2e 54 50 0a 5c 66 42 73 6e 69 5c 66 52 20  ...TP.\fBsni\fR 
9810: 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 73 65 72  \fIchannelId ser
9820: 76 65 72 6e 61 6d 65 5c 66 52 0a 46 6f 72 20 73  vername\fR.For s
9830: 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 6f 72  ervers, this for
9840: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73  m of callback is
9850: 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74 68   invoked when th
9860: 65 20 53 65 72 76 65 72 20 4e 61 6d 65 20 49 6e  e Server Name In
9870: 64 69 63 61 74 69 6f 6e 0a 28 53 4e 49 29 20 65  dication.(SNI) e
9880: 78 74 65 6e 73 69 6f 6e 20 69 73 20 72 65 63 65  xtension is rece
9890: 69 76 65 64 5c 26 2e 20 54 68 65 20 5c 66 49 73  ived\&. The \fIs
98a0: 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 61 72 67  ervername\fR arg
98b0: 75 6d 65 6e 74 20 69 73 20 74 68 65 20 63 6c 69  ument is the cli
98c0: 65 6e 74 0a 70 72 6f 76 69 64 65 64 20 73 65 72  ent.provided ser
98d0: 76 65 72 20 6e 61 6d 65 20 73 70 65 63 69 66 69  ver name specifi
98e0: 65 64 20 69 6e 20 74 68 65 20 5c 66 42 2d 73 65  ed in the \fB-se
98f0: 72 76 65 72 6e 61 6d 65 5c 66 52 20 6f 70 74 69  rvername\fR opti
9900: 6f 6e 5c 26 2e 20 54 68 65 0a 70 75 72 70 6f 73  on\&. The.purpos
9910: 65 20 69 73 20 73 6f 20 77 68 65 6e 20 61 20 73  e is so when a s
9920: 65 72 76 65 72 20 73 75 70 70 6f 72 74 73 20 6d  erver supports m
9930: 75 6c 74 69 70 6c 65 20 6e 61 6d 65 73 2c 20 74  ultiple names, t
9940: 68 65 20 72 69 67 68 74 20 63 65 72 74 69 66 69  he right certifi
9950: 63 61 74 65 0a 63 61 6e 20 62 65 20 75 73 65 64  cate.can be used
9960: 5c 26 2e 20 49 74 20 69 73 20 63 61 6c 6c 65 64  \&. It is called
9970: 20 61 66 74 65 72 20 74 68 65 20 48 65 6c 6c 6f   after the Hello
9980: 20 63 61 6c 6c 62 61 63 6b 20 62 75 74 20 62 65   callback but be
9990: 66 6f 72 65 20 74 68 65 20 41 4c 50 4e 0a 63 61  fore the ALPN.ca
99a0: 6c 6c 62 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c 66  llback\&...TP.\f
99b0: 42 76 65 72 69 66 79 5c 66 52 20 5c 66 49 63 68  Bverify\fR \fIch
99c0: 61 6e 6e 65 6c 49 64 20 64 65 70 74 68 20 63 65  annelId depth ce
99d0: 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72 5c  rt status error\
99e0: 66 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66 20  fR.This form of 
99f0: 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f  callback is invo
9a00: 6b 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 20 77  ked by OpenSSL w
9a10: 68 65 6e 20 61 20 6e 65 77 20 63 65 72 74 69 66  hen a new certif
9a20: 69 63 61 74 65 20 69 73 20 72 65 63 65 69 76 65  icate is receive
9a30: 64 0a 66 72 6f 6d 20 74 68 65 20 70 65 65 72 5c  d.from the peer\
9a40: 26 2e 20 49 74 20 61 6c 6c 6f 77 73 20 74 68 65  &. It allows the
9a50: 20 63 6c 69 65 6e 74 20 74 6f 20 63 68 65 63 6b   client to check
9a60: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
9a70: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 0a 72 65   verification.re
9a80: 73 75 6c 74 73 20 61 6e 64 20 63 68 6f 6f 73 65  sults and choose
9a90: 20 77 68 65 74 68 65 72 20 74 6f 20 63 6f 6e 74   whether to cont
9aa0: 69 6e 75 65 20 6f 72 20 6e 6f 74 5c 26 2e 20 49  inue or not\&. I
9ab0: 74 20 69 73 20 63 61 6c 6c 65 64 20 66 6f 72 20  t is called for 
9ac0: 65 61 63 68 0a 63 65 72 74 69 66 69 63 61 74 65  each.certificate
9ad0: 20 69 6e 20 74 68 65 20 63 65 72 74 69 66 69 63   in the certific
9ae0: 61 74 65 20 63 68 61 69 6e 5c 26 2e 20 54 68 69  ate chain\&. Thi
9af0: 73 20 63 61 6c 6c 62 61 63 6b 20 77 61 73 20 6d  s callback was m
9b00: 6f 76 65 64 20 66 72 6f 6d 0a 5c 66 42 2d 63 6f  oved from.\fB-co
9b10: 6d 6d 61 6e 64 5c 66 52 20 69 6e 20 54 63 6c 54  mmand\fR in TclT
9b20: 4c 53 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65 20  LS 1\&.8\&. The 
9b30: 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e  arguments are:..
9b40: 52 53 0a 2e 54 50 0a 5c 66 49 64 65 70 74 68 5c  RS..TP.\fIdepth\
9b50: 66 52 0a 54 68 65 20 64 65 70 74 68 20 69 73 20  fR.The depth is 
9b60: 74 68 65 20 69 6e 74 65 67 65 72 20 64 65 70 74  the integer dept
9b70: 68 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69  h of the certifi
9b80: 63 61 74 65 20 69 6e 20 74 68 65 20 63 65 72 74  cate in the cert
9b90: 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c 0a 77  ificate chain,.w
9ba0: 68 65 72 65 20 30 20 69 73 20 74 68 65 20 70 65  here 0 is the pe
9bb0: 65 72 20 63 65 72 74 69 66 69 63 61 74 65 20 61  er certificate a
9bc0: 6e 64 20 68 69 67 68 65 72 20 76 61 6c 75 65 73  nd higher values
9bd0: 20 67 6f 69 6e 67 20 75 70 20 74 6f 20 74 68 65   going up to the
9be0: 20 43 65 72 74 69 66 69 63 61 74 65 0a 41 75 74   Certificate.Aut
9bf0: 68 6f 72 69 74 79 20 28 43 41 29 5c 26 2e 0a 2e  hority (CA)\&...
9c00: 54 50 0a 5c 66 49 63 65 72 74 5c 66 52 0a 54 68  TP.\fIcert\fR.Th
9c10: 65 20 63 65 72 74 20 61 72 67 75 6d 65 6e 74 20  e cert argument 
9c20: 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79  is a list of key
9c30: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 73 69 6d  -value pairs sim
9c40: 69 6c 61 72 20 74 6f 20 74 68 6f 73 65 20 72 65  ilar to those re
9c50: 74 75 72 6e 65 64 20 62 79 0a 5c 66 42 74 6c 73  turned by.\fBtls
9c60: 3a 3a 73 74 61 74 75 73 5c 66 52 5c 26 2e 0a 2e  ::status\fR\&...
9c70: 54 50 0a 5c 66 49 73 74 61 74 75 73 5c 66 52 0a  TP.\fIstatus\fR.
9c80: 54 68 65 20 73 74 61 74 75 73 20 61 72 67 75 6d  The status argum
9c90: 65 6e 74 20 69 73 20 74 68 65 20 62 6f 6f 6c 65  ent is the boole
9ca0: 61 6e 20 76 61 6c 69 64 69 74 79 20 6f 66 20 74  an validity of t
9cb0: 68 65 20 63 75 72 72 65 6e 74 20 63 65 72 74 69  he current certi
9cc0: 66 69 63 61 74 65 20 77 68 65 72 65 20 30 0a 69  ficate where 0.i
9cd0: 73 20 69 6e 76 61 6c 69 64 20 61 6e 64 20 31 20  s invalid and 1 
9ce0: 69 73 20 76 61 6c 69 64 5c 26 2e 0a 2e 54 50 0a  is valid\&...TP.
9cf0: 5c 66 49 65 72 72 6f 72 5c 66 52 0a 54 68 65 20  \fIerror\fR.The 
9d00: 65 72 72 6f 72 20 61 72 67 75 6d 65 6e 74 20 69  error argument i
9d10: 73 20 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73  s the error mess
9d20: 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 65 6e  age, if any, gen
9d30: 65 72 61 74 65 64 20 62 79 0a 5c 66 42 58 35 30  erated by.\fBX50
9d40: 39 5f 53 54 4f 52 45 5f 43 54 58 5f 67 65 74 5f  9_STORE_CTX_get_
9d50: 65 72 72 6f 72 28 29 5c 66 52 5c 26 2e 0a 2e 52  error()\fR\&...R
9d60: 45 0a 2e 50 50 0a 52 65 66 65 72 65 6e 63 65 20  E..PP.Reference 
9d70: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20  implementations 
9d80: 6f 66 20 74 68 65 73 65 20 63 61 6c 6c 62 61 63  of these callbac
9d90: 6b 73 20 61 72 65 20 70 72 6f 76 69 64 65 64 20  ks are provided 
9da0: 69 6e 20 22 5c 66 49 74 6c 73 5c 26 2e 74 63 6c  in "\fItls\&.tcl
9db0: 5c 66 52 22 0a 61 73 20 5c 66 42 74 6c 73 3a 3a  \fR".as \fBtls::
9dc0: 63 61 6c 6c 62 61 63 6b 5c 66 52 2c 20 5c 66 42  callback\fR, \fB
9dd0: 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 5c 66 52  tls::password\fR
9de0: 2c 20 61 6e 64 20 5c 66 42 74 6c 73 3a 3a 76 61  , and \fBtls::va
9df0: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66  lidate_command\f
9e00: 52 0a 72 65 73 70 65 63 74 69 76 65 6c 79 5c 26  R.respectively\&
9e10: 2e 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73  . Note that thes
9e20: 65 20 61 72 65 20 6f 6e 6c 79 20 5c 66 49 73 61  e are only \fIsa
9e30: 6d 70 6c 65 5c 66 52 20 69 6d 70 6c 65 6d 65 6e  mple\fR implemen
9e40: 74 61 74 69 6f 6e 73 5c 26 2e 20 49 6e 20 61 20  tations\&. In a 
9e50: 6d 6f 72 65 0a 72 65 61 6c 69 73 74 69 63 20 64  more.realistic d
9e60: 65 70 6c 6f 79 6d 65 6e 74 20 79 6f 75 20 77 6f  eployment you wo
9e70: 75 6c 64 20 73 70 65 63 69 66 79 20 79 6f 75 72  uld specify your
9e80: 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 20 73 63   own callback sc
9e90: 72 69 70 74 73 20 6f 6e 20 65 61 63 68 20 54 4c  ripts on each TL
9ea0: 53 0a 63 68 61 6e 6e 65 6c 20 75 73 69 6e 67 20  S.channel using 
9eb0: 74 68 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c  the \fB-command\
9ec0: 66 52 2c 20 5c 66 42 2d 70 61 73 73 77 6f 72 64  fR, \fB-password
9ed0: 5c 66 52 2c 20 61 6e 64 0a 5c 66 42 2d 76 61 6c  \fR, and.\fB-val
9ee0: 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52  idate_command\fR
9ef0: 20 6f 70 74 69 6f 6e 73 5c 26 2e 0a 2e 50 50 0a   options\&...PP.
9f00: 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61  The default beha
9f10: 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 5c 66  vior when the \f
9f20: 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20 61 6e 64  B-command\fR and
9f30: 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 5f 63 6f   \fB-validate_co
9f40: 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74 69 6f 6e 73  mmand\fR.options
9f50: 20 61 72 65 20 6e 6f 74 20 73 70 65 63 69 66 69   are not specifi
9f60: 65 64 2c 20 69 73 20 66 6f 72 20 54 63 6c 54 4c  ed, is for TclTL
9f70: 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65  S to process the
9f80: 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72   associated libr
9f90: 61 72 79 0a 63 61 6c 6c 62 61 63 6b 73 20 69 6e  ary.callbacks in
9fa0: 74 65 72 6e 61 6c 6c 79 5c 26 2e 20 54 68 65 20  ternally\&. The 
9fb0: 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72  default behavior
9fc0: 20 77 68 65 6e 20 74 68 65 20 5c 66 42 2d 70 61   when the \fB-pa
9fd0: 73 73 77 6f 72 64 5c 66 52 20 6f 70 74 69 6f 6e  ssword\fR option
9fe0: 0a 69 73 20 6e 6f 74 20 73 70 65 63 69 66 69 65  .is not specifie
9ff0: 64 20 69 73 20 66 6f 72 20 54 63 6c 54 4c 53 20  d is for TclTLS 
a000: 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 61  to process the a
a010: 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 72  ssociated librar
a020: 79 20 63 61 6c 6c 62 61 63 6b 73 20 62 79 0a 61  y callbacks by.a
a030: 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 63 61 6c  ttempting to cal
a040: 6c 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f  l \fBtls::passwo
a050: 72 64 5c 66 52 5c 26 2e 20 54 68 65 20 64 69 66  rd\fR\&. The dif
a060: 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20  ference between 
a070: 74 68 65 73 65 20 74 77 6f 0a 62 65 68 61 76 69  these two.behavi
a080: 6f 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75  ors is a consequ
a090: 65 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e  ence of maintain
a0a0: 69 6e 67 20 63 6f 6d 70 61 74 69 62 69 6c 69 74  ing compatibilit
a0b0: 79 20 77 69 74 68 20 65 61 72 6c 69 65 72 0a 69  y with earlier.i
a0c0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 5c 26  mplementations\&
a0d0: 2e 0a 2e 50 50 0a 5c 66 49 54 68 65 20 75 73 65  ...PP.\fIThe use
a0e0: 20 6f 66 20 74 68 65 20 72 65 66 65 72 65 6e 63   of the referenc
a0f0: 65 20 63 61 6c 6c 62 61 63 6b 73 20 5c 66 42 74  e callbacks \fBt
a100: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 2c  ls::callback\fR,
a110: 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72   \fBtls::passwor
a120: 64 5c 66 52 2c 0a 61 6e 64 20 5c 66 42 74 6c 73  d\fR,.and \fBtls
a130: 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  ::validate_comma
a140: 6e 64 5c 66 52 20 69 73 20 6e 6f 74 20 72 65 63  nd\fR is not rec
a150: 6f 6d 6d 65 6e 64 65 64 5c 26 2e 20 54 68 65 79  ommended\&. They
a160: 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20   may be removed 
a170: 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65  from future rele
a180: 61 73 65 73 5c 26 2e 5c 66 52 0a 2e 53 48 20 44  ases\&.\fR..SH D
a190: 45 42 55 47 0a 46 6f 72 20 6d 6f 73 74 20 64 65  EBUG.For most de
a1a0: 62 75 67 67 69 6e 67 20 6e 65 65 64 73 2c 20 74  bugging needs, t
a1b0: 68 65 20 5c 66 42 2d 63 61 6c 6c 62 61 63 6b 5c  he \fB-callback\
a1c0: 66 52 20 6f 70 74 69 6f 6e 20 63 61 6e 20 62 65  fR option can be
a1d0: 20 75 73 65 64 20 74 6f 20 70 72 6f 76 69 64 65   used to provide
a1e0: 0a 73 75 66 66 69 63 69 65 6e 74 20 69 6e 73 69  .sufficient insi
a1f0: 67 68 74 20 61 6e 64 20 69 6e 66 6f 72 6d 61 74  ght and informat
a200: 69 6f 6e 20 6f 6e 20 74 68 65 20 54 4c 53 20 68  ion on the TLS h
a210: 61 6e 64 73 68 61 6b 65 20 61 6e 64 20 70 72 6f  andshake and pro
a220: 67 72 65 73 73 5c 26 2e 20 49 66 0a 66 75 72 74  gress\&. If.furt
a230: 68 65 72 20 74 72 6f 75 62 6c 65 73 68 6f 6f 74  her troubleshoot
a240: 69 6e 67 20 69 6e 73 69 67 68 74 20 69 73 20 6e  ing insight is n
a250: 65 65 64 65 64 2c 20 74 68 65 20 63 6f 6d 70 69  eeded, the compi
a260: 6c 65 20 74 69 6d 65 20 6f 70 74 69 6f 6e 0a 5c  le time option.\
a270: 66 42 2d 2d 65 6e 61 62 6c 65 2d 64 65 62 75 67  fB--enable-debug
a280: 5c 66 52 20 63 61 6e 20 62 65 20 75 73 65 64 20  \fR can be used 
a290: 74 6f 20 67 65 74 20 64 65 74 61 69 6c 65 64 20  to get detailed 
a2a0: 65 78 65 63 75 74 69 6f 6e 20 66 6c 6f 77 20 73  execution flow s
a2b0: 74 61 74 75 73 5c 26 2e 0a 2e 50 50 0a 54 4c 53  tatus\&...PP.TLS
a2c0: 20 6b 65 79 20 6c 6f 67 67 69 6e 67 20 63 61 6e   key logging can
a2d0: 20 62 65 20 65 6e 61 62 6c 65 64 20 62 79 20 73   be enabled by s
a2e0: 65 74 74 69 6e 67 20 74 68 65 20 65 6e 76 69 72  etting the envir
a2f0: 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 0a  onment variable.
a300: 5c 66 42 53 53 4c 4b 45 59 4c 4f 47 46 49 4c 45  \fBSSLKEYLOGFILE
a310: 5c 66 52 20 74 6f 20 74 68 65 20 6e 61 6d 65 20  \fR to the name 
a320: 6f 66 20 74 68 65 20 66 69 6c 65 20 74 6f 20 6c  of the file to l
a330: 6f 67 20 74 6f 5c 26 2e 20 54 68 65 6e 20 77 68  og to\&. Then wh
a340: 65 6e 65 76 65 72 20 54 4c 53 20 6b 65 79 0a 6d  enever TLS key.m
a350: 61 74 65 72 69 61 6c 20 69 73 20 67 65 6e 65 72  aterial is gener
a360: 61 74 65 64 20 6f 72 20 72 65 63 65 69 76 65 64  ated or received
a370: 20 69 74 20 77 69 6c 6c 20 62 65 20 6c 6f 67 67   it will be logg
a380: 65 64 20 74 6f 20 74 68 65 20 66 69 6c 65 5c 26  ed to the file\&
a390: 2e 20 54 68 69 73 20 69 73 20 75 73 65 66 75 6c  . This is useful
a3a0: 0a 66 6f 72 20 6c 6f 67 67 69 6e 67 20 6b 65 79  .for logging key
a3b0: 20 64 61 74 61 20 66 6f 72 20 6e 65 74 77 6f 72   data for networ
a3c0: 6b 20 6c 6f 67 67 69 6e 67 20 74 6f 6f 6c 73 20  k logging tools 
a3d0: 74 6f 20 75 73 65 20 74 6f 20 64 65 63 72 79 70  to use to decryp
a3e0: 74 20 74 68 65 20 64 61 74 61 5c 26 2e 0a 2e 50  t the data\&...P
a3f0: 50 0a 54 68 65 20 5c 66 42 74 6c 73 3a 3a 64 65  P.The \fBtls::de
a400: 62 75 67 5c 66 52 20 76 61 72 69 61 62 6c 65 20  bug\fR variable 
a410: 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 61 64  provides some ad
a420: 64 69 74 69 6f 6e 61 6c 20 63 6f 6e 74 72 6f 6c  ditional control
a430: 20 6f 76 65 72 20 74 68 65 0a 64 65 62 75 67 20   over the.debug 
a440: 6c 6f 67 67 69 6e 67 20 69 6e 20 74 68 65 20 5c  logging in the \
a450: 66 42 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c  fBtls::callback\
a460: 66 52 2c 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73  fR, \fBtls::pass
a470: 77 6f 72 64 5c 66 52 2c 20 61 6e 64 0a 5c 66 42  word\fR, and.\fB
a480: 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f  tls::validate_co
a490: 6d 6d 61 6e 64 5c 66 52 20 64 65 66 61 75 6c 74  mmand\fR default
a4a0: 20 68 61 6e 64 6c 65 72 73 20 69 6e 20 22 5c 66   handlers in "\f
a4b0: 49 74 6c 73 5c 26 2e 74 63 6c 5c 66 52 22 5c 26  Itls\&.tcl\fR"\&
a4c0: 2e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 76 61  ..The default va
a4d0: 6c 75 65 20 69 73 20 30 20 77 69 74 68 20 68 69  lue is 0 with hi
a4e0: 67 68 65 72 20 76 61 6c 75 65 73 20 70 72 6f 64  gher values prod
a4f0: 75 63 69 6e 67 20 6d 6f 72 65 20 64 69 61 67 6e  ucing more diagn
a500: 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 0a 61 6e  ostic output,.an
a510: 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 63  d will also forc
a520: 65 20 74 68 65 20 76 65 72 69 66 79 20 6d 65 74  e the verify met
a530: 68 6f 64 20 69 6e 20 5c 66 42 74 6c 73 3a 3a 63  hod in \fBtls::c
a540: 61 6c 6c 62 61 63 6b 5c 66 52 20 74 6f 20 61 63  allback\fR to ac
a550: 63 65 70 74 20 74 68 65 0a 63 65 72 74 69 66 69  cept the.certifi
a560: 63 61 74 65 2c 20 65 76 65 6e 20 69 66 20 69 74  cate, even if it
a570: 20 69 73 20 69 6e 76 61 6c 69 64 20 77 68 65 6e   is invalid when
a580: 20 74 68 65 20 5c 66 42 2d 76 61 6c 69 64 61 74   the \fB-validat
a590: 65 63 6f 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74 69  ecommand\fR.opti
a5a0: 6f 6e 20 69 73 20 73 65 74 20 74 6f 20 5c 66 42  on is set to \fB
a5b0: 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f  tls::validate_co
a5c0: 6d 6d 61 6e 64 5c 66 52 5c 26 2e 0a 2e 50 50 0a  mmand\fR\&...PP.
a5d0: 5c 66 49 54 68 65 20 75 73 65 20 6f 66 20 74 68  \fIThe use of th
a5e0: 65 20 76 61 72 69 61 62 6c 65 20 5c 66 42 74 6c  e variable \fBtl
a5f0: 73 3a 3a 64 65 62 75 67 5c 66 52 20 69 73 20 6e  s::debug\fR is n
a600: 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 5c 26  ot recommended\&
a610: 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65 6d 6f  ..It may be remo
a620: 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 20  ved from future 
a630: 72 65 6c 65 61 73 65 73 5c 26 2e 5c 66 52 0a 2e  releases\&.\fR..
a640: 53 48 20 45 58 41 4d 50 4c 45 53 0a 54 68 65 20  SH EXAMPLES.The 
a650: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 65 20 65 78  following are ex
a660: 61 6d 70 6c 65 20 73 63 72 69 70 74 73 20 74 6f  ample scripts to
a670: 20 64 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62 70   download a webp
a680: 61 67 65 20 61 6e 64 20 66 69 6c 65 20 75 73 69  age and file usi
a690: 6e 67 20 74 68 65 0a 68 74 74 70 20 70 61 63 6b  ng the.http pack
a6a0: 61 67 65 5c 26 2e 20 53 65 65 20 5c 66 42 43 65  age\&. See \fBCe
a6b0: 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64 61  rtificate Valida
a6c0: 74 69 6f 6e 5c 66 52 20 66 6f 72 20 77 68 65 6e  tion\fR for when
a6d0: 20 74 68 65 0a 5c 66 42 2d 63 61 64 69 72 5c 66   the.\fB-cadir\f
a6e0: 52 2c 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52  R, \fB-cafile\fR
a6f0: 2c 20 61 6e 64 20 5c 66 42 2d 63 61 73 74 6f 72  , and \fB-castor
a700: 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 61 72 65  e\fR options are
a710: 20 61 6c 73 6f 0a 6e 65 65 64 65 64 5c 26 2e 20   also.needed\&. 
a720: 53 65 65 20 74 68 65 20 22 5c 66 49 64 65 6d 6f  See the "\fIdemo
a730: 73 5c 66 52 22 20 64 69 72 65 63 74 6f 72 79 20  s\fR" directory 
a740: 66 6f 72 20 6d 6f 72 65 20 65 78 61 6d 70 6c 65  for more example
a750: 20 73 63 72 69 70 74 73 5c 26 2e 0a 2e 50 50 0a   scripts\&...PP.
a760: 45 78 61 6d 70 6c 65 20 23 31 3a 20 44 6f 77 6e  Example #1: Down
a770: 6c 6f 61 64 20 61 20 77 65 62 20 70 61 67 65 0a  load a web page.
a780: 2e 43 53 0a 0a 0a 0a 70 61 63 6b 61 67 65 20 72  .CS....package r
a790: 65 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b  equire http.pack
a7a0: 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a  age require tls.
a7b0: 0a 73 65 74 20 75 72 6c 20 22 68 74 74 70 73 3a  .set url "https:
a7c0: 2f 2f 77 77 77 5c 26 2e 74 63 6c 5c 26 2e 74 6b  //www\&.tcl\&.tk
a7d0: 2f 22 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65  /".http::registe
a7e0: 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73  r https 443 [lis
a7f0: 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  t ::tls::socket 
a800: 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20  -autoservername 
a810: 31 20 2d 72 65 71 75 69 72 65 20 31 5d 0a 0a 23  1 -require 1]..#
a820: 20 47 65 74 20 55 52 4c 0a 73 65 74 20 74 6f 6b   Get URL.set tok
a830: 65 6e 20 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c  en [http::geturl
a840: 20 24 75 72 6c 5d 0a 0a 23 20 43 68 65 63 6b 20   $url]..# Check 
a850: 66 6f 72 20 65 72 72 6f 72 0a 69 66 20 7b 5b 68  for error.if {[h
a860: 74 74 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b  ttp::status $tok
a870: 65 6e 5d 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a 20  en] ne "ok"} {. 
a880: 20 20 20 70 75 74 73 20 5b 66 6f 72 6d 61 74 20     puts [format 
a890: 22 45 72 72 6f 72 20 25 73 22 20 5b 68 74 74 70  "Error %s" [http
a8a0: 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d  ::status $token]
a8b0: 5d 0a 7d 0a 0a 23 20 53 61 76 65 20 77 65 62 20  ].}..# Save web 
a8c0: 70 61 67 65 20 74 6f 20 66 69 6c 65 0a 73 65 74  page to file.set
a8d0: 20 63 68 20 5b 6f 70 65 6e 20 65 78 61 6d 70 6c   ch [open exampl
a8e0: 65 5c 26 2e 68 74 6d 6c 20 77 62 5d 0a 70 75 74  e\&.html wb].put
a8f0: 73 20 24 63 68 20 5b 68 74 74 70 3a 3a 64 61 74  s $ch [http::dat
a900: 61 20 24 74 6f 6b 65 6e 5d 0a 63 6c 6f 73 65 20  a $token].close 
a910: 24 63 68 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 3a  $ch..# Cleanup.:
a920: 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20 24  :http::cleanup $
a930: 74 6f 6b 65 6e 0a 0a 2e 43 45 0a 45 78 61 6d 70  token...CE.Examp
a940: 6c 65 20 23 32 3a 20 44 6f 77 6e 6c 6f 61 64 20  le #2: Download 
a950: 61 20 66 69 6c 65 0a 2e 43 53 0a 0a 0a 0a 70 61  a file..CS....pa
a960: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 68 74  ckage require ht
a970: 74 70 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  tp.package requi
a980: 72 65 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c 20  re tls..set url 
a990: 22 68 74 74 70 73 3a 2f 2f 77 69 6b 69 5c 26 2e  "https://wiki\&.
a9a0: 74 63 6c 2d 6c 61 6e 67 5c 26 2e 6f 72 67 2f 73  tcl-lang\&.org/s
a9b0: 69 74 65 6d 61 70 5c 26 2e 78 6d 6c 22 0a 68 74  itemap\&.xml".ht
a9c0: 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 74 74  tp::register htt
a9d0: 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74  ps 443 [list ::t
a9e0: 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f  ls::socket -auto
a9f0: 73 65 72 76 65 72 6e 61 6d 65 20 31 20 2d 72 65  servername 1 -re
aa00: 71 75 69 72 65 20 31 5d 0a 0a 23 20 4f 70 65 6e  quire 1]..# Open
aa10: 20 6f 75 74 70 75 74 20 66 69 6c 65 0a 73 65 74   output file.set
aa20: 20 66 69 6c 65 6e 61 6d 65 20 5b 66 69 6c 65 20   filename [file 
aa30: 74 61 69 6c 20 24 75 72 6c 5d 0a 73 65 74 20 63  tail $url].set c
aa40: 68 20 5b 6f 70 65 6e 20 24 66 69 6c 65 6e 61 6d  h [open $filenam
aa50: 65 20 77 62 5d 0a 0a 23 20 47 65 74 20 66 69 6c  e wb]..# Get fil
aa60: 65 0a 73 65 74 20 74 6f 6b 65 6e 20 5b 3a 3a 68  e.set token [::h
aa70: 74 74 70 3a 3a 67 65 74 75 72 6c 20 24 75 72 6c  ttp::geturl $url
aa80: 20 2d 62 6c 6f 63 6b 73 69 7a 65 20 36 35 35 33   -blocksize 6553
aa90: 36 20 2d 63 68 61 6e 6e 65 6c 20 24 63 68 5d 0a  6 -channel $ch].
aaa0: 0a 23 20 43 68 65 63 6b 20 66 6f 72 20 65 72 72  .# Check for err
aab0: 6f 72 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73 74  or.if {[http::st
aac0: 61 74 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65 20  atus $token] ne 
aad0: 22 6f 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74 73  "ok"} {.    puts
aae0: 20 5b 66 6f 72 6d 61 74 20 22 45 72 72 6f 72 20   [format "Error 
aaf0: 25 73 22 20 5b 68 74 74 70 3a 3a 73 74 61 74 75  %s" [http::statu
ab00: 73 20 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20  s $token]].}..# 
ab10: 43 6c 65 61 6e 75 70 0a 63 6c 6f 73 65 20 24 63  Cleanup.close $c
ab20: 68 0a 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75  h.::http::cleanu
ab30: 70 20 24 74 6f 6b 65 6e 0a 0a 2e 43 45 0a 2e 53  p $token...CE..S
ab40: 48 20 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49  H "SPECIAL CONSI
ab50: 44 45 52 41 54 49 4f 4e 53 22 0a 54 68 65 20 63  DERATIONS".The c
ab60: 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74  apabilities of t
ab70: 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20  his package can 
ab80: 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20  vary enormously 
ab90: 62 61 73 65 64 20 75 70 6f 6e 20 68 6f 77 20 74  based upon how t
aba0: 68 65 0a 6c 69 6e 6b 65 64 20 74 6f 20 4f 70 65  he.linked to Ope
abb0: 6e 53 53 4c 20 6c 69 62 72 61 72 79 20 77 61 73  nSSL library was
abc0: 20 63 6f 6e 66 69 67 75 72 65 64 20 61 6e 64 20   configured and 
abd0: 62 75 69 6c 74 5c 26 2e 20 4e 65 77 20 76 65 72  built\&. New ver
abe0: 73 69 6f 6e 73 20 6d 61 79 20 6f 62 73 6f 6c 65  sions may obsole
abf0: 74 65 0a 6f 6c 64 65 72 20 70 72 6f 74 6f 63 6f  te.older protoco
ac00: 6c 20 76 65 72 73 69 6f 6e 73 2c 20 61 64 64 20  l versions, add 
ac10: 6f 72 20 72 65 6d 6f 76 65 20 63 69 70 68 65 72  or remove cipher
ac20: 73 2c 20 63 68 61 6e 67 65 20 64 65 66 61 75 6c  s, change defaul
ac30: 74 20 76 61 6c 75 65 73 2c 20 65 74 63 5c 26 2e  t values, etc\&.
ac40: 0a 55 73 65 20 74 68 65 20 5c 66 42 74 6c 73 3a  .Use the \fBtls:
ac50: 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f  :protocols\fR co
ac60: 6d 6d 61 6e 64 20 74 6f 20 6f 62 74 61 69 6e 20  mmand to obtain 
ac70: 74 68 65 20 73 75 70 70 6f 72 74 65 64 0a 70 72  the supported.pr
ac80: 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 73 5c  otocol versions\
ac90: 26 2e 0a 2e 53 48 20 22 45 52 52 4f 52 20 4d 45  &...SH "ERROR ME
aca0: 53 53 41 47 45 53 22 0a 53 6f 6d 65 20 4f 70 73  SSAGES".Some Ops
acb0: 6e 53 53 6c 20 65 72 72 6f 72 20 6d 65 73 73 61  nSSl error messa
acc0: 67 65 73 20 68 61 76 65 20 63 72 79 70 74 69 63  ges have cryptic
acd0: 20 6d 65 61 6e 69 6e 67 73 5c 26 2e 20 54 68 69   meanings\&. Thi
ace0: 73 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6d  s is a list of m
acf0: 65 73 73 61 67 65 73 0a 61 6c 6f 6e 67 20 77 69  essages.along wi
ad00: 74 68 20 74 68 65 69 72 20 74 72 75 65 20 6d 65  th their true me
ad10: 61 6e 69 6e 67 5c 26 2e 0a 2e 54 50 0a 5c 66 49  aning\&...TP.\fI
ad20: 68 61 6e 64 73 68 61 6b 65 20 66 61 69 6c 65 64  handshake failed
ad30: 3a 20 63 65 72 74 69 66 69 63 61 74 65 20 76 65  : certificate ve
ad40: 72 69 66 79 20 66 61 69 6c 65 64 20 64 75 65 20  rify failed due 
ad50: 74 6f 20 22 75 6e 61 62 6c 65 20 74 6f 20 67 65  to "unable to ge
ad60: 74 20 6c 6f 63 61 6c 20 69 73 73 75 65 72 20 63  t local issuer c
ad70: 65 72 74 69 66 69 63 61 74 65 22 5c 66 52 0a 54  ertificate"\fR.T
ad80: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 73 20  he certificates 
ad90: 69 6e 20 74 68 65 20 43 41 20 66 69 6c 65 20 6f  in the CA file o
ada0: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 74  r certificate st
adb0: 6f 72 65 20 65 69 74 68 65 72 20 64 6f 20 6e 6f  ore either do no
adc0: 74 20 68 61 76 65 20 6f 6e 65 20 6f 72 0a 6d 6f  t have one or.mo
add0: 72 65 20 69 73 73 75 65 72 73 20 6f 66 20 74 68  re issuers of th
ade0: 65 20 63 65 72 74 69 66 69 63 61 74 65 73 20 79  e certificates y
adf0: 6f 75 20 61 72 65 20 76 61 6c 69 64 61 74 69 6e  ou are validatin
ae00: 67 20 6f 72 20 74 68 65 79 20 68 61 76 65 20 65  g or they have e
ae10: 78 70 69 72 65 64 5c 26 2e 0a 55 73 75 61 6c 6c  xpired\&..Usuall
ae20: 79 20 74 68 69 73 20 6d 65 61 6e 73 20 79 6f 75  y this means you
ae30: 20 6e 65 65 64 20 61 6e 20 75 70 64 61 74 65 64   need an updated
ae40: 20 43 41 63 65 72 74 20 66 69 6c 65 5c 26 2e 0a   CAcert file\&..
ae50: 2e 54 50 0a 5c 66 49 70 61 63 6b 65 74 20 6c 65  .TP.\fIpacket le
ae60: 6e 67 74 68 20 74 6f 6f 20 6c 6f 6e 67 5c 66 52  ngth too long\fR
ae70: 0a 43 6c 69 65 6e 74 20 68 61 73 20 74 72 69 65  .Client has trie
ae80: 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f 20  d to connect to 
ae90: 61 20 48 54 54 50 20 73 65 72 76 65 72 20 6f 6e  a HTTP server on
aea0: 20 74 68 65 20 70 6c 61 69 6e 2d 74 65 78 74 20   the plain-text 
aeb0: 70 6f 72 74 20 69 6e 73 74 65 61 64 20 6f 66 0a  port instead of.
aec0: 74 68 65 20 53 53 4c 2f 54 4c 53 20 70 6f 72 74  the SSL/TLS port
aed0: 5c 26 2e 0a 2e 54 50 0a 5c 66 49 75 6e 65 78 70  \&...TP.\fIunexp
aee0: 65 63 74 65 64 20 65 6f 66 20 77 68 69 6c 65 20  ected eof while 
aef0: 72 65 61 64 69 6e 67 5c 66 52 0a 54 68 65 20 70  reading\fR.The p
af00: 65 65 72 20 68 61 73 20 63 6c 6f 73 65 64 20 74  eer has closed t
af10: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 77 69  he connection wi
af20: 74 68 6f 75 74 20 73 65 6e 64 69 6e 67 20 74 68  thout sending th
af30: 65 20 22 63 6c 6f 73 65 20 6e 6f 74 69 66 79 22  e "close notify"
af40: 20 73 68 75 74 64 6f 77 6e 0a 61 6c 65 72 74 5c   shutdown.alert\
af50: 26 2e 20 53 6f 6d 65 20 73 65 72 76 65 72 73 20  &. Some servers 
af60: 77 69 6c 6c 20 74 65 72 6d 69 6e 61 74 65 20 74  will terminate t
af70: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 61 66  he connection af
af80: 74 65 72 20 74 68 65 20 66 69 6c 65 20 6f 72 20  ter the file or 
af90: 77 65 62 70 61 67 65 20 68 61 73 0a 62 65 65 6e  webpage has.been
afa0: 20 73 65 6e 74 20 77 69 74 68 6f 75 74 20 73 65   sent without se
afb0: 6e 64 69 6e 67 20 74 68 65 20 22 63 6c 6f 73 65  nding the "close
afc0: 20 6e 6f 74 69 66 79 22 20 6d 65 73 73 61 67 65   notify" message
afd0: 5c 26 2e 20 49 6e 20 74 68 69 73 20 63 61 73 65  \&. In this case
afe0: 2c 20 69 74 20 73 68 6f 75 6c 64 0a 6e 6f 74 20  , it should.not 
aff0: 72 65 73 75 6c 74 20 69 6e 20 61 20 6c 6f 73 73  result in a loss
b000: 20 6f 66 20 64 61 74 61 5c 26 2e 0a 2e 54 50 0a   of data\&...TP.
b010: 5c 66 49 77 72 6f 6e 67 20 76 65 72 73 69 6f 6e  \fIwrong version
b020: 20 6e 75 6d 62 65 72 5c 66 52 0a 43 6c 69 65 6e   number\fR.Clien
b030: 74 20 68 61 73 20 74 72 69 65 64 20 74 6f 20 63  t has tried to c
b040: 6f 6e 6e 65 63 74 20 74 6f 20 61 20 6e 6f 6e 2d  onnect to a non-
b050: 48 54 54 50 20 73 65 72 76 65 72 20 6f 6e 20 61  HTTP server on a
b060: 20 6e 6f 6e 2d 54 4c 53 20 28 69 5c 26 2e 65 5c   non-TLS (i\&.e\
b070: 26 2e 20 70 6c 61 69 6e 20 74 65 78 74 29 20 70  &. plain text) p
b080: 6f 72 74 5c 26 2e 0a 2e 50 50 0a 2e 53 48 20 22  ort\&...PP..SH "
b090: 53 45 45 20 41 4c 53 4f 22 0a 5c 66 49 4f 70 65  SEE ALSO".\fIOpe
b0a0: 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a 2f  nSSL\fR [https:/
b0b0: 2f 77 77 77 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26  /www\&.openssl\&
b0c0: 2e 6f 72 67 2f 5d 2c 20 68 74 74 70 2c 20 73 6f  .org/], http, so
b0d0: 63 6b 65 74 0a 2e 53 48 20 4b 45 59 57 4f 52 44  cket..SH KEYWORD
b0e0: 53 0a 49 2f 4f 2c 20 49 50 20 41 64 64 72 65 73  S.I/O, IP Addres
b0f0: 73 2c 20 4f 70 65 6e 53 53 4c 2c 20 53 53 4c 2c  s, OpenSSL, SSL,
b100: 20 54 43 50 2c 20 54 4c 53 2c 20 54 63 6c 54 4c   TCP, TLS, TclTL
b110: 53 2c 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 20  S, asynchronous 
b120: 49 2f 4f 2c 20 62 69 6e 64 2c 20 63 65 72 74 69  I/O, bind, certi
b130: 66 69 63 61 74 65 2c 20 63 68 61 6e 6e 65 6c 2c  ficate, channel,
b140: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 64 6f 6d   connection, dom
b150: 61 69 6e 20 6e 61 6d 65 2c 20 68 6f 73 74 2c 20  ain name, host, 
b160: 68 74 74 70 73 2c 20 6e 65 74 77 6f 72 6b 2c 20  https, network, 
b170: 6e 65 74 77 6f 72 6b 20 61 64 64 72 65 73 73 2c  network address,
b180: 20 73 6f 63 6b 65 74 2c 20 74 6c 73 0a 2e 53 48   socket, tls..SH
b190: 20 43 41 54 45 47 4f 52 59 0a 74 6c 73 0a 2e 53   CATEGORY.tls..S
b1a0: 48 20 43 4f 50 59 52 49 47 48 54 0a 2e 6e 66 0a  H COPYRIGHT..nf.
b1b0: 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 31 39  Copyright (c) 19
b1c0: 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 0a 43  99 Matt Newman.C
b1d0: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30  opyright (c) 200
b1e0: 34 20 53 74 61 72 66 69 73 68 20 53 79 73 74 65  4 Starfish Syste
b1f0: 6d 73 0a 43 6f 70 79 72 69 67 68 74 20 28 63 29  ms.Copyright (c)
b200: 20 32 30 32 34 20 42 72 69 61 6e 20 4f 27 48 61   2024 Brian O'Ha
b210: 67 61 6e 0a 0a 2e 66 69 0a                       gan...fi.