Hex Artifact Content

Artifact 7c52fb51a37c419f1209f691d7363cc510917191ce88f35c349f53dc047f41c9:


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 62 31 20 74 6c 73 20 22 54 63 6c 20  \&.0b1 tls "Tcl 
00e0: 54 4c 53 20 65 78 74 65 6e 73 69 6f 6e 22 0a 2e  TLS extension"..
00f0: 5c 22 20 54 68 65 20 2d 2a 2d 20 6e 72 6f 66 66  \" The -*- nroff
0100: 20 2d 2a 2d 20 64 65 66 69 6e 69 74 69 6f 6e 73   -*- definitions
0110: 20 62 65 6c 6f 77 20 61 72 65 20 66 6f 72 20 73   below are for s
0120: 75 70 70 6c 65 6d 65 6e 74 61 6c 20 6d 61 63 72  upplemental macr
0130: 6f 73 20 75 73 65 64 0a 2e 5c 22 20 69 6e 20 54  os used..\" in T
0140: 63 6c 2f 54 6b 20 6d 61 6e 75 61 6c 20 65 6e 74  cl/Tk manual ent
0150: 72 69 65 73 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 41  ries...\"..\" .A
0160: 50 20 74 79 70 65 20 6e 61 6d 65 20 69 6e 2f 6f  P type name in/o
0170: 75 74 20 3f 69 6e 64 65 6e 74 3f 0a 2e 5c 22 09  ut ?indent?..\".
0180: 53 74 61 72 74 20 70 61 72 61 67 72 61 70 68 20  Start paragraph 
0190: 64 65 73 63 72 69 62 69 6e 67 20 61 6e 20 61 72  describing an ar
01a0: 67 75 6d 65 6e 74 20 74 6f 20 61 20 6c 69 62 72  gument to a libr
01b0: 61 72 79 20 70 72 6f 63 65 64 75 72 65 2e 0a 2e  ary procedure...
01c0: 5c 22 09 74 79 70 65 20 69 73 20 74 79 70 65 20  \".type is type 
01d0: 6f 66 20 61 72 67 75 6d 65 6e 74 20 28 69 6e 74  of argument (int
01e0: 2c 20 65 74 63 2e 29 2c 20 69 6e 2f 6f 75 74 20  , etc.), in/out 
01f0: 69 73 20 65 69 74 68 65 72 20 22 69 6e 22 2c 20  is either "in", 
0200: 22 6f 75 74 22 2c 0a 2e 5c 22 09 6f 72 20 22 69  "out",..\".or "i
0210: 6e 2f 6f 75 74 22 20 74 6f 20 64 65 73 63 72 69  n/out" to descri
0220: 62 65 20 77 68 65 74 68 65 72 20 70 72 6f 63 65  be whether proce
0230: 64 75 72 65 20 72 65 61 64 73 20 6f 72 20 6d 6f  dure reads or mo
0240: 64 69 66 69 65 73 20 61 72 67 2c 0a 2e 5c 22 09  difies arg,..\".
0250: 61 6e 64 20 69 6e 64 65 6e 74 20 69 73 20 65 71  and indent is eq
0260: 75 69 76 61 6c 65 6e 74 20 74 6f 20 73 65 63 6f  uivalent to seco
0270: 6e 64 20 61 72 67 20 6f 66 20 2e 49 50 20 28 73  nd arg of .IP (s
0280: 68 6f 75 6c 64 6e 27 74 20 65 76 65 72 20 62 65  houldn't ever be
0290: 0a 2e 5c 22 09 6e 65 65 64 65 64 3b 20 20 75 73  ..\".needed;  us
02a0: 65 20 2e 41 53 20 62 65 6c 6f 77 20 69 6e 73 74  e .AS below inst
02b0: 65 61 64 29 0a 2e 5c 22 0a 2e 5c 22 20 2e 41 53  ead)..\"..\" .AS
02c0: 20 3f 74 79 70 65 3f 20 3f 6e 61 6d 65 3f 0a 2e   ?type? ?name?..
02d0: 5c 22 09 47 69 76 65 20 6d 61 78 69 6d 75 6d 20  \".Give maximum 
02e0: 73 69 7a 65 73 20 6f 66 20 61 72 67 75 6d 65 6e  sizes of argumen
02f0: 74 73 20 66 6f 72 20 73 65 74 74 69 6e 67 20 74  ts for setting t
0300: 61 62 20 73 74 6f 70 73 2e 20 20 54 79 70 65 20  ab stops.  Type 
0310: 61 6e 64 0a 2e 5c 22 09 6e 61 6d 65 20 61 72 65  and..\".name are
0320: 20 65 78 61 6d 70 6c 65 73 20 6f 66 20 6c 61 72   examples of lar
0330: 67 65 73 74 20 70 6f 73 73 69 62 6c 65 20 61 72  gest possible ar
0340: 67 75 6d 65 6e 74 73 20 74 68 61 74 20 77 69 6c  guments that wil
0350: 6c 20 62 65 20 70 61 73 73 65 64 0a 2e 5c 22 09  l be passed..\".
0360: 74 6f 20 2e 41 50 20 6c 61 74 65 72 2e 20 20 49  to .AP later.  I
0370: 66 20 61 72 67 73 20 61 72 65 20 6f 6d 69 74 74  f args are omitt
0380: 65 64 2c 20 64 65 66 61 75 6c 74 20 74 61 62 20  ed, default tab 
0390: 73 74 6f 70 73 20 61 72 65 20 75 73 65 64 2e 0a  stops are used..
03a0: 2e 5c 22 0a 2e 5c 22 20 2e 42 53 0a 2e 5c 22 09  .\"..\" .BS..\".
03b0: 53 74 61 72 74 20 62 6f 78 20 65 6e 63 6c 6f 73  Start box enclos
03c0: 75 72 65 2e 20 20 46 72 6f 6d 20 68 65 72 65 20  ure.  From here 
03d0: 75 6e 74 69 6c 20 6e 65 78 74 20 2e 42 45 2c 20  until next .BE, 
03e0: 65 76 65 72 79 74 68 69 6e 67 20 77 69 6c 6c 20  everything will 
03f0: 62 65 0a 2e 5c 22 09 65 6e 63 6c 6f 73 65 64 20  be..\".enclosed 
0400: 69 6e 20 6f 6e 65 20 6c 61 72 67 65 20 62 6f 78  in one large box
0410: 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 42 45 0a 2e 5c  ...\"..\" .BE..\
0420: 22 09 45 6e 64 20 6f 66 20 62 6f 78 20 65 6e 63  ".End of box enc
0430: 6c 6f 73 75 72 65 2e 0a 2e 5c 22 0a 2e 5c 22 20  losure...\"..\" 
0440: 2e 43 53 0a 2e 5c 22 09 42 65 67 69 6e 20 63 6f  .CS..\".Begin co
0450: 64 65 20 65 78 63 65 72 70 74 2e 0a 2e 5c 22 0a  de excerpt...\".
0460: 2e 5c 22 20 2e 43 45 0a 2e 5c 22 09 45 6e 64 20  .\" .CE..\".End 
0470: 63 6f 64 65 20 65 78 63 65 72 70 74 2e 0a 2e 5c  code excerpt...\
0480: 22 0a 2e 5c 22 20 2e 56 53 20 3f 76 65 72 73 69  "..\" .VS ?versi
0490: 6f 6e 3f 20 3f 62 72 3f 0a 2e 5c 22 09 42 65 67  on? ?br?..\".Beg
04a0: 69 6e 20 76 65 72 74 69 63 61 6c 20 73 69 64 65  in vertical side
04b0: 62 61 72 2c 20 66 6f 72 20 75 73 65 20 69 6e 20  bar, for use in 
04c0: 6d 61 72 6b 69 6e 67 20 6e 65 77 6c 79 2d 63 68  marking newly-ch
04d0: 61 6e 67 65 64 20 70 61 72 74 73 0a 2e 5c 22 09  anged parts..\".
04e0: 6f 66 20 6d 61 6e 20 70 61 67 65 73 2e 20 20 54  of man pages.  T
04f0: 68 65 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e  he first argumen
0500: 74 20 69 73 20 69 67 6e 6f 72 65 64 20 61 6e 64  t is ignored and
0510: 20 75 73 65 64 20 66 6f 72 20 72 65 63 6f 72 64   used for record
0520: 69 6e 67 0a 2e 5c 22 09 74 68 65 20 76 65 72 73  ing..\".the vers
0530: 69 6f 6e 20 77 68 65 6e 20 74 68 65 20 2e 56 53  ion when the .VS
0540: 20 77 61 73 20 61 64 64 65 64 2c 20 73 6f 20 74   was added, so t
0550: 68 61 74 20 74 68 65 20 73 69 64 65 62 61 72 73  hat the sidebars
0560: 20 63 61 6e 20 62 65 0a 2e 5c 22 09 66 6f 75 6e   can be..\".foun
0570: 64 20 61 6e 64 20 72 65 6d 6f 76 65 64 20 77 68  d and removed wh
0580: 65 6e 20 74 68 65 79 20 72 65 61 63 68 20 61 20  en they reach a 
0590: 63 65 72 74 61 69 6e 20 61 67 65 2e 20 20 49 66  certain age.  If
05a0: 20 61 6e 6f 74 68 65 72 20 61 72 67 75 6d 65 6e   another argumen
05b0: 74 0a 2e 5c 22 09 69 73 20 70 72 65 73 65 6e 74  t..\".is present
05c0: 2c 20 74 68 65 6e 20 61 20 6c 69 6e 65 20 62 72  , then a line br
05d0: 65 61 6b 20 69 73 20 66 6f 72 63 65 64 20 62 65  eak is forced be
05e0: 66 6f 72 65 20 73 74 61 72 74 69 6e 67 20 74 68  fore starting th
05f0: 65 20 73 69 64 65 62 61 72 2e 0a 2e 5c 22 0a 2e  e sidebar...\"..
0600: 5c 22 20 2e 56 45 0a 2e 5c 22 09 45 6e 64 20 6f  \" .VE..\".End o
0610: 66 20 76 65 72 74 69 63 61 6c 20 73 69 64 65 62  f vertical sideb
0620: 61 72 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 44 53 0a  ar...\"..\" .DS.
0630: 2e 5c 22 09 42 65 67 69 6e 20 61 6e 20 69 6e 64  .\".Begin an ind
0640: 65 6e 74 65 64 20 75 6e 66 69 6c 6c 65 64 20 64  ented unfilled d
0650: 69 73 70 6c 61 79 2e 0a 2e 5c 22 0a 2e 5c 22 20  isplay...\"..\" 
0660: 2e 44 45 0a 2e 5c 22 09 45 6e 64 20 6f 66 20 69  .DE..\".End of i
0670: 6e 64 65 6e 74 65 64 20 75 6e 66 69 6c 6c 65 64  ndented unfilled
0680: 20 64 69 73 70 6c 61 79 2e 0a 2e 5c 22 0a 2e 5c   display...\"..\
0690: 22 20 2e 53 4f 20 3f 6d 61 6e 70 61 67 65 3f 0a  " .SO ?manpage?.
06a0: 2e 5c 22 09 53 74 61 72 74 20 6f 66 20 6c 69 73  .\".Start of lis
06b0: 74 20 6f 66 20 73 74 61 6e 64 61 72 64 20 6f 70  t of standard op
06c0: 74 69 6f 6e 73 20 66 6f 72 20 61 20 54 6b 20 77  tions for a Tk w
06d0: 69 64 67 65 74 2e 20 54 68 65 20 6d 61 6e 70 61  idget. The manpa
06e0: 67 65 0a 2e 5c 22 09 61 72 67 75 6d 65 6e 74 20  ge..\".argument 
06f0: 64 65 66 69 6e 65 73 20 77 68 65 72 65 20 74 6f  defines where to
0700: 20 6c 6f 6f 6b 20 75 70 20 74 68 65 20 73 74 61   look up the sta
0710: 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 3b 20 69  ndard options; i
0720: 66 0a 2e 5c 22 09 6f 6d 69 74 74 65 64 2c 20 64  f..\".omitted, d
0730: 65 66 61 75 6c 74 73 20 74 6f 20 22 6f 70 74 69  efaults to "opti
0740: 6f 6e 73 22 2e 20 54 68 65 20 6f 70 74 69 6f 6e  ons". The option
0750: 73 20 66 6f 6c 6c 6f 77 20 6f 6e 20 73 75 63 63  s follow on succ
0760: 65 73 73 69 76 65 0a 2e 5c 22 09 6c 69 6e 65 73  essive..\".lines
0770: 2c 20 69 6e 20 74 68 72 65 65 20 63 6f 6c 75 6d  , in three colum
0780: 6e 73 20 73 65 70 61 72 61 74 65 64 20 62 79 20  ns separated by 
0790: 74 61 62 73 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e 53  tabs...\"..\" .S
07a0: 45 0a 2e 5c 22 09 45 6e 64 20 6f 66 20 6c 69 73  E..\".End of lis
07b0: 74 20 6f 66 20 73 74 61 6e 64 61 72 64 20 6f 70  t of standard op
07c0: 74 69 6f 6e 73 20 66 6f 72 20 61 20 54 6b 20 77  tions for a Tk w
07d0: 69 64 67 65 74 2e 0a 2e 5c 22 0a 2e 5c 22 20 2e  idget...\"..\" .
07e0: 4f 50 20 63 6d 64 4e 61 6d 65 20 64 62 4e 61 6d  OP cmdName dbNam
07f0: 65 20 64 62 43 6c 61 73 73 0a 2e 5c 22 09 53 74  e dbClass..\".St
0800: 61 72 74 20 6f 66 20 64 65 73 63 72 69 70 74 69  art of descripti
0810: 6f 6e 20 6f 66 20 61 20 73 70 65 63 69 66 69 63  on of a specific
0820: 20 6f 70 74 69 6f 6e 2e 20 20 63 6d 64 4e 61 6d   option.  cmdNam
0830: 65 20 67 69 76 65 73 20 74 68 65 0a 2e 5c 22 09  e gives the..\".
0840: 6f 70 74 69 6f 6e 27 73 20 6e 61 6d 65 20 61 73  option's name as
0850: 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 74 68   specified in th
0860: 65 20 63 6c 61 73 73 20 63 6f 6d 6d 61 6e 64 2c  e class command,
0870: 20 64 62 4e 61 6d 65 20 67 69 76 65 73 0a 2e 5c   dbName gives..\
0880: 22 09 74 68 65 20 6f 70 74 69 6f 6e 27 73 20 6e  ".the option's n
0890: 61 6d 65 20 69 6e 20 74 68 65 20 6f 70 74 69 6f  ame in the optio
08a0: 6e 20 64 61 74 61 62 61 73 65 2c 20 61 6e 64 20  n database, and 
08b0: 64 62 43 6c 61 73 73 20 67 69 76 65 73 0a 2e 5c  dbClass gives..\
08c0: 22 09 74 68 65 20 6f 70 74 69 6f 6e 27 73 20 63  ".the option's c
08d0: 6c 61 73 73 20 69 6e 20 74 68 65 20 6f 70 74 69  lass in the opti
08e0: 6f 6e 20 64 61 74 61 62 61 73 65 2e 0a 2e 5c 22  on database...\"
08f0: 0a 2e 5c 22 20 2e 55 4c 20 61 72 67 31 20 61 72  ..\" .UL arg1 ar
0900: 67 32 0a 2e 5c 22 09 50 72 69 6e 74 20 61 72 67  g2..\".Print arg
0910: 31 20 75 6e 64 65 72 6c 69 6e 65 64 2c 20 74 68  1 underlined, th
0920: 65 6e 20 70 72 69 6e 74 20 61 72 67 32 20 6e 6f  en print arg2 no
0930: 72 6d 61 6c 6c 79 2e 0a 2e 5c 22 0a 2e 5c 22 20  rmally...\"..\" 
0940: 2e 51 57 20 61 72 67 31 20 3f 61 72 67 32 3f 0a  .QW arg1 ?arg2?.
0950: 2e 5c 22 09 50 72 69 6e 74 20 61 72 67 31 20 69  .\".Print arg1 i
0960: 6e 20 71 75 6f 74 65 73 2c 20 74 68 65 6e 20 61  n quotes, then a
0970: 72 67 32 20 6e 6f 72 6d 61 6c 6c 79 20 28 66 6f  rg2 normally (fo
0980: 72 20 74 72 61 69 6c 69 6e 67 20 70 75 6e 63 74  r trailing punct
0990: 75 61 74 69 6f 6e 29 2e 0a 2e 5c 22 0a 2e 5c 22  uation)...\"..\"
09a0: 20 2e 50 51 20 61 72 67 31 20 3f 61 72 67 32 3f   .PQ arg1 ?arg2?
09b0: 0a 2e 5c 22 09 50 72 69 6e 74 20 61 6e 20 6f 70  ..\".Print an op
09c0: 65 6e 20 70 61 72 65 6e 74 68 65 73 69 73 2c 20  en parenthesis, 
09d0: 61 72 67 31 20 69 6e 20 71 75 6f 74 65 73 2c 20  arg1 in quotes, 
09e0: 74 68 65 6e 20 61 72 67 32 20 6e 6f 72 6d 61 6c  then arg2 normal
09f0: 6c 79 0a 2e 5c 22 09 28 66 6f 72 20 74 72 61 69  ly..\".(for trai
0a00: 6c 69 6e 67 20 70 75 6e 63 74 75 61 74 69 6f 6e  ling punctuation
0a10: 29 20 61 6e 64 20 74 68 65 6e 20 61 20 63 6c 6f  ) and then a clo
0a20: 73 69 6e 67 20 70 61 72 65 6e 74 68 65 73 69 73  sing parenthesis
0a30: 2e 0a 2e 5c 22 0a 2e 5c 22 09 23 20 53 65 74 20  ...\"..\".# Set 
0a40: 75 70 20 74 72 61 70 73 20 61 6e 64 20 6f 74 68  up traps and oth
0a50: 65 72 20 6d 69 73 63 65 6c 6c 61 6e 65 6f 75 73  er miscellaneous
0a60: 20 73 74 75 66 66 20 66 6f 72 20 54 63 6c 2f 54   stuff for Tcl/T
0a70: 6b 20 6d 61 6e 20 70 61 67 65 73 2e 0a 2e 69 66  k man pages...if
0a80: 20 74 20 2e 77 68 20 2d 31 2e 33 69 20 5e 42 0a   t .wh -1.3i ^B.
0a90: 2e 6e 72 20 5e 6c 20 5c 6e 28 2e 6c 0a 2e 61 64  .nr ^l \n(.l..ad
0aa0: 20 62 0a 2e 5c 22 09 23 20 53 74 61 72 74 20 61   b..\".# Start a
0ab0: 6e 20 61 72 67 75 6d 65 6e 74 20 64 65 73 63 72  n argument descr
0ac0: 69 70 74 69 6f 6e 0a 2e 64 65 20 41 50 0a 2e 69  iption..de AP..i
0ad0: 65 20 21 22 5c 5c 24 34 22 22 20 2e 54 50 20 5c  e !"\\$4"" .TP \
0ae0: 5c 24 34 0a 2e 65 6c 20 5c 7b 5c 0a 2e 20 20 20  \$4..el \{\..   
0af0: 69 65 20 21 22 5c 5c 24 32 22 22 20 2e 54 50 20  ie !"\\$2"" .TP 
0b00: 5c 5c 6e 28 29 43 75 0a 2e 20 20 20 65 6c 20 20  \\n()Cu..   el  
0b10: 20 20 20 20 20 20 20 20 2e 54 50 20 31 35 0a 2e          .TP 15..
0b20: 5c 7d 0a 2e 74 61 20 5c 5c 6e 28 29 41 75 20 5c  \}..ta \\n()Au \
0b30: 5c 6e 28 29 42 75 0a 2e 69 65 20 21 22 5c 5c 24  \n()Bu..ie !"\\$
0b40: 33 22 22 20 5c 7b 5c 0a 5c 26 5c 5c 24 31 20 5c  3"" \{\.\&\\$1 \
0b50: 5c 66 49 5c 5c 24 32 5c 5c 66 50 20 28 5c 5c 24  \fI\\$2\\fP (\\$
0b60: 33 29 0a 2e 5c 22 2e 62 0a 2e 5c 7d 0a 2e 65 6c  3)..\".b..\}..el
0b70: 20 5c 7b 5c 0a 2e 62 72 0a 2e 69 65 20 21 22 5c   \{\..br..ie !"\
0b80: 5c 24 32 22 22 20 5c 7b 5c 0a 5c 26 5c 5c 24 31  \$2"" \{\.\&\\$1
0b90: 09 5c 5c 66 49 5c 5c 24 32 5c 5c 66 50 0a 2e 5c  .\\fI\\$2\\fP..\
0ba0: 7d 0a 2e 65 6c 20 5c 7b 5c 0a 5c 26 5c 5c 66 49  }..el \{\.\&\\fI
0bb0: 5c 5c 24 31 5c 5c 66 50 0a 2e 5c 7d 0a 2e 5c 7d  \\$1\\fP..\}..\}
0bc0: 0a 2e 2e 0a 2e 5c 22 09 23 20 64 65 66 69 6e 65  .....\".# define
0bd0: 20 74 61 62 62 69 6e 67 20 76 61 6c 75 65 73 20   tabbing values 
0be0: 66 6f 72 20 2e 41 50 0a 2e 64 65 20 41 53 0a 2e  for .AP..de AS..
0bf0: 6e 72 20 29 41 20 31 30 6e 0a 2e 69 66 20 21 22  nr )A 10n..if !"
0c00: 5c 5c 24 31 22 22 20 2e 6e 72 20 29 41 20 5c 5c  \\$1"" .nr )A \\
0c10: 77 27 5c 5c 24 31 27 75 2b 33 6e 0a 2e 6e 72 20  w'\\$1'u+3n..nr 
0c20: 29 42 20 5c 5c 6e 28 29 41 75 2b 31 35 6e 0a 2e  )B \\n()Au+15n..
0c30: 5c 22 0a 2e 69 66 20 21 22 5c 5c 24 32 22 22 20  \"..if !"\\$2"" 
0c40: 2e 6e 72 20 29 42 20 5c 5c 77 27 5c 5c 24 32 27  .nr )B \\w'\\$2'
0c50: 75 2b 5c 5c 6e 28 29 41 75 2b 33 6e 0a 2e 6e 72  u+\\n()Au+3n..nr
0c60: 20 29 43 20 5c 5c 6e 28 29 42 75 2b 5c 5c 77 27   )C \\n()Bu+\\w'
0c70: 28 69 6e 2f 6f 75 74 29 27 75 2b 32 6e 0a 2e 2e  (in/out)'u+2n...
0c80: 0a 2e 41 53 20 54 63 6c 5f 49 6e 74 65 72 70 20  ..AS Tcl_Interp 
0c90: 54 63 6c 5f 43 72 65 61 74 65 49 6e 74 65 72 70  Tcl_CreateInterp
0ca0: 20 69 6e 2f 6f 75 74 0a 2e 5c 22 09 23 20 42 53   in/out..\".# BS
0cb0: 20 2d 20 73 74 61 72 74 20 62 6f 78 65 64 20 74   - start boxed t
0cc0: 65 78 74 0a 2e 5c 22 09 23 20 5e 79 20 3d 20 73  ext..\".# ^y = s
0cd0: 74 61 72 74 69 6e 67 20 79 20 6c 6f 63 61 74 69  tarting y locati
0ce0: 6f 6e 0a 2e 5c 22 09 23 20 5e 62 20 3d 20 31 0a  on..\".# ^b = 1.
0cf0: 2e 64 65 20 42 53 0a 2e 62 72 0a 2e 6d 6b 20 5e  .de BS..br..mk ^
0d00: 79 0a 2e 6e 72 20 5e 62 20 31 75 0a 2e 69 66 20  y..nr ^b 1u..if 
0d10: 6e 20 2e 6e 66 0a 2e 69 66 20 6e 20 2e 74 69 20  n .nf..if n .ti 
0d20: 30 0a 2e 69 66 20 6e 20 5c 6c 27 5c 5c 6e 28 2e  0..if n \l'\\n(.
0d30: 6c 75 5c 28 75 6c 27 0a 2e 69 66 20 6e 20 2e 66  lu\(ul'..if n .f
0d40: 69 0a 2e 2e 0a 2e 5c 22 09 23 20 42 45 20 2d 20  i.....\".# BE - 
0d50: 65 6e 64 20 62 6f 78 65 64 20 74 65 78 74 20 28  end boxed text (
0d60: 64 72 61 77 20 62 6f 78 20 6e 6f 77 29 0a 2e 64  draw box now)..d
0d70: 65 20 42 45 0a 2e 6e 66 0a 2e 74 69 20 30 0a 2e  e BE..nf..ti 0..
0d80: 6d 6b 20 5e 74 0a 2e 69 65 20 6e 20 5c 6c 27 5c  mk ^t..ie n \l'\
0d90: 5c 6e 28 5e 6c 75 5c 28 75 6c 27 0a 2e 65 6c 20  \n(^lu\(ul'..el 
0da0: 5c 7b 5c 0a 2e 5c 22 09 44 72 61 77 20 66 6f 75  \{\..\".Draw fou
0db0: 72 2d 73 69 64 65 64 20 62 6f 78 20 6e 6f 72 6d  r-sided box norm
0dc0: 61 6c 6c 79 2c 20 62 75 74 20 64 6f 6e 27 74 20  ally, but don't 
0dd0: 64 72 61 77 20 74 6f 70 20 6f 66 0a 2e 5c 22 09  draw top of..\".
0de0: 62 6f 78 20 69 66 20 74 68 65 20 62 6f 78 20 73  box if the box s
0df0: 74 61 72 74 65 64 20 6f 6e 20 61 6e 20 65 61 72  tarted on an ear
0e00: 6c 69 65 72 20 70 61 67 65 2e 0a 2e 69 65 20 21  lier page...ie !
0e10: 5c 5c 6e 28 5e 62 2d 31 20 5c 7b 5c 0a 5c 68 27  \\n(^b-1 \{\.\h'
0e20: 2d 31 2e 35 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 79  -1.5n'\L'|\\n(^y
0e30: 75 2d 31 76 27 5c 6c 27 5c 5c 6e 28 5e 6c 75 2b  u-1v'\l'\\n(^lu+
0e40: 33 6e 5c 28 75 6c 27 5c 4c 27 5c 5c 6e 28 5e 74  3n\(ul'\L'\\n(^t
0e50: 75 2b 31 76 2d 5c 5c 6e 28 5e 79 75 27 5c 6c 27  u+1v-\\n(^yu'\l'
0e60: 7c 30 75 2d 31 2e 35 6e 5c 28 75 6c 27 0a 2e 5c  |0u-1.5n\(ul'..\
0e70: 7d 0a 2e 65 6c 20 5c 7d 5c 0a 5c 68 27 2d 31 2e  }..el \}\.\h'-1.
0e80: 35 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 79 75 2d 31  5n'\L'|\\n(^yu-1
0e90: 76 27 5c 68 27 5c 5c 6e 28 5e 6c 75 2b 33 6e 27  v'\h'\\n(^lu+3n'
0ea0: 5c 4c 27 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c  \L'\\n(^tu+1v-\\
0eb0: 6e 28 5e 79 75 27 5c 6c 27 7c 30 75 2d 31 2e 35  n(^yu'\l'|0u-1.5
0ec0: 6e 5c 28 75 6c 27 0a 2e 5c 7d 0a 2e 5c 7d 0a 2e  n\(ul'..\}..\}..
0ed0: 66 69 0a 2e 62 72 0a 2e 6e 72 20 5e 62 20 30 0a  fi..br..nr ^b 0.
0ee0: 2e 2e 0a 2e 5c 22 09 23 20 56 53 20 2d 20 73 74  ....\".# VS - st
0ef0: 61 72 74 20 76 65 72 74 69 63 61 6c 20 73 69 64  art vertical sid
0f00: 65 62 61 72 0a 2e 5c 22 09 23 20 5e 59 20 3d 20  ebar..\".# ^Y = 
0f10: 73 74 61 72 74 69 6e 67 20 79 20 6c 6f 63 61 74  starting y locat
0f20: 69 6f 6e 0a 2e 5c 22 09 23 20 5e 76 20 3d 20 31  ion..\".# ^v = 1
0f30: 20 28 66 6f 72 20 74 72 6f 66 66 3b 20 20 66 6f   (for troff;  fo
0f40: 72 20 6e 72 6f 66 66 20 74 68 69 73 20 64 6f 65  r nroff this doe
0f50: 73 6e 27 74 20 6d 61 74 74 65 72 29 0a 2e 64 65  sn't matter)..de
0f60: 20 56 53 0a 2e 69 66 20 21 22 5c 5c 24 32 22 22   VS..if !"\\$2""
0f70: 20 2e 62 72 0a 2e 6d 6b 20 5e 59 0a 2e 69 65 20   .br..mk ^Y..ie 
0f80: 6e 20 27 6d 63 20 5c 73 31 32 5c 28 62 72 5c 73  n 'mc \s12\(br\s
0f90: 30 0a 2e 65 6c 20 2e 6e 72 20 5e 76 20 31 75 0a  0..el .nr ^v 1u.
0fa0: 2e 2e 0a 2e 5c 22 09 23 20 56 45 20 2d 20 65 6e  ....\".# VE - en
0fb0: 64 20 6f 66 20 76 65 72 74 69 63 61 6c 20 73 69  d of vertical si
0fc0: 64 65 62 61 72 0a 2e 64 65 20 56 45 0a 2e 69 65  debar..de VE..ie
0fd0: 20 6e 20 27 6d 63 0a 2e 65 6c 20 5c 7b 5c 0a 2e   n 'mc..el \{\..
0fe0: 65 76 20 32 0a 2e 6e 66 0a 2e 74 69 20 30 0a 2e  ev 2..nf..ti 0..
0ff0: 6d 6b 20 5e 74 0a 5c 68 27 7c 5c 5c 6e 28 5e 6c  mk ^t.\h'|\\n(^l
1000: 75 2b 33 6e 27 5c 4c 27 7c 5c 5c 6e 28 5e 59 75  u+3n'\L'|\\n(^Yu
1010: 2d 31 76 5c 28 62 76 27 5c 76 27 5c 5c 6e 28 5e  -1v\(bv'\v'\\n(^
1020: 74 75 2b 31 76 2d 5c 5c 6e 28 5e 59 75 27 5c 68  tu+1v-\\n(^Yu'\h
1030: 27 2d 7c 5c 5c 6e 28 5e 6c 75 2b 33 6e 27 0a 2e  '-|\\n(^lu+3n'..
1040: 73 70 20 2d 31 0a 2e 66 69 0a 2e 65 76 0a 2e 5c  sp -1..fi..ev..\
1050: 7d 0a 2e 6e 72 20 5e 76 20 30 0a 2e 2e 0a 2e 5c  }..nr ^v 0.....\
1060: 22 09 23 20 53 70 65 63 69 61 6c 20 6d 61 63 72  ".# Special macr
1070: 6f 20 74 6f 20 68 61 6e 64 6c 65 20 70 61 67 65  o to handle page
1080: 20 62 6f 74 74 6f 6d 3a 20 20 66 69 6e 69 73 68   bottom:  finish
1090: 20 6f 66 66 20 63 75 72 72 65 6e 74 0a 2e 5c 22   off current..\"
10a0: 09 23 20 62 6f 78 2f 73 69 64 65 62 61 72 20 69  .# box/sidebar i
10b0: 66 20 69 6e 20 62 6f 78 2f 73 69 64 65 62 61 72  f in box/sidebar
10c0: 20 6d 6f 64 65 2c 20 74 68 65 6e 20 69 6e 76 6f   mode, then invo
10d0: 6b 65 64 20 73 74 61 6e 64 61 72 64 0a 2e 5c 22  ked standard..\"
10e0: 09 23 20 70 61 67 65 20 62 6f 74 74 6f 6d 20 6d  .# page bottom m
10f0: 61 63 72 6f 2e 0a 2e 64 65 20 5e 42 0a 2e 65 76  acro...de ^B..ev
1100: 20 32 0a 27 74 69 20 30 0a 27 6e 66 0a 2e 6d 6b   2.'ti 0.'nf..mk
1110: 20 5e 74 0a 2e 69 66 20 5c 5c 6e 28 5e 62 20 5c   ^t..if \\n(^b \
1120: 7b 5c 0a 2e 5c 22 09 44 72 61 77 20 74 68 72 65  {\..\".Draw thre
1130: 65 2d 73 69 64 65 64 20 62 6f 78 20 69 66 20 74  e-sided box if t
1140: 68 69 73 20 69 73 20 74 68 65 20 62 6f 78 27 73  his is the box's
1150: 20 66 69 72 73 74 20 70 61 67 65 2c 0a 2e 5c 22   first page,..\"
1160: 09 64 72 61 77 20 74 77 6f 20 73 69 64 65 73 20  .draw two sides 
1170: 62 75 74 20 6e 6f 20 74 6f 70 20 6f 74 68 65 72  but no top other
1180: 77 69 73 65 2e 0a 2e 69 65 20 21 5c 5c 6e 28 5e  wise...ie !\\n(^
1190: 62 2d 31 20 5c 68 27 2d 31 2e 35 6e 27 5c 4c 27  b-1 \h'-1.5n'\L'
11a0: 7c 5c 5c 6e 28 5e 79 75 2d 31 76 27 5c 6c 27 5c  |\\n(^yu-1v'\l'\
11b0: 5c 6e 28 5e 6c 75 2b 33 6e 5c 28 75 6c 27 5c 4c  \n(^lu+3n\(ul'\L
11c0: 27 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c 6e 28  '\\n(^tu+1v-\\n(
11d0: 5e 79 75 27 5c 68 27 7c 30 75 27 5c 63 0a 2e 65  ^yu'\h'|0u'\c..e
11e0: 6c 20 5c 68 27 2d 31 2e 35 6e 27 5c 4c 27 7c 5c  l \h'-1.5n'\L'|\
11f0: 5c 6e 28 5e 79 75 2d 31 76 27 5c 68 27 5c 5c 6e  \n(^yu-1v'\h'\\n
1200: 28 5e 6c 75 2b 33 6e 27 5c 4c 27 5c 5c 6e 28 5e  (^lu+3n'\L'\\n(^
1210: 74 75 2b 31 76 2d 5c 5c 6e 28 5e 79 75 27 5c 68  tu+1v-\\n(^yu'\h
1220: 27 7c 30 75 27 5c 63 0a 2e 5c 7d 0a 2e 69 66 20  '|0u'\c..\}..if 
1230: 5c 5c 6e 28 5e 76 20 5c 7b 5c 0a 2e 6e 72 20 5e  \\n(^v \{\..nr ^
1240: 78 20 5c 5c 6e 28 5e 74 75 2b 31 76 2d 5c 5c 6e  x \\n(^tu+1v-\\n
1250: 28 5e 59 75 0a 5c 6b 78 5c 68 27 2d 5c 5c 6e 78  (^Yu.\kx\h'-\\nx
1260: 75 27 5c 68 27 7c 5c 5c 6e 28 5e 6c 75 2b 33 6e  u'\h'|\\n(^lu+3n
1270: 27 5c 6b 79 5c 4c 27 2d 5c 5c 6e 28 5e 78 75 27  '\ky\L'-\\n(^xu'
1280: 5c 76 27 5c 5c 6e 28 5e 78 75 27 5c 68 27 7c 30  \v'\\n(^xu'\h'|0
1290: 75 27 5c 63 0a 2e 5c 7d 0a 2e 62 70 0a 27 66 69  u'\c..\}..bp.'fi
12a0: 0a 2e 65 76 0a 2e 69 66 20 5c 5c 6e 28 5e 62 20  ..ev..if \\n(^b 
12b0: 5c 7b 5c 0a 2e 6d 6b 20 5e 79 0a 2e 6e 72 20 5e  \{\..mk ^y..nr ^
12c0: 62 20 32 0a 2e 5c 7d 0a 2e 69 66 20 5c 5c 6e 28  b 2..\}..if \\n(
12d0: 5e 76 20 5c 7b 5c 0a 2e 6d 6b 20 5e 59 0a 2e 5c  ^v \{\..mk ^Y..\
12e0: 7d 0a 2e 2e 0a 2e 5c 22 09 23 20 44 53 20 2d 20  }.....\".# DS - 
12f0: 62 65 67 69 6e 20 64 69 73 70 6c 61 79 0a 2e 64  begin display..d
1300: 65 20 44 53 0a 2e 52 53 0a 2e 6e 66 0a 2e 73 70  e DS..RS..nf..sp
1310: 0a 2e 2e 0a 2e 5c 22 09 23 20 44 45 20 2d 20 65  .....\".# DE - e
1320: 6e 64 20 64 69 73 70 6c 61 79 0a 2e 64 65 20 44  nd display..de D
1330: 45 0a 2e 66 69 0a 2e 52 45 0a 2e 73 70 0a 2e 2e  E..fi..RE..sp...
1340: 0a 2e 5c 22 09 23 20 53 4f 20 2d 20 73 74 61 72  ..\".# SO - star
1350: 74 20 6f 66 20 6c 69 73 74 20 6f 66 20 73 74 61  t of list of sta
1360: 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 0a 2e 64  ndard options..d
1370: 65 20 53 4f 0a 27 69 65 20 27 5c 5c 24 31 27 27  e SO.'ie '\\$1''
1380: 20 2e 64 73 20 53 6f 20 5c 5c 66 42 6f 70 74 69   .ds So \\fBopti
1390: 6f 6e 73 5c 5c 66 52 0a 27 65 6c 20 2e 64 73 20  ons\\fR.'el .ds 
13a0: 53 6f 20 5c 5c 66 42 5c 5c 24 31 5c 5c 66 52 0a  So \\fB\\$1\\fR.
13b0: 2e 53 48 20 22 53 54 41 4e 44 41 52 44 20 4f 50  .SH "STANDARD OP
13c0: 54 49 4f 4e 53 22 0a 2e 4c 50 0a 2e 6e 66 0a 2e  TIONS"..LP..nf..
13d0: 74 61 20 35 2e 35 63 20 31 31 63 0a 2e 66 74 20  ta 5.5c 11c..ft 
13e0: 42 0a 2e 2e 0a 2e 5c 22 09 23 20 53 45 20 2d 20  B.....\".# SE - 
13f0: 65 6e 64 20 6f 66 20 6c 69 73 74 20 6f 66 20 73  end of list of s
1400: 74 61 6e 64 61 72 64 20 6f 70 74 69 6f 6e 73 0a  tandard options.
1410: 2e 64 65 20 53 45 0a 2e 66 69 0a 2e 66 74 20 52  .de SE..fi..ft R
1420: 0a 2e 4c 50 0a 53 65 65 20 74 68 65 20 5c 5c 2a  ..LP.See the \\*
1430: 28 53 6f 20 6d 61 6e 75 61 6c 20 65 6e 74 72 79  (So manual entry
1440: 20 66 6f 72 20 64 65 74 61 69 6c 73 20 6f 6e 20   for details on 
1450: 74 68 65 20 73 74 61 6e 64 61 72 64 20 6f 70 74  the standard opt
1460: 69 6f 6e 73 2e 0a 2e 2e 0a 2e 5c 22 09 23 20 4f  ions......\".# O
1470: 50 20 2d 20 73 74 61 72 74 20 6f 66 20 66 75 6c  P - start of ful
1480: 6c 20 64 65 73 63 72 69 70 74 69 6f 6e 20 66 6f  l description fo
1490: 72 20 61 20 73 69 6e 67 6c 65 20 6f 70 74 69 6f  r a single optio
14a0: 6e 0a 2e 64 65 20 4f 50 0a 2e 4c 50 0a 2e 6e 66  n..de OP..LP..nf
14b0: 0a 2e 74 61 20 34 63 0a 43 6f 6d 6d 61 6e 64 2d  ..ta 4c.Command-
14c0: 4c 69 6e 65 20 4e 61 6d 65 3a 09 5c 5c 66 42 5c  Line Name:.\\fB\
14d0: 5c 24 31 5c 5c 66 52 0a 44 61 74 61 62 61 73 65  \$1\\fR.Database
14e0: 20 4e 61 6d 65 3a 09 5c 5c 66 42 5c 5c 24 32 5c   Name:.\\fB\\$2\
14f0: 5c 66 52 0a 44 61 74 61 62 61 73 65 20 43 6c 61  \fR.Database Cla
1500: 73 73 3a 09 5c 5c 66 42 5c 5c 24 33 5c 5c 66 52  ss:.\\fB\\$3\\fR
1510: 0a 2e 66 69 0a 2e 49 50 0a 2e 2e 0a 2e 5c 22 09  ..fi..IP.....\".
1520: 23 20 43 53 20 2d 20 62 65 67 69 6e 20 63 6f 64  # CS - begin cod
1530: 65 20 65 78 63 65 72 70 74 0a 2e 64 65 20 43 53  e excerpt..de CS
1540: 0a 2e 52 53 0a 2e 6e 66 0a 2e 74 61 20 2e 32 35  ..RS..nf..ta .25
1550: 69 20 2e 35 69 20 2e 37 35 69 20 31 69 0a 2e 2e  i .5i .75i 1i...
1560: 0a 2e 5c 22 09 23 20 43 45 20 2d 20 65 6e 64 20  ..\".# CE - end 
1570: 63 6f 64 65 20 65 78 63 65 72 70 74 0a 2e 64 65  code excerpt..de
1580: 20 43 45 0a 2e 66 69 0a 2e 52 45 0a 2e 2e 0a 2e   CE..fi..RE.....
1590: 5c 22 09 23 20 55 4c 20 2d 20 75 6e 64 65 72 6c  \".# UL - underl
15a0: 69 6e 65 20 77 6f 72 64 0a 2e 64 65 20 55 4c 0a  ine word..de UL.
15b0: 5c 5c 24 31 5c 6c 27 7c 30 5c 28 75 6c 27 5c 5c  \\$1\l'|0\(ul'\\
15c0: 24 32 0a 2e 2e 0a 2e 5c 22 09 23 20 51 57 20 2d  $2.....\".# QW -
15d0: 20 61 70 70 6c 79 20 71 75 6f 74 61 74 69 6f 6e   apply quotation
15e0: 20 6d 61 72 6b 73 20 74 6f 20 77 6f 72 64 0a 2e   marks to word..
15f0: 64 65 20 51 57 0a 2e 69 65 20 27 5c 5c 2a 28 6c  de QW..ie '\\*(l
1600: 71 27 22 27 20 60 60 5c 5c 24 31 27 27 5c 5c 24  q'"' ``\\$1''\\$
1610: 32 0a 2e 5c 22 22 20 66 69 78 20 65 6d 61 63 73  2..\"" fix emacs
1620: 20 68 69 67 68 6c 69 67 68 74 69 6e 67 0a 2e 65   highlighting..e
1630: 6c 20 5c 5c 2a 28 6c 71 5c 5c 24 31 5c 5c 2a 28  l \\*(lq\\$1\\*(
1640: 72 71 5c 5c 24 32 0a 2e 2e 0a 2e 5c 22 09 23 20  rq\\$2.....\".# 
1650: 50 51 20 2d 20 61 70 70 6c 79 20 70 61 72 65 6e  PQ - apply paren
1660: 73 20 61 6e 64 20 71 75 6f 74 61 74 69 6f 6e 20  s and quotation 
1670: 6d 61 72 6b 73 20 74 6f 20 77 6f 72 64 0a 2e 64  marks to word..d
1680: 65 20 50 51 0a 2e 69 65 20 27 5c 5c 2a 28 6c 71  e PQ..ie '\\*(lq
1690: 27 22 27 20 28 60 60 5c 5c 24 31 27 27 5c 5c 24  '"' (``\\$1''\\$
16a0: 32 29 5c 5c 24 33 0a 2e 5c 22 22 20 66 69 78 20  2)\\$3..\"" fix 
16b0: 65 6d 61 63 73 20 68 69 67 68 6c 69 67 68 74 69  emacs highlighti
16c0: 6e 67 0a 2e 65 6c 20 28 5c 5c 2a 28 6c 71 5c 5c  ng..el (\\*(lq\\
16d0: 24 31 5c 5c 2a 28 72 71 5c 5c 24 32 29 5c 5c 24  $1\\*(rq\\$2)\\$
16e0: 33 0a 2e 2e 0a 2e 5c 22 09 23 20 51 52 20 2d 20  3.....\".# QR - 
16f0: 71 75 6f 74 65 64 20 72 61 6e 67 65 0a 2e 64 65  quoted range..de
1700: 20 51 52 0a 2e 69 65 20 27 5c 5c 2a 28 6c 71 27   QR..ie '\\*(lq'
1710: 22 27 20 60 60 5c 5c 24 31 27 27 5c 5c 2d 60 60  "' ``\\$1''\\-``
1720: 5c 5c 24 32 27 27 5c 5c 24 33 0a 2e 5c 22 22 20  \\$2''\\$3..\"" 
1730: 66 69 78 20 65 6d 61 63 73 20 68 69 67 68 6c 69  fix emacs highli
1740: 67 68 74 69 6e 67 0a 2e 65 6c 20 5c 5c 2a 28 6c  ghting..el \\*(l
1750: 71 5c 5c 24 31 5c 5c 2a 28 72 71 5c 5c 2d 5c 5c  q\\$1\\*(rq\\-\\
1760: 2a 28 6c 71 5c 5c 24 32 5c 5c 2a 28 72 71 5c 5c  *(lq\\$2\\*(rq\\
1770: 24 33 0a 2e 2e 0a 2e 5c 22 09 23 20 4d 54 20 2d  $3.....\".# MT -
1780: 20 22 65 6d 70 74 79 22 20 73 74 72 69 6e 67 0a   "empty" string.
1790: 2e 64 65 20 4d 54 0a 2e 51 57 20 22 22 0a 2e 2e  .de MT..QW ""...
17a0: 0a 2e 42 53 0a 2e 53 48 20 4e 41 4d 45 0a 74 6c  ..BS..SH NAME.tl
17b0: 73 20 5c 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20  s \- binding to 
17c0: 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72  the OpenSSL libr
17d0: 61 72 79 20 66 6f 72 20 65 6e 63 72 79 70 74 65  ary for encrypte
17e0: 64 20 73 6f 63 6b 65 74 20 61 6e 64 20 49 2f 4f  d socket and I/O
17f0: 20 63 68 61 6e 6e 65 6c 20 63 6f 6d 6d 75 6e 69   channel communi
1800: 63 61 74 69 6f 6e 73 0a 2e 53 48 20 53 59 4e 4f  cations..SH SYNO
1810: 50 53 49 53 0a 70 61 63 6b 61 67 65 20 72 65 71  PSIS.package req
1820: 75 69 72 65 20 5c 66 42 54 63 6c 20 38 5c 26 2e  uire \fBTcl 8\&.
1830: 35 2d 5c 66 52 0a 2e 73 70 0a 70 61 63 6b 61 67  5-\fR..sp.packag
1840: 65 20 72 65 71 75 69 72 65 20 5c 66 42 74 6c 73  e require \fBtls
1850: 20 32 5c 26 2e 30 62 31 5c 66 52 0a 2e 73 70 0a   2\&.0b1\fR..sp.
1860: 5c 66 42 74 6c 73 3a 3a 69 6e 69 74 5c 66 52 20  \fBtls::init\fR 
1870: 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20  ?\fI-option\fR? 
1880: 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c  ?\fIvalue\fR? ?\
1890: 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20  fI-option value 
18a0: 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 0a 2e 73  \&.\&.\&.\fR?..s
18b0: 70 0a 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74  p.\fBtls::socket
18c0: 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c  \fR ?\fI-option\
18d0: 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52  fR? ?\fIvalue\fR
18e0: 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61  ? ?\fI-option va
18f0: 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52  lue \&.\&.\&.\fR
1900: 3f 20 5c 66 49 68 6f 73 74 5c 66 52 20 5c 66 49  ? \fIhost\fR \fI
1910: 70 6f 72 74 5c 66 52 0a 2e 73 70 0a 5c 66 42 74  port\fR..sp.\fBt
1920: 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66 52 20 5c 66  ls::socket\fR \f
1930: 42 2d 73 65 72 76 65 72 5c 66 52 20 5c 66 49 63  B-server\fR \fIc
1940: 6f 6d 6d 61 6e 64 5c 66 52 20 3f 5c 66 49 2d 6f  ommand\fR ?\fI-o
1950: 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61  ption\fR? ?\fIva
1960: 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74  lue\fR? ?\fI-opt
1970: 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e  ion value \&.\&.
1980: 5c 26 2e 5c 66 52 3f 20 5c 66 49 70 6f 72 74 5c  \&.\fR? \fIport\
1990: 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 69  fR..sp.\fBtls::i
19a0: 6d 70 6f 72 74 5c 66 52 20 5c 66 49 63 68 61 6e  mport\fR \fIchan
19b0: 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69  nel\fR ?\fI-opti
19c0: 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65  on\fR? ?\fIvalue
19d0: 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e  \fR? ?\fI-option
19e0: 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e   value \&.\&.\&.
19f0: 5c 66 52 3f 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a  \fR?..sp.\fBtls:
1a00: 3a 75 6e 69 6d 70 6f 72 74 5c 66 52 20 5c 66 49  :unimport\fR \fI
1a10: 63 68 61 6e 6e 65 6c 5c 66 52 0a 2e 73 70 0a 5c  channel\fR..sp.\
1a20: 66 42 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65  fBtls::handshake
1a30: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66  \fR \fIchannel\f
1a40: 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 73 74  R..sp.\fBtls::st
1a50: 61 74 75 73 5c 66 52 20 3f 5c 66 42 2d 6c 6f 63  atus\fR ?\fB-loc
1a60: 61 6c 5c 66 52 3f 20 5c 66 49 63 68 61 6e 6e 65  al\fR? \fIchanne
1a70: 6c 5c 66 52 0a 2e 73 70 0a 5c 66 42 74 6c 73 3a  l\fR..sp.\fBtls:
1a80: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 5c 66 52 20 5c  :connection\fR \
1a90: 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 2e 73 70  fIchannel\fR..sp
1aa0: 0a 5c 66 42 74 6c 73 3a 3a 63 69 70 68 65 72 73  .\fBtls::ciphers
1ab0: 5c 66 52 20 3f 5c 66 49 70 72 6f 74 6f 63 6f 6c  \fR ?\fIprotocol
1ac0: 5c 66 52 3f 20 3f 5c 66 49 76 65 72 62 6f 73 65  \fR? ?\fIverbose
1ad0: 5c 66 52 3f 20 3f 5c 66 49 73 75 70 70 6f 72 74  \fR? ?\fIsupport
1ae0: 65 64 5c 66 52 3f 0a 2e 73 70 0a 5c 66 42 74 6c  ed\fR?..sp.\fBtl
1af0: 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 0a  s::protocols\fR.
1b00: 2e 73 70 0a 5c 66 42 74 6c 73 3a 3a 76 65 72 73  .sp.\fBtls::vers
1b10: 69 6f 6e 5c 66 52 0a 2e 73 70 0a 2e 42 45 0a 2e  ion\fR..sp..BE..
1b20: 53 48 20 44 45 53 43 52 49 50 54 49 4f 4e 0a 54  SH DESCRIPTION.T
1b30: 68 69 73 20 65 78 74 65 6e 73 69 6f 6e 20 70 72  his extension pr
1b40: 6f 76 69 64 65 73 20 54 43 4c 20 73 63 72 69 70  ovides TCL scrip
1b50: 74 20 61 63 63 65 73 73 20 74 6f 20 73 65 63 75  t access to secu
1b60: 72 65 20 73 6f 63 6b 65 74 20 63 6f 6d 6d 75 6e  re socket commun
1b70: 69 63 61 74 69 6f 6e 73 0a 75 73 69 6e 67 20 74  ications.using t
1b80: 68 65 20 54 72 61 6e 73 70 6f 72 74 20 4c 61 79  he Transport Lay
1b90: 65 72 20 53 65 63 75 72 69 74 79 20 28 54 4c 53  er Security (TLS
1ba0: 29 20 70 72 6f 74 6f 63 6f 6c 5c 26 2e 20 49 74  ) protocol\&. It
1bb0: 20 70 72 6f 76 69 64 65 73 20 61 20 67 65 6e 65   provides a gene
1bc0: 72 69 63 0a 62 69 6e 64 69 6e 67 20 74 6f 20 5c  ric.binding to \
1bd0: 66 49 4f 70 65 6e 53 53 4c 5c 66 52 20 5b 68 74  fIOpenSSL\fR [ht
1be0: 74 70 73 3a 2f 2f 77 77 77 5c 26 2e 6f 70 65 6e  tps://www\&.open
1bf0: 73 73 6c 5c 26 2e 6f 72 67 2f 5d 2c 20 75 74 69  ssl\&.org/], uti
1c00: 6c 69 7a 69 6e 67 20 74 68 65 0a 5c 66 42 54 63  lizing the.\fBTc
1c10: 6c 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 5c 66  l_StackChannel\f
1c20: 52 20 41 50 49 20 69 6e 20 54 43 4c 20 38 5c 26  R API in TCL 8\&
1c30: 2e 34 20 61 6e 64 20 68 69 67 68 65 72 5c 26 2e  .4 and higher\&.
1c40: 0a 54 68 65 73 65 20 73 6f 63 6b 65 74 73 20 62  .These sockets b
1c50: 65 68 61 76 65 20 65 78 61 63 74 6c 79 20 74 68  ehave exactly th
1c60: 65 20 73 61 6d 65 20 61 73 20 63 68 61 6e 6e 65  e same as channe
1c70: 6c 73 20 63 72 65 61 74 65 64 20 75 73 69 6e 67  ls created using
1c80: 20 74 68 65 20 62 75 69 6c 74 2d 69 6e 0a 5c 66   the built-in.\f
1c90: 42 73 6f 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61  Bsocket\fR comma
1ca0: 6e 64 2c 20 61 6c 6f 6e 67 20 77 69 74 68 20 61  nd, along with a
1cb0: 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e  dditional option
1cc0: 73 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e  s for controllin
1cd0: 67 0a 74 68 65 20 53 53 4c 2f 54 4c 53 20 73 65  g.the SSL/TLS se
1ce0: 73 73 69 6f 6e 5c 26 2e 0a 2e 53 48 20 43 4f 4d  ssion\&...SH COM
1cf0: 4d 41 4e 44 53 0a 54 79 70 69 63 61 6c 6c 79 20  MANDS.Typically 
1d00: 6f 6e 65 20 77 6f 75 6c 64 20 75 73 65 20 74 68  one would use th
1d10: 65 20 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74  e \fBtls::socket
1d20: 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 63  \fR command to c
1d30: 72 65 61 74 65 20 61 20 6e 65 77 20 65 6e 63 72  reate a new encr
1d40: 79 70 74 65 64 0a 54 43 50 20 73 6f 63 6b 65 74  ypted.TCP socket
1d50: 5c 26 2e 20 49 74 20 69 73 20 63 6f 6d 70 61 74  \&. It is compat
1d60: 69 62 6c 65 20 77 69 74 68 20 74 68 65 20 6e 61  ible with the na
1d70: 74 69 76 65 20 54 43 4c 20 5c 66 42 3a 3a 73 6f  tive TCL \fB::so
1d80: 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 5c  cket\fR command\
1d90: 26 2e 0a 41 6c 74 65 72 6e 61 74 69 76 65 6c 79  &..Alternatively
1da0: 20 66 6f 72 20 61 6e 20 65 78 69 73 74 69 6e 67   for an existing
1db0: 20 54 43 50 20 73 6f 63 6b 65 74 2c 20 74 68 65   TCP socket, the
1dc0: 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c   \fBtls::import\
1dd0: 66 52 20 63 6f 6d 6d 61 6e 64 20 63 61 6e 20 62  fR command can b
1de0: 65 0a 75 73 65 64 20 74 6f 20 73 74 61 72 74 20  e.used to start 
1df0: 54 4c 53 20 6f 6e 20 74 68 65 20 63 6f 6e 6e 65  TLS on the conne
1e00: 63 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ction\&...TP.\fB
1e10: 74 6c 73 3a 3a 69 6e 69 74 5c 66 52 20 3f 5c 66  tls::init\fR ?\f
1e20: 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66  I-option\fR? ?\f
1e30: 49 76 61 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d  Ivalue\fR? ?\fI-
1e40: 6f 70 74 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e  option value \&.
1e50: 5c 26 2e 5c 26 2e 5c 66 52 3f 0a 4f 70 74 69 6f  \&.\&.\fR?.Optio
1e60: 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 20 74 6f 20  nal function to 
1e70: 73 65 74 20 74 68 65 20 64 65 66 61 75 6c 74 20  set the default 
1e80: 6f 70 74 69 6f 6e 73 20 75 73 65 64 20 62 79 20  options used by 
1e90: 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66  \fBtls::socket\f
1ea0: 52 5c 26 2e 20 49 66 20 79 6f 75 0a 63 61 6c 6c  R\&. If you.call
1eb0: 20 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c   \fBtls::import\
1ec0: 66 52 20 64 69 72 65 63 74 6c 79 2c 20 74 68 69  fR directly, thi
1ed0: 73 20 63 6f 6d 6d 61 6e 64 20 68 61 73 20 6e 6f  s command has no
1ee0: 20 65 66 66 65 63 74 5c 26 2e 20 54 68 69 73 20   effect\&. This 
1ef0: 63 6f 6d 6d 61 6e 64 0a 73 75 70 70 6f 72 74 73  command.supports
1f00: 20 61 6c 6c 20 6f 66 20 74 68 65 20 73 61 6d 65   all of the same
1f10: 20 6f 70 74 69 6f 6e 73 20 61 73 20 74 68 65 20   options as the 
1f20: 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66  \fBtls::socket\f
1f30: 52 20 63 6f 6d 6d 61 6e 64 2c 20 74 68 6f 75 67  R command, thoug
1f40: 68 20 79 6f 75 0a 73 68 6f 75 6c 64 20 6c 69 6d  h you.should lim
1f50: 69 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 73 20  it your options 
1f60: 74 6f 20 6f 6e 6c 79 20 54 4c 53 20 72 65 6c 61  to only TLS rela
1f70: 74 65 64 20 6f 6e 65 73 5c 26 2e 0a 2e 54 50 0a  ted ones\&...TP.
1f80: 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66  \fBtls::socket\f
1f90: 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52  R ?\fI-option\fR
1fa0: 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20  ? ?\fIvalue\fR? 
1fb0: 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75  ?\fI-option valu
1fc0: 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 20  e \&.\&.\&.\fR? 
1fd0: 5c 66 49 68 6f 73 74 5c 66 52 20 5c 66 49 70 6f  \fIhost\fR \fIpo
1fe0: 72 74 5c 66 52 0a 54 68 69 73 20 69 73 20 61 20  rt\fR.This is a 
1ff0: 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e 20  helper function 
2000: 74 68 61 74 20 75 74 69 6c 69 7a 65 73 20 74 68  that utilizes th
2010: 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 63 6f 6d  e underlying com
2020: 6d 61 6e 64 73 20 5c 66 42 73 6f 63 6b 65 74 5c  mands \fBsocket\
2030: 66 52 0a 61 6e 64 20 5c 66 42 74 6c 73 3a 3a 69  fR.and \fBtls::i
2040: 6d 70 6f 72 74 5c 66 52 20 74 6f 20 63 72 65 61  mport\fR to crea
2050: 74 65 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f  te the connectio
2060: 6e 5c 26 2e 20 49 74 20 62 65 68 61 76 65 73 20  n\&. It behaves 
2070: 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 65 0a  the same as the.
2080: 6e 61 74 69 76 65 20 54 43 4c 20 5c 66 42 73 6f  native TCL \fBso
2090: 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e 64 2c  cket\fR command,
20a0: 20 62 75 74 20 61 6c 73 6f 20 73 75 70 70 6f 72   but also suppor
20b0: 74 73 20 74 68 65 20 5c 66 42 74 6c 73 3a 69 6d  ts the \fBtls:im
20c0: 70 6f 72 74 5c 66 52 0a 63 6f 6d 6d 61 6e 64 20  port\fR.command 
20d0: 6f 70 74 69 6f 6e 73 20 77 69 74 68 20 6f 6e 65  options with one
20e0: 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69   additional opti
20f0: 6f 6e 5c 26 2e 20 49 74 20 72 65 74 75 72 6e 73  on\&. It returns
2100: 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e   the channel han
2110: 64 6c 65 20 69 64 0a 66 6f 72 20 74 68 65 20 6e  dle id.for the n
2120: 65 77 20 73 6f 63 6b 65 74 5c 26 2e 0a 2e 52 53  ew socket\&...RS
2130: 0a 2e 54 50 0a 5c 66 42 2d 61 75 74 6f 73 65 72  ..TP.\fB-autoser
2140: 76 65 72 6e 61 6d 65 5c 66 52 20 5c 66 49 62 6f  vername\fR \fIbo
2150: 6f 6c 5c 66 52 0a 49 66 20 5c 66 42 74 72 75 65  ol\fR.If \fBtrue
2160: 5c 66 52 2c 20 61 75 74 6f 6d 61 74 69 63 61 6c  \fR, automatical
2170: 6c 79 20 73 65 74 20 74 68 65 20 5c 66 42 2d 73  ly set the \fB-s
2180: 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 61 72 67  ervername\fR arg
2190: 75 6d 65 6e 74 20 74 6f 20 74 68 65 0a 5c 66 49  ument to the.\fI
21a0: 68 6f 73 74 5c 66 52 20 61 72 67 75 6d 65 6e 74  host\fR argument
21b0: 5c 26 2e 20 50 72 69 6f 72 20 74 6f 20 54 63 6c  \&. Prior to Tcl
21c0: 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68 65 20 64  TLS 2\&.0, the d
21d0: 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66 61 6c  efault is \fBfal
21e0: 73 65 5c 66 52 5c 26 2e 0a 53 74 61 72 74 69 6e  se\fR\&..Startin
21f0: 67 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c 26 2e  g in TclTLS 2\&.
2200: 30 2c 20 74 68 65 20 64 65 66 61 75 6c 74 20 69  0, the default i
2210: 73 20 5c 66 42 74 72 75 65 5c 66 52 20 75 6e 6c  s \fBtrue\fR unl
2220: 65 73 73 20 5c 66 42 2d 73 65 72 76 65 72 6e 61  ess \fB-serverna
2230: 6d 65 5c 66 52 0a 69 73 20 61 6c 73 6f 20 73 70  me\fR.is also sp
2240: 65 63 69 66 69 65 64 5c 26 2e 0a 2e 52 45 0a 2e  ecified\&...RE..
2250: 54 50 0a 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65  TP.\fBtls::socke
2260: 74 5c 66 52 20 5c 66 42 2d 73 65 72 76 65 72 5c  t\fR \fB-server\
2270: 66 52 20 5c 66 49 63 6f 6d 6d 61 6e 64 5c 66 52  fR \fIcommand\fR
2280: 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c 66 52 3f   ?\fI-option\fR?
2290: 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52 3f 20 3f   ?\fIvalue\fR? ?
22a0: 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65  \fI-option value
22b0: 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52 3f 20 5c   \&.\&.\&.\fR? \
22c0: 66 49 70 6f 72 74 5c 66 52 0a 53 61 6d 65 20 61  fIport\fR.Same a
22d0: 73 20 70 72 65 76 69 6f 75 73 2c 20 62 75 74 20  s previous, but 
22e0: 69 6e 73 74 65 61 64 20 63 72 65 61 74 65 73 20  instead creates 
22f0: 61 20 73 65 72 76 65 72 20 73 6f 63 6b 65 74 20  a server socket 
2300: 66 6f 72 20 63 6c 69 65 6e 74 73 20 74 6f 20 63  for clients to c
2310: 6f 6e 6e 65 63 74 20 74 6f 0a 6a 75 73 74 20 6c  onnect to.just l
2320: 69 6b 65 20 74 68 65 20 54 63 6c 20 5c 66 42 73  ike the Tcl \fBs
2330: 6f 63 6b 65 74 20 2d 73 65 72 76 65 72 5c 66 52  ocket -server\fR
2340: 20 63 6f 6d 6d 61 6e 64 5c 26 2e 20 49 74 20 72   command\&. It r
2350: 65 74 75 72 6e 73 20 74 68 65 20 63 68 61 6e 6e  eturns the chann
2360: 65 6c 0a 68 61 6e 64 6c 65 20 69 64 20 66 6f 72  el.handle id for
2370: 20 74 68 65 20 6e 65 77 20 73 6f 63 6b 65 74 5c   the new socket\
2380: 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 69  &...TP.\fBtls::i
2390: 6d 70 6f 72 74 5c 66 52 20 5c 66 49 63 68 61 6e  mport\fR \fIchan
23a0: 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69  nel\fR ?\fI-opti
23b0: 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65  on\fR? ?\fIvalue
23c0: 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e  \fR? ?\fI-option
23d0: 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e   value \&.\&.\&.
23e0: 5c 66 52 3f 0a 53 74 61 72 74 20 54 4c 53 20 65  \fR?.Start TLS e
23f0: 6e 63 72 79 70 74 69 6f 6e 20 6f 6e 20 54 43 4c  ncryption on TCL
2400: 20 63 68 61 6e 6e 65 6c 20 5c 66 49 63 68 61 6e   channel \fIchan
2410: 6e 65 6c 5c 66 52 20 76 69 61 20 61 20 73 74 61  nel\fR via a sta
2420: 63 6b 65 64 20 63 68 61 6e 6e 65 6c 5c 26 2e 20  cked channel\&. 
2430: 49 74 0a 6e 65 65 64 20 6e 6f 74 20 62 65 20 61  It.need not be a
2440: 20 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73   socket, but mus
2450: 74 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72  t provide bi-dir
2460: 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 5c 26 2e  ectional flow\&.
2470: 20 41 6c 73 6f 20 73 65 74 73 20 73 65 73 73 69   Also sets sessi
2480: 6f 6e 0a 70 61 72 61 6d 65 74 65 72 73 20 66 6f  on.parameters fo
2490: 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c  r SSL handshake\
24a0: 26 2e 20 56 61 6c 69 64 20 6f 70 74 69 6f 6e 73  &. Valid options
24b0: 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66   are:..RS..TP.\f
24c0: 42 2d 61 6c 70 6e 5c 66 52 20 5c 66 49 6c 69 73  B-alpn\fR \fIlis
24d0: 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20 70 72 6f  t\fR.List of pro
24e0: 74 6f 63 6f 6c 73 20 74 6f 20 6f 66 66 65 72 20  tocols to offer 
24f0: 64 75 72 69 6e 67 20 41 70 70 6c 69 63 61 74 69  during Applicati
2500: 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f  on-Layer Protoco
2510: 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 0a 28 41  l Negotiation.(A
2520: 4c 50 4e 29 5c 26 2e 20 46 6f 72 20 65 78 61 6d  LPN)\&. For exam
2530: 70 6c 65 3a 20 5c 66 42 68 32 5c 66 52 20 61 6e  ple: \fBh2\fR an
2540: 64 20 5c 66 42 68 74 74 70 2f 31 5c 26 2e 31 5c  d \fBhttp/1\&.1\
2550: 66 52 2c 20 62 75 74 20 6e 6f 74 20 5c 66 42 68  fR, but not \fBh
2560: 33 5c 66 52 20 6f 72 0a 5c 66 42 71 75 69 63 5c  3\fR or.\fBquic\
2570: 66 52 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61  fR\&...TP.\fB-ca
2580: 64 69 72 5c 66 52 20 5c 66 49 64 69 72 65 63 74  dir\fR \fIdirect
2590: 6f 72 79 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ory\fR.Specifies
25a0: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 77   the directory w
25b0: 68 65 72 65 20 74 68 65 20 43 65 72 74 69 66 69  here the Certifi
25c0: 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 28  cate Authority (
25d0: 43 41 29 20 63 65 72 74 69 66 69 63 61 74 65 73  CA) certificates
25e0: 20 61 72 65 0a 73 74 6f 72 65 64 5c 26 2e 20 54   are.stored\&. T
25f0: 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 70 6c  he default is pl
2600: 61 74 66 6f 72 6d 20 73 70 65 63 69 66 69 63 20  atform specific 
2610: 61 6e 64 20 63 61 6e 20 62 65 20 73 65 74 20 61  and can be set a
2620: 74 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 5c 26  t compile time\&
2630: 2e 20 54 68 65 0a 64 65 66 61 75 6c 74 20 6c 6f  . The.default lo
2640: 63 61 74 69 6f 6e 20 63 61 6e 20 62 65 20 6f 76  cation can be ov
2650: 65 72 72 69 64 64 65 6e 20 62 79 20 74 68 65 20  erridden by the 
2660: 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44 49 52 5c  \fBSSL_CERT_DIR\
2670: 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 76  fR environment.v
2680: 61 72 69 61 62 6c 65 5c 26 2e 20 53 65 65 20 5c  ariable\&. See \
2690: 66 42 43 65 72 74 69 66 69 63 61 74 65 20 56 61  fBCertificate Va
26a0: 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20  lidation\fR for 
26b0: 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c 26 2e 0a  more details\&..
26c0: 2e 54 50 0a 5c 66 42 2d 63 61 66 69 6c 65 5c 66  .TP.\fB-cafile\f
26d0: 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65 5c 66 52  R \fIfilename\fR
26e0: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 66  .Specifies the f
26f0: 69 6c 65 20 77 69 74 68 20 74 68 65 20 43 65 72  ile with the Cer
2700: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69  tificate Authori
2710: 74 79 20 28 43 41 29 20 63 65 72 74 69 66 69 63  ty (CA) certific
2720: 61 74 65 73 20 74 6f 20 75 73 65 20 69 6e 0a 5c  ates to use in.\
2730: 66 42 50 45 4d 5c 66 52 20 66 69 6c 65 20 66 6f  fBPEM\fR file fo
2740: 72 6d 61 74 5c 26 2e 20 54 68 65 20 64 65 66 61  rmat\&. The defa
2750: 75 6c 74 20 69 73 20 22 5c 66 49 63 65 72 74 5c  ult is "\fIcert\
2760: 26 2e 70 65 6d 5c 66 52 22 2c 20 69 6e 20 74 68  &.pem\fR", in th
2770: 65 20 4f 70 65 6e 53 53 4c 0a 64 69 72 65 63 74  e OpenSSL.direct
2780: 6f 72 79 5c 26 2e 20 54 68 65 20 64 65 66 61 75  ory\&. The defau
2790: 6c 74 20 66 69 6c 65 20 63 61 6e 20 62 65 20 6f  lt file can be o
27a0: 76 65 72 72 69 64 64 65 6e 20 62 79 20 74 68 65  verridden by the
27b0: 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f 46 49 4c   \fBSSL_CERT_FIL
27c0: 45 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74  E\fR environment
27d0: 0a 76 61 72 69 61 62 6c 65 5c 26 2e 20 53 65 65  .variable\&. See
27e0: 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65 20   \fBCertificate 
27f0: 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66 6f  Validation\fR fo
2800: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c 26  r more details\&
2810: 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 73 74 6f 72  ...TP.\fB-castor
2820: 65 5c 66 52 20 5c 66 49 55 52 49 5c 66 52 0a 53  e\fR \fIURI\fR.S
2830: 70 65 63 69 66 69 65 73 20 74 68 65 20 55 6e 69  pecifies the Uni
2840: 66 6f 72 6d 20 52 65 73 6f 75 72 63 65 20 49 64  form Resource Id
2850: 65 6e 74 69 66 69 65 72 20 28 55 52 49 29 20 66  entifier (URI) f
2860: 6f 72 20 74 68 65 20 43 65 72 74 69 66 69 63 61  or the Certifica
2870: 74 65 20 41 75 74 68 6f 72 69 74 79 0a 28 43 41  te Authority.(CA
2880: 29 20 73 74 6f 72 65 2c 20 77 68 69 63 68 20 6d  ) store, which m
2890: 61 79 20 62 65 20 61 20 73 69 6e 67 6c 65 20 63  ay be a single c
28a0: 6f 6e 74 61 69 6e 65 72 20 6f 72 20 61 20 63 61  ontainer or a ca
28b0: 74 61 6c 6f 67 20 6f 66 20 63 6f 6e 74 61 69 6e  talog of contain
28c0: 65 72 73 5c 26 2e 0a 53 74 61 72 74 69 6e 67 20  ers\&..Starting 
28d0: 77 69 74 68 20 4f 70 65 6e 53 53 4c 20 33 5c 26  with OpenSSL 3\&
28e0: 2e 32 20 6f 6e 20 4d 53 20 57 69 6e 64 6f 77 73  .2 on MS Windows
28f0: 2c 20 73 65 74 20 74 6f 20 22 5c 66 42 6f 72 67  , set to "\fBorg
2900: 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e 77 69 6e  \&.openssl\&.win
2910: 73 74 6f 72 65 3a 2f 2f 5c 66 52 22 0a 74 6f 20  store://\fR".to 
2920: 75 73 65 20 74 68 65 20 62 75 69 6c 74 2d 69 6e  use the built-in
2930: 20 4d 53 20 57 69 6e 64 6f 77 73 20 43 65 72 74   MS Windows Cert
2940: 69 66 69 63 61 74 65 20 53 74 6f 72 65 5c 26 2e  ificate Store\&.
2950: 20 53 65 65 0a 5c 66 42 43 65 72 74 69 66 69 63   See.\fBCertific
2960: 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66  ate Validation\f
2970: 52 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69  R for more detai
2980: 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 65  ls\&...TP.\fB-ce
2990: 72 74 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c  rtfile\fR \fIfil
29a0: 65 6e 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69  ename\fR.Specifi
29b0: 65 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74  es the name of t
29c0: 68 65 20 66 69 6c 65 20 77 69 74 68 20 74 68 65  he file with the
29d0: 20 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20   certificate to 
29e0: 75 73 65 20 69 6e 20 50 45 4d 20 66 6f 72 6d 61  use in PEM forma
29f0: 74 0a 61 73 20 74 68 65 20 6c 6f 63 61 6c 20 28  t.as the local (
2a00: 63 6c 69 65 6e 74 20 6f 72 20 73 65 72 76 65 72  client or server
2a10: 29 20 63 65 72 74 69 66 69 63 61 74 65 5c 26 2e  ) certificate\&.
2a20: 20 49 74 20 61 6c 73 6f 20 63 6f 6e 74 61 69 6e   It also contain
2a30: 73 20 74 68 65 20 70 75 62 6c 69 63 20 6b 65 79  s the public key
2a40: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 65 72 74  \&...TP.\fB-cert
2a50: 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52  \fR \fIstring\fR
2a60: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 63  .Specifies the c
2a70: 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73  ertificate to us
2a80: 65 20 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64  e as a DER encod
2a90: 65 64 20 73 74 72 69 6e 67 20 28 58 5c 26 2e 35  ed string (X\&.5
2aa0: 30 39 20 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c  09 DER)\&...TP.\
2ab0: 66 42 2d 63 69 70 68 65 72 5c 66 52 20 5c 66 49  fB-cipher\fR \fI
2ac0: 73 74 72 69 6e 67 5c 66 52 0a 53 70 65 63 69 66  string\fR.Specif
2ad0: 69 65 73 20 74 68 65 20 6c 69 73 74 20 6f 66 20  ies the list of 
2ae0: 63 69 70 68 65 72 73 20 74 6f 20 75 73 65 20 66  ciphers to use f
2af0: 6f 72 20 54 4c 53 20 31 5c 26 2e 32 20 61 6e 64  or TLS 1\&.2 and
2b00: 20 65 61 72 6c 69 65 72 20 63 6f 6e 6e 65 63 74   earlier connect
2b10: 69 6f 6e 73 5c 26 2e 0a 53 74 72 69 6e 67 20 69  ions\&..String i
2b20: 73 20 61 20 63 6f 6c 6f 6e 20 22 5c 66 42 3a 5c  s a colon "\fB:\
2b30: 66 52 22 20 73 65 70 61 72 61 74 65 64 20 6c 69  fR" separated li
2b40: 73 74 20 6f 66 20 63 69 70 68 65 72 73 5c 26 2e  st of ciphers\&.
2b50: 0a 43 69 70 68 65 72 73 20 63 61 6e 20 62 65 20  .Ciphers can be 
2b60: 63 6f 6d 62 69 6e 65 64 20 75 73 69 6e 67 20 74  combined using t
2b70: 68 65 20 22 5c 66 42 2b 5c 66 52 22 20 63 68 61  he "\fB+\fR" cha
2b80: 72 61 63 74 65 72 5c 26 2e 0a 50 72 65 66 69 78  racter\&..Prefix
2b90: 65 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 74  es can be used t
2ba0: 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 72 65  o permanently re
2bb0: 6d 6f 76 65 20 22 5c 66 42 21 5c 66 52 22 2c 20  move "\fB!\fR", 
2bc0: 64 65 6c 65 74 65 20 22 5c 66 42 2d 5c 66 52 22  delete "\fB-\fR"
2bd0: 2c 20 6f 72 0a 6d 6f 76 65 20 74 6f 20 74 68 65  , or.move to the
2be0: 20 65 6e 64 20 22 5c 66 42 2b 5c 66 52 22 20 61   end "\fB+\fR" a
2bf0: 20 73 70 65 63 69 66 69 65 64 20 63 69 70 68 65   specified ciphe
2c00: 72 5c 26 2e 0a 4b 65 79 77 6f 72 64 73 20 5c 66  r\&..Keywords \f
2c10: 42 40 53 54 52 45 4e 47 54 48 5c 66 52 20 28 73  B@STRENGTH\fR (s
2c20: 6f 72 74 20 62 79 20 61 6c 67 6f 72 69 74 68 6d  ort by algorithm
2c30: 20 6b 65 79 20 6c 65 6e 67 74 68 29 2c 0a 5c 66   key length),.\f
2c40: 42 40 53 45 43 4c 45 56 45 4c 3d 5c 66 52 5c 66  B@SECLEVEL=\fR\f
2c50: 49 6e 5c 66 52 20 28 73 65 74 20 73 65 63 75 72  In\fR (set secur
2c60: 69 74 79 20 6c 65 76 65 6c 20 74 6f 20 6e 29 2c  ity level to n),
2c70: 20 61 6e 64 0a 5c 66 42 44 45 46 41 55 4c 54 5c   and.\fBDEFAULT\
2c80: 66 52 20 28 75 73 65 20 64 65 66 61 75 6c 74 20  fR (use default 
2c90: 63 69 70 68 65 72 20 6c 69 73 74 2c 20 61 74 20  cipher list, at 
2ca0: 73 74 61 72 74 20 6f 6e 6c 79 29 20 63 61 6e 20  start only) can 
2cb0: 61 6c 73 6f 20 62 65 20 73 70 65 63 69 66 69 65  also be specifie
2cc0: 64 5c 26 2e 0a 53 65 65 20 74 68 65 20 5c 66 49  d\&..See the \fI
2cd0: 4f 70 65 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70  OpenSSL\fR [http
2ce0: 73 3a 2f 2f 64 6f 63 73 5c 26 2e 6f 70 65 6e 73  s://docs\&.opens
2cf0: 73 6c 5c 26 2e 6f 72 67 2f 6d 61 73 74 65 72 2f  sl\&.org/master/
2d00: 6d 61 6e 31 2f 6f 70 65 6e 73 73 6c 2d 63 69 70  man1/openssl-cip
2d10: 68 65 72 73 2f 23 6f 70 74 69 6f 6e 73 5d 0a 64  hers/#options].d
2d20: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72  ocumentation for
2d30: 20 74 68 65 20 66 75 6c 6c 20 6c 69 73 74 20 6f   the full list o
2d40: 66 20 76 61 6c 69 64 20 76 61 6c 75 65 73 5c 26  f valid values\&
2d50: 2e 0a 2e 54 50 0a 5c 66 42 2d 63 69 70 68 65 72  ...TP.\fB-cipher
2d60: 73 75 69 74 65 73 5c 66 52 20 5c 66 49 73 74 72  suites\fR \fIstr
2d70: 69 6e 67 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ing\fR.Specifies
2d80: 20 74 68 65 20 6c 69 73 74 20 6f 66 20 63 69 70   the list of cip
2d90: 68 65 72 20 73 75 69 74 65 73 20 74 6f 20 75 73  her suites to us
2da0: 65 20 66 6f 72 20 54 4c 53 20 31 5c 26 2e 33 20  e for TLS 1\&.3 
2db0: 61 73 20 61 20 63 6f 6c 6f 6e 0a 22 5c 66 42 3a  as a colon."\fB:
2dc0: 5c 66 52 22 20 73 65 70 61 72 61 74 65 64 20 6c  \fR" separated l
2dd0: 69 73 74 20 6f 66 20 63 69 70 68 65 72 20 73 75  ist of cipher su
2de0: 69 74 65 20 6e 61 6d 65 73 5c 26 2e 20 53 65 65  ite names\&. See
2df0: 20 74 68 65 0a 5c 66 49 4f 70 65 6e 53 53 4c 5c   the.\fIOpenSSL\
2e00: 66 52 20 5b 68 74 74 70 73 3a 2f 2f 64 6f 63 73  fR [https://docs
2e10: 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e 6f 72 67  \&.openssl\&.org
2e20: 2f 6d 61 73 74 65 72 2f 6d 61 6e 31 2f 6f 70 65  /master/man1/ope
2e30: 6e 73 73 6c 2d 63 69 70 68 65 72 73 2f 23 6f 70  nssl-ciphers/#op
2e40: 74 69 6f 6e 73 5d 0a 64 6f 63 75 6d 65 6e 74 61  tions].documenta
2e50: 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 66 75 6c  tion for the ful
2e60: 6c 20 6c 69 73 74 20 6f 66 20 76 61 6c 69 64 20  l list of valid 
2e70: 76 61 6c 75 65 73 5c 26 2e 0a 2e 54 50 0a 5c 66  values\&...TP.\f
2e80: 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20 5c 66 49  B-command\fR \fI
2e90: 63 61 6c 6c 62 61 63 6b 5c 66 52 0a 53 70 65 63  callback\fR.Spec
2ea0: 69 66 69 65 73 20 74 68 65 20 63 61 6c 6c 62 61  ifies the callba
2eb0: 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 62 65  ck command to be
2ec0: 20 69 6e 76 6f 6b 65 64 20 61 74 20 73 65 76 65   invoked at seve
2ed0: 72 61 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e  ral points durin
2ee0: 67 20 74 68 65 0a 68 61 6e 64 73 68 61 6b 65 20  g the.handshake 
2ef0: 74 6f 20 70 61 73 73 20 65 72 72 6f 72 73 2c 20  to pass errors, 
2f00: 74 72 61 63 69 6e 67 20 69 6e 66 6f 72 6d 61 74  tracing informat
2f10: 69 6f 6e 2c 20 61 6e 64 20 70 72 6f 74 6f 63 6f  ion, and protoco
2f20: 6c 20 6d 65 73 73 61 67 65 73 5c 26 2e 0a 53 65  l messages\&..Se
2f30: 65 20 5c 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70  e \fBCallback Op
2f40: 74 69 6f 6e 73 5c 66 52 20 66 6f 72 20 6d 6f 72  tions\fR for mor
2f50: 65 20 69 6e 66 6f 5c 26 2e 0a 2e 54 50 0a 5c 66  e info\&...TP.\f
2f60: 42 2d 64 68 70 61 72 61 6d 73 5c 66 52 20 5c 66  B-dhparams\fR \f
2f70: 49 66 69 6c 65 6e 61 6d 65 5c 66 52 0a 53 70 65  Ifilename\fR.Spe
2f80: 63 69 66 69 65 73 20 74 68 65 20 44 69 66 66 69  cifies the Diffi
2f90: 65 2d 48 65 6c 6c 6d 61 6e 20 28 44 48 29 20 70  e-Hellman (DH) p
2fa0: 61 72 61 6d 65 74 65 72 73 20 66 69 6c 65 5c 26  arameters file\&
2fb0: 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65 79 66 69 6c  ...TP.\fB-keyfil
2fc0: 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65  e\fR \fIfilename
2fd0: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
2fe0: 65 20 70 72 69 76 61 74 65 20 6b 65 79 20 66 69  e private key fi
2ff0: 6c 65 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  le\&. The defaul
3000: 74 20 69 73 20 74 6f 20 75 73 65 20 74 68 65 20  t is to use the 
3010: 66 69 6c 65 0a 73 70 65 63 69 66 69 65 64 20 62  file.specified b
3020: 79 20 74 68 65 20 5c 66 49 2d 63 65 72 74 66 69  y the \fI-certfi
3030: 6c 65 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a  le\fR option\&..
3040: 2e 54 50 0a 5c 66 42 2d 6b 65 79 5c 66 52 20 5c  .TP.\fB-key\fR \
3050: 66 49 73 74 72 69 6e 67 5c 66 52 0a 53 70 65 63  fIstring\fR.Spec
3060: 69 66 69 65 73 20 74 68 65 20 70 72 69 76 61 74  ifies the privat
3070: 65 20 6b 65 79 20 74 6f 20 75 73 65 20 61 73 20  e key to use as 
3080: 61 20 44 45 52 20 65 6e 63 6f 64 65 64 20 73 74  a DER encoded st
3090: 72 69 6e 67 20 28 50 4b 43 53 23 31 20 44 45 52  ring (PKCS#1 DER
30a0: 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6d 6f 64  )\&...TP.\fB-mod
30b0: 65 6c 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  el\fR \fIchannel
30c0: 5c 66 52 0a 46 6f 72 63 65 20 74 68 69 73 20 63  \fR.Force this c
30d0: 68 61 6e 6e 65 6c 20 74 6f 20 73 68 61 72 65 20  hannel to share 
30e0: 74 68 65 20 73 61 6d 65 20 5c 66 49 53 53 4c 5f  the same \fISSL_
30f0: 43 54 58 5c 66 52 20 73 74 72 75 63 74 75 72 65  CTX\fR structure
3100: 20 61 73 20 74 68 65 0a 73 70 65 63 69 66 69 65   as the.specifie
3110: 64 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 2c  d \fIchannel\fR,
3120: 20 61 6e 64 20 74 68 65 72 65 66 6f 72 65 20 73   and therefore s
3130: 68 61 72 65 20 63 6f 6e 66 69 67 2c 20 63 61 6c  hare config, cal
3140: 6c 62 61 63 6b 73 2c 20 65 74 63 5c 26 2e 0a 2e  lbacks, etc\&...
3150: 54 50 0a 5c 66 42 2d 70 61 73 73 77 6f 72 64 5c  TP.\fB-password\
3160: 66 52 20 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66  fR \fIcallback\f
3170: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
3180: 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64  callback command
3190: 20 74 6f 20 69 6e 76 6f 6b 65 20 77 68 65 6e 20   to invoke when 
31a0: 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 20 74 6f  OpenSSL needs to
31b0: 20 6f 62 74 61 69 6e 20 61 0a 70 61 73 73 77 6f   obtain a.passwo
31c0: 72 64 5c 26 2e 20 54 68 69 73 20 69 73 20 74 79  rd\&. This is ty
31d0: 70 69 63 61 6c 6c 79 20 75 73 65 64 20 74 6f 20  pically used to 
31e0: 75 6e 6c 6f 63 6b 20 74 68 65 20 70 72 69 76 61  unlock the priva
31f0: 74 65 20 6b 65 79 20 6f 66 20 61 20 63 65 72 74  te key of a cert
3200: 69 66 69 63 61 74 65 5c 26 2e 0a 54 68 65 20 63  ificate\&..The c
3210: 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72  allback should r
3220: 65 74 75 72 6e 20 61 20 70 61 73 73 77 6f 72 64  eturn a password
3230: 20 73 74 72 69 6e 67 5c 26 2e 20 53 65 65 20 5c   string\&. See \
3240: 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69 6f  fBCallback Optio
3250: 6e 73 5c 66 52 0a 66 6f 72 20 6d 6f 72 65 20 69  ns\fR.for more i
3260: 6e 66 6f 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 70  nfo\&...TP.\fB-p
3270: 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 5c 66 52  ost_handshake\fR
3280: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 41 6c 6c 6f   \fIbool\fR.Allo
3290: 77 20 70 6f 73 74 2d 68 61 6e 64 73 68 61 6b 65  w post-handshake
32a0: 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20   session ticket 
32b0: 75 70 64 61 74 65 73 5c 26 2e 0a 2e 54 50 0a 5c  updates\&...TP.\
32c0: 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20 5c 66  fB-request\fR \f
32d0: 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75 65 73 74  Ibool\fR.Request
32e0: 20 61 20 63 65 72 74 69 66 69 63 61 74 65 20 66   a certificate f
32f0: 72 6f 6d 20 74 68 65 20 70 65 65 72 20 64 75 72  rom the peer dur
3300: 69 6e 67 20 74 68 65 20 53 53 4c 20 68 61 6e 64  ing the SSL hand
3310: 73 68 61 6b 65 5c 26 2e 20 54 68 69 73 20 69 73  shake\&. This is
3320: 20 6e 65 65 64 65 64 0a 74 6f 20 64 6f 20 43 65   needed.to do Ce
3330: 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64 61  rtificate Valida
3340: 74 69 6f 6e 5c 26 2e 20 53 74 61 72 74 69 6e 67  tion\&. Starting
3350: 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38   in TclTLS 1\&.8
3360: 2c 20 74 68 65 20 64 65 66 61 75 6c 74 20 69 73  , the default is
3370: 0a 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 53  .\fBtrue\fR\&. S
3380: 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c  tarting in TclTL
3390: 53 20 32 5c 26 2e 30 2c 20 49 66 20 73 65 74 20  S 2\&.0, If set 
33a0: 74 6f 20 5c 66 42 66 61 6c 73 65 5c 66 52 20 61  to \fBfalse\fR a
33b0: 6e 64 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c 66  nd.\fB-require\f
33c0: 52 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 2c  R is \fBtrue\fR,
33d0: 20 74 68 65 6e 20 74 68 69 73 20 77 69 6c 6c 20   then this will 
33e0: 62 65 20 6f 76 65 72 72 69 64 64 65 6e 20 74 6f  be overridden to
33f0: 20 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 0a 53   \fBtrue\fR\&..S
3400: 65 65 20 5c 66 42 43 65 72 74 69 66 69 63 61 74  ee \fBCertificat
3410: 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20  e Validation\fR 
3420: 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73  for more details
3430: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72 65 71 75  \&...TP.\fB-requ
3440: 69 72 65 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66  ire\fR \fIbool\f
3450: 52 0a 52 65 71 75 69 72 65 20 61 20 76 61 6c 69  R.Require a vali
3460: 64 20 63 65 72 74 69 66 69 63 61 74 65 20 66 72  d certificate fr
3470: 6f 6d 20 74 68 65 20 70 65 65 72 20 64 75 72 69  om the peer duri
3480: 6e 67 20 74 68 65 20 53 53 4c 20 68 61 6e 64 73  ng the SSL hands
3490: 68 61 6b 65 5c 26 2e 20 49 66 20 74 68 69 73 20  hake\&. If this 
34a0: 69 73 0a 73 65 74 20 74 6f 20 74 72 75 65 2c 20  is.set to true, 
34b0: 74 68 65 6e 20 5c 66 42 2d 72 65 71 75 65 73 74  then \fB-request
34c0: 5c 66 52 20 6d 75 73 74 20 61 6c 73 6f 20 62 65  \fR must also be
34d0: 20 73 65 74 20 74 6f 20 74 72 75 65 20 61 6e 64   set to true and
34e0: 20 61 20 65 69 74 68 65 72 0a 5c 66 42 2d 63 61   a either.\fB-ca
34f0: 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 66 69  dir\fR, \fB-cafi
3500: 6c 65 5c 66 52 2c 20 5c 66 42 2d 63 61 73 74 6f  le\fR, \fB-casto
3510: 72 65 5c 66 52 2c 20 6f 72 20 61 20 70 6c 61 74  re\fR, or a plat
3520: 66 6f 72 6d 20 64 65 66 61 75 6c 74 0a 6d 75 73  form default.mus
3530: 74 20 62 65 20 70 72 6f 76 69 64 65 64 20 69 6e  t be provided in
3540: 20 6f 72 64 65 72 20 74 6f 20 76 61 6c 69 64 61   order to valida
3550: 74 65 20 61 67 61 69 6e 73 74 5c 26 2e 20 54 68  te against\&. Th
3560: 65 20 64 65 66 61 75 6c 74 20 69 6e 20 54 63 6c  e default in Tcl
3570: 54 4c 53 20 31 5c 26 2e 38 20 61 6e 64 0a 65 61  TLS 1\&.8 and.ea
3580: 72 6c 69 65 72 20 76 65 72 73 69 6f 6e 73 20 69  rlier versions i
3590: 73 20 5c 66 42 66 61 6c 73 65 5c 66 52 20 73 69  s \fBfalse\fR si
35a0: 6e 63 65 20 6e 6f 74 20 61 6c 6c 20 70 6c 61 74  nce not all plat
35b0: 66 6f 72 6d 73 20 68 61 76 65 20 63 65 72 74 69  forms have certi
35c0: 66 69 63 61 74 65 73 20 74 6f 0a 76 61 6c 69 64  ficates to.valid
35d0: 61 74 65 20 61 67 61 69 6e 73 74 20 69 6e 20 61  ate against in a
35e0: 20 66 6f 72 6d 20 63 6f 6d 70 61 74 69 62 6c 65   form compatible
35f0: 20 77 69 74 68 20 4f 70 65 6e 53 53 4c 5c 26 2e   with OpenSSL\&.
3600: 20 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63 6c   Starting in Tcl
3610: 54 4c 53 20 32 5c 26 2e 30 2c 0a 74 68 65 20 64  TLS 2\&.0,.the d
3620: 65 66 61 75 6c 74 20 69 73 20 5c 66 42 74 72 75  efault is \fBtru
3630: 65 5c 66 52 5c 26 2e 0a 53 65 65 20 5c 66 42 43  e\fR\&..See \fBC
3640: 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64  ertificate Valid
3650: 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 6d 6f 72  ation\fR for mor
3660: 65 20 64 65 74 61 69 6c 73 5c 26 2e 0a 2e 54 50  e details\&...TP
3670: 0a 5c 66 42 2d 73 65 63 75 72 69 74 79 5f 6c 65  .\fB-security_le
3680: 76 65 6c 5c 66 52 20 5c 66 49 69 6e 74 65 67 65  vel\fR \fIintege
3690: 72 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  r\fR.Specifies t
36a0: 68 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65  he security leve
36b0: 6c 20 28 76 61 6c 75 65 20 66 72 6f 6d 20 30 20  l (value from 0 
36c0: 74 6f 20 35 29 5c 26 2e 20 54 68 65 20 73 65 63  to 5)\&. The sec
36d0: 75 72 69 74 79 20 6c 65 76 65 6c 20 61 66 66 65  urity level affe
36e0: 63 74 73 0a 74 68 65 20 61 6c 6c 6f 77 65 64 20  cts.the allowed 
36f0: 63 69 70 68 65 72 20 73 75 69 74 65 20 65 6e 63  cipher suite enc
3700: 72 79 70 74 69 6f 6e 20 61 6c 67 6f 72 69 74 68  ryption algorith
3710: 6d 73 2c 20 73 75 70 70 6f 72 74 65 64 20 45 43  ms, supported EC
3720: 43 20 63 75 72 76 65 73 2c 0a 73 75 70 70 6f 72  C curves,.suppor
3730: 74 65 64 20 73 69 67 6e 61 74 75 72 65 20 61 6c  ted signature al
3740: 67 6f 72 69 74 68 6d 73 2c 20 44 48 20 70 61 72  gorithms, DH par
3750: 61 6d 65 74 65 72 20 73 69 7a 65 73 2c 20 63 65  ameter sizes, ce
3760: 72 74 69 66 69 63 61 74 65 20 6b 65 79 20 73 69  rtificate key si
3770: 7a 65 73 0a 61 6e 64 20 73 69 67 6e 61 74 75 72  zes.and signatur
3780: 65 20 61 6c 67 6f 72 69 74 68 6d 73 5c 26 2e 20  e algorithms\&. 
3790: 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 31  The default is 1
37a0: 20 70 72 69 6f 72 20 74 6f 20 4f 70 65 6e 53 53   prior to OpenSS
37b0: 4c 20 33 5c 26 2e 32 20 61 6e 64 20 32 0a 74 68  L 3\&.2 and 2.th
37c0: 65 72 65 61 66 74 65 72 5c 26 2e 20 4c 65 76 65  ereafter\&. Leve
37d0: 6c 20 33 20 61 6e 64 20 68 69 67 68 65 72 20 64  l 3 and higher d
37e0: 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20 66  isable support f
37f0: 6f 72 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65  or session ticke
3800: 74 73 20 61 6e 64 0a 6f 6e 6c 79 20 61 63 63 65  ts and.only acce
3810: 70 74 20 63 69 70 68 65 72 20 73 75 69 74 65 73  pt cipher suites
3820: 20 74 68 61 74 20 70 72 6f 76 69 64 65 20 66 6f   that provide fo
3830: 72 77 61 72 64 20 73 65 63 72 65 63 79 5c 26 2e  rward secrecy\&.
3840: 0a 2e 54 50 0a 5c 66 42 2d 73 65 72 76 65 72 5c  ..TP.\fB-server\
3850: 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 53 70  fR \fIbool\fR.Sp
3860: 65 63 69 66 69 65 73 20 77 68 65 74 68 65 72 20  ecifies whether 
3870: 74 6f 20 61 63 74 20 61 73 20 61 20 73 65 72 76  to act as a serv
3880: 65 72 20 61 6e 64 20 72 65 73 70 6f 6e 64 20 77  er and respond w
3890: 69 74 68 20 61 20 73 65 72 76 65 72 20 68 61 6e  ith a server han
38a0: 64 73 68 61 6b 65 20 77 68 65 6e 20 61 0a 63 6c  dshake when a.cl
38b0: 69 65 6e 74 20 63 6f 6e 6e 65 63 74 73 20 61 6e  ient connects an
38c0: 64 20 70 72 6f 76 69 64 65 73 20 61 20 63 6c 69  d provides a cli
38d0: 65 6e 74 20 68 61 6e 64 73 68 61 6b 65 5c 26 2e  ent handshake\&.
38e0: 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20   The default is 
38f0: 5c 66 42 66 61 6c 73 65 5c 66 52 5c 26 2e 0a 2e  \fBfalse\fR\&...
3900: 54 50 0a 5c 66 42 2d 73 65 72 76 65 72 6e 61 6d  TP.\fB-servernam
3910: 65 5c 66 52 20 5c 66 49 68 6f 73 74 6e 61 6d 65  e\fR \fIhostname
3920: 5c 66 52 0a 53 70 65 63 69 66 79 20 74 68 65 20  \fR.Specify the 
3930: 70 65 65 72 27 73 20 68 6f 73 74 6e 61 6d 65 5c  peer's hostname\
3940: 26 2e 20 54 68 69 73 20 69 73 20 75 73 65 64 20  &. This is used 
3950: 74 6f 20 73 65 74 20 74 68 65 20 54 4c 53 20 53  to set the TLS S
3960: 65 72 76 65 72 20 4e 61 6d 65 20 49 6e 64 69 63  erver Name Indic
3970: 61 74 69 6f 6e 0a 28 53 4e 49 29 20 65 78 74 65  ation.(SNI) exte
3980: 6e 73 69 6f 6e 5c 26 2e 20 53 65 74 20 74 68 69  nsion\&. Set thi
3990: 73 20 74 6f 20 74 68 65 20 65 78 70 65 63 74 65  s to the expecte
39a0: 64 20 73 65 72 76 65 72 6e 61 6d 65 20 69 6e 20  d servername in 
39b0: 74 68 65 20 73 65 72 76 65 72 27 73 20 63 65 72  the server's cer
39c0: 74 69 66 69 63 61 74 65 0a 6f 72 20 6f 6e 65 20  tificate.or one 
39d0: 6f 66 20 74 68 65 20 53 75 62 6a 65 63 74 20 41  of the Subject A
39e0: 6c 74 65 72 6e 61 74 65 20 4e 61 6d 65 73 20 28  lternate Names (
39f0: 53 41 4e 29 5c 26 2e 20 53 74 61 72 74 69 6e 67  SAN)\&. Starting
3a00: 20 69 6e 20 54 63 6c 54 4c 53 20 32 5c 26 2e 30   in TclTLS 2\&.0
3a10: 2c 20 74 68 69 73 20 77 69 6c 6c 0a 64 65 66 61  , this will.defa
3a20: 75 6c 74 20 74 6f 20 74 68 65 20 68 6f 73 74 20  ult to the host 
3a30: 66 6f 72 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a  for the \fBtls::
3a40: 73 6f 63 6b 65 74 5c 66 52 20 63 6f 6d 6d 61 6e  socket\fR comman
3a50: 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 73  d\&...TP.\fB-ses
3a60: 73 69 6f 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69  sion_id\fR \fIbi
3a70: 6e 61 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 53  nary_string\fR.S
3a80: 70 65 63 69 66 69 65 73 20 74 68 65 20 73 65 73  pecifies the ses
3a90: 73 69 6f 6e 20 69 64 20 74 6f 20 72 65 73 75 6d  sion id to resum
3aa0: 65 20 61 20 73 65 73 73 69 6f 6e 5c 26 2e 20 4e  e a session\&. N
3ab0: 6f 74 20 73 75 70 70 6f 72 74 65 64 20 79 65 74  ot supported yet
3ac0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 73 6c 32  \&...TP.\fB-ssl2
3ad0: 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45  \fR \fIbool\fR.E
3ae0: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c  nable use of SSL
3af0: 20 76 32 5c 26 2e 20 54 68 65 20 64 65 66 61 75   v2\&. The defau
3b00: 6c 74 20 69 73 20 5c 66 42 66 61 6c 73 65 5c 66  lt is \fBfalse\f
3b10: 52 5c 26 2e 20 4e 6f 74 65 3a 20 52 65 63 65 6e  R\&. Note: Recen
3b20: 74 20 76 65 72 73 69 6f 6e 73 20 6f 66 0a 4f 70  t versions of.Op
3b30: 65 6e 53 53 4c 20 6e 6f 20 6c 6f 6e 67 65 72 20  enSSL no longer 
3b40: 73 75 70 70 6f 72 74 20 53 53 4c 76 32 2c 20 73  support SSLv2, s
3b50: 6f 20 74 68 69 73 20 6d 61 79 20 6e 6f 74 20 68  o this may not h
3b60: 61 76 65 20 61 6e 79 20 65 66 66 65 63 74 5c 26  ave any effect\&
3b70: 2e 20 53 65 65 20 74 68 65 0a 5c 66 42 74 6c 73  . See the.\fBtls
3b80: 3a 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63  ::protocols\fR c
3b90: 6f 6d 6d 61 6e 64 20 66 6f 72 20 73 75 70 70 6f  ommand for suppo
3ba0: 72 74 65 64 20 70 72 6f 74 6f 63 6f 6c 73 5c 26  rted protocols\&
3bb0: 2e 0a 2e 54 50 0a 5c 66 42 2d 73 73 6c 33 5c 66  ...TP.\fB-ssl3\f
3bc0: 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61  R \fIbool\fR.Ena
3bd0: 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20 76  ble use of SSL v
3be0: 33 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  3\&. The default
3bf0: 20 69 73 20 5c 66 42 66 61 6c 73 65 5c 66 52 5c   is \fBfalse\fR\
3c00: 26 2e 20 4e 6f 74 65 3a 20 52 65 63 65 6e 74 20  &. Note: Recent 
3c10: 76 65 72 73 69 6f 6e 73 0a 6f 66 20 4f 70 65 6e  versions.of Open
3c20: 53 53 4c 20 6d 61 79 20 68 61 76 65 20 74 68 69  SSL may have thi
3c30: 73 20 64 69 73 61 62 6c 65 64 20 61 74 20 63 6f  s disabled at co
3c40: 6d 70 69 6c 65 20 74 69 6d 65 2c 20 73 6f 20 74  mpile time, so t
3c50: 68 69 73 20 6d 61 79 20 6e 6f 74 20 68 61 76 65  his may not have
3c60: 20 61 6e 79 0a 65 66 66 65 63 74 5c 26 2e 20 53   any.effect\&. S
3c70: 65 65 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 70  ee the \fBtls::p
3c80: 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d  rotocols\fR comm
3c90: 61 6e 64 20 66 6f 72 20 73 75 70 70 6f 72 74 65  and for supporte
3ca0: 64 20 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e 0a 2e  d protocols\&...
3cb0: 54 50 0a 5c 66 42 2d 74 6c 73 31 5c 66 52 20 5c  TP.\fB-tls1\fR \
3cc0: 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65  fIbool\fR.Enable
3cd0: 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 5c 26   use of TLS v1\&
3ce0: 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73  . The default is
3cf0: 20 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 4e   \fBtrue\fR\&. N
3d00: 6f 74 65 3a 20 54 4c 53 20 31 5c 26 2e 30 20 6e  ote: TLS 1\&.0 n
3d10: 65 65 64 73 0a 53 48 41 31 20 74 6f 20 6f 70 65  eeds.SHA1 to ope
3d20: 72 61 74 65 2c 20 77 68 69 63 68 20 69 73 20 6f  rate, which is o
3d30: 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 69 6e  nly available in
3d40: 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20   security level 
3d50: 30 20 66 6f 72 20 4f 70 65 6e 20 53 53 4c 20 33  0 for Open SSL 3
3d60: 5c 26 2e 30 2b 5c 26 2e 0a 53 65 65 20 74 68 65  \&.0+\&..See the
3d70: 20 5c 66 49 2d 73 65 63 75 72 69 74 79 5f 6c 65   \fI-security_le
3d80: 76 65 6c 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e  vel\fR option\&.
3d90: 0a 2e 54 50 0a 5c 66 42 2d 74 6c 73 31 5c 26 2e  ..TP.\fB-tls1\&.
3da0: 31 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a  1\fR \fIbool\fR.
3db0: 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c  Enable use of TL
3dc0: 53 20 76 31 5c 26 2e 31 5c 26 2e 20 54 68 65 20  S v1\&.1\&. The 
3dd0: 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 74 72  default is \fBtr
3de0: 75 65 5c 66 52 5c 26 2e 20 4e 6f 74 65 3a 20 54  ue\fR\&. Note: T
3df0: 4c 53 20 31 5c 26 2e 31 20 6e 65 65 64 73 0a 53  LS 1\&.1 needs.S
3e00: 48 41 31 20 74 6f 20 6f 70 65 72 61 74 65 2c 20  HA1 to operate, 
3e10: 77 68 69 63 68 20 69 73 20 6f 6e 6c 79 20 61 76  which is only av
3e20: 61 69 6c 61 62 6c 65 20 69 6e 20 73 65 63 75 72  ailable in secur
3e30: 69 74 79 20 6c 65 76 65 6c 20 30 20 66 6f 72 20  ity level 0 for 
3e40: 4f 70 65 6e 20 53 53 4c 20 33 5c 26 2e 30 2b 5c  Open SSL 3\&.0+\
3e50: 26 2e 0a 53 65 65 20 74 68 65 20 5c 66 49 2d 73  &..See the \fI-s
3e60: 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c 66 52  ecurity_level\fR
3e70: 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c   option\&...TP.\
3e80: 66 42 2d 74 6c 73 31 5c 26 2e 32 5c 66 52 20 5c  fB-tls1\&.2\fR \
3e90: 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65  fIbool\fR.Enable
3ea0: 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 5c 26   use of TLS v1\&
3eb0: 2e 32 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  .2\&. The defaul
3ec0: 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 5c  t is \fBtrue\fR\
3ed0: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 74 6c 73 31 5c  &...TP.\fB-tls1\
3ee0: 26 2e 33 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66  &.3\fR \fIbool\f
3ef0: 52 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20  R.Enable use of 
3f00: 54 4c 53 20 76 31 5c 26 2e 33 5c 26 2e 20 54 68  TLS v1\&.3\&. Th
3f10: 65 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42  e default is \fB
3f20: 74 72 75 65 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c  true\fR\&...TP.\
3f30: 66 42 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61  fB-validatecomma
3f40: 6e 64 5c 66 52 20 5c 66 49 63 61 6c 6c 62 61 63  nd\fR \fIcallbac
3f50: 6b 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  k\fR.Specifies t
3f60: 68 65 20 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d  he callback comm
3f70: 61 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20 74 6f  and to invoke to
3f80: 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 70 65   validate the pe
3f90: 65 72 20 63 65 72 74 69 66 69 63 61 74 65 73 0a  er certificates.
3fa0: 61 6e 64 20 6f 74 68 65 72 20 63 6f 6e 66 69 67  and other config
3fb0: 20 69 6e 66 6f 20 64 75 72 69 6e 67 20 74 68 65   info during the
3fc0: 20 70 72 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69   protocol negoti
3fd0: 61 74 69 6f 6e 20 70 68 61 73 65 5c 26 2e 20 54  ation phase\&. T
3fe0: 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 0a  his can be used.
3ff0: 62 79 20 54 43 4c 20 73 63 72 69 70 74 73 20 74  by TCL scripts t
4000: 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72 20  o perform their 
4010: 6f 77 6e 20 43 65 72 74 69 66 69 63 61 74 65 20  own Certificate 
4020: 56 61 6c 69 64 61 74 69 6f 6e 20 74 6f 20 73 75  Validation to su
4030: 70 70 6c 65 6d 65 6e 74 20 74 68 65 0a 64 65 66  pplement the.def
4040: 61 75 6c 74 20 76 61 6c 69 64 61 74 69 6f 6e 20  ault validation 
4050: 70 72 6f 76 69 64 65 64 20 62 79 20 4f 70 65 6e  provided by Open
4060: 53 53 4c 5c 26 2e 20 54 68 65 20 73 63 72 69 70  SSL\&. The scrip
4070: 74 20 6d 75 73 74 20 72 65 74 75 72 6e 20 61 20  t must return a 
4080: 62 6f 6f 6c 65 61 6e 20 74 72 75 65 0a 74 6f 20  boolean true.to 
4090: 63 6f 6e 74 69 6e 75 65 20 74 68 65 20 6e 65 67  continue the neg
40a0: 6f 74 69 61 74 69 6f 6e 5c 26 2e 20 53 65 65 20  otiation\&. See 
40b0: 5c 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69  \fBCallback Opti
40c0: 6f 6e 73 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20  ons\fR for more 
40d0: 69 6e 66 6f 5c 26 2e 0a 2e 52 45 0a 2e 54 50 0a  info\&...RE..TP.
40e0: 5c 66 42 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74  \fBtls::unimport
40f0: 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66  \fR \fIchannel\f
4100: 52 0a 43 6f 6d 70 6c 69 6d 65 6e 74 20 74 6f 20  R.Compliment to 
4110: 5c 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c 66  \fBtls::import\f
4120: 52 5c 26 2e 20 55 73 65 64 20 74 6f 20 72 65 6d  R\&. Used to rem
4130: 6f 76 65 20 74 68 65 20 74 6f 70 20 6c 65 76 65  ove the top leve
4140: 6c 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65  l stacked channe
4150: 6c 0a 66 72 6f 6d 20 5c 66 49 63 68 61 6e 6e 65  l.from \fIchanne
4160: 6c 5c 66 52 5c 26 2e 20 54 68 69 73 20 75 6e 73  l\fR\&. This uns
4170: 74 61 63 6b 73 20 74 68 65 20 65 6e 63 72 79 70  tacks the encryp
4180: 74 69 6f 6e 20 6f 66 20 61 20 72 65 67 75 6c 61  tion of a regula
4190: 72 20 54 43 4c 20 63 68 61 6e 6e 65 6c 5c 26 2e  r TCL channel\&.
41a0: 20 41 6e 0a 65 72 72 6f 72 20 69 73 20 74 68 72   An.error is thr
41b0: 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 20 6e 6f  own if TLS is no
41c0: 74 20 74 68 65 20 74 6f 70 20 73 74 61 63 6b 65  t the top stacke
41d0: 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 65 5c 26  d channel type\&
41e0: 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 68 61  ...TP.\fBtls::ha
41f0: 6e 64 73 68 61 6b 65 5c 66 52 20 5c 66 49 63 68  ndshake\fR \fIch
4200: 61 6e 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 73 20  annel\fR.Forces 
4210: 74 68 65 20 54 4c 53 20 6e 65 67 6f 74 69 61 74  the TLS negotiat
4220: 69 6f 6e 20 68 61 6e 64 73 68 61 6b 65 20 74 6f  ion handshake to
4230: 20 74 61 6b 65 20 70 6c 61 63 65 20 69 6d 6d 65   take place imme
4240: 64 69 61 74 65 6c 79 2c 20 61 6e 64 20 72 65 74  diately, and ret
4250: 75 72 6e 73 20 30 0a 69 66 20 68 61 6e 64 73 68  urns 0.if handsh
4260: 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20  ake is still in 
4270: 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c  progress (non-bl
4280: 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66  ocking), or 1 if
4290: 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77   the handshake w
42a0: 61 73 0a 73 75 63 63 65 73 73 66 75 6c 5c 26 2e  as.successful\&.
42b0: 20 49 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b   If the handshak
42c0: 65 20 66 61 69 6c 65 64 2c 20 61 6e 20 65 72 72  e failed, an err
42d0: 6f 72 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72  or will be retur
42e0: 6e 65 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c  ned\&...TP.\fBtl
42f0: 73 3a 3a 73 74 61 74 75 73 5c 66 52 20 3f 5c 66  s::status\fR ?\f
4300: 42 2d 6c 6f 63 61 6c 5c 66 52 3f 20 5c 66 49 63  B-local\fR? \fIc
4310: 68 61 6e 6e 65 6c 5c 66 52 0a 52 65 74 75 72 6e  hannel\fR.Return
4320: 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 74  s the current st
4330: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63  atus of an SSL c
4340: 68 61 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65  hannel\&. The re
4350: 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f  sult is a list o
4360: 66 20 6b 65 79 2d 76 61 6c 75 65 0a 70 61 69 72  f key-value.pair
4370: 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65  s describing the
4380: 20 53 53 4c 2c 20 63 65 72 74 69 66 69 63 61 74   SSL, certificat
4390: 65 2c 20 61 6e 64 20 63 65 72 74 69 66 69 63 61  e, and certifica
43a0: 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20  te verification 
43b0: 73 74 61 74 75 73 5c 26 2e 20 49 66 0a 74 68 65  status\&. If.the
43c0: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68   SSL handshake h
43d0: 61 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c  as not yet compl
43e0: 65 74 65 64 2c 20 61 6e 20 65 6d 70 74 79 20 6c  eted, an empty l
43f0: 69 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 5c  ist is returned\
4400: 26 2e 20 49 66 20 74 68 65 0a 5c 66 42 2d 6c 6f  &. If the.\fB-lo
4410: 63 61 6c 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73  cal\fR option is
4420: 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e   specified, then
4430: 20 74 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69   the local certi
4440: 66 69 63 61 74 65 20 69 73 20 75 73 65 64 5c 26  ficate is used\&
4450: 2e 20 52 65 74 75 72 6e 65 64 0a 76 61 6c 75 65  . Returned.value
4460: 73 20 69 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a 53  s include:..sp.S
4470: 53 4c 20 53 74 61 74 75 73 0a 2e 52 53 0a 2e 54  SL Status..RS..T
4480: 50 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66 49  P.\fBalpn\fR \fI
4490: 70 72 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68 65 20  protocol\fR.The 
44a0: 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65  protocol selecte
44b0: 64 20 61 66 74 65 72 20 41 70 70 6c 69 63 61 74  d after Applicat
44c0: 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63  ion-Layer Protoc
44d0: 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28  ol Negotiation (
44e0: 41 4c 50 4e 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ALPN)\&...TP.\fB
44f0: 63 69 70 68 65 72 5c 66 52 20 5c 66 49 63 69 70  cipher\fR \fIcip
4500: 68 65 72 5c 66 52 0a 54 68 65 20 63 75 72 72 65  her\fR.The curre
4510: 6e 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 65  nt cipher in use
4520: 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f 6e   for the session
4530: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 65 65 72 6e  \&...TP.\fBpeern
4540: 61 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c 66  ame\fR \fIname\f
4550: 52 0a 54 68 65 20 70 65 65 72 6e 61 6d 65 20 66  R.The peername f
4560: 72 6f 6d 20 74 68 65 20 63 65 72 74 69 66 69 63  rom the certific
4570: 61 74 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 72  ate\&...TP.\fBpr
4580: 6f 74 6f 63 6f 6c 5c 66 52 20 5c 66 49 76 65 72  otocol\fR \fIver
4590: 73 69 6f 6e 5c 66 52 0a 54 68 65 20 70 72 6f 74  sion\fR.The prot
45a0: 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65  ocol version use
45b0: 64 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63  d for the connec
45c0: 74 69 6f 6e 3a 20 53 53 4c 32 2c 20 53 53 4c 33  tion: SSL2, SSL3
45d0: 2c 20 54 4c 53 31 2c 20 54 4c 53 31 5c 26 2e 31  , TLS1, TLS1\&.1
45e0: 2c 20 54 4c 53 31 5c 26 2e 32 2c 20 54 4c 53 31  , TLS1\&.2, TLS1
45f0: 5c 26 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e  \&.3, or unknown
4600: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 62 69 74 73  \&...TP.\fBsbits
4610: 5c 66 52 20 5c 66 49 6e 5c 66 52 0a 54 68 65 20  \fR \fIn\fR.The 
4620: 6e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75  number of bits u
4630: 73 65 64 20 66 6f 72 20 74 68 65 20 73 65 73 73  sed for the sess
4640: 69 6f 6e 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c  ion key\&...TP.\
4650: 66 42 73 69 67 6e 61 74 75 72 65 48 61 73 68 41  fBsignatureHashA
4660: 6c 67 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49 61  lgorithm\fR \fIa
4670: 6c 67 6f 72 69 74 68 6d 5c 66 52 0a 54 68 65 20  lgorithm\fR.The 
4680: 73 69 67 6e 61 74 75 72 65 20 68 61 73 68 20 61  signature hash a
4690: 6c 67 6f 72 69 74 68 6d 5c 26 2e 0a 2e 54 50 0a  lgorithm\&...TP.
46a0: 5c 66 42 73 69 67 6e 61 74 75 72 65 54 79 70 65  \fBsignatureType
46b0: 5c 66 52 20 5c 66 49 74 79 70 65 5c 66 52 0a 54  \fR \fItype\fR.T
46c0: 68 65 20 73 69 67 6e 61 74 75 72 65 20 74 79 70  he signature typ
46d0: 65 20 76 61 6c 75 65 5c 26 2e 0a 2e 54 50 0a 5c  e value\&...TP.\
46e0: 66 42 76 65 72 69 66 79 44 65 70 74 68 5c 66 52  fBverifyDepth\fR
46f0: 20 5c 66 49 6e 5c 66 52 0a 4d 61 78 69 6d 75 6d   \fIn\fR.Maximum
4700: 20 64 65 70 74 68 20 66 6f 72 20 74 68 65 20 63   depth for the c
4710: 65 72 74 69 66 69 63 61 74 65 20 63 68 61 69 6e  ertificate chain
4720: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 5c 26 2e   verification\&.
4730: 20 44 65 66 61 75 6c 74 20 69 73 20 2d 31 2c 20   Default is -1, 
4740: 74 6f 20 63 68 65 63 6b 20 61 6c 6c 5c 26 2e 0a  to check all\&..
4750: 2e 54 50 0a 5c 66 42 76 65 72 69 66 79 4d 6f 64  .TP.\fBverifyMod
4760: 65 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a  e\fR \fIlist\fR.
4770: 4c 69 73 74 20 6f 66 20 63 65 72 74 69 66 69 63  List of certific
4780: 61 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e  ate verification
4790: 20 6d 6f 64 65 73 5c 26 2e 0a 2e 54 50 0a 5c 66   modes\&...TP.\f
47a0: 42 76 65 72 69 66 79 52 65 73 75 6c 74 5c 66 52  BverifyResult\fR
47b0: 20 5c 66 49 72 65 73 75 6c 74 5c 66 52 0a 43 65   \fIresult\fR.Ce
47c0: 72 74 69 66 69 63 61 74 65 20 76 65 72 69 66 69  rtificate verifi
47d0: 63 61 74 69 6f 6e 20 72 65 73 75 6c 74 5c 26 2e  cation result\&.
47e0: 0a 2e 54 50 0a 5c 66 42 63 61 5f 6e 61 6d 65 73  ..TP.\fBca_names
47f0: 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a 4c  \fR \fIlist\fR.L
4800: 69 73 74 20 6f 66 20 74 68 65 20 43 65 72 74 69  ist of the Certi
4810: 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 69  ficate Authoriti
4820: 65 73 20 75 73 65 64 20 74 6f 20 63 72 65 61 74  es used to creat
4830: 65 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  e the certificat
4840: 65 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 43 65 72  e\&...RE..IP.Cer
4850: 74 69 66 69 63 61 74 65 20 53 74 61 74 75 73 0a  tificate Status.
4860: 2e 52 53 0a 2e 54 50 0a 5c 66 42 61 6c 6c 5c 66  .RS..TP.\fBall\f
4870: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 44  R \fIstring\fR.D
4880: 75 6d 70 20 6f 66 20 61 6c 6c 20 63 65 72 74 69  ump of all certi
4890: 66 69 63 61 74 65 20 69 6e 66 6f 5c 26 2e 0a 2e  ficate info\&...
48a0: 54 50 0a 5c 66 42 76 65 72 73 69 6f 6e 5c 66 52  TP.\fBversion\fR
48b0: 20 5c 66 49 76 61 6c 75 65 5c 66 52 0a 54 68 65   \fIvalue\fR.The
48c0: 20 63 65 72 74 69 66 69 63 61 74 65 20 76 65 72   certificate ver
48d0: 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73  sion\&...TP.\fBs
48e0: 65 72 69 61 6c 4e 75 6d 62 65 72 5c 66 52 20 5c  erialNumber\fR \
48f0: 66 49 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20  fIstring\fR.The 
4900: 73 65 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66  serial number of
4910: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
4920: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67   as a hex string
4930: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61  \&...TP.\fBsigna
4940: 74 75 72 65 5c 66 52 20 5c 66 49 61 6c 67 6f 72  ture\fR \fIalgor
4950: 69 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20 61  ithm\fR.Cipher a
4960: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f  lgorithm used fo
4970: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69  r certificate si
4980: 67 6e 61 74 75 72 65 5c 26 2e 0a 2e 54 50 0a 5c  gnature\&...TP.\
4990: 66 42 69 73 73 75 65 72 5c 66 52 20 5c 66 49 73  fBissuer\fR \fIs
49a0: 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 64 69 73  tring\fR.The dis
49b0: 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20  tinguished name 
49c0: 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74  (DN) of the cert
49d0: 69 66 69 63 61 74 65 20 69 73 73 75 65 72 5c 26  ificate issuer\&
49e0: 2e 0a 2e 54 50 0a 5c 66 42 6e 6f 74 42 65 66 6f  ...TP.\fBnotBefo
49f0: 72 65 5c 66 52 20 5c 66 49 64 61 74 65 5c 66 52  re\fR \fIdate\fR
4a00: 0a 54 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 64  .The beginning d
4a10: 61 74 65 20 6f 66 20 74 68 65 20 63 65 72 74 69  ate of the certi
4a20: 66 69 63 61 74 65 20 76 61 6c 69 64 69 74 79 5c  ficate validity\
4a30: 26 2e 0a 2e 54 50 0a 5c 66 42 6e 6f 74 41 66 74  &...TP.\fBnotAft
4a40: 65 72 5c 66 52 20 5c 66 49 64 61 74 65 5c 66 52  er\fR \fIdate\fR
4a50: 0a 54 68 65 20 65 78 70 69 72 61 74 69 6f 6e 20  .The expiration 
4a60: 64 61 74 65 20 6f 66 20 74 68 65 20 63 65 72 74  date of the cert
4a70: 69 66 69 63 61 74 65 20 76 61 6c 69 64 69 74 79  ificate validity
4a80: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65  \&...TP.\fBsubje
4a90: 63 74 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c  ct\fR \fIstring\
4aa0: 66 52 0a 54 68 65 20 64 69 73 74 69 6e 67 75 69  fR.The distingui
4ab0: 73 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f  shed name (DN) o
4ac0: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
4ad0: 65 20 73 75 62 6a 65 63 74 5c 26 2e 20 46 69 65  e subject\&. Fie
4ae0: 6c 64 73 20 69 6e 63 6c 75 64 65 3a 20 43 6f 6d  lds include: Com
4af0: 6d 6f 6e 0a 4e 61 6d 65 20 28 43 4e 29 2c 20 4f  mon.Name (CN), O
4b00: 72 67 61 6e 69 7a 61 74 69 6f 6e 20 28 4f 29 2c  rganization (O),
4b10: 20 4c 6f 63 61 6c 69 74 79 20 6f 72 20 43 69 74   Locality or Cit
4b20: 79 20 28 4c 29 2c 20 53 74 61 74 65 20 6f 72 20  y (L), State or 
4b30: 50 72 6f 76 69 6e 63 65 20 28 53 29 2c 20 61 6e  Province (S), an
4b40: 64 0a 43 6f 75 6e 74 72 79 20 4e 61 6d 65 20 28  d.Country Name (
4b50: 43 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69 73 73  C)\&...TP.\fBiss
4b60: 75 65 72 55 6e 69 71 75 65 49 44 5c 66 52 20 5c  uerUniqueID\fR \
4b70: 66 49 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20  fIstring\fR.The 
4b80: 69 73 73 75 65 72 20 75 6e 69 71 75 65 20 69 64  issuer unique id
4b90: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65  \&...TP.\fBsubje
4ba0: 63 74 55 6e 69 71 75 65 49 44 5c 66 52 20 5c 66  ctUniqueID\fR \f
4bb0: 49 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 73  Istring\fR.The s
4bc0: 75 62 6a 65 63 74 20 75 6e 69 71 75 65 20 69 64  ubject unique id
4bd0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6e 75 6d 5f 65  \&...TP.\fBnum_e
4be0: 78 74 65 6e 73 69 6f 6e 73 5c 66 52 20 5c 66 49  xtensions\fR \fI
4bf0: 6e 5c 66 52 0a 4e 75 6d 62 65 72 20 6f 66 20 63  n\fR.Number of c
4c00: 65 72 74 69 66 69 63 61 74 65 20 65 78 74 65 6e  ertificate exten
4c10: 73 69 6f 6e 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  sions\&...TP.\fB
4c20: 65 78 74 65 6e 73 69 6f 6e 73 5c 66 52 20 5c 66  extensions\fR \f
4c30: 49 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66  Ilist\fR.List of
4c40: 20 63 65 72 74 69 66 69 63 61 74 65 20 65 78 74   certificate ext
4c50: 65 6e 73 69 6f 6e 20 6e 61 6d 65 73 5c 26 2e 0a  ension names\&..
4c60: 2e 54 50 0a 5c 66 42 61 75 74 68 6f 72 69 74 79  .TP.\fBauthority
4c70: 4b 65 79 49 64 65 6e 74 69 66 69 65 72 5c 66 52  KeyIdentifier\fR
4c80: 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 41 75   \fIstring\fR.Au
4c90: 74 68 6f 72 69 74 79 20 4b 65 79 20 49 64 65 6e  thority Key Iden
4ca0: 74 69 66 69 65 72 20 28 41 4b 49 29 20 6f 66 20  tifier (AKI) of 
4cb0: 74 68 65 20 49 73 73 75 69 6e 67 20 43 41 20 63  the Issuing CA c
4cc0: 65 72 74 69 66 69 63 61 74 65 20 74 68 61 74 20  ertificate that 
4cd0: 73 69 67 6e 65 64 20 74 68 65 0a 53 53 4c 20 63  signed the.SSL c
4ce0: 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20  ertificate as a 
4cf0: 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 20 54 68  hex string\&. Th
4d00: 69 73 20 76 61 6c 75 65 20 6d 61 74 63 68 65 73  is value matches
4d10: 20 74 68 65 20 53 4b 49 20 76 61 6c 75 65 20 6f   the SKI value o
4d20: 66 20 74 68 65 0a 49 6e 74 65 72 6d 65 64 69 61  f the.Intermedia
4d30: 74 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74  te CA certificat
4d40: 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a  e\&...TP.\fBsubj
4d50: 65 63 74 4b 65 79 49 64 65 6e 74 69 66 69 65 72  ectKeyIdentifier
4d60: 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52  \fR \fIstring\fR
4d70: 0a 53 75 62 6a 65 63 74 20 4b 65 79 20 49 64 65  .Subject Key Ide
4d80: 6e 74 69 66 69 65 72 20 28 53 4b 49 29 20 68 61  ntifier (SKI) ha
4d90: 73 68 20 6f 66 20 74 68 65 20 70 75 62 6c 69 63  sh of the public
4da0: 20 6b 65 79 20 69 6e 73 69 64 65 20 74 68 65 20   key inside the 
4db0: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61  certificate as a
4dc0: 0a 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 20 55  .hex string\&. U
4dd0: 73 65 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20  sed to identify 
4de0: 63 65 72 74 69 66 69 63 61 74 65 73 20 74 68 61  certificates tha
4df0: 74 20 63 6f 6e 74 61 69 6e 20 61 20 70 61 72 74  t contain a part
4e00: 69 63 75 6c 61 72 20 70 75 62 6c 69 63 20 6b 65  icular public ke
4e10: 79 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a  y\&...TP.\fBsubj
4e20: 65 63 74 41 6c 74 4e 61 6d 65 5c 66 52 20 5c 66  ectAltName\fR \f
4e30: 49 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66  Ilist\fR.List of
4e40: 20 61 6c 6c 20 6f 66 20 74 68 65 20 53 75 62 6a   all of the Subj
4e50: 65 63 74 20 41 6c 74 65 72 6e 61 74 69 76 65 20  ect Alternative 
4e60: 4e 61 6d 65 73 20 28 53 41 4e 29 20 69 6e 63 6c  Names (SAN) incl
4e70: 75 64 69 6e 67 20 64 6f 6d 61 69 6e 20 6e 61 6d  uding domain nam
4e80: 65 73 2c 20 73 75 62 0a 64 6f 6d 61 69 6e 73 2c  es, sub.domains,
4e90: 20 61 6e 64 20 49 50 20 61 64 64 72 65 73 73 65   and IP addresse
4ea0: 73 20 74 68 61 74 20 61 72 65 20 73 65 63 75 72  s that are secur
4eb0: 65 64 20 62 79 20 74 68 65 20 63 65 72 74 69 66  ed by the certif
4ec0: 69 63 61 74 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42  icate\&...TP.\fB
4ed0: 6f 63 73 70 5c 66 52 20 5c 66 49 6c 69 73 74 5c  ocsp\fR \fIlist\
4ee0: 66 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20 4f  fR.List of all O
4ef0: 6e 6c 69 6e 65 20 43 65 72 74 69 66 69 63 61 74  nline Certificat
4f00: 65 20 53 74 61 74 75 73 20 50 72 6f 74 6f 63 6f  e Status Protoco
4f10: 6c 20 28 4f 43 53 50 29 20 55 52 4c 73 20 74 68  l (OCSP) URLs th
4f20: 61 74 20 63 61 6e 20 62 65 20 75 73 65 64 20 74  at can be used t
4f30: 6f 0a 63 68 65 63 6b 20 74 68 65 20 76 61 6c 69  o.check the vali
4f40: 64 69 74 79 20 6f 66 20 74 68 69 73 20 63 65 72  dity of this cer
4f50: 74 69 66 69 63 61 74 65 5c 26 2e 0a 2e 54 50 0a  tificate\&...TP.
4f60: 5c 66 42 63 65 72 74 69 66 69 63 61 74 65 5c 66  \fBcertificate\f
4f70: 52 20 5c 66 49 63 65 72 74 5c 66 52 0a 54 68 65  R \fIcert\fR.The
4f80: 20 50 45 4d 20 65 6e 63 6f 64 65 64 20 63 65 72   PEM encoded cer
4f90: 74 69 66 69 63 61 74 65 5c 26 2e 0a 2e 54 50 0a  tificate\&...TP.
4fa0: 5c 66 42 73 69 67 6e 61 74 75 72 65 41 6c 67 6f  \fBsignatureAlgo
4fb0: 72 69 74 68 6d 5c 66 52 20 5c 66 49 61 6c 67 6f  rithm\fR \fIalgo
4fc0: 72 69 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20  rithm\fR.Cipher 
4fd0: 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66  algorithm used f
4fe0: 6f 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61  or the certifica
4ff0: 74 65 20 73 69 67 6e 61 74 75 72 65 5c 26 2e 0a  te signature\&..
5000: 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74 75 72 65  .TP.\fBsignature
5010: 56 61 6c 75 65 5c 66 52 20 5c 66 49 73 74 72 69  Value\fR \fIstri
5020: 6e 67 5c 66 52 0a 43 65 72 74 69 66 69 63 61 74  ng\fR.Certificat
5030: 65 20 73 69 67 6e 61 74 75 72 65 20 61 73 20 61  e signature as a
5040: 20 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 0a 2e   hex string\&...
5050: 54 50 0a 5c 66 42 73 69 67 6e 61 74 75 72 65 44  TP.\fBsignatureD
5060: 69 67 65 73 74 5c 66 52 20 5c 66 49 76 65 72 73  igest\fR \fIvers
5070: 69 6f 6e 5c 66 52 0a 43 65 72 74 69 66 69 63 61  ion\fR.Certifica
5080: 74 65 20 73 69 67 6e 69 6e 67 20 64 69 67 65 73  te signing diges
5090: 74 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e  t as a hex strin
50a0: 67 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 75 62 6c  g\&...TP.\fBpubl
50b0: 69 63 4b 65 79 41 6c 67 6f 72 69 74 68 6d 5c 66  icKeyAlgorithm\f
50c0: 52 20 5c 66 49 61 6c 67 6f 72 69 74 68 6d 5c 66  R \fIalgorithm\f
50d0: 52 0a 43 65 72 74 69 66 69 63 61 74 65 20 73 69  R.Certificate si
50e0: 67 6e 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b  gnature public k
50f0: 65 79 20 61 6c 67 6f 72 69 74 68 6d 5c 26 2e 0a  ey algorithm\&..
5100: 2e 54 50 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79  .TP.\fBpublicKey
5110: 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52  \fR \fIstring\fR
5120: 0a 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67  .Certificate sig
5130: 6e 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65  nature public ke
5140: 79 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e  y as a hex strin
5150: 67 5c 26 2e 0a 2e 54 50 0a 5c 66 42 62 69 74 73  g\&...TP.\fBbits
5160: 5c 66 52 20 5c 66 49 6e 5c 66 52 0a 4e 75 6d 62  \fR \fIn\fR.Numb
5170: 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 64 20  er of bits used 
5180: 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20  for certificate 
5190: 73 69 67 6e 61 74 75 72 65 20 6b 65 79 5c 26 2e  signature key\&.
51a0: 0a 2e 54 50 0a 5c 66 42 73 65 6c 66 5f 73 69 67  ..TP.\fBself_sig
51b0: 6e 65 64 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61  ned\fR \fIboolea
51c0: 6e 5c 66 52 0a 57 68 65 74 68 65 72 20 74 68 65  n\fR.Whether the
51d0: 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69 67   certificate sig
51e0: 6e 61 74 75 72 65 20 69 73 20 73 65 6c 66 20 73  nature is self s
51f0: 69 67 6e 65 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42  igned\&...TP.\fB
5200: 73 68 61 31 5f 68 61 73 68 5c 66 52 20 5c 66 49  sha1_hash\fR \fI
5210: 68 61 73 68 5c 66 52 0a 54 68 65 20 53 48 41 31  hash\fR.The SHA1
5220: 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 65 72   hash of the cer
5230: 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68 65  tificate as a he
5240: 78 20 73 74 72 69 6e 67 5c 26 2e 0a 2e 54 50 0a  x string\&...TP.
5250: 5c 66 42 73 68 61 32 35 36 5f 68 61 73 68 5c 66  \fBsha256_hash\f
5260: 52 20 5c 66 49 68 61 73 68 5c 66 52 0a 54 68 65  R \fIhash\fR.The
5270: 20 53 48 41 32 35 36 20 68 61 73 68 20 6f 66 20   SHA256 hash of 
5280: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20  the certificate 
5290: 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 5c  as a hex string\
52a0: 26 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 74 6c  &...RE..TP.\fBtl
52b0: 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 5c 66 52  s::connection\fR
52c0: 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 52   \fIchannel\fR.R
52d0: 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65  eturns the curre
52e0: 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74  nt connection st
52f0: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63  atus of an SSL c
5300: 68 61 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65  hannel\&. The re
5310: 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 0a 6f  sult is a list.o
5320: 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72  f key-value pair
5330: 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65  s describing the
5340: 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 20 52   connection\&. R
5350: 65 74 75 72 6e 65 64 20 76 61 6c 75 65 73 20 69  eturned values i
5360: 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a 53 53 4c 20  nclude:..sp.SSL 
5370: 53 74 61 74 75 73 0a 2e 52 53 0a 2e 54 50 0a 5c  Status..RS..TP.\
5380: 66 42 73 74 61 74 65 5c 66 52 20 5c 66 49 73 74  fBstate\fR \fIst
5390: 61 74 65 5c 66 52 0a 53 74 61 74 65 20 6f 66 20  ate\fR.State of 
53a0: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26  the connection\&
53b0: 2e 0a 2e 54 50 0a 5c 66 42 73 65 72 76 65 72 6e  ...TP.\fBservern
53c0: 61 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c 66  ame\fR \fIname\f
53d0: 52 0a 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68  R.The name of th
53e0: 65 20 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 73  e connected to s
53f0: 65 72 76 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42  erver\&...TP.\fB
5400: 70 72 6f 74 6f 63 6f 6c 5c 66 52 20 5c 66 49 76  protocol\fR \fIv
5410: 65 72 73 69 6f 6e 5c 66 52 0a 54 68 65 20 70 72  ersion\fR.The pr
5420: 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75  otocol version u
5430: 73 65 64 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e  sed for the conn
5440: 65 63 74 69 6f 6e 3a 20 53 53 4c 32 2c 20 53 53  ection: SSL2, SS
5450: 4c 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 5c 26  L3, TLS1, TLS1\&
5460: 2e 31 2c 20 54 4c 53 31 5c 26 2e 32 2c 20 54 4c  .1, TLS1\&.2, TL
5470: 53 31 5c 26 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f  S1\&.3, or unkno
5480: 77 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 72 65 6e  wn\&...TP.\fBren
5490: 65 67 6f 74 69 61 74 69 6f 6e 5f 61 6c 6c 6f 77  egotiation_allow
54a0: 65 64 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e  ed\fR \fIboolean
54b0: 5c 66 52 0a 57 68 65 74 68 65 72 20 70 72 6f 74  \fR.Whether prot
54c0: 6f 63 6f 6c 20 72 65 6e 65 67 6f 74 69 61 74 69  ocol renegotiati
54d0: 6f 6e 20 69 73 20 73 75 70 70 6f 72 74 65 64 20  on is supported 
54e0: 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66  or not\&...TP.\f
54f0: 42 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c  Bsecurity_level\
5500: 66 52 20 5c 66 49 6c 65 76 65 6c 5c 66 52 0a 54  fR \fIlevel\fR.T
5510: 68 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65  he security leve
5520: 6c 20 75 73 65 64 20 66 6f 72 20 73 65 6c 65 63  l used for selec
5530: 74 69 6f 6e 20 6f 66 20 63 69 70 68 65 72 73 2c  tion of ciphers,
5540: 20 6b 65 79 20 73 69 7a 65 2c 20 65 74 63 5c 26   key size, etc\&
5550: 2e 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69 6f 6e  ...TP.\fBsession
5560: 5f 72 65 75 73 65 64 5c 66 52 20 5c 66 49 62 6f  _reused\fR \fIbo
5570: 6f 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72  olean\fR.Whether
5580: 20 74 68 65 20 73 65 73 73 69 6f 6e 20 68 61 73   the session has
5590: 20 62 65 65 6e 20 72 65 75 73 65 64 20 6f 72 20   been reused or 
55a0: 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69 73  not\&...TP.\fBis
55b0: 5f 73 65 72 76 65 72 5c 66 52 20 5c 66 49 62 6f  _server\fR \fIbo
55c0: 6f 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72  olean\fR.Whether
55d0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20   the connection 
55e0: 69 73 20 63 6f 6e 66 69 67 75 72 65 64 20 61 73  is configured as
55f0: 20 61 20 73 65 72 76 65 72 20 28 31 29 20 6f 72   a server (1) or
5600: 20 63 6c 69 65 6e 74 20 28 30 29 5c 26 2e 0a 2e   client (0)\&...
5610: 54 50 0a 5c 66 42 63 6f 6d 70 72 65 73 73 69 6f  TP.\fBcompressio
5620: 6e 5c 66 52 20 5c 66 49 6d 6f 64 65 5c 66 52 0a  n\fR \fImode\fR.
5630: 43 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68  Compression meth
5640: 6f 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 65 78 70  od\&...TP.\fBexp
5650: 61 6e 73 69 6f 6e 5c 66 52 20 5c 66 49 6d 6f 64  ansion\fR \fImod
5660: 65 5c 66 52 0a 45 78 70 61 6e 73 69 6f 6e 20 6d  e\fR.Expansion m
5670: 65 74 68 6f 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ethod\&...TP.\fB
5680: 63 61 4c 69 73 74 5c 66 52 20 5c 66 49 6c 69 73  caList\fR \fIlis
5690: 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20 43 65 72  t\fR.List of Cer
56a0: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69  tificate Authori
56b0: 74 69 65 73 20 28 43 41 29 20 66 6f 72 20 58 5c  ties (CA) for X\
56c0: 26 2e 35 30 39 20 63 65 72 74 69 66 69 63 61 74  &.509 certificat
56d0: 65 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 43 69 70  e\&...RE..IP.Cip
56e0: 68 65 72 20 49 6e 66 6f 0a 2e 52 53 0a 2e 54 50  her Info..RS..TP
56f0: 0a 5c 66 42 63 69 70 68 65 72 5c 66 52 20 5c 66  .\fBcipher\fR \f
5700: 49 63 69 70 68 65 72 5c 66 52 0a 54 68 65 20 63  Icipher\fR.The c
5710: 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e  urrent cipher in
5720: 20 75 73 65 20 66 6f 72 20 74 68 65 20 63 6f 6e   use for the con
5730: 6e 65 63 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c  nection\&...TP.\
5740: 66 42 73 74 61 6e 64 61 72 64 5f 6e 61 6d 65 5c  fBstandard_name\
5750: 66 52 20 5c 66 49 6e 61 6d 65 5c 66 52 0a 54 68  fR \fIname\fR.Th
5760: 65 20 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e  e standard RFC n
5770: 61 6d 65 20 6f 66 20 63 69 70 68 65 72 5c 26 2e  ame of cipher\&.
5780: 0a 2e 54 50 0a 5c 66 42 61 6c 67 6f 72 69 74 68  ..TP.\fBalgorith
5790: 6d 5f 62 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66  m_bits\fR \fIn\f
57a0: 52 0a 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20  R.The number of 
57b0: 70 72 6f 63 65 73 73 65 64 20 62 69 74 73 20 75  processed bits u
57c0: 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 5c 26  sed for cipher\&
57d0: 2e 0a 2e 54 50 0a 5c 66 42 73 65 63 72 65 74 5f  ...TP.\fBsecret_
57e0: 62 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66 52 0a  bits\fR \fIn\fR.
57f0: 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 73 65  The number of se
5800: 63 72 65 74 20 62 69 74 73 20 75 73 65 64 20 66  cret bits used f
5810: 6f 72 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54 50  or cipher\&...TP
5820: 0a 5c 66 42 6d 69 6e 5f 76 65 72 73 69 6f 6e 5c  .\fBmin_version\
5830: 66 52 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52  fR \fIversion\fR
5840: 0a 54 68 65 20 6d 69 6e 69 6d 75 6d 20 70 72 6f  .The minimum pro
5850: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 66 6f  tocol version fo
5860: 72 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54 50 0a  r cipher\&...TP.
5870: 5c 66 42 63 69 70 68 65 72 5f 69 73 5f 61 65 61  \fBcipher_is_aea
5880: 64 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c  d\fR \fIboolean\
5890: 66 52 0a 57 68 65 74 68 65 72 20 74 68 65 20 63  fR.Whether the c
58a0: 69 70 68 65 72 20 69 73 20 41 75 74 68 65 6e 74  ipher is Authent
58b0: 69 63 61 74 65 64 20 45 6e 63 72 79 70 74 69 6f  icated Encryptio
58c0: 6e 20 77 69 74 68 20 41 73 73 6f 63 69 61 74 65  n with Associate
58d0: 64 20 44 61 74 61 20 28 41 45 41 44 29 5c 26 2e  d Data (AEAD)\&.
58e0: 0a 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5f 69  ..TP.\fBcipher_i
58f0: 64 5c 66 52 20 5c 66 49 69 64 5c 66 52 0a 54 68  d\fR \fIid\fR.Th
5900: 65 20 4f 70 65 6e 53 53 4c 20 63 69 70 68 65 72  e OpenSSL cipher
5910: 20 69 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 64 65   id\&...TP.\fBde
5920: 73 63 72 69 70 74 69 6f 6e 5c 66 52 20 5c 66 49  scription\fR \fI
5930: 73 74 72 69 6e 67 5c 66 52 0a 41 20 74 65 78 74  string\fR.A text
5940: 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 66 20   description of 
5950: 74 68 65 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54  the cipher\&...T
5960: 50 0a 5c 66 42 68 61 6e 64 73 68 61 6b 65 5f 64  P.\fBhandshake_d
5970: 69 67 65 73 74 5c 66 52 20 5c 66 49 62 6f 6f 6c  igest\fR \fIbool
5980: 65 61 6e 5c 66 52 0a 44 69 67 65 73 74 20 75 73  ean\fR.Digest us
5990: 65 64 20 64 75 72 69 6e 67 20 68 61 6e 64 73 68  ed during handsh
59a0: 61 6b 65 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 53  ake\&...RE..IP.S
59b0: 65 73 73 69 6f 6e 20 49 6e 66 6f 0a 2e 52 53 0a  ession Info..RS.
59c0: 2e 54 50 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c  .TP.\fBalpn\fR \
59d0: 66 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68  fIprotocol\fR.Th
59e0: 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63  e protocol selec
59f0: 74 65 64 20 61 66 74 65 72 20 41 70 70 6c 69 63  ted after Applic
5a00: 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74  ation-Layer Prot
5a10: 6f 63 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e  ocol Negotiation
5a20: 20 28 41 4c 50 4e 29 5c 26 2e 0a 2e 54 50 0a 5c   (ALPN)\&...TP.\
5a30: 66 42 72 65 73 75 6d 61 62 6c 65 5c 66 52 20 5c  fBresumable\fR \
5a40: 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68 65  fIboolean\fR.Whe
5a50: 74 68 65 72 20 74 68 65 20 73 65 73 73 69 6f 6e  ther the session
5a60: 20 63 61 6e 20 62 65 20 72 65 73 75 6d 65 64 20   can be resumed 
5a70: 6f 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66  or not\&...TP.\f
5a80: 42 73 74 61 72 74 5f 74 69 6d 65 5c 66 52 20 5c  Bstart_time\fR \
5a90: 66 49 73 65 63 6f 6e 64 73 5c 66 52 0a 54 69 6d  fIseconds\fR.Tim
5aa0: 65 20 73 69 6e 63 65 20 73 65 73 73 69 6f 6e 20  e since session 
5ab0: 73 74 61 72 74 65 64 20 69 6e 20 73 65 63 6f 6e  started in secon
5ac0: 64 73 20 73 69 6e 63 65 20 65 70 6f 63 68 5c 26  ds since epoch\&
5ad0: 2e 0a 2e 54 50 0a 5c 66 42 74 69 6d 65 6f 75 74  ...TP.\fBtimeout
5ae0: 5c 66 52 20 5c 66 49 73 65 63 6f 6e 64 73 5c 66  \fR \fIseconds\f
5af0: 52 0a 4d 61 78 20 64 75 72 61 74 69 6f 6e 20 6f  R.Max duration o
5b00: 66 20 73 65 73 73 69 6f 6e 20 69 6e 20 73 65 63  f session in sec
5b10: 6f 6e 64 73 20 62 65 66 6f 72 65 20 74 69 6d 65  onds before time
5b20: 2d 6f 75 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6c  -out\&...TP.\fBl
5b30: 69 66 65 74 69 6d 65 5c 66 52 20 5c 66 49 73 65  ifetime\fR \fIse
5b40: 63 6f 6e 64 73 5c 66 52 0a 53 65 73 73 69 6f 6e  conds\fR.Session
5b50: 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65   ticket lifetime
5b60: 20 68 69 6e 74 20 69 6e 20 73 65 63 6f 6e 64 73   hint in seconds
5b70: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69  \&...TP.\fBsessi
5b80: 6f 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69 6e 61  on_id\fR \fIbina
5b90: 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e 69  ry_string\fR.Uni
5ba0: 71 75 65 20 73 65 73 73 69 6f 6e 20 69 64 20 66  que session id f
5bb0: 6f 72 20 75 73 65 20 69 6e 20 72 65 73 75 6d 69  or use in resumi
5bc0: 6e 67 20 74 68 65 20 73 65 73 73 69 6f 6e 5c 26  ng the session\&
5bd0: 2e 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69 6f 6e  ...TP.\fBsession
5be0: 5f 74 69 63 6b 65 74 5c 66 52 20 5c 66 49 62 69  _ticket\fR \fIbi
5bf0: 6e 61 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55  nary_string\fR.U
5c00: 6e 69 71 75 65 20 73 65 73 73 69 6f 6e 20 74 69  nique session ti
5c10: 63 6b 65 74 20 66 6f 72 20 75 73 65 20 69 6e 20  cket for use in 
5c20: 72 65 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73  resuming the ses
5c30: 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74  sion\&...TP.\fBt
5c40: 69 63 6b 65 74 5f 61 70 70 5f 64 61 74 61 5c 66  icket_app_data\f
5c50: 52 20 5c 66 49 62 69 6e 61 72 79 5f 73 74 72 69  R \fIbinary_stri
5c60: 6e 67 5c 66 52 0a 55 6e 69 71 75 65 20 73 65 73  ng\fR.Unique ses
5c70: 73 69 6f 6e 20 74 69 63 6b 65 74 20 61 70 70 6c  sion ticket appl
5c80: 69 63 61 74 69 6f 6e 20 64 61 74 61 5c 26 2e 0a  ication data\&..
5c90: 2e 54 50 0a 5c 66 42 6d 61 73 74 65 72 5f 6b 65  .TP.\fBmaster_ke
5ca0: 79 5c 66 52 20 5c 66 49 62 69 6e 61 72 79 5f 73  y\fR \fIbinary_s
5cb0: 74 72 69 6e 67 5c 66 52 0a 55 6e 69 71 75 65 20  tring\fR.Unique 
5cc0: 73 65 73 73 69 6f 6e 20 6d 61 73 74 65 72 20 6b  session master k
5cd0: 65 79 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73  ey\&...TP.\fBses
5ce0: 73 69 6f 6e 5f 63 61 63 68 65 5f 6d 6f 64 65 5c  sion_cache_mode\
5cf0: 66 52 20 5c 66 49 6d 6f 64 65 5c 66 52 0a 53 65  fR \fImode\fR.Se
5d00: 72 76 65 72 20 63 61 63 68 65 20 6d 6f 64 65 20  rver cache mode 
5d10: 28 63 6c 69 65 6e 74 2c 20 73 65 72 76 65 72 2c  (client, server,
5d20: 20 6f 72 20 62 6f 74 68 29 5c 26 2e 0a 2e 52 45   or both)\&...RE
5d30: 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 63 69 70  ..TP.\fBtls::cip
5d40: 68 65 72 73 5c 66 52 20 3f 5c 66 49 70 72 6f 74  hers\fR ?\fIprot
5d50: 6f 63 6f 6c 5c 66 52 3f 20 3f 5c 66 49 76 65 72  ocol\fR? ?\fIver
5d60: 62 6f 73 65 5c 66 52 3f 20 3f 5c 66 49 73 75 70  bose\fR? ?\fIsup
5d70: 70 6f 72 74 65 64 5c 66 52 3f 0a 57 69 74 68 6f  ported\fR?.Witho
5d80: 75 74 20 61 6e 79 20 61 72 67 73 2c 20 72 65 74  ut any args, ret
5d90: 75 72 6e 73 20 61 20 6c 69 73 74 20 6f 66 20 61  urns a list of a
5da0: 6c 6c 20 73 79 6d 6d 65 74 72 69 63 20 63 69 70  ll symmetric cip
5db0: 68 65 72 73 20 66 6f 72 20 75 73 65 20 77 69 74  hers for use wit
5dc0: 68 20 74 68 65 0a 5c 66 49 2d 63 69 70 68 65 72  h the.\fI-cipher
5dd0: 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 20 57 69  \fR option\&. Wi
5de0: 74 68 20 5c 66 49 70 72 6f 74 6f 63 6f 6c 5c 66  th \fIprotocol\f
5df0: 52 2c 20 6f 6e 6c 79 20 74 68 65 20 63 69 70 68  R, only the ciph
5e00: 65 72 73 20 73 75 70 70 6f 72 74 65 64 20 66 6f  ers supported fo
5e10: 72 20 74 68 61 74 0a 70 72 6f 74 6f 63 6f 6c 20  r that.protocol 
5e20: 61 72 65 20 72 65 74 75 72 6e 65 64 5c 26 2e 20  are returned\&. 
5e30: 53 65 65 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a  See the \fBtls::
5e40: 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f 6d  protocols\fR com
5e50: 6d 61 6e 64 20 66 6f 72 20 74 68 65 20 73 75 70  mand for the sup
5e60: 70 6f 72 74 65 64 0a 70 72 6f 74 6f 63 6f 6c 73  ported.protocols
5e70: 5c 26 2e 20 49 66 20 5c 66 49 76 65 72 62 6f 73  \&. If \fIverbos
5e80: 65 5c 66 52 20 69 73 20 73 70 65 63 69 66 69 65  e\fR is specifie
5e90: 64 20 61 73 20 74 72 75 65 20 74 68 65 6e 20 61  d as true then a
5ea0: 20 76 65 72 62 6f 73 65 2c 20 68 75 6d 61 6e 20   verbose, human 
5eb0: 72 65 61 64 61 62 6c 65 0a 6c 69 73 74 20 69 73  readable.list is
5ec0: 20 72 65 74 75 72 6e 65 64 20 77 69 74 68 20 61   returned with a
5ed0: 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d  dditional inform
5ee0: 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 63 69 70  ation on the cip
5ef0: 68 65 72 5c 26 2e 20 49 66 20 5c 66 49 73 75 70  her\&. If \fIsup
5f00: 70 6f 72 74 65 64 5c 66 52 0a 69 73 20 73 70 65  ported\fR.is spe
5f10: 63 69 66 69 65 64 20 61 73 20 74 72 75 65 2c 20  cified as true, 
5f20: 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20 63 69  then only the ci
5f30: 70 68 65 72 73 20 73 75 70 70 6f 72 74 65 64 20  phers supported 
5f40: 66 6f 72 20 70 72 6f 74 6f 63 6f 6c 20 77 69 6c  for protocol wil
5f50: 6c 20 62 65 20 6c 69 73 74 65 64 5c 26 2e 0a 2e  l be listed\&...
5f60: 54 50 0a 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f  TP.\fBtls::proto
5f70: 63 6f 6c 73 5c 66 52 0a 52 65 74 75 72 6e 73 20  cols\fR.Returns 
5f80: 61 20 6c 69 73 74 20 6f 66 20 74 68 65 20 73 75  a list of the su
5f90: 70 70 6f 72 74 65 64 20 53 53 4c 2f 54 4c 53 20  pported SSL/TLS 
5fa0: 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e 20 56 61 6c  protocols\&. Val
5fb0: 69 64 20 76 61 6c 75 65 73 20 61 72 65 3a 0a 5c  id values are:.\
5fc0: 66 42 73 73 6c 32 5c 66 52 2c 20 5c 66 42 73 73  fBssl2\fR, \fBss
5fd0: 6c 33 5c 66 52 2c 20 5c 66 42 74 6c 73 31 5c 66  l3\fR, \fBtls1\f
5fe0: 52 2c 20 5c 66 42 74 6c 73 31 5c 26 2e 31 5c 66  R, \fBtls1\&.1\f
5ff0: 52 2c 20 5c 66 42 74 6c 73 31 5c 26 2e 32 5c 66  R, \fBtls1\&.2\f
6000: 52 2c 20 61 6e 64 0a 5c 66 42 74 6c 73 31 5c 26  R, and.\fBtls1\&
6010: 2e 33 5c 66 52 5c 26 2e 20 45 78 61 63 74 20 6c  .3\fR\&. Exact l
6020: 69 73 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 4f  ist depends on O
6030: 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 61  penSSL version a
6040: 6e 64 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 20  nd compile time 
6050: 66 6c 61 67 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  flags\&...TP.\fB
6060: 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 5c 66 52 0a  tls::version\fR.
6070: 52 65 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e  Returns the Open
6080: 53 53 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69  SSL version stri
6090: 6e 67 5c 26 2e 0a 2e 50 50 0a 2e 53 48 20 22 43  ng\&...PP..SH "C
60a0: 45 52 54 49 46 49 43 41 54 45 20 56 41 4c 49 44  ERTIFICATE VALID
60b0: 41 54 49 4f 4e 22 0a 2e 53 53 20 22 50 4b 49 20  ATION"..SS "PKI 
60c0: 41 4e 44 20 43 45 52 54 49 46 49 43 41 54 45 53  AND CERTIFICATES
60d0: 22 0a 55 73 69 6e 67 20 74 68 65 20 50 75 62 6c  ".Using the Publ
60e0: 69 63 20 4b 65 79 20 49 6e 66 72 61 73 74 72 75  ic Key Infrastru
60f0: 63 74 75 72 65 20 28 50 4b 49 29 2c 20 65 61 63  cture (PKI), eac
6100: 68 20 75 73 65 72 20 63 72 65 61 74 65 73 20 61  h user creates a
6110: 20 70 72 69 76 61 74 65 20 6b 65 79 20 74 68 61   private key tha
6120: 74 0a 6f 6e 6c 79 20 74 68 65 79 20 6b 6e 6f 77  t.only they know
6130: 20 61 62 6f 75 74 20 61 6e 64 20 61 20 70 75 62   about and a pub
6140: 6c 69 63 20 6b 65 79 20 74 68 65 79 20 63 61 6e  lic key they can
6150: 20 65 78 63 68 61 6e 67 65 20 77 69 74 68 20 6f   exchange with o
6160: 74 68 65 72 73 20 66 6f 72 20 75 73 65 20 69 6e  thers for use in
6170: 0a 65 6e 63 72 79 70 74 69 6e 67 20 61 6e 64 20  .encrypting and 
6180: 64 65 63 72 79 70 74 69 6e 67 20 64 61 74 61 5c  decrypting data\
6190: 26 2e 20 54 68 65 20 70 72 6f 63 65 73 73 20 69  &. The process i
61a0: 73 20 74 68 65 20 73 65 6e 64 65 72 20 65 6e 63  s the sender enc
61b0: 72 79 70 74 73 20 74 68 65 69 72 20 64 61 74 61  rypts their data
61c0: 0a 75 73 69 6e 67 20 74 68 65 69 72 20 70 72 69  .using their pri
61d0: 76 61 74 65 20 6b 65 79 20 61 6e 64 20 74 68 65  vate key and the
61e0: 20 72 65 63 65 69 76 65 72 27 73 20 70 75 62 6c   receiver's publ
61f0: 69 63 20 6b 65 79 5c 26 2e 20 54 68 65 20 64 61  ic key\&. The da
6200: 74 61 20 69 73 20 74 68 65 6e 20 73 65 6e 74 0a  ta is then sent.
6210: 74 6f 20 74 68 65 20 72 65 63 65 69 76 65 72 5c  to the receiver\
6220: 26 2e 20 49 6e 20 61 20 73 69 6d 69 6c 61 72 20  &. In a similar 
6230: 6d 61 6e 6e 65 72 2c 20 74 68 65 20 72 65 63 65  manner, the rece
6240: 69 76 65 72 20 75 73 65 73 20 74 68 65 69 72 20  iver uses their 
6250: 70 72 69 76 61 74 65 20 6b 65 79 20 61 6e 64 0a  private key and.
6260: 74 68 65 20 73 65 6e 64 65 72 27 73 20 70 75 62  the sender's pub
6270: 6c 69 63 20 6b 65 79 20 74 6f 20 64 65 63 72 79  lic key to decry
6280: 70 74 20 74 68 65 20 64 61 74 61 5c 26 2e 20 54  pt the data\&. T
6290: 68 69 73 20 70 72 6f 76 69 64 65 73 20 64 61 74  his provides dat
62a0: 61 20 69 6e 74 65 67 72 69 74 79 2c 20 74 6f 0a  a integrity, to.
62b0: 65 6e 73 75 72 65 20 74 68 65 20 64 61 74 61 20  ensure the data 
62c0: 63 61 6e 27 74 20 62 65 20 76 69 65 77 65 64 20  can't be viewed 
62d0: 6f 72 20 61 6c 74 65 72 65 64 20 64 75 72 69 6e  or altered durin
62e0: 67 20 74 72 61 6e 73 70 6f 72 74 5c 26 2e 20 53  g transport\&. S
62f0: 65 65 20 74 68 65 0a 5c 66 42 2d 6b 65 79 5c 66  ee the.\fB-key\f
6300: 52 20 61 6e 64 20 5c 66 42 2d 6b 65 79 66 69 6c  R and \fB-keyfil
6310: 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 66 6f 72  e\fR options for
6320: 20 68 6f 77 20 74 6f 20 73 70 65 63 69 66 79 20   how to specify 
6330: 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 5c  the private key\
6340: 26 2e 0a 41 6c 73 6f 20 73 65 65 20 74 68 65 20  &..Also see the 
6350: 5c 66 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 20  \fB-password\fR 
6360: 6f 70 74 69 6f 6e 20 66 6f 72 20 68 6f 77 20 74  option for how t
6370: 6f 20 70 72 6f 76 69 64 65 20 74 68 65 20 70 61  o provide the pa
6380: 73 73 77 6f 72 64 5c 26 2e 0a 2e 50 50 0a 49 6e  ssword\&...PP.In
6390: 20 6f 72 64 65 72 20 74 6f 20 70 72 6f 76 69 64   order to provid
63a0: 65 20 61 75 74 68 65 6e 74 69 63 61 74 69 6f 6e  e authentication
63b0: 2c 20 69 5c 26 2e 65 5c 26 2e 20 65 6e 73 75 72  , i\&.e\&. ensur
63c0: 69 6e 67 20 73 6f 6d 65 6f 6e 65 20 69 73 20 77  ing someone is w
63d0: 68 6f 20 74 68 65 79 20 73 61 79 20 74 68 65 79  ho they say they
63e0: 0a 61 72 65 2c 20 74 68 65 20 70 75 62 6c 69 63  .are, the public
63f0: 20 6b 65 79 20 61 6e 64 20 75 73 65 72 20 69 64   key and user id
6400: 65 6e 74 69 66 69 63 61 74 69 6f 6e 20 69 6e 66  entification inf
6410: 6f 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 61  o is stored in a
6420: 20 58 5c 26 2e 35 30 39 0a 63 65 72 74 69 66 69   X\&.509.certifi
6430: 63 61 74 65 20 61 6e 64 20 74 68 61 74 20 63 65  cate and that ce
6440: 72 74 69 66 69 63 61 74 65 20 69 73 20 61 75 74  rtificate is aut
6450: 68 65 6e 74 69 63 61 74 65 64 20 28 69 5c 26 2e  henticated (i\&.
6460: 65 5c 26 2e 20 73 69 67 6e 65 64 29 20 62 79 20  e\&. signed) by 
6470: 61 20 43 65 72 74 69 66 69 63 61 74 65 0a 41 75  a Certificate.Au
6480: 74 68 6f 72 69 74 79 20 28 43 41 29 5c 26 2e 20  thority (CA)\&. 
6490: 55 73 65 72 73 20 63 61 6e 20 74 68 65 6e 20 65  Users can then e
64a0: 78 63 68 61 6e 67 65 20 74 68 65 73 65 20 63 65  xchange these ce
64b0: 72 74 69 66 69 63 61 74 65 73 20 64 75 72 69 6e  rtificates durin
64c0: 67 20 74 68 65 20 54 4c 53 0a 69 6e 69 74 69 61  g the TLS.initia
64d0: 6c 69 7a 61 74 69 6f 6e 20 70 72 6f 63 65 73 73  lization process
64e0: 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 6d 20   and check them 
64f0: 61 67 61 69 6e 73 74 20 74 68 65 20 72 6f 6f 74  against the root
6500: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73   CA certificates
6510: 20 74 6f 20 65 6e 73 75 72 65 0a 74 68 65 79 20   to ensure.they 
6520: 61 72 65 20 76 61 6c 69 64 5c 26 2e 20 54 68 69  are valid\&. Thi
6530: 73 20 69 73 20 68 61 6e 64 6c 65 64 20 62 79 20  s is handled by 
6540: 4f 70 65 6e 53 53 4c 20 76 69 61 20 74 68 65 20  OpenSSL via the 
6550: 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20 61  \fB-request\fR a
6560: 6e 64 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c 66  nd.\fB-require\f
6570: 52 20 6f 70 74 69 6f 6e 73 5c 26 2e 20 53 65 65  R options\&. See
6580: 20 74 68 65 20 5c 66 42 2d 63 61 64 69 72 5c 66   the \fB-cadir\f
6590: 52 2c 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c  R, \fB-cadir\fR,
65a0: 20 61 6e 64 0a 5c 66 42 2d 63 61 73 74 6f 72 65   and.\fB-castore
65b0: 5c 66 52 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20  \fR options for 
65c0: 68 6f 77 20 74 70 20 73 70 65 63 69 66 79 20 77  how tp specify w
65d0: 68 65 72 65 20 74 6f 20 66 69 6e 64 20 74 68 65  here to find the
65e0: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73   CA certificates
65f0: 5c 26 2e 0a 4f 70 74 69 6f 6e 61 6c 6c 79 2c 20  \&..Optionally, 
6600: 69 6e 20 61 20 66 75 74 75 72 65 20 72 65 6c 65  in a future rele
6610: 61 73 65 2c 20 74 68 65 79 20 63 61 6e 20 61 6c  ase, they can al
6620: 73 6f 20 62 65 20 63 68 65 63 6b 65 64 20 61 67  so be checked ag
6630: 61 69 6e 73 74 20 74 68 65 20 43 65 72 74 69 66  ainst the Certif
6640: 69 63 61 74 65 0a 52 65 76 6f 63 61 74 69 6f 6e  icate.Revocation
6650: 20 4c 69 73 74 20 28 43 52 4c 29 20 6f 66 20 72   List (CRL) of r
6660: 65 76 6f 6b 65 64 20 63 65 72 74 69 66 69 63 61  evoked certifica
6670: 74 65 73 5c 26 2e 20 43 65 72 74 69 66 69 63 61  tes\&. Certifica
6680: 74 65 73 20 63 61 6e 20 61 6c 73 6f 20 62 65 0a  tes can also be.
6690: 73 65 6c 66 2d 73 69 67 6e 65 64 2c 20 62 75 74  self-signed, but
66a0: 20 74 68 65 79 20 61 72 65 20 62 79 20 64 65 66   they are by def
66b0: 61 75 6c 74 20 6e 6f 74 20 74 72 75 73 74 65 64  ault not trusted
66c0: 20 75 6e 6c 65 73 73 20 79 6f 75 20 61 64 64 20   unless you add 
66d0: 74 68 65 6d 20 74 6f 20 79 6f 75 72 0a 63 65 72  them to your.cer
66e0: 74 69 66 69 63 61 74 65 20 73 74 6f 72 65 5c 26  tificate store\&
66f0: 2e 0a 2e 50 50 0a 54 79 70 69 63 61 6c 6c 79 20  ...PP.Typically 
6700: 77 68 65 6e 20 76 69 73 69 74 69 6e 67 20 77 65  when visiting we
6710: 62 20 73 69 74 65 73 2c 20 6f 6e 6c 79 20 74 68  b sites, only th
6720: 65 20 63 6c 69 65 6e 74 20 6e 65 65 64 73 20 74  e client needs t
6730: 6f 20 63 68 65 63 6b 20 74 68 65 20 73 65 72 76  o check the serv
6740: 65 72 27 73 0a 63 65 72 74 69 66 69 63 61 74 65  er's.certificate
6750: 20 74 6f 20 65 6e 73 75 72 65 20 69 74 20 69 73   to ensure it is
6760: 20 76 61 6c 69 64 5c 26 2e 20 54 68 65 20 73 65   valid\&. The se
6770: 72 76 65 72 20 64 6f 65 73 6e 27 74 20 6e 65 65  rver doesn't nee
6780: 64 20 74 6f 20 63 68 65 63 6b 20 74 68 65 20 63  d to check the c
6790: 6c 69 65 6e 74 0a 63 65 72 74 69 66 69 63 61 74  lient.certificat
67a0: 65 20 75 6e 6c 65 73 73 20 79 6f 75 20 6e 65 65  e unless you nee
67b0: 64 20 74 6f 20 61 75 74 68 65 6e 74 69 63 61 74  d to authenticat
67c0: 65 20 77 69 74 68 20 74 68 65 6d 20 74 6f 20 6c  e with them to l
67d0: 6f 67 69 6e 2c 20 65 74 63 5c 26 2e 20 53 65 65  ogin, etc\&. See
67e0: 20 74 68 65 0a 5c 66 42 2d 63 65 72 74 5c 66 52   the.\fB-cert\fR
67f0: 20 61 6e 64 20 5c 66 42 2d 63 65 72 74 66 69 6c   and \fB-certfil
6800: 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 69 66 20  e\fR options if 
6810: 79 6f 75 20 6e 65 65 64 20 74 6f 20 70 72 6f 76  you need to prov
6820: 69 64 65 20 61 20 63 65 72 74 69 66 69 63 61 74  ide a certificat
6830: 65 5c 26 2e 0a 2e 53 53 20 22 53 55 4d 4d 41 52  e\&...SS "SUMMAR
6840: 59 20 4f 46 20 43 4f 4d 4d 41 4e 44 20 4c 49 4e  Y OF COMMAND LIN
6850: 45 20 4f 50 54 49 4f 4e 53 22 0a 54 68 65 20 66  E OPTIONS".The f
6860: 6f 6c 6c 6f 77 69 6e 67 20 6f 70 74 69 6f 6e 73  ollowing options
6870: 20 61 72 65 20 75 73 65 64 20 66 6f 72 20 70 65   are used for pe
6880: 65 72 20 63 65 72 74 69 66 69 63 61 74 65 20 76  er certificate v
6890: 61 6c 69 64 61 74 69 6f 6e 3a 0a 2e 54 50 0a 5c  alidation:..TP.\
68a0: 66 42 2d 63 61 64 69 72 5c 66 52 20 5c 66 49 64  fB-cadir\fR \fId
68b0: 69 72 65 63 74 6f 72 79 5c 66 52 0a 53 70 65 63  irectory\fR.Spec
68c0: 69 66 69 65 73 20 74 68 65 20 64 69 72 65 63 74  ifies the direct
68d0: 6f 72 79 20 77 68 65 72 65 20 74 68 65 20 43 65  ory where the Ce
68e0: 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72  rtificate Author
68f0: 69 74 79 20 28 43 41 29 20 63 65 72 74 69 66 69  ity (CA) certifi
6900: 63 61 74 65 73 20 61 72 65 0a 73 74 6f 72 65 64  cates are.stored
6910: 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20  \&. The default 
6920: 69 73 20 70 6c 61 74 66 6f 72 6d 20 73 70 65 63  is platform spec
6930: 69 66 69 63 2c 20 62 75 74 20 69 73 20 75 73 75  ific, but is usu
6940: 61 6c 6c 79 20 22 5c 66 49 2f 65 74 63 2f 73 73  ally "\fI/etc/ss
6950: 6c 2f 63 65 72 74 73 5c 66 52 22 20 6f 6e 0a 4c  l/certs\fR" on.L
6960: 69 6e 75 78 2f 55 6e 69 78 20 73 79 73 74 65 6d  inux/Unix system
6970: 73 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  s\&. The default
6980: 20 6c 6f 63 61 74 69 6f 6e 20 63 61 6e 20 62 65   location can be
6990: 20 6f 76 65 72 72 69 64 64 65 6e 20 62 79 20 74   overridden by t
69a0: 68 65 0a 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44  he.\fBSSL_CERT_D
69b0: 49 52 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e  IR\fR environmen
69c0: 74 20 76 61 72 69 61 62 6c 65 5c 26 2e 0a 2e 54  t variable\&...T
69d0: 50 0a 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52 20  P.\fB-cafile\fR 
69e0: 5c 66 49 66 69 6c 65 6e 61 6d 65 5c 66 52 0a 53  \fIfilename\fR.S
69f0: 70 65 63 69 66 69 65 73 20 74 68 65 20 66 69 6c  pecifies the fil
6a00: 65 20 77 69 74 68 20 74 68 65 20 43 65 72 74 69  e with the Certi
6a10: 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79  ficate Authority
6a20: 20 28 43 41 29 20 63 65 72 74 69 66 69 63 61 74   (CA) certificat
6a30: 65 73 20 74 6f 20 75 73 65 20 69 6e 0a 5c 66 42  es to use in.\fB
6a40: 50 45 4d 5c 66 52 20 66 69 6c 65 20 66 6f 72 6d  PEM\fR file form
6a50: 61 74 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  at\&. The defaul
6a60: 74 20 69 73 20 22 5c 66 49 63 65 72 74 5c 26 2e  t is "\fIcert\&.
6a70: 70 65 6d 5c 66 52 22 2c 20 69 6e 20 74 68 65 20  pem\fR", in the 
6a80: 4f 70 65 6e 53 53 4c 0a 64 69 72 65 63 74 6f 72  OpenSSL.director
6a90: 79 5c 26 2e 20 4f 6e 20 4c 69 6e 75 78 2f 55 6e  y\&. On Linux/Un
6aa0: 69 78 20 73 79 73 74 65 6d 73 2c 20 74 68 69 73  ix systems, this
6ab0: 20 69 73 20 75 73 75 61 6c 6c 79 20 22 5c 66 49   is usually "\fI
6ac0: 2f 65 74 63 2f 73 73 6c 2f 63 61 2d 62 75 6e 64  /etc/ssl/ca-bund
6ad0: 6c 65 5c 26 2e 70 65 6d 5c 66 52 22 5c 26 2e 0a  le\&.pem\fR"\&..
6ae0: 54 68 65 20 64 65 66 61 75 6c 74 20 66 69 6c 65  The default file
6af0: 20 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64   can be overridd
6b00: 65 6e 20 62 79 20 74 68 65 20 5c 66 42 53 53 4c  en by the \fBSSL
6b10: 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52 20 65 6e  _CERT_FILE\fR en
6b20: 76 69 72 6f 6e 6d 65 6e 74 0a 76 61 72 69 61 62  vironment.variab
6b30: 6c 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61  le\&...TP.\fB-ca
6b40: 73 74 6f 72 65 5c 66 52 20 5c 66 49 55 52 49 5c  store\fR \fIURI\
6b50: 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65  fR.Specifies the
6b60: 20 55 6e 69 66 6f 72 6d 20 52 65 73 6f 75 72 63   Uniform Resourc
6b70: 65 20 49 64 65 6e 74 69 66 69 65 72 20 28 55 52  e Identifier (UR
6b80: 49 29 20 66 6f 72 20 74 68 65 20 43 65 72 74 69  I) for the Certi
6b90: 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79  ficate Authority
6ba0: 0a 28 43 41 29 20 73 74 6f 72 65 2c 20 77 68 69  .(CA) store, whi
6bb0: 63 68 20 6d 61 79 20 62 65 20 61 20 73 69 6e 67  ch may be a sing
6bc0: 6c 65 20 63 6f 6e 74 61 69 6e 65 72 20 6f 72 20  le container or 
6bd0: 61 20 63 61 74 61 6c 6f 67 20 6f 66 20 63 6f 6e  a catalog of con
6be0: 74 61 69 6e 65 72 73 5c 26 2e 0a 53 74 61 72 74  tainers\&..Start
6bf0: 69 6e 67 20 77 69 74 68 20 4f 70 65 6e 53 53 4c  ing with OpenSSL
6c00: 20 33 5c 26 2e 32 20 6f 6e 20 4d 53 20 57 69 6e   3\&.2 on MS Win
6c10: 64 6f 77 73 2c 20 73 65 74 20 74 6f 20 22 5c 66  dows, set to "\f
6c20: 42 6f 72 67 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26  Borg\&.openssl\&
6c30: 2e 77 69 6e 73 74 6f 72 65 3a 2f 2f 5c 66 52 22  .winstore://\fR"
6c40: 0a 74 6f 20 75 73 65 20 74 68 65 20 62 75 69 6c  .to use the buil
6c50: 74 2d 69 6e 20 4d 53 20 57 69 6e 64 6f 77 73 20  t-in MS Windows 
6c60: 43 65 72 74 69 66 69 63 61 74 65 20 53 74 6f 72  Certificate Stor
6c70: 65 5c 26 2e 0a 54 68 69 73 20 73 74 6f 72 65 20  e\&..This store 
6c80: 6f 6e 6c 79 20 73 75 70 70 6f 72 74 73 20 72 6f  only supports ro
6c90: 6f 74 20 63 65 72 74 69 66 69 63 61 74 65 20 73  ot certificate s
6ca0: 74 6f 72 65 73 5c 26 2e 20 53 65 65 0a 5c 66 42  tores\&. See.\fB
6cb0: 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69  Certificate Vali
6cc0: 64 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 6d 6f  dation\fR for mo
6cd0: 72 65 20 64 65 74 61 69 6c 73 5c 26 2e 0a 2e 54  re details\&...T
6ce0: 50 0a 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52  P.\fB-request\fR
6cf0: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75   \fIbool\fR.Requ
6d00: 65 73 74 20 61 20 63 65 72 74 69 66 69 63 61 74  est a certificat
6d10: 65 20 66 72 6f 6d 20 74 68 65 20 70 65 65 72 20  e from the peer 
6d20: 64 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20 68  during the SSL h
6d30: 61 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68 69 73  andshake\&. This
6d40: 20 69 73 20 6e 65 65 64 65 64 0a 74 6f 20 64 6f   is needed.to do
6d50: 20 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c   Certificate Val
6d60: 69 64 61 74 69 6f 6e 5c 26 2e 20 53 74 61 72 74  idation\&. Start
6d70: 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c  ing in TclTLS 1\
6d80: 26 2e 38 2c 20 74 68 65 20 64 65 66 61 75 6c 74  &.8, the default
6d90: 20 69 73 0a 5c 66 42 74 72 75 65 5c 66 52 5c 26   is.\fBtrue\fR\&
6da0: 2e 20 53 74 61 72 74 69 6e 67 20 69 6e 20 54 63  . Starting in Tc
6db0: 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 49 66 20 73  lTLS 2\&.0, If s
6dc0: 65 74 20 74 6f 20 5c 66 42 66 61 6c 73 65 5c 66  et to \fBfalse\f
6dd0: 52 20 61 6e 64 0a 5c 66 42 2d 72 65 71 75 69 72  R and.\fB-requir
6de0: 65 5c 66 52 20 69 73 20 5c 66 42 74 72 75 65 5c  e\fR is \fBtrue\
6df0: 66 52 2c 20 74 68 65 6e 20 74 68 69 73 20 77 69  fR, then this wi
6e00: 6c 6c 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e  ll be overridden
6e10: 20 74 6f 20 5c 66 42 74 72 75 65 5c 66 52 5c 26   to \fBtrue\fR\&
6e20: 2e 0a 49 6e 20 61 64 64 69 74 69 6f 6e 2c 20 74  ..In addition, t
6e30: 68 65 20 63 6c 69 65 6e 74 20 63 61 6e 20 6d 61  he client can ma
6e40: 6e 75 61 6c 6c 79 20 69 6e 73 70 65 63 74 20 61  nually inspect a
6e50: 6e 64 20 61 63 63 65 70 74 20 6f 72 20 72 65 6a  nd accept or rej
6e60: 65 63 74 0a 65 61 63 68 20 63 65 72 74 69 66 69  ect.each certifi
6e70: 63 61 74 65 20 75 73 69 6e 67 20 74 68 65 20 5c  cate using the \
6e80: 66 49 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61  fI-validatecomma
6e90: 6e 64 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a  nd\fR option\&..
6ea0: 2e 54 50 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c  .TP.\fB-require\
6eb0: 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65  fR \fIbool\fR.Re
6ec0: 71 75 69 72 65 20 61 20 76 61 6c 69 64 20 63 65  quire a valid ce
6ed0: 72 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20 74  rtificate from t
6ee0: 68 65 20 70 65 65 72 20 64 75 72 69 6e 67 20 74  he peer during t
6ef0: 68 65 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65  he SSL handshake
6f00: 5c 26 2e 20 49 66 20 74 68 69 73 20 69 73 0a 73  \&. If this is.s
6f10: 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68 65 6e  et to true, then
6f20: 20 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20   \fB-request\fR 
6f30: 6d 75 73 74 20 61 6c 73 6f 20 62 65 20 73 65 74  must also be set
6f40: 20 74 6f 20 74 72 75 65 20 61 6e 64 20 61 20 65   to true and a e
6f50: 69 74 68 65 72 0a 5c 66 42 2d 63 61 64 69 72 5c  ither.\fB-cadir\
6f60: 66 52 2c 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66  fR, \fB-cafile\f
6f70: 52 2c 20 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66  R, \fB-castore\f
6f80: 52 2c 20 6f 72 20 61 20 70 6c 61 74 66 6f 72 6d  R, or a platform
6f90: 20 64 65 66 61 75 6c 74 0a 6d 75 73 74 20 62 65   default.must be
6fa0: 20 70 72 6f 76 69 64 65 64 20 69 6e 20 6f 72 64   provided in ord
6fb0: 65 72 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61  er to validate a
6fc0: 67 61 69 6e 73 74 5c 26 2e 20 54 68 65 20 64 65  gainst\&. The de
6fd0: 66 61 75 6c 74 20 69 6e 20 54 63 6c 54 4c 53 20  fault in TclTLS 
6fe0: 31 5c 26 2e 38 20 61 6e 64 0a 65 61 72 6c 69 65  1\&.8 and.earlie
6ff0: 72 20 76 65 72 73 69 6f 6e 73 20 69 73 20 5c 66  r versions is \f
7000: 42 66 61 6c 73 65 5c 66 52 20 73 69 6e 63 65 20  Bfalse\fR since 
7010: 6e 6f 74 20 61 6c 6c 20 70 6c 61 74 66 6f 72 6d  not all platform
7020: 73 20 68 61 76 65 20 63 65 72 74 69 66 69 63 61  s have certifica
7030: 74 65 73 20 74 6f 0a 76 61 6c 69 64 61 74 65 20  tes to.validate 
7040: 61 67 61 69 6e 73 74 20 69 6e 20 61 20 66 6f 72  against in a for
7050: 6d 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74  m compatible wit
7060: 68 20 4f 70 65 6e 53 53 4c 5c 26 2e 20 53 74 61  h OpenSSL\&. Sta
7070: 72 74 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20  rting in TclTLS 
7080: 32 5c 26 2e 30 2c 0a 74 68 65 20 64 65 66 61 75  2\&.0,.the defau
7090: 6c 74 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52  lt is \fBtrue\fR
70a0: 5c 26 2e 0a 2e 50 50 0a 2e 53 53 20 22 57 48 45  \&...PP..SS "WHE
70b0: 4e 20 41 52 45 20 43 4f 4d 4d 41 4e 44 20 4c 49  N ARE COMMAND LI
70c0: 4e 45 20 4f 50 54 49 4f 4e 53 20 4e 45 45 44 45  NE OPTIONS NEEDE
70d0: 44 3f 22 0a 49 6e 20 54 63 6c 54 4c 53 20 31 5c  D?".In TclTLS 1\
70e0: 26 2e 38 20 61 6e 64 20 65 61 72 6c 69 65 72 20  &.8 and earlier 
70f0: 76 65 72 73 69 6f 6e 73 2c 20 63 65 72 74 69 66  versions, certif
7100: 69 63 61 74 65 20 76 61 6c 69 64 61 74 69 6f 6e  icate validation
7110: 20 69 73 0a 5c 66 49 4e 4f 54 5c 66 52 20 65 6e   is.\fINOT\fR en
7120: 61 62 6c 65 64 20 62 79 20 64 65 66 61 75 6c 74  abled by default
7130: 5c 26 2e 20 54 68 69 73 20 6c 69 6d 69 74 61 74  \&. This limitat
7140: 69 6f 6e 20 69 73 20 64 75 65 20 74 6f 20 74 68  ion is due to th
7150: 65 20 6c 61 63 6b 20 6f 66 20 61 20 63 6f 6d 6d  e lack of a comm
7160: 6f 6e 0a 63 72 6f 73 73 20 70 6c 61 74 66 6f 72  on.cross platfor
7170: 6d 20 64 61 74 61 62 61 73 65 20 6f 66 20 43 65  m database of Ce
7180: 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72  rtificate Author
7190: 69 74 79 20 28 43 41 29 20 70 72 6f 76 69 64 65  ity (CA) provide
71a0: 64 20 63 65 72 74 69 66 69 63 61 74 65 73 20 74  d certificates t
71b0: 6f 0a 76 61 6c 69 64 61 74 65 20 61 67 61 69 6e  o.validate again
71c0: 73 74 5c 26 2e 20 4d 61 6e 79 20 4c 69 6e 75 78  st\&. Many Linux
71d0: 20 73 79 73 74 65 6d 73 20 6e 61 74 69 76 65 6c   systems nativel
71e0: 79 20 73 75 70 70 6f 72 74 20 4f 70 65 6e 53 53  y support OpenSS
71f0: 4c 20 61 6e 64 20 74 68 75 73 20 68 61 76 65 0a  L and thus have.
7200: 74 68 65 73 65 20 63 65 72 74 69 66 69 63 61 74  these certificat
7210: 65 73 20 69 6e 73 74 61 6c 6c 65 64 20 61 73 20  es installed as 
7220: 70 61 72 74 20 6f 66 20 74 68 65 20 4f 53 2c 20  part of the OS, 
7230: 62 75 74 20 4d 61 63 4f 53 20 61 6e 64 20 4d 53  but MacOS and MS
7240: 20 57 69 6e 64 6f 77 73 20 64 6f 20 6e 6f 74 5c   Windows do not\
7250: 26 2e 0a 53 74 61 72 69 6e 67 20 69 6e 20 54 63  &..Staring in Tc
7260: 6c 54 4c 53 20 32 5c 26 2e 30 2c 20 74 68 69 73  lTLS 2\&.0, this
7270: 20 68 61 73 20 62 65 65 6e 20 63 68 61 6e 67 65   has been change
7280: 64 20 74 6f 20 72 65 71 75 69 72 65 20 63 65 72  d to require cer
7290: 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 61 74  tificate validat
72a0: 69 6f 6e 0a 62 79 20 64 65 66 61 75 6c 74 5c 26  ion.by default\&
72b0: 2e 20 49 6e 20 6f 72 64 65 72 20 74 6f 20 75 73  . In order to us
72c0: 65 20 74 68 65 20 5c 66 42 2d 72 65 71 75 69 72  e the \fB-requir
72d0: 65 5c 66 52 20 6f 70 74 69 6f 6e 2c 20 6f 6e 65  e\fR option, one
72e0: 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e   of the followin
72f0: 67 0a 6d 75 73 74 20 62 65 20 74 72 75 65 3a 0a  g.must be true:.
7300: 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4c 69 6e 75  .IP \(bu.On Linu
7310: 78 20 61 6e 64 20 55 6e 69 78 20 73 79 73 74 65  x and Unix syste
7320: 6d 73 20 77 69 74 68 20 4f 70 65 6e 53 53 4c 20  ms with OpenSSL 
7330: 61 6c 72 65 61 64 79 20 69 6e 73 74 61 6c 6c 65  already installe
7340: 64 20 6f 72 20 69 66 20 74 68 65 20 43 41 0a 63  d or if the CA.c
7350: 65 72 74 69 66 69 63 61 74 65 73 20 61 72 65 20  ertificates are 
7360: 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 50 45 4d  available in PEM
7370: 20 66 6f 72 6d 61 74 2c 20 61 6e 64 20 69 66 20   format, and if 
7380: 74 68 65 79 20 61 72 65 20 73 74 6f 72 65 64 20  they are stored 
7390: 69 6e 20 74 68 65 0a 73 74 61 6e 64 61 72 64 20  in the.standard 
73a0: 6c 6f 63 61 74 69 6f 6e 73 2c 20 6f 72 20 69 66  locations, or if
73b0: 20 74 68 65 20 5c 66 42 53 53 4c 5f 43 45 52 54   the \fBSSL_CERT
73c0: 5f 44 49 52 5c 66 52 20 6f 72 20 5c 66 42 53 53  _DIR\fR or \fBSS
73d0: 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52 0a 65  L_CERT_FILE\fR.e
73e0: 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61  nvironment varia
73f0: 62 6c 65 73 20 61 72 65 20 73 65 74 2c 20 74 68  bles are set, th
7400: 65 6e 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c  en \fB-cadir\fR,
7410: 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c 0a 61   \fB-cadir\fR,.a
7420: 6e 64 20 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66  nd \fB-castore\f
7430: 52 20 61 72 65 6e 27 74 20 6e 65 65 64 65 64 5c  R aren't needed\
7440: 26 2e 0a 2e 49 50 20 5c 28 62 75 0a 49 66 20 4f  &...IP \(bu.If O
7450: 70 65 6e 53 53 4c 20 69 73 20 6e 6f 74 20 69 6e  penSSL is not in
7460: 73 74 61 6c 6c 65 64 20 69 6e 20 74 68 65 20 64  stalled in the d
7470: 65 66 61 75 6c 74 20 6c 6f 63 61 74 69 6f 6e 2c  efault location,
7480: 20 6f 72 20 77 68 65 6e 20 75 73 69 6e 67 20 4d   or when using M
7490: 61 63 20 4f 53 0a 6f 72 20 4d 53 20 57 69 6e 64  ac OS.or MS Wind
74a0: 6f 77 73 20 61 6e 64 20 4f 70 65 6e 53 53 4c 20  ows and OpenSSL 
74b0: 69 73 20 69 6e 73 74 61 6c 6c 65 64 2c 20 74 68  is installed, th
74c0: 65 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44 49  e \fBSSL_CERT_DI
74d0: 52 5c 66 52 20 61 6e 64 2f 6f 72 0a 5c 66 42 53  R\fR and/or.\fBS
74e0: 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52 20  SL_CERT_FILE\fR 
74f0: 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69  environment vari
7500: 61 62 6c 65 73 20 6f 72 20 74 68 65 20 6f 6e 65  ables or the one
7510: 20 6f 66 20 74 68 65 20 5c 66 42 2d 63 61 64 69   of the \fB-cadi
7520: 72 5c 66 52 2c 0a 5c 66 42 2d 63 61 64 69 72 5c  r\fR,.\fB-cadir\
7530: 66 52 2c 20 6f 72 20 5c 66 42 2d 63 61 73 74 6f  fR, or \fB-casto
7540: 72 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 6d 75  re\fR options mu
7550: 73 74 20 62 65 20 64 65 66 69 6e 65 64 5c 26 2e  st be defined\&.
7560: 0a 2e 49 50 20 5c 28 62 75 0a 4f 6e 20 4d 53 20  ..IP \(bu.On MS 
7570: 57 69 6e 64 6f 77 73 2c 20 73 74 61 72 74 69 6e  Windows, startin
7580: 67 20 69 6e 20 4f 70 65 6e 53 53 4c 20 33 5c 26  g in OpenSSL 3\&
7590: 2e 32 2c 20 69 74 20 69 73 20 6e 6f 77 20 70 6f  .2, it is now po
75a0: 73 73 69 62 6c 65 20 74 6f 20 61 63 63 65 73 73  ssible to access
75b0: 20 74 68 65 0a 62 75 69 6c 74 2d 69 6e 20 57 69   the.built-in Wi
75c0: 6e 64 6f 77 73 20 43 65 72 74 69 66 69 63 61 74  ndows Certificat
75d0: 65 20 53 74 6f 72 65 20 66 72 6f 6d 20 4f 70 65  e Store from Ope
75e0: 6e 53 53 4c 5c 26 2e 20 54 68 69 73 20 63 61 6e  nSSL\&. This can
75f0: 20 75 74 69 6c 69 7a 65 64 20 62 79 0a 73 65 74   utilized by.set
7600: 74 69 6e 67 20 74 68 65 20 5c 66 42 2d 63 61 73  ting the \fB-cas
7610: 74 6f 72 65 5c 66 52 20 6f 70 74 69 6f 6e 20 74  tore\fR option t
7620: 6f 20 22 5c 66 42 6f 72 67 5c 26 2e 6f 70 65 6e  o "\fBorg\&.open
7630: 73 73 6c 5c 26 2e 77 69 6e 73 74 6f 72 65 3a 2f  ssl\&.winstore:/
7640: 2f 5c 66 52 22 5c 26 2e 0a 2e 49 50 20 5c 28 62  /\fR"\&...IP \(b
7650: 75 0a 49 66 20 4f 70 65 6e 53 53 4c 20 69 73 20  u.If OpenSSL is 
7660: 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64 20 6f 72  not installed or
7670: 20 74 68 65 20 43 41 20 63 65 72 74 69 66 69 63   the CA certific
7680: 61 74 65 73 20 61 72 65 20 6e 6f 74 20 61 76 61  ates are not ava
7690: 69 6c 61 62 6c 65 20 69 6e 20 50 45 4d 0a 66 6f  ilable in PEM.fo
76a0: 72 6d 61 74 2c 20 74 68 65 20 43 41 20 63 65 72  rmat, the CA cer
76b0: 74 69 66 69 63 61 74 65 73 20 6d 75 73 74 20 62  tificates must b
76c0: 65 20 64 6f 77 6e 6c 6f 61 64 65 64 20 61 6e 64  e downloaded and
76d0: 20 69 6e 73 74 61 6c 6c 65 64 20 77 69 74 68 20   installed with 
76e0: 74 68 65 20 75 73 65 72 0a 73 6f 66 74 77 61 72  the user.softwar
76f0: 65 5c 26 2e 20 54 68 65 20 43 55 52 4c 20 74 65  e\&. The CURL te
7700: 61 6d 20 6d 61 6b 65 73 20 74 68 65 6d 20 61 76  am makes them av
7710: 61 69 6c 61 62 6c 65 20 61 74 0a 5c 66 49 43 41  ailable at.\fICA
7720: 20 63 65 72 74 69 66 69 63 61 74 65 73 20 65 78   certificates ex
7730: 74 72 61 63 74 65 64 0a 66 72 6f 6d 20 4d 6f 7a  tracted.from Moz
7740: 69 6c 6c 61 5c 66 52 20 5b 68 74 74 70 73 3a 2f  illa\fR [https:/
7750: 2f 63 75 72 6c 5c 26 2e 73 65 2f 64 6f 63 73 2f  /curl\&.se/docs/
7760: 63 61 65 78 74 72 61 63 74 5c 26 2e 68 74 6d 6c  caextract\&.html
7770: 5d 20 69 6e 20 74 68 65 20 22 5c 66 49 63 61 63  ] in the "\fIcac
7780: 65 72 74 5c 26 2e 70 65 6d 5c 66 52 22 20 66 69  ert\&.pem\fR" fi
7790: 6c 65 5c 26 2e 20 59 6f 75 20 6d 75 73 74 20 74  le\&. You must t
77a0: 68 65 6e 20 65 69 74 68 65 72 20 73 65 74 20 74  hen either set t
77b0: 68 65 0a 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44  he.\fBSSL_CERT_D
77c0: 49 52 5c 66 52 20 61 6e 64 2f 6f 72 20 5c 66 42  IR\fR and/or \fB
77d0: 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 5c 66 52  SSL_CERT_FILE\fR
77e0: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72   environment var
77f0: 69 61 62 6c 65 73 20 6f 72 20 74 68 65 0a 5c 66  iables or the.\f
7800: 42 2d 63 61 64 69 72 5c 66 52 20 6f 72 20 5c 66  B-cadir\fR or \f
7810: 42 2d 63 61 66 69 6c 65 5c 66 52 20 6f 70 74 69  B-cafile\fR opti
7820: 6f 6e 73 20 74 6f 20 74 68 65 20 43 41 20 63 65  ons to the CA ce
7830: 72 74 20 66 69 6c 65 27 73 20 69 6e 73 74 61 6c  rt file's instal
7840: 6c 0a 6c 6f 63 61 74 69 6f 6e 5c 26 2e 20 49 74  l.location\&. It
7850: 20 69 73 20 79 6f 75 72 20 72 65 73 70 6f 6e 73   is your respons
7860: 69 62 69 6c 69 74 79 20 74 6f 20 6b 65 65 70 20  ibility to keep 
7870: 74 68 69 73 20 66 69 6c 65 20 75 70 20 74 6f 20  this file up to 
7880: 64 61 74 65 5c 26 2e 0a 2e 50 50 0a 2e 53 48 20  date\&...PP..SH 
7890: 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  "CALLBACK OPTION
78a0: 53 22 0a 41 73 20 70 72 65 76 69 6f 75 73 6c 79  S".As previously
78b0: 20 64 65 73 63 72 69 62 65 64 2c 20 65 61 63 68   described, each
78c0: 20 63 68 61 6e 6e 65 6c 20 63 61 6e 20 62 65 20   channel can be 
78d0: 67 69 76 65 6e 20 74 68 65 69 72 20 6f 77 6e 20  given their own 
78e0: 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20 68 61 6e  callbacks.to han
78f0: 64 6c 65 20 69 6e 74 65 72 6d 65 64 69 61 74 65  dle intermediate
7900: 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20 74   processing by t
7910: 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61  he OpenSSL libra
7920: 72 79 2c 20 75 73 69 6e 67 20 74 68 65 0a 5c 66  ry, using the.\f
7930: 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 2c 20 5c 66  B-command\fR, \f
7940: 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 2c 20 61  B-password\fR, a
7950: 6e 64 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 5f  nd \fB-validate_
7960: 63 6f 6d 6d 61 6e 64 5c 66 52 20 6f 70 74 69 6f  command\fR optio
7970: 6e 73 0a 70 61 73 73 65 64 20 74 6f 20 65 69 74  ns.passed to eit
7980: 68 65 72 20 6f 66 20 5c 66 42 74 6c 73 3a 3a 73  her of \fBtls::s
7990: 6f 63 6b 65 74 5c 66 52 20 6f 72 20 5c 66 42 74  ocket\fR or \fBt
79a0: 6c 73 3a 3a 69 6d 70 6f 72 74 5c 66 52 5c 26 2e  ls::import\fR\&.
79b0: 0a 55 6e 6c 69 6b 65 20 70 72 65 76 69 6f 75 73  .Unlike previous
79c0: 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 54 63 6c   versions of Tcl
79d0: 54 4c 53 2c 20 6f 6e 6c 79 20 69 66 20 74 68 65  TLS, only if the
79e0: 20 63 61 6c 6c 62 61 63 6b 20 67 65 6e 65 72 61   callback genera
79f0: 74 65 73 20 61 6e 20 65 72 72 6f 72 2c 0a 77 69  tes an error,.wi
7a00: 6c 6c 20 74 68 65 20 5c 66 42 62 67 65 72 72 6f  ll the \fBbgerro
7a10: 72 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 62 65 20  r\fR command be 
7a20: 69 6e 76 6f 6b 65 64 20 77 69 74 68 20 74 68 65  invoked with the
7a30: 20 65 72 72 6f 72 20 69 6e 66 6f 72 6d 61 74 69   error informati
7a40: 6f 6e 5c 26 2e 0a 2e 53 53 20 22 56 41 4c 55 45  on\&...SS "VALUE
7a50: 53 20 46 4f 52 20 43 4f 4d 4d 41 4e 44 20 43 41  S FOR COMMAND CA
7a60: 4c 4c 42 41 43 4b 22 0a 54 68 65 20 63 61 6c 6c  LLBACK".The call
7a70: 62 61 63 6b 20 66 6f 72 20 74 68 65 20 5c 66 42  back for the \fB
7a80: 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20 6f 70 74 69  -command\fR opti
7a90: 6f 6e 20 69 73 20 69 6e 76 6f 6b 65 64 20 61 74  on is invoked at
7aa0: 20 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20   several points 
7ab0: 64 75 72 69 6e 67 20 74 68 65 0a 4f 70 65 6e 53  during the.OpenS
7ac0: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 61 6e 64  SL handshake and
7ad0: 20 64 75 72 69 6e 67 20 72 6f 75 74 69 6e 65 20   during routine 
7ae0: 6f 70 65 72 61 74 69 6f 6e 73 5c 26 2e 20 53 65  operations\&. Se
7af0: 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 20  e below for the 
7b00: 70 6f 73 73 69 62 6c 65 0a 61 72 67 75 6d 65 6e  possible.argumen
7b10: 74 73 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  ts passed to the
7b20: 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74   callback script
7b30: 5c 26 2e 20 56 61 6c 75 65 73 20 72 65 74 75 72  \&. Values retur
7b40: 6e 65 64 20 66 72 6f 6d 20 74 68 65 20 63 61 6c  ned from the cal
7b50: 6c 62 61 63 6b 20 61 72 65 0a 69 67 6e 6f 72 65  lback are.ignore
7b60: 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 65 72 72 6f  d\&...TP.\fBerro
7b70: 72 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49  r\fR \fIchannelI
7b80: 64 20 6d 65 73 73 61 67 65 5c 66 52 0a 54 68 69  d message\fR.Thi
7b90: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
7ba0: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68  ck is invoked wh
7bb0: 65 6e 65 76 65 72 20 61 6e 20 65 72 72 6f 72 20  enever an error 
7bc0: 6f 63 63 75 72 73 20 64 75 72 69 6e 67 20 74 68  occurs during th
7bd0: 65 20 69 6e 69 74 69 61 6c 0a 63 6f 6e 6e 65 63  e initial.connec
7be0: 74 69 6f 6e 2c 20 68 61 6e 64 73 68 61 6b 65 2c  tion, handshake,
7bf0: 20 6f 72 20 49 2f 4f 20 6f 70 65 72 61 74 69 6f   or I/O operatio
7c00: 6e 73 5c 26 2e 20 54 68 65 20 5c 66 49 6d 65 73  ns\&. The \fImes
7c10: 73 61 67 65 5c 66 52 20 61 72 67 75 6d 65 6e 74  sage\fR argument
7c20: 20 63 61 6e 20 62 65 0a 66 72 6f 6d 20 74 68 65   can be.from the
7c30: 20 54 63 6c 5f 45 72 72 6e 6f 4d 73 67 2c 20 4f   Tcl_ErrnoMsg, O
7c40: 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 20  penSSL function 
7c50: 5c 66 42 45 52 52 5f 72 65 61 73 6f 6e 5f 65 72  \fBERR_reason_er
7c60: 72 6f 72 5f 73 74 72 69 6e 67 28 29 5c 66 52 2c  ror_string()\fR,
7c70: 0a 6f 72 20 61 20 63 75 73 74 6f 6d 20 6d 65 73  .or a custom mes
7c80: 73 61 67 65 5c 26 2e 20 54 68 69 73 20 63 61 6c  sage\&. This cal
7c90: 6c 62 61 63 6b 20 69 73 20 6e 65 77 20 66 6f 72  lback is new for
7ca0: 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e   TclTLS 1\&.8\&.
7cb0: 0a 2e 54 50 0a 5c 66 42 69 6e 66 6f 5c 66 52 20  ..TP.\fBinfo\fR 
7cc0: 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 6d 61 6a  \fIchannelId maj
7cd0: 6f 72 20 6d 69 6e 6f 72 20 6d 65 73 73 61 67 65  or minor message
7ce0: 20 74 79 70 65 5c 66 52 0a 54 68 69 73 20 66 6f   type\fR.This fo
7cf0: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
7d00: 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65  s invoked by the
7d10: 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f   OpenSSL functio
7d20: 6e 0a 5c 66 42 53 53 4c 5f 73 65 74 5f 69 6e 66  n.\fBSSL_set_inf
7d30: 6f 5f 63 61 6c 6c 62 61 63 6b 28 29 5c 66 52 20  o_callback()\fR 
7d40: 64 75 72 69 6e 67 20 74 68 65 20 69 6e 69 74 69  during the initi
7d50: 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 61 6e  al connection an
7d60: 64 20 68 61 6e 64 73 68 61 6b 65 0a 6f 70 65 72  d handshake.oper
7d70: 61 74 69 6f 6e 73 5c 26 2e 20 54 68 65 20 61 72  ations\&. The ar
7d80: 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e 52 53  guments are:..RS
7d90: 0a 2e 54 50 0a 5c 66 49 6d 61 6a 6f 72 5c 66 52  ..TP.\fImajor\fR
7da0: 0a 4d 61 6a 6f 72 20 63 61 74 65 67 6f 72 79 20  .Major category 
7db0: 66 6f 72 20 65 72 72 6f 72 5c 26 2e 20 56 61 6c  for error\&. Val
7dc0: 69 64 20 65 6e 75 6d 73 20 61 72 65 3a 20 5c 66  id enums are: \f
7dd0: 42 68 61 6e 64 73 68 61 6b 65 5c 66 52 2c 20 5c  Bhandshake\fR, \
7de0: 66 42 61 6c 65 72 74 5c 66 52 2c 0a 5c 66 42 63  fBalert\fR,.\fBc
7df0: 6f 6e 6e 65 63 74 5c 66 52 2c 20 5c 66 42 61 63  onnect\fR, \fBac
7e00: 63 65 70 74 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c  cept\fR\&...TP.\
7e10: 66 49 6d 69 6e 6f 72 5c 66 52 0a 4d 69 6e 6f 72  fIminor\fR.Minor
7e20: 20 63 61 74 65 67 6f 72 79 20 66 6f 72 20 65 72   category for er
7e30: 72 6f 72 5c 26 2e 20 56 61 6c 69 64 20 65 6e 75  ror\&. Valid enu
7e40: 6d 73 20 61 72 65 3a 20 5c 66 42 73 74 61 72 74  ms are: \fBstart
7e50: 5c 66 52 2c 20 5c 66 42 64 6f 6e 65 5c 66 52 2c  \fR, \fBdone\fR,
7e60: 20 5c 66 42 72 65 61 64 5c 66 52 2c 0a 5c 66 42   \fBread\fR,.\fB
7e70: 77 72 69 74 65 5c 66 52 2c 20 5c 66 42 6c 6f 6f  write\fR, \fBloo
7e80: 70 5c 66 52 2c 20 5c 66 42 65 78 69 74 5c 66 52  p\fR, \fBexit\fR
7e90: 5c 26 2e 0a 2e 54 50 0a 5c 66 49 6d 65 73 73 61  \&...TP.\fImessa
7ea0: 67 65 5c 66 52 0a 44 65 73 63 72 69 70 74 69 76  ge\fR.Descriptiv
7eb0: 65 20 6d 65 73 73 61 67 65 20 73 74 72 69 6e 67  e message string
7ec0: 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 67 65   which may be ge
7ed0: 6e 65 72 61 74 65 64 20 65 69 74 68 65 72 20 62  nerated either b
7ee0: 79 0a 5c 66 42 53 53 4c 5f 73 74 61 74 65 5f 73  y.\fBSSL_state_s
7ef0: 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 5c 66 52 20  tring_long()\fR 
7f00: 6f 72 20 5c 66 42 53 53 4c 5f 61 6c 65 72 74 5f  or \fBSSL_alert_
7f10: 64 65 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67  desc_string_long
7f20: 28 29 5c 66 52 2c 0a 64 65 70 65 6e 64 69 6e 67  ()\fR,.depending
7f30: 20 6f 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 5c   on the context\
7f40: 26 2e 0a 2e 54 50 0a 5c 66 49 74 79 70 65 5c 66  &...TP.\fItype\f
7f50: 52 0a 46 6f 72 20 61 6c 65 72 74 73 2c 20 74 68  R.For alerts, th
7f60: 65 20 70 6f 73 73 69 62 6c 65 20 76 61 6c 75 65  e possible value
7f70: 73 20 61 72 65 3a 20 5c 66 42 77 61 72 6e 69 6e  s are: \fBwarnin
7f80: 67 5c 66 52 2c 0a 5c 66 42 66 61 74 61 6c 5c 66  g\fR,.\fBfatal\f
7f90: 52 2c 20 61 6e 64 20 5c 66 42 75 6e 6b 6e 6f 77  R, and \fBunknow
7fa0: 6e 5c 66 52 5c 26 2e 20 46 6f 72 20 6f 74 68 65  n\fR\&. For othe
7fb0: 72 73 2c 20 5c 66 42 69 6e 66 6f 5c 66 52 20 69  rs, \fBinfo\fR i
7fc0: 73 20 75 73 65 64 5c 26 2e 0a 54 68 69 73 20 61  s used\&..This a
7fd0: 72 67 75 6d 65 6e 74 20 69 73 20 6e 65 77 20 66  rgument is new f
7fe0: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
7ff0: 26 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 6d 65  &...RE..TP.\fBme
8000: 73 73 61 67 65 5c 66 52 20 5c 66 49 63 68 61 6e  ssage\fR \fIchan
8010: 6e 65 6c 49 64 20 64 69 72 65 63 74 69 6f 6e 20  nelId direction 
8020: 76 65 72 73 69 6f 6e 20 63 6f 6e 74 65 6e 74 5f  version content_
8030: 74 79 70 65 20 6d 65 73 73 61 67 65 5c 66 52 0a  type message\fR.
8040: 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c  This form of cal
8050: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64  lback is invoked
8060: 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20   by the OpenSSL 
8070: 66 75 6e 63 74 69 6f 6e 0a 5c 66 42 53 53 4c 5f  function.\fBSSL_
8080: 73 65 74 5f 6d 73 67 5f 63 61 6c 6c 62 61 63 6b  set_msg_callback
8090: 28 29 5c 66 52 20 77 68 65 6e 65 76 65 72 20 61  ()\fR whenever a
80a0: 20 6d 65 73 73 61 67 65 20 69 73 20 73 65 6e 74   message is sent
80b0: 20 6f 72 20 72 65 63 65 69 76 65 64 20 64 75 72   or received dur
80c0: 69 6e 67 20 74 68 65 0a 69 6e 69 74 69 61 6c 20  ing the.initial 
80d0: 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 68 61 6e 64  connection, hand
80e0: 73 68 61 6b 65 2c 20 6f 72 20 49 2f 4f 20 6f 70  shake, or I/O op
80f0: 65 72 61 74 69 6f 6e 73 5c 26 2e 20 49 74 20 69  erations\&. It i
8100: 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65  s only available
8110: 20 77 68 65 6e 0a 4f 70 65 6e 53 53 4c 20 69 73   when.OpenSSL is
8120: 20 63 6f 6d 70 6c 69 65 64 20 77 69 74 68 20 74   complied with t
8130: 68 65 20 5c 66 42 65 6e 61 62 6c 65 2d 73 73 6c  he \fBenable-ssl
8140: 2d 74 72 61 63 65 5c 66 52 20 6f 70 74 69 6f 6e  -trace\fR option
8150: 5c 26 2e 20 54 68 69 73 20 63 61 6c 6c 62 61 63  \&. This callbac
8160: 6b 20 69 73 0a 6e 65 77 20 66 6f 72 20 54 63 6c  k is.new for Tcl
8170: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65  TLS 1\&.8\&. The
8180: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a   arguments are:.
8190: 2e 52 53 0a 2e 54 50 0a 5c 66 49 64 69 72 65 63  .RS..TP.\fIdirec
81a0: 74 69 6f 6e 5c 66 52 0a 44 69 72 65 63 74 69 6f  tion\fR.Directio
81b0: 6e 20 69 73 20 65 69 74 68 65 72 20 5c 66 42 53  n is either \fBS
81c0: 65 6e 74 5c 66 52 20 6f 72 20 5c 66 42 52 65 63  ent\fR or \fBRec
81d0: 65 69 76 65 64 5c 66 52 5c 26 2e 0a 2e 54 50 0a  eived\fR\&...TP.
81e0: 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a 56 65  \fIversion\fR.Ve
81f0: 72 73 69 6f 6e 20 69 73 20 74 68 65 20 70 72 6f  rsion is the pro
8200: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 5c 26 2e  tocol version\&.
8210: 0a 2e 54 50 0a 5c 66 49 63 6f 6e 74 65 6e 74 5f  ..TP.\fIcontent_
8220: 74 79 70 65 5c 66 52 0a 43 6f 6e 74 65 6e 74 20  type\fR.Content 
8230: 74 79 70 65 20 69 73 20 74 68 65 20 6d 65 73 73  type is the mess
8240: 61 67 65 20 63 6f 6e 74 65 6e 74 20 74 79 70 65  age content type
8250: 5c 26 2e 0a 2e 54 50 0a 5c 66 49 6d 65 73 73 61  \&...TP.\fImessa
8260: 67 65 5c 66 52 0a 4d 65 73 73 61 67 65 20 69 73  ge\fR.Message is
8270: 20 6d 6f 72 65 20 69 6e 66 6f 20 66 72 6f 6d 20   more info from 
8280: 74 68 65 20 5c 66 42 53 53 4c 5f 74 72 61 63 65  the \fBSSL_trace
8290: 5c 66 52 20 41 50 49 5c 26 2e 0a 2e 52 45 0a 2e  \fR API\&...RE..
82a0: 54 50 0a 5c 66 42 73 65 73 73 69 6f 6e 5c 66 52  TP.\fBsession\fR
82b0: 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 73 65   \fIchannelId se
82c0: 73 73 69 6f 6e 5f 69 64 20 73 65 73 73 69 6f 6e  ssion_id session
82d0: 5f 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65  _ticket lifetime
82e0: 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66  \fR.This form of
82f0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76   callback is inv
8300: 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e  oked by the Open
8310: 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 5c 66 42  SSL function.\fB
8320: 53 53 4c 5f 43 54 58 5f 73 65 73 73 5f 73 65 74  SSL_CTX_sess_set
8330: 5f 6e 65 77 5f 63 62 28 29 5c 66 52 20 77 68 65  _new_cb()\fR whe
8340: 6e 65 76 65 72 20 61 20 6e 65 77 20 73 65 73 73  never a new sess
8350: 69 6f 6e 20 69 64 20 69 73 20 73 65 6e 74 20 62  ion id is sent b
8360: 79 20 74 68 65 0a 73 65 72 76 65 72 20 64 75 72  y the.server dur
8370: 69 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c 20  ing the initial 
8380: 63 6f 6e 6e 65 63 74 69 6f 6e 20 61 6e 64 20 68  connection and h
8390: 61 6e 64 73 68 61 6b 65 20 61 6e 64 20 61 6c 73  andshake and als
83a0: 6f 20 64 75 72 69 6e 67 20 74 68 65 20 73 65 73  o during the ses
83b0: 73 69 6f 6e 0a 69 66 20 74 68 65 20 5c 66 42 2d  sion.if the \fB-
83c0: 70 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 5c 66  post_handshake\f
83d0: 52 20 6f 70 74 69 6f 6e 20 69 73 20 73 65 74 20  R option is set 
83e0: 74 6f 20 74 72 75 65 5c 26 2e 20 54 68 69 73 20  to true\&. This 
83f0: 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 20  callback is new 
8400: 66 6f 72 0a 54 63 6c 54 4c 53 20 31 5c 26 2e 38  for.TclTLS 1\&.8
8410: 5c 26 2e 20 54 68 65 20 61 72 67 75 6d 65 6e 74  \&. The argument
8420: 73 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c  s are:..RS..TP.\
8430: 66 49 73 65 73 73 69 6f 6e 5f 69 64 5c 66 52 0a  fIsession_id\fR.
8440: 53 65 73 73 69 6f 6e 20 49 64 20 69 73 20 74 68  Session Id is th
8450: 65 20 63 75 72 72 65 6e 74 20 73 65 73 73 69 6f  e current sessio
8460: 6e 20 69 64 65 6e 74 69 66 69 65 72 0a 2e 54 50  n identifier..TP
8470: 0a 5c 66 49 73 65 73 73 69 6f 6e 5f 74 69 63 6b  .\fIsession_tick
8480: 65 74 5c 66 52 0a 54 69 63 6b 65 74 20 69 73 20  et\fR.Ticket is 
8490: 74 68 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b  the session tick
84a0: 65 74 20 69 6e 66 6f 0a 2e 54 50 0a 5c 66 49 6c  et info..TP.\fIl
84b0: 69 66 65 74 69 6d 65 5c 66 52 0a 4c 69 66 65 74  ifetime\fR.Lifet
84c0: 69 6d 65 20 69 73 20 74 68 65 20 74 69 63 6b 65  ime is the ticke
84d0: 74 20 6c 69 66 65 74 69 6d 65 20 69 6e 20 73 65  t lifetime in se
84e0: 63 6f 6e 64 73 5c 26 2e 0a 2e 52 45 0a 2e 54 50  conds\&...RE..TP
84f0: 0a 5c 66 42 76 65 72 69 66 79 5c 66 52 20 5c 66  .\fBverify\fR \f
8500: 49 63 68 61 6e 6e 65 6c 49 64 20 64 65 70 74 68  IchannelId depth
8510: 20 63 65 72 74 20 73 74 61 74 75 73 20 65 72 72   cert status err
8520: 6f 72 5c 66 52 0a 54 68 69 73 20 63 61 6c 6c 62  or\fR.This callb
8530: 61 63 6b 20 77 61 73 20 6d 6f 76 65 64 20 74 6f  ack was moved to
8540: 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 63 6f 6d   \fB-validatecom
8550: 6d 61 6e 64 5c 66 52 20 69 6e 20 54 63 6c 54 4c  mand\fR in TclTL
8560: 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 50 50 0a 2e  S 1\&.8\&...PP..
8570: 53 53 20 22 56 41 4c 55 45 53 20 46 4f 52 20 50  SS "VALUES FOR P
8580: 41 53 53 57 4f 52 44 20 43 41 4c 4c 42 41 43 4b  ASSWORD CALLBACK
8590: 22 0a 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 66  ".The callback f
85a0: 6f 72 20 74 68 65 20 5c 66 42 2d 70 61 73 73 77  or the \fB-passw
85b0: 6f 72 64 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73  ord\fR option is
85c0: 20 69 6e 76 6f 6b 65 64 20 62 79 20 54 63 6c 54   invoked by TclT
85d0: 4c 53 20 77 68 65 6e 65 76 65 72 20 4f 70 65 6e  LS whenever Open
85e0: 53 53 4c 20 6e 65 65 64 73 0a 74 6f 20 6f 62 74  SSL needs.to obt
85f0: 61 69 6e 20 61 20 70 61 73 73 77 6f 72 64 5c 26  ain a password\&
8600: 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 20  . See below for 
8610: 74 68 65 20 70 6f 73 73 69 62 6c 65 20 61 72 67  the possible arg
8620: 75 6d 65 6e 74 73 20 70 61 73 73 65 64 20 74 6f  uments passed to
8630: 20 74 68 65 0a 63 61 6c 6c 62 61 63 6b 20 73 63   the.callback sc
8640: 72 69 70 74 5c 26 2e 20 54 68 65 20 75 73 65 72  ript\&. The user
8650: 20 70 72 6f 76 69 64 65 64 20 70 61 73 73 77 6f   provided passwo
8660: 72 64 20 69 73 20 65 78 70 65 63 74 65 64 20 74  rd is expected t
8670: 6f 20 62 65 20 72 65 74 75 72 6e 65 64 20 62 79  o be returned by
8680: 20 74 68 65 0a 63 61 6c 6c 62 61 63 6b 5c 26 2e   the.callback\&.
8690: 0a 2e 54 50 0a 5c 66 42 70 61 73 73 77 6f 72 64  ..TP.\fBpassword
86a0: 5c 66 52 20 5c 66 49 72 77 66 6c 61 67 20 73 69  \fR \fIrwflag si
86b0: 7a 65 5c 66 52 0a 49 6e 76 6f 6b 65 64 20 77 68  ze\fR.Invoked wh
86c0: 65 6e 20 6c 6f 61 64 69 6e 67 20 6f 72 20 73 74  en loading or st
86d0: 6f 72 69 6e 67 20 61 6e 20 65 6e 63 72 79 70 74  oring an encrypt
86e0: 65 64 20 50 45 4d 20 63 65 72 74 69 66 69 63 61  ed PEM certifica
86f0: 74 65 5c 26 2e 20 54 68 65 20 61 72 67 75 6d 65  te\&. The argume
8700: 6e 74 73 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50  nts are:..RS..TP
8710: 0a 5c 66 49 72 77 66 6c 61 67 5c 66 52 0a 54 68  .\fIrwflag\fR.Th
8720: 65 20 72 65 61 64 2f 77 72 69 74 65 20 66 6c 61  e read/write fla
8730: 67 20 69 73 20 30 20 66 6f 72 20 72 65 61 64 69  g is 0 for readi
8740: 6e 67 2f 64 65 63 72 79 70 74 69 6f 6e 20 6f 72  ng/decryption or
8750: 20 31 20 66 6f 72 20 77 72 69 74 69 6e 67 2f 65   1 for writing/e
8760: 6e 63 72 79 70 74 69 6f 6e 5c 26 2e 0a 54 68 65  ncryption\&..The
8770: 20 6c 61 74 74 65 72 20 63 61 6e 20 62 65 20 75   latter can be u
8780: 73 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65  sed to determine
8790: 20 77 68 65 6e 20 74 6f 20 70 72 6f 6d 70 74 20   when to prompt 
87a0: 74 68 65 20 75 73 65 72 20 74 6f 20 63 6f 6e 66  the user to conf
87b0: 69 72 6d 5c 26 2e 0a 54 68 69 73 20 61 72 67 75  irm\&..This argu
87c0: 6d 65 6e 74 20 69 73 20 6e 65 77 20 66 6f 72 20  ment is new for 
87d0: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a  TclTLS 1\&.8\&..
87e0: 2e 54 50 0a 5c 66 49 73 69 7a 65 5c 66 52 0a 54  .TP.\fIsize\fR.T
87f0: 68 65 20 73 69 7a 65 20 69 73 20 74 68 65 20 6d  he size is the m
8800: 61 78 69 6d 75 6d 20 6c 65 6e 67 74 68 20 6f 66  aximum length of
8810: 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 69 6e   the password in
8820: 20 62 79 74 65 73 5c 26 2e 0a 54 68 69 73 20 61   bytes\&..This a
8830: 72 67 75 6d 65 6e 74 20 69 73 20 6e 65 77 20 66  rgument is new f
8840: 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c  or TclTLS 1\&.8\
8850: 26 2e 0a 2e 52 45 0a 2e 50 50 0a 2e 53 53 20 22  &...RE..PP..SS "
8860: 56 41 4c 55 45 53 20 46 4f 52 20 56 41 4c 49 44  VALUES FOR VALID
8870: 41 54 45 20 43 4f 4d 4d 41 4e 44 20 43 41 4c 4c  ATE COMMAND CALL
8880: 42 41 43 4b 22 0a 54 68 65 20 63 61 6c 6c 62 61  BACK".The callba
8890: 63 6b 20 66 6f 72 20 74 68 65 20 5c 66 42 2d 76  ck for the \fB-v
88a0: 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66  alidatecommand\f
88b0: 52 20 6f 70 74 69 6f 6e 20 69 73 20 69 6e 76 6f  R option is invo
88c0: 6b 65 64 20 64 75 72 69 6e 67 20 74 68 65 20 68  ked during the h
88d0: 61 6e 64 73 68 61 6b 65 0a 70 72 6f 63 65 73 73  andshake.process
88e0: 20 69 6e 20 6f 72 64 65 72 20 66 6f 72 20 74 68   in order for th
88f0: 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 74 6f  e application to
8900: 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 70 72   validate the pr
8910: 6f 76 69 64 65 64 20 76 61 6c 75 65 28 73 29 5c  ovided value(s)\
8920: 26 2e 20 53 65 65 0a 62 65 6c 6f 77 20 66 6f 72  &. See.below for
8930: 20 74 68 65 20 70 6f 73 73 69 62 6c 65 20 61 72   the possible ar
8940: 67 75 6d 65 6e 74 73 20 70 61 73 73 65 64 20 74  guments passed t
8950: 6f 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73  o the callback s
8960: 63 72 69 70 74 5c 26 2e 20 49 66 20 6e 6f 74 0a  cript\&. If not.
8970: 73 70 65 63 69 66 69 65 64 2c 20 4f 70 65 6e 53  specified, OpenS
8980: 53 4c 20 77 69 6c 6c 20 61 63 63 65 70 74 20 61  SL will accept a
8990: 6c 6c 20 76 61 6c 69 64 20 63 65 72 74 69 66 69  ll valid certifi
89a0: 63 61 74 65 73 20 61 6e 64 20 65 78 74 65 6e 73  cates and extens
89b0: 69 6f 6e 73 5c 26 2e 20 54 6f 20 72 65 6a 65 63  ions\&. To rejec
89c0: 74 0a 74 68 65 20 76 61 6c 75 65 20 61 6e 64 20  t.the value and 
89d0: 61 62 6f 72 74 20 74 68 65 20 63 6f 6e 6e 65 63  abort the connec
89e0: 74 69 6f 6e 2c 20 74 68 65 20 63 61 6c 6c 62 61  tion, the callba
89f0: 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  ck should return
8a00: 20 30 5c 26 2e 20 54 6f 20 61 63 63 65 70 74 20   0\&. To accept 
8a10: 74 68 65 0a 76 61 6c 75 65 20 61 6e 64 20 63 6f  the.value and co
8a20: 6e 74 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65  ntinue the conne
8a30: 63 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64  ction, it should
8a40: 20 72 65 74 75 72 6e 20 31 5c 26 2e 20 54 6f 20   return 1\&. To 
8a50: 72 65 6a 65 63 74 20 74 68 65 20 76 61 6c 75 65  reject the value
8a60: 2c 20 62 75 74 0a 63 6f 6e 74 69 6e 75 65 20 74  , but.continue t
8a70: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69  he connection, i
8a80: 74 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20  t should return 
8a90: 32 5c 26 2e 20 54 68 69 73 20 63 61 6c 6c 62 61  2\&. This callba
8aa0: 63 6b 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63  ck is new for Tc
8ab0: 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54  lTLS 1\&.8\&...T
8ac0: 50 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66 49  P.\fBalpn\fR \fI
8ad0: 63 68 61 6e 6e 65 6c 49 64 20 70 72 6f 74 6f 63  channelId protoc
8ae0: 6f 6c 20 6d 61 74 63 68 5c 66 52 0a 46 6f 72 20  ol match\fR.For 
8af0: 73 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 6f  servers, this fo
8b00: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
8b10: 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74  s invoked when t
8b20: 68 65 20 63 6c 69 65 6e 74 20 41 4c 50 4e 20 65  he client ALPN e
8b30: 78 74 65 6e 73 69 6f 6e 20 69 73 0a 72 65 63 65  xtension is.rece
8b40: 69 76 65 64 5c 26 2e 20 49 66 20 5c 66 49 6d 61  ived\&. If \fIma
8b50: 74 63 68 5c 66 52 20 69 73 20 74 72 75 65 2c 20  tch\fR is true, 
8b60: 74 68 65 6e 20 5c 66 49 70 72 6f 74 6f 63 6f 6c  then \fIprotocol
8b70: 5c 66 52 20 69 73 20 74 68 65 20 66 69 72 73 74  \fR is the first
8b80: 0a 5c 66 42 2d 61 6c 70 6e 5c 66 52 20 70 72 6f  .\fB-alpn\fR pro
8b90: 74 6f 63 6f 6c 20 6f 70 74 69 6f 6e 20 69 6e 20  tocol option in 
8ba0: 63 6f 6d 6d 6f 6e 20 74 6f 20 62 6f 74 68 20 74  common to both t
8bb0: 68 65 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65  he client and se
8bc0: 72 76 65 72 5c 26 2e 0a 49 66 20 6e 6f 74 2c 20  rver\&..If not, 
8bd0: 74 68 65 20 66 69 72 73 74 20 63 6c 69 65 6e 74  the first client
8be0: 20 73 70 65 63 69 66 69 65 64 20 70 72 6f 74 6f   specified proto
8bf0: 63 6f 6c 20 69 73 20 75 73 65 64 5c 26 2e 20 54  col is used\&. T
8c00: 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20  his callback is 
8c10: 63 61 6c 6c 65 64 0a 61 66 74 65 72 20 74 68 65  called.after the
8c20: 20 48 65 6c 6c 6f 20 61 6e 64 20 41 4c 50 4e 20   Hello and ALPN 
8c30: 63 61 6c 6c 62 61 63 6b 73 5c 26 2e 0a 2e 54 50  callbacks\&...TP
8c40: 0a 5c 66 42 68 65 6c 6c 6f 5c 66 52 20 5c 66 49  .\fBhello\fR \fI
8c50: 63 68 61 6e 6e 65 6c 49 64 20 73 65 72 76 65 72  channelId server
8c60: 6e 61 6d 65 5c 66 52 0a 46 6f 72 20 73 65 72 76  name\fR.For serv
8c70: 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f  ers, this form o
8c80: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e  f callback is in
8c90: 76 6f 6b 65 64 20 64 75 72 69 6e 67 20 63 6c 69  voked during cli
8ca0: 65 6e 74 20 68 65 6c 6c 6f 20 6d 65 73 73 61 67  ent hello messag
8cb0: 65 0a 70 72 6f 63 65 73 73 69 6e 67 5c 26 2e 20  e.processing\&. 
8cc0: 54 68 65 20 70 75 72 70 6f 73 65 20 69 73 20 73  The purpose is s
8cd0: 6f 20 74 68 65 20 73 65 72 76 65 72 20 63 61 6e  o the server can
8ce0: 20 73 65 6c 65 63 74 20 74 68 65 20 61 70 70 72   select the appr
8cf0: 6f 70 72 69 61 74 65 20 63 65 72 74 69 66 69 63  opriate certific
8d00: 61 74 65 0a 74 6f 20 70 72 65 73 65 6e 74 20 74  ate.to present t
8d10: 6f 20 74 68 65 20 63 6c 69 65 6e 74 2c 20 61 6e  o the client, an
8d20: 64 20 74 6f 20 6d 61 6b 65 20 6f 74 68 65 72 20  d to make other 
8d30: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 64  configuration ad
8d40: 6a 75 73 74 6d 65 6e 74 73 20 72 65 6c 65 76 61  justments releva
8d50: 6e 74 0a 74 6f 20 74 68 61 74 20 73 65 72 76 65  nt.to that serve
8d60: 72 20 6e 61 6d 65 20 61 6e 64 20 69 74 73 20 63  r name and its c
8d70: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5c 26 2e 20  onfiguration\&. 
8d80: 49 74 20 69 73 20 63 61 6c 6c 65 64 20 62 65 66  It is called bef
8d90: 6f 72 65 20 74 68 65 20 53 4e 49 20 61 6e 64 20  ore the SNI and 
8da0: 41 4c 50 4e 0a 63 61 6c 6c 62 61 63 6b 73 5c 26  ALPN.callbacks\&
8db0: 2e 0a 2e 54 50 0a 5c 66 42 73 6e 69 5c 66 52 20  ...TP.\fBsni\fR 
8dc0: 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 73 65 72  \fIchannelId ser
8dd0: 76 65 72 6e 61 6d 65 5c 66 52 0a 46 6f 72 20 73  vername\fR.For s
8de0: 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 6f 72  ervers, this for
8df0: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73  m of callback is
8e00: 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74 68   invoked when th
8e10: 65 20 53 65 72 76 65 72 20 4e 61 6d 65 20 49 6e  e Server Name In
8e20: 64 69 63 61 74 69 6f 6e 0a 28 53 4e 49 29 20 65  dication.(SNI) e
8e30: 78 74 65 6e 73 69 6f 6e 20 69 73 20 72 65 63 65  xtension is rece
8e40: 69 76 65 64 5c 26 2e 20 54 68 65 20 5c 66 49 73  ived\&. The \fIs
8e50: 65 72 76 65 72 6e 61 6d 65 5c 66 52 20 61 72 67  ervername\fR arg
8e60: 75 6d 65 6e 74 20 69 73 20 74 68 65 20 63 6c 69  ument is the cli
8e70: 65 6e 74 0a 70 72 6f 76 69 64 65 64 20 73 65 72  ent.provided ser
8e80: 76 65 72 20 6e 61 6d 65 20 73 70 65 63 69 66 69  ver name specifi
8e90: 65 64 20 69 6e 20 74 68 65 20 5c 66 42 2d 73 65  ed in the \fB-se
8ea0: 72 76 65 72 6e 61 6d 65 3c 2f 62 3e 5c 66 52 20  rvername</b>\fR 
8eb0: 6f 70 74 69 6f 6e 5c 26 2e 20 54 68 65 0a 70 75  option\&. The.pu
8ec0: 72 70 6f 73 65 20 69 73 20 73 6f 20 77 68 65 6e  rpose is so when
8ed0: 20 61 20 73 65 72 76 65 72 20 73 75 70 70 6f 72   a server suppor
8ee0: 74 73 20 6d 75 6c 74 69 70 6c 65 20 6e 61 6d 65  ts multiple name
8ef0: 73 2c 20 74 68 65 20 72 69 67 68 74 20 63 65 72  s, the right cer
8f00: 74 69 66 69 63 61 74 65 0a 63 61 6e 20 62 65 20  tificate.can be 
8f10: 75 73 65 64 5c 26 2e 20 49 74 20 69 73 20 63 61  used\&. It is ca
8f20: 6c 6c 65 64 20 61 66 74 65 72 20 74 68 65 20 68  lled after the h
8f30: 65 6c 6c 6f 20 63 61 6c 6c 62 61 63 6b 20 62 75  ello callback bu
8f40: 74 20 62 65 66 6f 72 65 20 74 68 65 20 41 4c 50  t before the ALP
8f50: 4e 0a 63 61 6c 6c 62 61 63 6b 5c 26 2e 0a 2e 54  N.callback\&...T
8f60: 50 0a 5c 66 42 76 65 72 69 66 79 5c 66 52 20 5c  P.\fBverify\fR \
8f70: 66 49 63 68 61 6e 6e 65 6c 49 64 20 64 65 70 74  fIchannelId dept
8f80: 68 20 63 65 72 74 20 73 74 61 74 75 73 20 65 72  h cert status er
8f90: 72 6f 72 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d  ror\fR.This form
8fa0: 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20   of callback is 
8fb0: 69 6e 76 6f 6b 65 64 20 62 79 20 4f 70 65 6e 53  invoked by OpenS
8fc0: 53 4c 20 77 68 65 6e 20 61 20 6e 65 77 20 63 65  SL when a new ce
8fd0: 72 74 69 66 69 63 61 74 65 20 69 73 20 72 65 63  rtificate is rec
8fe0: 65 69 76 65 64 0a 66 72 6f 6d 20 74 68 65 20 70  eived.from the p
8ff0: 65 65 72 5c 26 2e 20 49 74 20 61 6c 6c 6f 77 73  eer\&. It allows
9000: 20 74 68 65 20 63 6c 69 65 6e 74 20 74 6f 20 63   the client to c
9010: 68 65 63 6b 20 74 68 65 20 63 65 72 74 69 66 69  heck the certifi
9020: 63 61 74 65 20 76 65 72 69 66 69 63 61 74 69 6f  cate verificatio
9030: 6e 0a 72 65 73 75 6c 74 73 20 61 6e 64 20 63 68  n.results and ch
9040: 6f 6f 73 65 20 77 68 65 74 68 65 72 20 74 6f 20  oose whether to 
9050: 63 6f 6e 74 69 6e 75 65 20 6f 72 20 6e 6f 74 5c  continue or not\
9060: 26 2e 20 49 74 20 69 73 20 63 61 6c 6c 65 64 20  &. It is called 
9070: 66 6f 72 20 65 61 63 68 0a 63 65 72 74 69 66 69  for each.certifi
9080: 63 61 74 65 20 69 6e 20 74 68 65 20 63 65 72 74  cate in the cert
9090: 69 66 69 63 61 74 65 20 63 68 61 69 6e 5c 26 2e  ificate chain\&.
90a0: 20 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 77   This callback w
90b0: 61 73 20 6d 6f 76 65 64 20 66 72 6f 6d 0a 5c 66  as moved from.\f
90c0: 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20 69 6e 20  B-command\fR in 
90d0: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 20  TclTLS 1\&.8\&. 
90e0: 54 68 65 20 61 72 67 75 6d 65 6e 74 73 20 61 72  The arguments ar
90f0: 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66 49 64 65  e:..RS..TP.\fIde
9100: 70 74 68 5c 66 52 0a 54 68 65 20 64 65 70 74 68  pth\fR.The depth
9110: 20 69 73 20 74 68 65 20 69 6e 74 65 67 65 72 20   is the integer 
9120: 64 65 70 74 68 20 6f 66 20 74 68 65 20 63 65 72  depth of the cer
9130: 74 69 66 69 63 61 74 65 20 69 6e 20 74 68 65 20  tificate in the 
9140: 63 65 72 74 69 66 69 63 61 74 65 20 63 68 61 69  certificate chai
9150: 6e 2c 0a 77 68 65 72 65 20 30 20 69 73 20 74 68  n,.where 0 is th
9160: 65 20 70 65 65 72 20 63 65 72 74 69 66 69 63 61  e peer certifica
9170: 74 65 20 61 6e 64 20 68 69 67 68 65 72 20 76 61  te and higher va
9180: 6c 75 65 73 20 67 6f 69 6e 67 20 75 70 20 74 6f  lues going up to
9190: 20 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65   the Certificate
91a0: 0a 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 5c  .Authority (CA)\
91b0: 26 2e 0a 2e 54 50 0a 5c 66 49 63 65 72 74 5c 66  &...TP.\fIcert\f
91c0: 52 0a 54 68 65 20 63 65 72 74 20 61 72 67 75 6d  R.The cert argum
91d0: 65 6e 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66  ent is a list of
91e0: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73   key-value pairs
91f0: 20 73 69 6d 69 6c 61 72 20 74 6f 20 74 68 6f 73   similar to thos
9200: 65 20 72 65 74 75 72 6e 65 64 20 62 79 0a 5c 66  e returned by.\f
9210: 42 74 6c 73 3a 3a 73 74 61 74 75 73 5c 66 52 5c  Btls::status\fR\
9220: 26 2e 0a 2e 54 50 0a 5c 66 49 73 74 61 74 75 73  &...TP.\fIstatus
9230: 5c 66 52 0a 54 68 65 20 73 74 61 74 75 73 20 61  \fR.The status a
9240: 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 62  rgument is the b
9250: 6f 6f 6c 65 61 6e 20 76 61 6c 69 64 69 74 79 20  oolean validity 
9260: 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 63  of the current c
9270: 65 72 74 69 66 69 63 61 74 65 20 77 68 65 72 65  ertificate where
9280: 20 30 0a 69 73 20 69 6e 76 61 6c 69 64 20 61 6e   0.is invalid an
9290: 64 20 31 20 69 73 20 76 61 6c 69 64 5c 26 2e 0a  d 1 is valid\&..
92a0: 2e 54 50 0a 5c 66 49 65 72 72 6f 72 5c 66 52 0a  .TP.\fIerror\fR.
92b0: 54 68 65 20 65 72 72 6f 72 20 61 72 67 75 6d 65  The error argume
92c0: 6e 74 20 69 73 20 74 68 65 20 65 72 72 6f 72 20  nt is the error 
92d0: 6d 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2c  message, if any,
92e0: 20 67 65 6e 65 72 61 74 65 64 20 62 79 0a 5c 66   generated by.\f
92f0: 42 58 35 30 39 5f 53 54 4f 52 45 5f 43 54 58 5f  BX509_STORE_CTX_
9300: 67 65 74 5f 65 72 72 6f 72 28 29 5c 66 52 5c 26  get_error()\fR\&
9310: 2e 0a 2e 52 45 0a 2e 50 50 0a 52 65 66 65 72 65  ...RE..PP.Refere
9320: 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69  nce implementati
9330: 6f 6e 73 20 6f 66 20 74 68 65 73 65 20 63 61 6c  ons of these cal
9340: 6c 62 61 63 6b 73 20 61 72 65 20 70 72 6f 76 69  lbacks are provi
9350: 64 65 64 20 69 6e 20 22 5c 66 49 74 6c 73 5c 26  ded in "\fItls\&
9360: 2e 74 63 6c 5c 66 52 22 0a 61 73 20 5c 66 42 74  .tcl\fR".as \fBt
9370: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 2c  ls::callback\fR,
9380: 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72   \fBtls::passwor
9390: 64 5c 66 52 2c 20 61 6e 64 20 5c 66 42 74 6c 73  d\fR, and \fBtls
93a0: 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  ::validate_comma
93b0: 6e 64 5c 66 52 0a 72 65 73 70 65 63 74 69 76 65  nd\fR.respective
93c0: 6c 79 5c 26 2e 20 4e 6f 74 65 20 74 68 61 74 20  ly\&. Note that 
93d0: 74 68 65 73 65 20 61 72 65 20 6f 6e 6c 79 20 5c  these are only \
93e0: 66 49 73 61 6d 70 6c 65 5c 66 52 20 69 6d 70 6c  fIsample\fR impl
93f0: 65 6d 65 6e 74 61 74 69 6f 6e 73 5c 26 2e 20 49  ementations\&. I
9400: 6e 20 61 20 6d 6f 72 65 0a 72 65 61 6c 69 73 74  n a more.realist
9410: 69 63 20 64 65 70 6c 6f 79 6d 65 6e 74 20 79 6f  ic deployment yo
9420: 75 20 77 6f 75 6c 64 20 73 70 65 63 69 66 79 20  u would specify 
9430: 79 6f 75 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63  your own callbac
9440: 6b 20 73 63 72 69 70 74 73 20 6f 6e 20 65 61 63  k scripts on eac
9450: 68 20 54 4c 53 0a 63 68 61 6e 6e 65 6c 20 75 73  h TLS.channel us
9460: 69 6e 67 20 74 68 65 20 5c 66 42 2d 63 6f 6d 6d  ing the \fB-comm
9470: 61 6e 64 5c 66 52 2c 20 5c 66 42 2d 70 61 73 73  and\fR, \fB-pass
9480: 77 6f 72 64 5c 66 52 2c 20 61 6e 64 0a 5c 66 42  word\fR, and.\fB
9490: 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e  -validate_comman
94a0: 64 5c 66 52 20 6f 70 74 69 6f 6e 73 5c 26 2e 0a  d\fR options\&..
94b0: 2e 50 50 0a 54 68 65 20 64 65 66 61 75 6c 74 20  .PP.The default 
94c0: 62 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74 68  behavior when th
94d0: 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52  e \fB-command\fR
94e0: 20 61 6e 64 20 5c 66 42 2d 76 61 6c 69 64 61 74   and \fB-validat
94f0: 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74  e_command\fR.opt
9500: 69 6f 6e 73 20 61 72 65 20 6e 6f 74 20 73 70 65  ions are not spe
9510: 63 69 66 69 65 64 2c 20 69 73 20 66 6f 72 20 54  cified, is for T
9520: 63 6c 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73  clTLS to process
9530: 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 20   the associated 
9540: 6c 69 62 72 61 72 79 0a 63 61 6c 6c 62 61 63 6b  library.callback
9550: 73 20 69 6e 74 65 72 6e 61 6c 6c 79 5c 26 2e 20  s internally\&. 
9560: 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61  The default beha
9570: 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 5c 66  vior when the \f
9580: 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 20 6f 70  B-password\fR op
9590: 74 69 6f 6e 0a 69 73 20 6e 6f 74 20 73 70 65 63  tion.is not spec
95a0: 69 66 69 65 64 20 69 73 20 66 6f 72 20 54 63 6c  ified is for Tcl
95b0: 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74  TLS to process t
95c0: 68 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69  he associated li
95d0: 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 20  brary callbacks 
95e0: 62 79 0a 61 74 74 65 6d 70 74 69 6e 67 20 74 6f  by.attempting to
95f0: 20 63 61 6c 6c 20 5c 66 42 74 6c 73 3a 3a 70 61   call \fBtls::pa
9600: 73 73 77 6f 72 64 5c 66 52 5c 26 2e 20 54 68 65  ssword\fR\&. The
9610: 20 64 69 66 66 65 72 65 6e 63 65 20 62 65 74 77   difference betw
9620: 65 65 6e 20 74 68 65 73 65 20 74 77 6f 0a 62 65  een these two.be
9630: 68 61 76 69 6f 72 73 20 69 73 20 61 20 63 6f 6e  haviors is a con
9640: 73 65 71 75 65 6e 63 65 20 6f 66 20 6d 61 69 6e  sequence of main
9650: 74 61 69 6e 69 6e 67 20 63 6f 6d 70 61 74 69 62  taining compatib
9660: 69 6c 69 74 79 20 77 69 74 68 20 65 61 72 6c 69  ility with earli
9670: 65 72 0a 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  er.implementatio
9680: 6e 73 5c 26 2e 0a 2e 50 50 0a 5c 66 49 54 68 65  ns\&...PP.\fIThe
9690: 20 75 73 65 20 6f 66 20 74 68 65 20 72 65 66 65   use of the refe
96a0: 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 20  rence callbacks 
96b0: 5c 66 42 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b  \fBtls::callback
96c0: 5c 66 52 2c 20 5c 66 42 74 6c 73 3a 3a 70 61 73  \fR, \fBtls::pas
96d0: 73 77 6f 72 64 5c 66 52 2c 0a 61 6e 64 20 5c 66  sword\fR,.and \f
96e0: 42 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63  Btls::validate_c
96f0: 6f 6d 6d 61 6e 64 5c 66 52 20 69 73 20 6e 6f 74  ommand\fR is not
9700: 20 72 65 63 6f 6d 6d 65 6e 64 65 64 5c 26 2e 20   recommended\&. 
9710: 54 68 65 79 20 6d 61 79 20 62 65 20 72 65 6d 6f  They may be remo
9720: 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 20  ved from future 
9730: 72 65 6c 65 61 73 65 73 5c 26 2e 5c 66 52 0a 2e  releases\&.\fR..
9740: 53 48 20 44 45 42 55 47 0a 46 6f 72 20 6d 6f 73  SH DEBUG.For mos
9750: 74 20 64 65 62 75 67 67 69 6e 67 20 6e 65 65 64  t debugging need
9760: 73 2c 20 74 68 65 20 5c 66 42 2d 63 61 6c 6c 62  s, the \fB-callb
9770: 61 63 6b 5c 66 52 20 6f 70 74 69 6f 6e 20 63 61  ack\fR option ca
9780: 6e 20 62 65 20 75 73 65 64 20 74 6f 20 70 72 6f  n be used to pro
9790: 76 69 64 65 0a 73 75 66 66 69 63 69 65 6e 74 20  vide.sufficient 
97a0: 69 6e 73 69 67 68 74 20 61 6e 64 20 69 6e 66 6f  insight and info
97b0: 72 6d 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 54  rmation on the T
97c0: 4c 53 20 68 61 6e 64 73 68 61 6b 65 20 61 6e 64  LS handshake and
97d0: 20 70 72 6f 67 72 65 73 73 5c 26 2e 20 49 66 0a   progress\&. If.
97e0: 66 75 72 74 68 65 72 20 74 72 6f 75 62 6c 65 73  further troubles
97f0: 68 6f 6f 74 69 6e 67 20 69 6e 73 69 67 68 74 20  hooting insight 
9800: 69 73 20 6e 65 65 64 65 64 2c 20 74 68 65 20 63  is needed, the c
9810: 6f 6d 70 69 6c 65 20 74 69 6d 65 20 6f 70 74 69  ompile time opti
9820: 6f 6e 0a 5c 66 42 2d 2d 65 6e 61 62 6c 65 2d 64  on.\fB--enable-d
9830: 65 62 75 67 5c 66 52 20 63 61 6e 20 62 65 20 75  ebug\fR can be u
9840: 73 65 64 20 74 6f 20 67 65 74 20 64 65 74 61 69  sed to get detai
9850: 6c 65 64 20 65 78 65 63 75 74 69 6f 6e 20 66 6c  led execution fl
9860: 6f 77 20 73 74 61 74 75 73 5c 26 2e 0a 2e 50 50  ow status\&...PP
9870: 0a 54 4c 53 20 6b 65 79 20 6c 6f 67 67 69 6e 67  .TLS key logging
9880: 20 63 61 6e 20 62 65 20 65 6e 61 62 6c 65 64 20   can be enabled 
9890: 62 79 20 73 65 74 74 69 6e 67 20 74 68 65 20 65  by setting the e
98a0: 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61  nvironment varia
98b0: 62 6c 65 0a 5c 66 42 53 53 4c 4b 45 59 4c 4f 47  ble.\fBSSLKEYLOG
98c0: 46 49 4c 45 5c 66 52 20 74 6f 20 74 68 65 20 6e  FILE\fR to the n
98d0: 61 6d 65 20 6f 66 20 74 68 65 20 66 69 6c 65 20  ame of the file 
98e0: 74 6f 20 6c 6f 67 20 74 6f 5c 26 2e 20 54 68 65  to log to\&. The
98f0: 6e 20 77 68 65 6e 65 76 65 72 20 54 4c 53 20 6b  n whenever TLS k
9900: 65 79 0a 6d 61 74 65 72 69 61 6c 20 69 73 20 67  ey.material is g
9910: 65 6e 65 72 61 74 65 64 20 6f 72 20 72 65 63 65  enerated or rece
9920: 69 76 65 64 20 69 74 20 77 69 6c 6c 20 62 65 20  ived it will be 
9930: 6c 6f 67 67 65 64 20 74 6f 20 74 68 65 20 66 69  logged to the fi
9940: 6c 65 5c 26 2e 20 54 68 69 73 20 69 73 20 75 73  le\&. This is us
9950: 65 66 75 6c 0a 66 6f 72 20 6c 6f 67 67 69 6e 67  eful.for logging
9960: 20 6b 65 79 20 64 61 74 61 20 66 6f 72 20 6e 65   key data for ne
9970: 74 77 6f 72 6b 20 6c 6f 67 67 69 6e 67 20 74 6f  twork logging to
9980: 6f 6c 73 20 74 6f 20 75 73 65 20 74 6f 20 64 65  ols to use to de
9990: 63 72 79 70 74 20 74 68 65 20 64 61 74 61 5c 26  crypt the data\&
99a0: 2e 0a 2e 50 50 0a 54 68 65 20 5c 66 42 74 6c 73  ...PP.The \fBtls
99b0: 3a 3a 64 65 62 75 67 5c 66 52 20 76 61 72 69 61  ::debug\fR varia
99c0: 62 6c 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d  ble provides som
99d0: 65 20 61 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6e  e additional con
99e0: 74 72 6f 6c 20 6f 76 65 72 20 74 68 65 0a 64 65  trol over the.de
99f0: 62 75 67 20 6c 6f 67 67 69 6e 67 20 69 6e 20 74  bug logging in t
9a00: 68 65 20 5c 66 42 74 6c 73 3a 3a 63 61 6c 6c 62  he \fBtls::callb
9a10: 61 63 6b 5c 66 52 2c 20 5c 66 42 74 6c 73 3a 3a  ack\fR, \fBtls::
9a20: 70 61 73 73 77 6f 72 64 5c 66 52 2c 20 61 6e 64  password\fR, and
9a30: 0a 5c 66 42 74 6c 73 3a 3a 76 61 6c 69 64 61 74  .\fBtls::validat
9a40: 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52 20 64 65 66  e_command\fR def
9a50: 61 75 6c 74 20 68 61 6e 64 6c 65 72 73 20 69 6e  ault handlers in
9a60: 20 22 5c 66 49 74 6c 73 5c 26 2e 74 63 6c 5c 66   "\fItls\&.tcl\f
9a70: 52 22 5c 26 2e 0a 54 68 65 20 64 65 66 61 75 6c  R"\&..The defaul
9a80: 74 20 76 61 6c 75 65 20 69 73 20 30 20 77 69 74  t value is 0 wit
9a90: 68 20 68 69 67 68 65 72 20 76 61 6c 75 65 73 20  h higher values 
9aa0: 70 72 6f 64 75 63 69 6e 67 20 6d 6f 72 65 20 64  producing more d
9ab0: 69 61 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74  iagnostic output
9ac0: 2c 0a 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20  ,.and will also 
9ad0: 66 6f 72 63 65 20 74 68 65 20 76 65 72 69 66 79  force the verify
9ae0: 20 6d 65 74 68 6f 64 20 69 6e 20 5c 66 42 74 6c   method in \fBtl
9af0: 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 20 74  s::callback\fR t
9b00: 6f 20 61 63 63 65 70 74 20 74 68 65 0a 63 65 72  o accept the.cer
9b10: 74 69 66 69 63 61 74 65 2c 20 65 76 65 6e 20 69  tificate, even i
9b20: 66 20 69 74 20 69 73 20 69 6e 76 61 6c 69 64 20  f it is invalid 
9b30: 77 68 65 6e 20 74 68 65 20 5c 66 42 2d 76 61 6c  when the \fB-val
9b40: 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66 52 0a  idatecommand\fR.
9b50: 6f 70 74 69 6f 6e 20 69 73 20 73 65 74 20 74 6f  option is set to
9b60: 20 5c 66 42 74 6c 73 3a 3a 76 61 6c 69 64 61 74   \fBtls::validat
9b70: 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52 5c 26 2e 0a  e_command\fR\&..
9b80: 2e 50 50 0a 5c 66 49 54 68 65 20 75 73 65 20 6f  .PP.\fIThe use o
9b90: 66 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 5c  f the variable \
9ba0: 66 42 74 6c 73 3a 3a 64 65 62 75 67 5c 66 52 20  fBtls::debug\fR 
9bb0: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64  is not recommend
9bc0: 65 64 5c 26 2e 0a 49 74 20 6d 61 79 20 62 65 20  ed\&..It may be 
9bd0: 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 66 75 74  removed from fut
9be0: 75 72 65 20 72 65 6c 65 61 73 65 73 5c 26 2e 5c  ure releases\&.\
9bf0: 66 52 0a 2e 53 48 20 22 48 54 54 50 20 50 41 43  fR..SH "HTTP PAC
9c00: 4b 41 47 45 20 45 58 41 4d 50 4c 45 53 22 0a 54  KAGE EXAMPLES".T
9c10: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 65  he following are
9c20: 20 65 78 61 6d 70 6c 65 20 73 63 72 69 70 74 73   example scripts
9c30: 20 74 6f 20 64 6f 77 6e 6c 6f 61 64 20 61 20 77   to download a w
9c40: 65 62 70 61 67 65 20 61 6e 64 20 66 69 6c 65 20  ebpage and file 
9c50: 75 73 69 6e 67 20 74 68 65 0a 68 74 74 70 20 70  using the.http p
9c60: 61 63 6b 61 67 65 5c 26 2e 20 53 65 65 20 5c 66  ackage\&. See \f
9c70: 42 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c  BCertificate Val
9c80: 69 64 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 77  idation\fR for w
9c90: 68 65 74 68 65 72 20 74 68 65 0a 5c 66 42 2d 63  hether the.\fB-c
9ca0: 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61 66  adir\fR, \fB-caf
9cb0: 69 6c 65 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d  ile\fR, and \fB-
9cc0: 63 61 73 74 6f 72 65 5c 66 52 20 6f 70 74 69 6f  castore\fR optio
9cd0: 6e 73 20 61 72 65 20 61 6c 73 6f 0a 6e 65 65 64  ns are also.need
9ce0: 65 64 5c 26 2e 20 53 65 65 20 74 68 65 20 64 65  ed\&. See the de
9cf0: 6d 6f 73 20 64 69 72 65 63 74 6f 72 79 20 66 6f  mos directory fo
9d00: 72 20 6d 6f 72 65 20 65 78 61 6d 70 6c 65 20 73  r more example s
9d10: 63 72 69 70 74 73 5c 26 2e 0a 2e 50 50 0a 45 78  cripts\&...PP.Ex
9d20: 61 6d 70 6c 65 20 23 31 3a 20 44 6f 77 6e 6c 6f  ample #1: Downlo
9d30: 61 64 20 61 20 77 65 62 20 70 61 67 65 0a 2e 43  ad a web page..C
9d40: 53 0a 0a 0a 0a 70 61 63 6b 61 67 65 20 72 65 71  S....package req
9d50: 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67  uire http.packag
9d60: 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 73  e require tls..s
9d70: 65 74 20 75 72 6c 20 22 68 74 74 70 73 3a 2f 2f  et url "https://
9d80: 77 77 77 5c 26 2e 74 63 6c 5c 26 2e 74 6b 2f 22  www\&.tcl\&.tk/"
9d90: 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20  .http::register 
9da0: 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20  https 443 [list 
9db0: 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61  ::tls::socket -a
9dc0: 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 31 20  utoservername 1 
9dd0: 2d 72 65 71 75 69 72 65 20 31 5d 0a 0a 23 20 47  -require 1]..# G
9de0: 65 74 20 55 52 4c 0a 73 65 74 20 74 6f 6b 65 6e  et URL.set token
9df0: 20 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 24   [http::geturl $
9e00: 75 72 6c 5d 0a 0a 23 20 43 68 65 63 6b 20 66 6f  url]..# Check fo
9e10: 72 20 65 72 72 6f 72 0a 69 66 20 7b 5b 68 74 74  r error.if {[htt
9e20: 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e  p::status $token
9e30: 5d 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a 20 20 20  ] ne "ok"} {.   
9e40: 20 70 75 74 73 20 5b 66 6f 72 6d 61 74 20 22 45   puts [format "E
9e50: 72 72 6f 72 20 25 73 22 20 5b 68 74 74 70 3a 3a  rror %s" [http::
9e60: 73 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d 5d 0a  status $token]].
9e70: 7d 0a 0a 23 20 53 61 76 65 20 77 65 62 20 70 61  }..# Save web pa
9e80: 67 65 20 74 6f 20 66 69 6c 65 0a 73 65 74 20 63  ge to file.set c
9e90: 68 20 5b 6f 70 65 6e 20 65 78 61 6d 70 6c 65 5c  h [open example\
9ea0: 26 2e 68 74 6d 6c 20 77 62 5d 0a 70 75 74 73 20  &.html wb].puts 
9eb0: 24 63 68 20 5b 68 74 74 70 3a 3a 64 61 74 61 20  $ch [http::data 
9ec0: 24 74 6f 6b 65 6e 5d 0a 63 6c 6f 73 65 20 24 63  $token].close $c
9ed0: 68 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 3a 3a 68  h..# Cleanup.::h
9ee0: 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20 24 74 6f  ttp::cleanup $to
9ef0: 6b 65 6e 0a 0a 2e 43 45 0a 45 78 61 6d 70 6c 65  ken...CE.Example
9f00: 20 23 32 3a 20 44 6f 77 6e 6c 6f 61 64 20 61 20   #2: Download a 
9f10: 66 69 6c 65 0a 2e 43 53 0a 0a 0a 0a 70 61 63 6b  file..CS....pack
9f20: 61 67 65 20 72 65 71 75 69 72 65 20 68 74 74 70  age require http
9f30: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  .package require
9f40: 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c 20 22 68   tls..set url "h
9f50: 74 74 70 73 3a 2f 2f 77 69 6b 69 5c 26 2e 74 63  ttps://wiki\&.tc
9f60: 6c 2d 6c 61 6e 67 5c 26 2e 6f 72 67 2f 73 69 74  l-lang\&.org/sit
9f70: 65 6d 61 70 5c 26 2e 78 6d 6c 22 0a 68 74 74 70  emap\&.xml".http
9f80: 3a 3a 72 65 67 69 73 74 65 72 20 68 74 74 70 73  ::register https
9f90: 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74 6c 73   443 [list ::tls
9fa0: 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65  ::socket -autose
9fb0: 72 76 65 72 6e 61 6d 65 20 31 20 2d 72 65 71 75  rvername 1 -requ
9fc0: 69 72 65 20 31 5d 0a 0a 23 20 4f 70 65 6e 20 6f  ire 1]..# Open o
9fd0: 75 74 70 75 74 20 66 69 6c 65 0a 73 65 74 20 66  utput file.set f
9fe0: 69 6c 65 6e 61 6d 65 20 5b 66 69 6c 65 20 74 61  ilename [file ta
9ff0: 69 6c 20 24 75 72 6c 5d 0a 73 65 74 20 63 68 20  il $url].set ch 
a000: 5b 6f 70 65 6e 20 24 66 69 6c 65 6e 61 6d 65 20  [open $filename 
a010: 77 62 5d 0a 0a 23 20 47 65 74 20 66 69 6c 65 0a  wb]..# Get file.
a020: 73 65 74 20 74 6f 6b 65 6e 20 5b 3a 3a 68 74 74  set token [::htt
a030: 70 3a 3a 67 65 74 75 72 6c 20 24 75 72 6c 20 2d  p::geturl $url -
a040: 62 6c 6f 63 6b 73 69 7a 65 20 36 35 35 33 36 20  blocksize 65536 
a050: 2d 63 68 61 6e 6e 65 6c 20 24 63 68 5d 0a 0a 23  -channel $ch]..#
a060: 20 43 68 65 63 6b 20 66 6f 72 20 65 72 72 6f 72   Check for error
a070: 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73 74 61 74  .if {[http::stat
a080: 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65 20 22 6f  us $token] ne "o
a090: 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74 73 20 5b  k"} {.    puts [
a0a0: 66 6f 72 6d 61 74 20 22 45 72 72 6f 72 20 25 73  format "Error %s
a0b0: 22 20 5b 68 74 74 70 3a 3a 73 74 61 74 75 73 20  " [http::status 
a0c0: 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20 43 6c  $token]].}..# Cl
a0d0: 65 61 6e 75 70 0a 63 6c 6f 73 65 20 24 63 68 0a  eanup.close $ch.
a0e0: 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20  ::http::cleanup 
a0f0: 24 74 6f 6b 65 6e 0a 0a 2e 43 45 0a 2e 53 48 20  $token...CE..SH 
a100: 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45  "SPECIAL CONSIDE
a110: 52 41 54 49 4f 4e 53 22 0a 54 68 65 20 63 61 70  RATIONS".The cap
a120: 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74 68 69  abilities of thi
a130: 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20 76 61  s package can va
a140: 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 62 61  ry enormously ba
a150: 73 65 64 20 75 70 6f 6e 20 68 6f 77 20 74 68 65  sed upon how the
a160: 0a 6c 69 6e 6b 65 64 20 74 6f 20 4f 70 65 6e 53  .linked to OpenS
a170: 53 4c 20 6c 69 62 72 61 72 79 20 77 61 73 20 63  SL library was c
a180: 6f 6e 66 69 67 75 72 65 64 20 61 6e 64 20 62 75  onfigured and bu
a190: 69 6c 74 5c 26 2e 20 4e 65 77 20 76 65 72 73 69  ilt\&. New versi
a1a0: 6f 6e 73 20 6d 61 79 20 6f 62 73 6f 6c 65 74 65  ons may obsolete
a1b0: 0a 6f 6c 64 65 72 20 70 72 6f 74 6f 63 6f 6c 20  .older protocol 
a1c0: 76 65 72 73 69 6f 6e 73 2c 20 61 64 64 20 6f 72  versions, add or
a1d0: 20 72 65 6d 6f 76 65 20 63 69 70 68 65 72 73 2c   remove ciphers,
a1e0: 20 63 68 61 6e 67 65 20 64 65 66 61 75 6c 74 20   change default 
a1f0: 76 61 6c 75 65 73 2c 20 65 74 63 5c 26 2e 0a 55  values, etc\&..U
a200: 73 65 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 70  se the \fBtls::p
a210: 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d  rotocols\fR comm
a220: 61 6e 64 73 20 74 6f 20 6f 62 74 61 69 6e 20 74  ands to obtain t
a230: 68 65 20 73 75 70 70 6f 72 74 65 64 0a 70 72 6f  he supported.pro
a240: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 73 5c 26  tocol versions\&
a250: 2e 0a 2e 53 48 20 22 53 45 45 20 41 4c 53 4f 22  ...SH "SEE ALSO"
a260: 0a 5c 66 49 4f 70 65 6e 53 53 4c 5c 66 52 20 5b  .\fIOpenSSL\fR [
a270: 68 74 74 70 73 3a 2f 2f 77 77 77 5c 26 2e 6f 70  https://www\&.op
a280: 65 6e 73 73 6c 5c 26 2e 6f 72 67 2f 5d 2c 20 68  enssl\&.org/], h
a290: 74 74 70 2c 20 73 6f 63 6b 65 74 0a 2e 53 48 20  ttp, socket..SH 
a2a0: 4b 45 59 57 4f 52 44 53 0a 49 2f 4f 2c 20 49 50  KEYWORDS.I/O, IP
a2b0: 20 41 64 64 72 65 73 73 2c 20 4f 70 65 6e 53 53   Address, OpenSS
a2c0: 4c 2c 20 53 53 4c 2c 20 54 43 50 2c 20 54 4c 53  L, SSL, TCP, TLS
a2d0: 2c 20 54 63 6c 54 4c 53 2c 20 61 73 79 6e 63 68  , TclTLS, asynch
a2e0: 72 6f 6e 6f 75 73 20 49 2f 4f 2c 20 62 69 6e 64  ronous I/O, bind
a2f0: 2c 20 63 65 72 74 69 66 69 63 61 74 65 2c 20 63  , certificate, c
a300: 68 61 6e 6e 65 6c 2c 20 63 6f 6e 6e 65 63 74 69  hannel, connecti
a310: 6f 6e 2c 20 64 6f 6d 61 69 6e 20 6e 61 6d 65 2c  on, domain name,
a320: 20 68 6f 73 74 2c 20 68 74 74 70 73 2c 20 6e 65   host, https, ne
a330: 74 77 6f 72 6b 2c 20 6e 65 74 77 6f 72 6b 20 61  twork, network a
a340: 64 64 72 65 73 73 2c 20 73 6f 63 6b 65 74 2c 20  ddress, socket, 
a350: 74 6c 73 0a 2e 53 48 20 43 41 54 45 47 4f 52 59  tls..SH CATEGORY
a360: 0a 74 6c 73 0a 2e 53 48 20 43 4f 50 59 52 49 47  .tls..SH COPYRIG
a370: 48 54 0a 2e 6e 66 0a 43 6f 70 79 72 69 67 68 74  HT..nf.Copyright
a380: 20 28 63 29 20 31 39 39 39 20 4d 61 74 74 20 4e   (c) 1999 Matt N
a390: 65 77 6d 61 6e 0a 43 6f 70 79 72 69 67 68 74 20  ewman.Copyright 
a3a0: 28 63 29 20 32 30 30 34 20 53 74 61 72 66 69 73  (c) 2004 Starfis
a3b0: 68 20 53 79 73 74 65 6d 73 0a 43 6f 70 79 72 69  h Systems.Copyri
a3c0: 67 68 74 20 28 63 29 20 32 30 32 34 20 42 72 69  ght (c) 2024 Bri
a3d0: 61 6e 20 4f 27 48 61 67 61 6e 0a 0a 2e 66 69 0a  an O'Hagan...fi.