Hex Artifact Content

Artifact 14300cf9488e8d0951a24ec291406de9e963d310779f63b17368f29c4b55bf98:


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 44 65 66 61 75 6c 74 20 69 73 20 5c  \&. Default is \
21c0: 66 42 66 61 6c 73 65 5c 66 52 5c 26 2e 0a 2e 52  fBfalse\fR\&...R
21d0: 45 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 73 6f  E..TP.\fBtls::so
21e0: 63 6b 65 74 5c 66 52 20 5c 66 42 2d 73 65 72 76  cket\fR \fB-serv
21f0: 65 72 5c 66 52 20 5c 66 49 63 6f 6d 6d 61 6e 64  er\fR \fIcommand
2200: 5c 66 52 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 5c  \fR ?\fI-option\
2210: 66 52 3f 20 3f 5c 66 49 76 61 6c 75 65 5c 66 52  fR? ?\fIvalue\fR
2220: 3f 20 3f 5c 66 49 2d 6f 70 74 69 6f 6e 20 76 61  ? ?\fI-option va
2230: 6c 75 65 20 5c 26 2e 5c 26 2e 5c 26 2e 5c 66 52  lue \&.\&.\&.\fR
2240: 3f 20 5c 66 49 70 6f 72 74 5c 66 52 0a 53 61 6d  ? \fIport\fR.Sam
2250: 65 20 61 73 20 70 72 65 76 69 6f 75 73 2c 20 62  e as previous, b
2260: 75 74 20 69 6e 73 74 65 61 64 20 63 72 65 61 74  ut instead creat
2270: 65 73 20 61 20 73 65 72 76 65 72 20 73 6f 63 6b  es a server sock
2280: 65 74 20 66 6f 72 20 63 6c 69 65 6e 74 73 20 74  et for clients t
2290: 6f 20 63 6f 6e 6e 65 63 74 20 74 6f 0a 6a 75 73  o connect to.jus
22a0: 74 20 6c 69 6b 65 20 74 68 65 20 54 63 6c 20 5c  t like the Tcl \
22b0: 66 42 73 6f 63 6b 65 74 20 2d 73 65 72 76 65 72  fBsocket -server
22c0: 5c 66 52 20 63 6f 6d 6d 61 6e 64 5c 26 2e 20 49  \fR command\&. I
22d0: 74 20 72 65 74 75 72 6e 73 20 74 68 65 20 63 68  t returns the ch
22e0: 61 6e 6e 65 6c 0a 68 61 6e 64 6c 65 20 69 64 20  annel.handle id 
22f0: 66 6f 72 20 74 68 65 20 6e 65 77 20 73 6f 63 6b  for the new sock
2300: 65 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73  et\&...TP.\fBtls
2310: 3a 3a 69 6d 70 6f 72 74 5c 66 52 20 5c 66 49 63  ::import\fR \fIc
2320: 68 61 6e 6e 65 6c 5c 66 52 20 3f 5c 66 49 2d 6f  hannel\fR ?\fI-o
2330: 70 74 69 6f 6e 5c 66 52 3f 20 3f 5c 66 49 76 61  ption\fR? ?\fIva
2340: 6c 75 65 5c 66 52 3f 20 3f 5c 66 49 2d 6f 70 74  lue\fR? ?\fI-opt
2350: 69 6f 6e 20 76 61 6c 75 65 20 5c 26 2e 5c 26 2e  ion value \&.\&.
2360: 5c 26 2e 5c 66 52 3f 0a 53 74 61 72 74 20 54 4c  \&.\fR?.Start TL
2370: 53 20 65 6e 63 72 79 70 74 69 6f 6e 20 6f 6e 20  S encryption on 
2380: 54 43 4c 20 63 68 61 6e 6e 65 6c 20 5c 66 49 63  TCL channel \fIc
2390: 68 61 6e 6e 65 6c 5c 66 52 20 76 69 61 20 61 20  hannel\fR via a 
23a0: 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 5c  stacked channel\
23b0: 26 2e 20 49 74 0a 6e 65 65 64 20 6e 6f 74 20 62  &. It.need not b
23c0: 65 20 61 20 73 6f 63 6b 65 74 2c 20 62 75 74 20  e a socket, but 
23d0: 6d 75 73 74 20 70 72 6f 76 69 64 65 20 62 69 2d  must provide bi-
23e0: 64 69 72 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77  directional flow
23f0: 5c 26 2e 20 41 6c 73 6f 20 73 65 74 73 20 73 65  \&. Also sets se
2400: 73 73 69 6f 6e 0a 70 61 72 61 6d 65 74 65 72 73  ssion.parameters
2410: 20 66 6f 72 20 53 53 4c 20 68 61 6e 64 73 68 61   for SSL handsha
2420: 6b 65 5c 26 2e 20 56 61 6c 69 64 20 6f 70 74 69  ke\&. Valid opti
2430: 6f 6e 73 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50  ons are:..RS..TP
2440: 0a 5c 66 42 2d 61 6c 70 6e 5c 66 52 20 5c 66 49  .\fB-alpn\fR \fI
2450: 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20  list\fR.List of 
2460: 70 72 6f 74 6f 63 6f 6c 73 20 74 6f 20 6f 66 66  protocols to off
2470: 65 72 20 64 75 72 69 6e 67 20 41 70 70 6c 69 63  er during Applic
2480: 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74  ation-Layer Prot
2490: 6f 63 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e  ocol Negotiation
24a0: 0a 28 41 4c 50 4e 29 5c 26 2e 20 46 6f 72 20 65  .(ALPN)\&. For e
24b0: 78 61 6d 70 6c 65 3a 20 5c 66 42 68 32 5c 66 52  xample: \fBh2\fR
24c0: 20 61 6e 64 20 5c 66 42 68 74 74 70 2f 31 5c 26   and \fBhttp/1\&
24d0: 2e 31 5c 66 52 2c 20 62 75 74 20 6e 6f 74 20 5c  .1\fR, but not \
24e0: 66 42 68 33 5c 66 52 20 6f 72 0a 5c 66 42 71 75  fBh3\fR or.\fBqu
24f0: 69 63 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c 66 42  ic\fR\&...TP.\fB
2500: 2d 63 61 64 69 72 5c 66 52 20 5c 66 49 64 69 72  -cadir\fR \fIdir
2510: 65 63 74 6f 72 79 5c 66 52 0a 53 70 65 63 69 66  ectory\fR.Specif
2520: 69 65 73 20 74 68 65 20 64 69 72 65 63 74 6f 72  ies the director
2530: 79 20 77 68 65 72 65 20 74 68 65 20 43 65 72 74  y where the Cert
2540: 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74  ificate Authorit
2550: 79 20 28 43 41 29 20 63 65 72 74 69 66 69 63 61  y (CA) certifica
2560: 74 65 73 20 61 72 65 0a 73 74 6f 72 65 64 5c 26  tes are.stored\&
2570: 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73  . The default is
2580: 20 70 6c 61 74 66 6f 72 6d 20 73 70 65 63 69 66   platform specif
2590: 69 63 20 61 6e 64 20 63 61 6e 20 62 65 20 73 65  ic and can be se
25a0: 74 20 61 74 20 63 6f 6d 70 69 6c 65 20 74 69 6d  t at compile tim
25b0: 65 5c 26 2e 20 54 68 65 0a 64 65 66 61 75 6c 74  e\&. The.default
25c0: 20 6c 6f 63 61 74 69 6f 6e 20 63 61 6e 20 62 65   location can be
25d0: 20 6f 76 65 72 72 69 64 64 65 6e 20 62 79 20 74   overridden by t
25e0: 68 65 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44  he \fBSSL_CERT_D
25f0: 49 52 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e  IR\fR environmen
2600: 74 0a 76 61 72 69 61 62 6c 65 5c 26 2e 20 53 65  t.variable\&. Se
2610: 65 20 5c 66 42 43 65 72 74 69 66 69 63 61 74 65  e \fBCertificate
2620: 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52 20 66   Validation\fR f
2630: 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 5c  or more details\
2640: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 66 69 6c  &...TP.\fB-cafil
2650: 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e 61 6d 65  e\fR \fIfilename
2660: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
2670: 65 20 66 69 6c 65 20 77 69 74 68 20 74 68 65 20  e file with the 
2680: 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68  Certificate Auth
2690: 6f 72 69 74 79 20 28 43 41 29 20 63 65 72 74 69  ority (CA) certi
26a0: 66 69 63 61 74 65 73 20 74 6f 20 75 73 65 20 69  ficates to use i
26b0: 6e 0a 5c 66 42 50 45 4d 5c 66 52 20 66 69 6c 65  n.\fBPEM\fR file
26c0: 20 66 6f 72 6d 61 74 5c 26 2e 20 54 68 65 20 64   format\&. The d
26d0: 65 66 61 75 6c 74 20 69 73 20 22 5c 66 49 63 65  efault is "\fIce
26e0: 72 74 5c 26 2e 70 65 6d 5c 66 52 22 2c 20 69 6e  rt\&.pem\fR", in
26f0: 20 74 68 65 20 4f 70 65 6e 53 53 4c 0a 64 69 72   the OpenSSL.dir
2700: 65 63 74 6f 72 79 5c 26 2e 20 54 68 65 20 64 65  ectory\&. The de
2710: 66 61 75 6c 74 20 66 69 6c 65 20 63 61 6e 20 62  fault file can b
2720: 65 20 6f 76 65 72 72 69 64 64 65 6e 20 62 79 20  e overridden by 
2730: 74 68 65 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f  the \fBSSL_CERT_
2740: 46 49 4c 45 5c 66 52 20 65 6e 76 69 72 6f 6e 6d  FILE\fR environm
2750: 65 6e 74 0a 76 61 72 69 61 62 6c 65 5c 26 2e 20  ent.variable\&. 
2760: 53 65 65 20 5c 66 42 43 65 72 74 69 66 69 63 61  See \fBCertifica
2770: 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c 66 52  te Validation\fR
2780: 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c   for more detail
2790: 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 73  s\&...TP.\fB-cas
27a0: 74 6f 72 65 5c 66 52 20 5c 66 49 55 52 49 5c 66  tore\fR \fIURI\f
27b0: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
27c0: 55 6e 69 66 6f 72 6d 20 52 65 73 6f 75 72 63 65  Uniform Resource
27d0: 20 49 64 65 6e 74 69 66 69 65 72 20 28 55 52 49   Identifier (URI
27e0: 29 20 66 6f 72 20 74 68 65 20 43 65 72 74 69 66  ) for the Certif
27f0: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 0a  icate Authority.
2800: 28 43 41 29 20 73 74 6f 72 65 2c 20 77 68 69 63  (CA) store, whic
2810: 68 20 6d 61 79 20 62 65 20 61 20 73 69 6e 67 6c  h may be a singl
2820: 65 20 63 6f 6e 74 61 69 6e 65 72 20 6f 72 20 61  e container or a
2830: 20 63 61 74 61 6c 6f 67 20 6f 66 20 63 6f 6e 74   catalog of cont
2840: 61 69 6e 65 72 73 5c 26 2e 0a 53 74 61 72 74 69  ainers\&..Starti
2850: 6e 67 20 77 69 74 68 20 4f 70 65 6e 53 53 4c 20  ng with OpenSSL 
2860: 33 5c 26 2e 32 20 6f 6e 20 4d 53 20 57 69 6e 64  3\&.2 on MS Wind
2870: 6f 77 73 2c 20 73 65 74 20 74 6f 20 22 5c 66 42  ows, set to "\fB
2880: 6f 72 67 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e  org\&.openssl\&.
2890: 77 69 6e 73 74 6f 72 65 3a 2f 2f 5c 66 52 22 0a  winstore://\fR".
28a0: 74 6f 20 75 73 65 20 74 68 65 20 62 75 69 6c 74  to use the built
28b0: 2d 69 6e 20 4d 53 20 57 69 6e 64 6f 77 73 20 43  -in MS Windows C
28c0: 65 72 74 69 66 69 63 61 74 65 20 53 74 6f 72 65  ertificate Store
28d0: 5c 26 2e 20 53 65 65 0a 5c 66 42 43 65 72 74 69  \&. See.\fBCerti
28e0: 66 69 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f  ficate Validatio
28f0: 6e 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65  n\fR for more de
2900: 74 61 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  tails\&...TP.\fB
2910: 2d 63 65 72 74 66 69 6c 65 5c 66 52 20 5c 66 49  -certfile\fR \fI
2920: 66 69 6c 65 6e 61 6d 65 5c 66 52 0a 53 70 65 63  filename\fR.Spec
2930: 69 66 69 65 73 20 74 68 65 20 6e 61 6d 65 20 6f  ifies the name o
2940: 66 20 74 68 65 20 66 69 6c 65 20 77 69 74 68 20  f the file with 
2950: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20  the certificate 
2960: 74 6f 20 75 73 65 20 69 6e 20 50 45 4d 20 66 6f  to use in PEM fo
2970: 72 6d 61 74 0a 61 73 20 74 68 65 20 6c 6f 63 61  rmat.as the loca
2980: 6c 20 28 63 6c 69 65 6e 74 20 6f 72 20 73 65 72  l (client or ser
2990: 76 65 72 29 20 63 65 72 74 69 66 69 63 61 74 65  ver) certificate
29a0: 5c 26 2e 20 49 74 20 61 6c 73 6f 20 63 6f 6e 74  \&. It also cont
29b0: 61 69 6e 73 20 74 68 65 20 70 75 62 6c 69 63 20  ains the public 
29c0: 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63  key\&...TP.\fB-c
29d0: 65 72 74 5c 66 52 20 5c 66 49 73 74 72 69 6e 67  ert\fR \fIstring
29e0: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
29f0: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 74 6f  e certificate to
2a00: 20 75 73 65 20 61 73 20 61 20 44 45 52 20 65 6e   use as a DER en
2a10: 63 6f 64 65 64 20 73 74 72 69 6e 67 20 28 58 5c  coded string (X\
2a20: 26 2e 35 30 39 20 44 45 52 29 5c 26 2e 0a 2e 54  &.509 DER)\&...T
2a30: 50 0a 5c 66 42 2d 63 69 70 68 65 72 5c 66 52 20  P.\fB-cipher\fR 
2a40: 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 53 70 65  \fIstring\fR.Spe
2a50: 63 69 66 69 65 73 20 74 68 65 20 6c 69 73 74 20  cifies the list 
2a60: 6f 66 20 63 69 70 68 65 72 73 20 74 6f 20 75 73  of ciphers to us
2a70: 65 20 66 6f 72 20 54 4c 53 20 31 5c 26 2e 32 20  e for TLS 1\&.2 
2a80: 61 6e 64 20 65 61 72 6c 69 65 72 20 63 6f 6e 6e  and earlier conn
2a90: 65 63 74 69 6f 6e 73 5c 26 2e 0a 53 74 72 69 6e  ections\&..Strin
2aa0: 67 20 69 73 20 61 20 63 6f 6c 6f 6e 20 22 5c 66  g is a colon "\f
2ab0: 42 3a 5c 66 52 22 20 73 65 70 61 72 61 74 65 64  B:\fR" separated
2ac0: 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72 73   list of ciphers
2ad0: 5c 26 2e 0a 43 69 70 68 65 72 73 20 63 61 6e 20  \&..Ciphers can 
2ae0: 62 65 20 63 6f 6d 62 69 6e 65 64 20 75 73 69 6e  be combined usin
2af0: 67 20 74 68 65 20 22 5c 66 42 2b 5c 66 52 22 20  g the "\fB+\fR" 
2b00: 63 68 61 72 61 63 74 65 72 5c 26 2e 0a 50 72 65  character\&..Pre
2b10: 66 69 78 65 73 20 63 61 6e 20 62 65 20 75 73 65  fixes can be use
2b20: 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79  d to permanently
2b30: 20 72 65 6d 6f 76 65 20 22 5c 66 42 21 5c 66 52   remove "\fB!\fR
2b40: 22 2c 20 64 65 6c 65 74 65 20 22 5c 66 42 2d 5c  ", delete "\fB-\
2b50: 66 52 22 2c 20 6f 72 0a 6d 6f 76 65 20 74 6f 20  fR", or.move to 
2b60: 74 68 65 20 65 6e 64 20 22 5c 66 42 2b 5c 66 52  the end "\fB+\fR
2b70: 22 20 61 20 73 70 65 63 69 66 69 65 64 20 63 69  " a specified ci
2b80: 70 68 65 72 5c 26 2e 0a 4b 65 79 77 6f 72 64 73  pher\&..Keywords
2b90: 20 5c 66 42 40 53 54 52 45 4e 47 54 48 5c 66 52   \fB@STRENGTH\fR
2ba0: 20 28 73 6f 72 74 20 62 79 20 61 6c 67 6f 72 69   (sort by algori
2bb0: 74 68 6d 20 6b 65 79 20 6c 65 6e 67 74 68 29 2c  thm key length),
2bc0: 0a 5c 66 42 40 53 45 43 4c 45 56 45 4c 3d 5c 66  .\fB@SECLEVEL=\f
2bd0: 52 5c 66 49 6e 5c 66 52 20 28 73 65 74 20 73 65  R\fIn\fR (set se
2be0: 63 75 72 69 74 79 20 6c 65 76 65 6c 20 74 6f 20  curity level to 
2bf0: 6e 29 2c 20 61 6e 64 0a 5c 66 42 44 45 46 41 55  n), and.\fBDEFAU
2c00: 4c 54 5c 66 52 20 28 75 73 65 20 64 65 66 61 75  LT\fR (use defau
2c10: 6c 74 20 63 69 70 68 65 72 20 6c 69 73 74 2c 20  lt cipher list, 
2c20: 61 74 20 73 74 61 72 74 20 6f 6e 6c 79 29 20 63  at start only) c
2c30: 61 6e 20 61 6c 73 6f 20 62 65 20 73 70 65 63 69  an also be speci
2c40: 66 69 65 64 5c 26 2e 0a 53 65 65 20 74 68 65 20  fied\&..See the 
2c50: 5c 66 49 4f 70 65 6e 53 53 4c 5c 66 52 20 5b 68  \fIOpenSSL\fR [h
2c60: 74 74 70 73 3a 2f 2f 64 6f 63 73 5c 26 2e 6f 70  ttps://docs\&.op
2c70: 65 6e 73 73 6c 5c 26 2e 6f 72 67 2f 6d 61 73 74  enssl\&.org/mast
2c80: 65 72 2f 6d 61 6e 31 2f 6f 70 65 6e 73 73 6c 2d  er/man1/openssl-
2c90: 63 69 70 68 65 72 73 2f 23 6f 70 74 69 6f 6e 73  ciphers/#options
2ca0: 5d 0a 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20  ].documentation 
2cb0: 66 6f 72 20 74 68 65 20 66 75 6c 6c 20 6c 69 73  for the full lis
2cc0: 74 20 6f 66 20 76 61 6c 69 64 20 76 61 6c 75 65  t of valid value
2cd0: 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 69 70  s\&...TP.\fB-cip
2ce0: 68 65 72 73 75 69 74 65 73 5c 66 52 20 5c 66 49  hersuites\fR \fI
2cf0: 73 74 72 69 6e 67 5c 66 52 0a 53 70 65 63 69 66  string\fR.Specif
2d00: 69 65 73 20 74 68 65 20 6c 69 73 74 20 6f 66 20  ies the list of 
2d10: 63 69 70 68 65 72 20 73 75 69 74 65 73 20 74 6f  cipher suites to
2d20: 20 75 73 65 20 66 6f 72 20 54 4c 53 20 31 5c 26   use for TLS 1\&
2d30: 2e 33 20 61 73 20 61 20 63 6f 6c 6f 6e 0a 22 5c  .3 as a colon."\
2d40: 66 42 3a 5c 66 52 22 20 73 65 70 61 72 61 74 65  fB:\fR" separate
2d50: 64 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72  d list of cipher
2d60: 20 73 75 69 74 65 20 6e 61 6d 65 73 5c 26 2e 20   suite names\&. 
2d70: 53 65 65 20 74 68 65 0a 5c 66 49 4f 70 65 6e 53  See the.\fIOpenS
2d80: 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a 2f 2f 64  SL\fR [https://d
2d90: 6f 63 73 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e  ocs\&.openssl\&.
2da0: 6f 72 67 2f 6d 61 73 74 65 72 2f 6d 61 6e 31 2f  org/master/man1/
2db0: 6f 70 65 6e 73 73 6c 2d 63 69 70 68 65 72 73 2f  openssl-ciphers/
2dc0: 23 6f 70 74 69 6f 6e 73 5d 0a 64 6f 63 75 6d 65  #options].docume
2dd0: 6e 74 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20  ntation for the 
2de0: 66 75 6c 6c 20 6c 69 73 74 20 6f 66 20 76 61 6c  full list of val
2df0: 69 64 20 76 61 6c 75 65 73 5c 26 2e 0a 2e 54 50  id values\&...TP
2e00: 0a 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 20  .\fB-command\fR 
2e10: 5c 66 49 63 61 6c 6c 62 61 63 6b 5c 66 52 0a 53  \fIcallback\fR.S
2e20: 70 65 63 69 66 69 65 73 20 74 68 65 20 63 61 6c  pecifies the cal
2e30: 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f  lback command to
2e40: 20 62 65 20 69 6e 76 6f 6b 65 64 20 61 74 20 73   be invoked at s
2e50: 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 75  everal points du
2e60: 72 69 6e 67 20 74 68 65 0a 68 61 6e 64 73 68 61  ring the.handsha
2e70: 6b 65 20 74 6f 20 70 61 73 73 20 65 72 72 6f 72  ke to pass error
2e80: 73 2c 20 74 72 61 63 69 6e 67 20 69 6e 66 6f 72  s, tracing infor
2e90: 6d 61 74 69 6f 6e 2c 20 61 6e 64 20 70 72 6f 74  mation, and prot
2ea0: 6f 63 6f 6c 20 6d 65 73 73 61 67 65 73 5c 26 2e  ocol messages\&.
2eb0: 0a 53 65 65 20 5c 66 42 43 61 6c 6c 62 61 63 6b  .See \fBCallback
2ec0: 20 4f 70 74 69 6f 6e 73 5c 66 52 20 66 6f 72 20   Options\fR for 
2ed0: 6d 6f 72 65 20 69 6e 66 6f 5c 26 2e 0a 2e 54 50  more info\&...TP
2ee0: 0a 5c 66 42 2d 64 68 70 61 72 61 6d 73 5c 66 52  .\fB-dhparams\fR
2ef0: 20 5c 66 49 66 69 6c 65 6e 61 6d 65 5c 66 52 0a   \fIfilename\fR.
2f00: 53 70 65 63 69 66 69 65 73 20 74 68 65 20 44 69  Specifies the Di
2f10: 66 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 28 44 48  ffie-Hellman (DH
2f20: 29 20 70 61 72 61 6d 65 74 65 72 73 20 66 69 6c  ) parameters fil
2f30: 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65 79  e\&...TP.\fB-key
2f40: 66 69 6c 65 5c 66 52 20 5c 66 49 66 69 6c 65 6e  file\fR \fIfilen
2f50: 61 6d 65 5c 66 52 0a 53 70 65 63 69 66 69 65 73  ame\fR.Specifies
2f60: 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79   the private key
2f70: 20 66 69 6c 65 5c 26 2e 20 54 68 65 20 64 65 66   file\&. The def
2f80: 61 75 6c 74 20 69 73 20 74 6f 20 75 73 65 20 74  ault is to use t
2f90: 68 65 20 66 69 6c 65 0a 73 70 65 63 69 66 69 65  he file.specifie
2fa0: 64 20 62 79 20 74 68 65 20 5c 66 49 2d 63 65 72  d by the \fI-cer
2fb0: 74 66 69 6c 65 5c 66 52 20 6f 70 74 69 6f 6e 5c  tfile\fR option\
2fc0: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 6b 65 79 5c 66  &...TP.\fB-key\f
2fd0: 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 53  R \fIstring\fR.S
2fe0: 70 65 63 69 66 69 65 73 20 74 68 65 20 70 72 69  pecifies the pri
2ff0: 76 61 74 65 20 6b 65 79 20 74 6f 20 75 73 65 20  vate key to use 
3000: 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64  as a DER encoded
3010: 20 73 74 72 69 6e 67 20 28 50 4b 43 53 23 31 20   string (PKCS#1 
3020: 44 45 52 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d  DER)\&...TP.\fB-
3030: 6d 6f 64 65 6c 5c 66 52 20 5c 66 49 63 68 61 6e  model\fR \fIchan
3040: 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 20 74 68 69  nel\fR.Force thi
3050: 73 20 63 68 61 6e 6e 65 6c 20 74 6f 20 73 68 61  s channel to sha
3060: 72 65 20 74 68 65 20 73 61 6d 65 20 5c 66 49 53  re the same \fIS
3070: 53 4c 5f 43 54 58 5c 66 52 20 73 74 72 75 63 74  SL_CTX\fR struct
3080: 75 72 65 20 61 73 20 74 68 65 0a 73 70 65 63 69  ure as the.speci
3090: 66 69 65 64 20 5c 66 49 63 68 61 6e 6e 65 6c 5c  fied \fIchannel\
30a0: 66 52 2c 20 61 6e 64 20 74 68 65 72 65 66 6f 72  fR, and therefor
30b0: 65 20 73 68 61 72 65 20 63 6f 6e 66 69 67 2c 20  e share config, 
30c0: 63 61 6c 6c 62 61 63 6b 73 2c 20 65 74 63 5c 26  callbacks, etc\&
30d0: 2e 0a 2e 54 50 0a 5c 66 42 2d 70 61 73 73 77 6f  ...TP.\fB-passwo
30e0: 72 64 5c 66 52 20 5c 66 49 63 61 6c 6c 62 61 63  rd\fR \fIcallbac
30f0: 6b 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74  k\fR.Specifies t
3100: 68 65 20 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d  he callback comm
3110: 61 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20 77 68  and to invoke wh
3120: 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73  en OpenSSL needs
3130: 20 74 6f 20 6f 62 74 61 69 6e 20 61 0a 70 61 73   to obtain a.pas
3140: 73 77 6f 72 64 5c 26 2e 20 54 68 69 73 20 69 73  sword\&. This is
3150: 20 74 79 70 69 63 61 6c 6c 79 20 75 73 65 64 20   typically used 
3160: 74 6f 20 75 6e 6c 6f 63 6b 20 74 68 65 20 70 72  to unlock the pr
3170: 69 76 61 74 65 20 6b 65 79 20 6f 66 20 61 20 63  ivate key of a c
3180: 65 72 74 69 66 69 63 61 74 65 5c 26 2e 0a 54 68  ertificate\&..Th
3190: 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c  e callback shoul
31a0: 64 20 72 65 74 75 72 6e 20 61 20 70 61 73 73 77  d return a passw
31b0: 6f 72 64 20 73 74 72 69 6e 67 5c 26 2e 20 53 65  ord string\&. Se
31c0: 65 20 5c 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70  e \fBCallback Op
31d0: 74 69 6f 6e 73 5c 66 52 0a 66 6f 72 20 6d 6f 72  tions\fR.for mor
31e0: 65 20 69 6e 66 6f 5c 26 2e 0a 2e 54 50 0a 5c 66  e info\&...TP.\f
31f0: 42 2d 70 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65  B-post_handshake
3200: 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 41  \fR \fIbool\fR.A
3210: 6c 6c 6f 77 20 70 6f 73 74 2d 68 61 6e 64 73 68  llow post-handsh
3220: 61 6b 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b  ake session tick
3230: 65 74 20 75 70 64 61 74 65 73 5c 26 2e 0a 2e 54  et updates\&...T
3240: 50 0a 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52  P.\fB-request\fR
3250: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75   \fIbool\fR.Requ
3260: 65 73 74 20 61 20 63 65 72 74 69 66 69 63 61 74  est a certificat
3270: 65 20 66 72 6f 6d 20 74 68 65 20 70 65 65 72 20  e from the peer 
3280: 64 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20 68  during the SSL h
3290: 61 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68 69 73  andshake\&. This
32a0: 20 69 73 20 6e 65 65 64 65 64 0a 74 6f 20 64 6f   is needed.to do
32b0: 20 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c   Certificate Val
32c0: 69 64 61 74 69 6f 6e 5c 26 2e 20 53 74 61 72 74  idation\&. Start
32d0: 69 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c  ing in TclTLS 1\
32e0: 26 2e 38 2c 20 74 68 65 20 64 65 66 61 75 6c 74  &.8, the default
32f0: 20 69 73 0a 5c 66 42 74 72 75 65 5c 66 52 5c 26   is.\fBtrue\fR\&
3300: 2e 0a 53 65 65 20 5c 66 42 43 65 72 74 69 66 69  ..See \fBCertifi
3310: 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e 5c  cate Validation\
3320: 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61  fR for more deta
3330: 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 72  ils\&...TP.\fB-r
3340: 65 71 75 69 72 65 5c 66 52 20 5c 66 49 62 6f 6f  equire\fR \fIboo
3350: 6c 5c 66 52 0a 52 65 71 75 69 72 65 20 61 20 76  l\fR.Require a v
3360: 61 6c 69 64 20 63 65 72 74 69 66 69 63 61 74 65  alid certificate
3370: 20 66 72 6f 6d 20 74 68 65 20 70 65 65 72 20 64   from the peer d
3380: 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20 68 61  uring the SSL ha
3390: 6e 64 73 68 61 6b 65 5c 26 2e 20 49 66 20 74 68  ndshake\&. If th
33a0: 69 73 20 69 73 0a 73 65 74 20 74 6f 20 74 72 75  is is.set to tru
33b0: 65 2c 20 74 68 65 6e 20 5c 66 42 2d 72 65 71 75  e, then \fB-requ
33c0: 65 73 74 5c 66 52 20 6d 75 73 74 20 61 6c 73 6f  est\fR must also
33d0: 20 62 65 20 73 65 74 20 74 6f 20 74 72 75 65 20   be set to true 
33e0: 61 6e 64 20 61 20 65 69 74 68 65 72 0a 5c 66 42  and a either.\fB
33f0: 2d 63 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63  -cadir\fR, \fB-c
3400: 61 66 69 6c 65 5c 66 52 2c 20 5c 66 42 2d 63 61  afile\fR, \fB-ca
3410: 73 74 6f 72 65 5c 66 52 2c 20 6f 72 20 61 20 70  store\fR, or a p
3420: 6c 61 74 66 6f 72 6d 20 64 65 66 61 75 6c 74 0a  latform default.
3430: 6d 75 73 74 20 62 65 20 70 72 6f 76 69 64 65 64  must be provided
3440: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 76 61 6c   in order to val
3450: 69 64 61 74 65 20 61 67 61 69 6e 73 74 5c 26 2e  idate against\&.
3460: 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 6e 20   The default in 
3470: 54 63 6c 54 4c 53 20 31 5c 26 2e 38 20 61 6e 64  TclTLS 1\&.8 and
3480: 0a 65 61 72 6c 69 65 72 20 76 65 72 73 69 6f 6e  .earlier version
3490: 73 20 69 73 20 5c 66 42 66 61 6c 73 65 5c 66 52  s is \fBfalse\fR
34a0: 20 73 69 6e 63 65 20 6e 6f 74 20 61 6c 6c 20 70   since not all p
34b0: 6c 61 74 66 6f 72 6d 73 20 68 61 76 65 20 63 65  latforms have ce
34c0: 72 74 69 66 69 63 61 74 65 73 20 74 6f 0a 76 61  rtificates to.va
34d0: 6c 69 64 61 74 65 20 61 67 61 69 6e 73 74 20 69  lidate against i
34e0: 6e 20 61 20 66 6f 72 6d 20 63 6f 6d 70 61 74 69  n a form compati
34f0: 62 6c 65 20 77 69 74 68 20 4f 70 65 6e 53 53 4c  ble with OpenSSL
3500: 5c 26 2e 0a 53 65 65 20 5c 66 42 43 65 72 74 69  \&..See \fBCerti
3510: 66 69 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f  ficate Validatio
3520: 6e 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 64 65  n\fR for more de
3530: 74 61 69 6c 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  tails\&...TP.\fB
3540: 2d 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c  -security_level\
3550: 66 52 20 5c 66 49 69 6e 74 65 67 65 72 5c 66 52  fR \fIinteger\fR
3560: 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20 73  .Specifies the s
3570: 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 28 76  ecurity level (v
3580: 61 6c 75 65 20 66 72 6f 6d 20 30 20 74 6f 20 35  alue from 0 to 5
3590: 29 5c 26 2e 20 54 68 65 20 73 65 63 75 72 69 74  )\&. The securit
35a0: 79 20 6c 65 76 65 6c 20 61 66 66 65 63 74 73 0a  y level affects.
35b0: 74 68 65 20 61 6c 6c 6f 77 65 64 20 63 69 70 68  the allowed ciph
35c0: 65 72 20 73 75 69 74 65 20 65 6e 63 72 79 70 74  er suite encrypt
35d0: 69 6f 6e 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20  ion algorithms, 
35e0: 73 75 70 70 6f 72 74 65 64 20 45 43 43 20 63 75  supported ECC cu
35f0: 72 76 65 73 2c 0a 73 75 70 70 6f 72 74 65 64 20  rves,.supported 
3600: 73 69 67 6e 61 74 75 72 65 20 61 6c 67 6f 72 69  signature algori
3610: 74 68 6d 73 2c 20 44 48 20 70 61 72 61 6d 65 74  thms, DH paramet
3620: 65 72 20 73 69 7a 65 73 2c 20 63 65 72 74 69 66  er sizes, certif
3630: 69 63 61 74 65 20 6b 65 79 20 73 69 7a 65 73 0a  icate key sizes.
3640: 61 6e 64 20 73 69 67 6e 61 74 75 72 65 20 61 6c  and signature al
3650: 67 6f 72 69 74 68 6d 73 5c 26 2e 20 54 68 65 20  gorithms\&. The 
3660: 64 65 66 61 75 6c 74 20 69 73 20 31 20 70 72 69  default is 1 pri
3670: 6f 72 20 74 6f 20 4f 70 65 6e 53 53 4c 20 33 5c  or to OpenSSL 3\
3680: 26 2e 32 20 61 6e 64 20 32 0a 74 68 65 72 65 61  &.2 and 2.therea
3690: 66 74 65 72 5c 26 2e 20 4c 65 76 65 6c 20 33 20  fter\&. Level 3 
36a0: 61 6e 64 20 68 69 67 68 65 72 20 64 69 73 61 62  and higher disab
36b0: 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 73  le support for s
36c0: 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 73 20 61  ession tickets a
36d0: 6e 64 0a 6f 6e 6c 79 20 61 63 63 65 70 74 20 63  nd.only accept c
36e0: 69 70 68 65 72 20 73 75 69 74 65 73 20 74 68 61  ipher suites tha
36f0: 74 20 70 72 6f 76 69 64 65 20 66 6f 72 77 61 72  t provide forwar
3700: 64 20 73 65 63 72 65 63 79 5c 26 2e 0a 2e 54 50  d secrecy\&...TP
3710: 0a 5c 66 42 2d 73 65 72 76 65 72 5c 66 52 20 5c  .\fB-server\fR \
3720: 66 49 62 6f 6f 6c 5c 66 52 0a 53 70 65 63 69 66  fIbool\fR.Specif
3730: 69 65 73 20 77 68 65 74 68 65 72 20 74 6f 20 61  ies whether to a
3740: 63 74 20 61 73 20 61 20 73 65 72 76 65 72 20 61  ct as a server a
3750: 6e 64 20 72 65 73 70 6f 6e 64 20 77 69 74 68 20  nd respond with 
3760: 61 20 73 65 72 76 65 72 20 68 61 6e 64 73 68 61  a server handsha
3770: 6b 65 20 77 68 65 6e 20 61 0a 63 6c 69 65 6e 74  ke when a.client
3780: 20 63 6f 6e 6e 65 63 74 73 20 61 6e 64 20 70 72   connects and pr
3790: 6f 76 69 64 65 73 20 61 20 63 6c 69 65 6e 74 20  ovides a client 
37a0: 68 61 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68 65  handshake\&. The
37b0: 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 66   default is \fBf
37c0: 61 6c 73 65 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c  alse\fR\&...TP.\
37d0: 66 42 2d 73 65 72 76 65 72 6e 61 6d 65 5c 66 52  fB-servername\fR
37e0: 20 5c 66 49 68 6f 73 74 6e 61 6d 65 5c 66 52 0a   \fIhostname\fR.
37f0: 53 70 65 63 69 66 79 20 74 68 65 20 70 65 65 72  Specify the peer
3800: 27 73 20 68 6f 73 74 6e 61 6d 65 5c 26 2e 20 54  's hostname\&. T
3810: 68 69 73 20 69 73 20 75 73 65 64 20 74 6f 20 73  his is used to s
3820: 65 74 20 74 68 65 20 54 4c 53 20 53 65 72 76 65  et the TLS Serve
3830: 72 20 4e 61 6d 65 0a 49 6e 64 69 63 61 74 69 6f  r Name.Indicatio
3840: 6e 20 28 53 4e 49 29 20 65 78 74 65 6e 73 69 6f  n (SNI) extensio
3850: 6e 5c 26 2e 20 53 65 74 20 74 68 69 73 20 74 6f  n\&. Set this to
3860: 20 74 68 65 20 65 78 70 65 63 74 65 64 20 73 65   the expected se
3870: 72 76 65 72 6e 61 6d 65 20 69 6e 20 74 68 65 0a  rvername in the.
3880: 73 65 72 76 65 72 27 73 20 63 65 72 74 69 66 69  server's certifi
3890: 63 61 74 65 20 6f 72 20 6f 6e 65 20 6f 66 20 74  cate or one of t
38a0: 68 65 20 53 75 62 6a 65 63 74 20 41 6c 74 65 72  he Subject Alter
38b0: 6e 61 74 65 20 4e 61 6d 65 73 20 28 53 41 4e 29  nate Names (SAN)
38c0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 65 73 73  \&...TP.\fB-sess
38d0: 69 6f 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69 6e  ion_id\fR \fIbin
38e0: 61 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 53 70  ary_string\fR.Sp
38f0: 65 63 69 66 69 65 73 20 74 68 65 20 73 65 73 73  ecifies the sess
3900: 69 6f 6e 20 69 64 20 74 6f 20 72 65 73 75 6d 65  ion id to resume
3910: 20 61 20 73 65 73 73 69 6f 6e 5c 26 2e 20 4e 6f   a session\&. No
3920: 74 20 73 75 70 70 6f 72 74 65 64 20 79 65 74 5c  t supported yet\
3930: 26 2e 0a 2e 54 50 0a 5c 66 42 2d 73 73 6c 32 5c  &...TP.\fB-ssl2\
3940: 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e  fR \fIbool\fR.En
3950: 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20  able use of SSL 
3960: 76 32 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c  v2\&. The defaul
3970: 74 20 69 73 20 5c 66 42 66 61 6c 73 65 5c 66 52  t is \fBfalse\fR
3980: 5c 26 2e 20 4e 6f 74 65 3a 20 52 65 63 65 6e 74  \&. Note: Recent
3990: 20 76 65 72 73 69 6f 6e 73 20 6f 66 0a 4f 70 65   versions of.Ope
39a0: 6e 53 53 4c 20 6e 6f 20 6c 6f 6e 67 65 72 20 73  nSSL no longer s
39b0: 75 70 70 6f 72 74 20 53 53 4c 76 32 2c 20 73 6f  upport SSLv2, so
39c0: 20 74 68 69 73 20 6d 61 79 20 6e 6f 74 20 68 61   this may not ha
39d0: 76 65 20 61 6e 79 20 65 66 66 65 63 74 5c 26 2e  ve any effect\&.
39e0: 20 53 65 65 20 74 68 65 0a 5c 66 42 74 6c 73 3a   See the.\fBtls:
39f0: 3a 70 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f  :protocols\fR co
3a00: 6d 6d 61 6e 64 20 66 6f 72 20 73 75 70 70 6f 72  mmand for suppor
3a10: 74 65 64 20 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e  ted protocols\&.
3a20: 0a 2e 54 50 0a 5c 66 42 2d 73 73 6c 33 5c 66 52  ..TP.\fB-ssl3\fR
3a30: 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62   \fIbool\fR.Enab
3a40: 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20 76 33  le use of SSL v3
3a50: 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20  \&. The default 
3a60: 69 73 20 5c 66 42 66 61 6c 73 65 5c 66 52 5c 26  is \fBfalse\fR\&
3a70: 2e 20 4e 6f 74 65 3a 20 52 65 63 65 6e 74 20 76  . Note: Recent v
3a80: 65 72 73 69 6f 6e 73 0a 6f 66 20 4f 70 65 6e 53  ersions.of OpenS
3a90: 53 4c 20 6d 61 79 20 68 61 76 65 20 74 68 69 73  SL may have this
3aa0: 20 64 69 73 61 62 6c 65 64 20 61 74 20 63 6f 6d   disabled at com
3ab0: 70 69 6c 65 20 74 69 6d 65 2c 20 73 6f 20 74 68  pile time, so th
3ac0: 69 73 20 6d 61 79 20 6e 6f 74 20 68 61 76 65 20  is may not have 
3ad0: 61 6e 79 0a 65 66 66 65 63 74 5c 26 2e 20 53 65  any.effect\&. Se
3ae0: 65 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 70 72  e the \fBtls::pr
3af0: 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d 61  otocols\fR comma
3b00: 6e 64 20 66 6f 72 20 73 75 70 70 6f 72 74 65 64  nd for supported
3b10: 20 70 72 6f 74 6f 63 6f 6c 73 5c 26 2e 0a 2e 54   protocols\&...T
3b20: 50 0a 5c 66 42 2d 74 6c 73 31 5c 66 52 20 5c 66  P.\fB-tls1\fR \f
3b30: 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65 20  Ibool\fR.Enable 
3b40: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 5c 26 2e  use of TLS v1\&.
3b50: 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20   The default is 
3b60: 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e 20 4e 6f  \fBtrue\fR\&. No
3b70: 74 65 3a 20 54 4c 53 20 31 5c 26 2e 30 20 6e 65  te: TLS 1\&.0 ne
3b80: 65 64 73 0a 53 48 41 31 20 74 6f 20 6f 70 65 72  eds.SHA1 to oper
3b90: 61 74 65 2c 20 77 68 69 63 68 20 69 73 20 6f 6e  ate, which is on
3ba0: 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20  ly available in 
3bb0: 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 30  security level 0
3bc0: 20 66 6f 72 20 4f 70 65 6e 20 53 53 4c 20 33 5c   for Open SSL 3\
3bd0: 26 2e 30 2b 5c 26 2e 0a 53 65 65 20 74 68 65 20  &.0+\&..See the 
3be0: 5c 66 49 2d 73 65 63 75 72 69 74 79 5f 6c 65 76  \fI-security_lev
3bf0: 65 6c 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a  el\fR option\&..
3c00: 2e 54 50 0a 5c 66 42 2d 74 6c 73 31 5c 26 2e 31  .TP.\fB-tls1\&.1
3c10: 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 45  \fR \fIbool\fR.E
3c20: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53  nable use of TLS
3c30: 20 76 31 5c 26 2e 31 5c 26 2e 20 54 68 65 20 64   v1\&.1\&. The d
3c40: 65 66 61 75 6c 74 20 69 73 20 5c 66 42 74 72 75  efault is \fBtru
3c50: 65 5c 66 52 5c 26 2e 20 4e 6f 74 65 3a 20 54 4c  e\fR\&. Note: TL
3c60: 53 20 31 5c 26 2e 31 20 6e 65 65 64 73 0a 53 48  S 1\&.1 needs.SH
3c70: 41 31 20 74 6f 20 6f 70 65 72 61 74 65 2c 20 77  A1 to operate, w
3c80: 68 69 63 68 20 69 73 20 6f 6e 6c 79 20 61 76 61  hich is only ava
3c90: 69 6c 61 62 6c 65 20 69 6e 20 73 65 63 75 72 69  ilable in securi
3ca0: 74 79 20 6c 65 76 65 6c 20 30 20 66 6f 72 20 4f  ty level 0 for O
3cb0: 70 65 6e 20 53 53 4c 20 33 5c 26 2e 30 2b 5c 26  pen SSL 3\&.0+\&
3cc0: 2e 0a 53 65 65 20 74 68 65 20 5c 66 49 2d 73 65  ..See the \fI-se
3cd0: 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c 66 52 20  curity_level\fR 
3ce0: 6f 70 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66  option\&...TP.\f
3cf0: 42 2d 74 6c 73 31 5c 26 2e 32 5c 66 52 20 5c 66  B-tls1\&.2\fR \f
3d00: 49 62 6f 6f 6c 5c 66 52 0a 45 6e 61 62 6c 65 20  Ibool\fR.Enable 
3d10: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 5c 26 2e  use of TLS v1\&.
3d20: 32 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  2\&. The default
3d30: 20 69 73 20 5c 66 42 74 72 75 65 5c 66 52 5c 26   is \fBtrue\fR\&
3d40: 2e 0a 2e 54 50 0a 5c 66 42 2d 74 6c 73 31 5c 26  ...TP.\fB-tls1\&
3d50: 2e 33 5c 66 52 20 5c 66 49 62 6f 6f 6c 5c 66 52  .3\fR \fIbool\fR
3d60: 0a 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54  .Enable use of T
3d70: 4c 53 20 76 31 5c 26 2e 33 5c 26 2e 20 54 68 65  LS v1\&.3\&. The
3d80: 20 64 65 66 61 75 6c 74 20 69 73 20 5c 66 42 74   default is \fBt
3d90: 72 75 65 5c 66 52 5c 26 2e 0a 2e 54 50 0a 5c 66  rue\fR\&...TP.\f
3da0: 42 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e  B-validatecomman
3db0: 64 5c 66 52 20 5c 66 49 63 61 6c 6c 62 61 63 6b  d\fR \fIcallback
3dc0: 5c 66 52 0a 53 70 65 63 69 66 69 65 73 20 74 68  \fR.Specifies th
3dd0: 65 20 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61  e callback comma
3de0: 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20 74 6f 20  nd to invoke to 
3df0: 76 61 6c 69 64 61 74 65 20 74 68 65 20 70 65 65  validate the pee
3e00: 72 20 63 65 72 74 69 66 69 63 61 74 65 73 0a 61  r certificates.a
3e10: 6e 64 20 6f 74 68 65 72 20 63 6f 6e 66 69 67 20  nd other config 
3e20: 69 6e 66 6f 20 64 75 72 69 6e 67 20 74 68 65 20  info during the 
3e30: 70 72 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61  protocol negotia
3e40: 74 69 6f 6e 20 70 68 61 73 65 5c 26 2e 20 54 68  tion phase\&. Th
3e50: 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 0a 62  is can be used.b
3e60: 79 20 54 43 4c 20 73 63 72 69 70 74 73 20 74 6f  y TCL scripts to
3e70: 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72 20 6f   perform their o
3e80: 77 6e 20 43 65 72 74 69 66 69 63 61 74 65 20 56  wn Certificate V
3e90: 61 6c 69 64 61 74 69 6f 6e 20 74 6f 20 73 75 70  alidation to sup
3ea0: 70 6c 65 6d 65 6e 74 20 74 68 65 0a 64 65 66 61  plement the.defa
3eb0: 75 6c 74 20 76 61 6c 69 64 61 74 69 6f 6e 20 70  ult validation p
3ec0: 72 6f 76 69 64 65 64 20 62 79 20 4f 70 65 6e 53  rovided by OpenS
3ed0: 53 4c 5c 26 2e 20 54 68 65 20 73 63 72 69 70 74  SL\&. The script
3ee0: 20 6d 75 73 74 20 72 65 74 75 72 6e 20 61 20 62   must return a b
3ef0: 6f 6f 6c 65 61 6e 20 74 72 75 65 0a 74 6f 20 63  oolean true.to c
3f00: 6f 6e 74 69 6e 75 65 20 74 68 65 20 6e 65 67 6f  ontinue the nego
3f10: 74 69 61 74 69 6f 6e 5c 26 2e 20 53 65 65 20 5c  tiation\&. See \
3f20: 66 42 43 61 6c 6c 62 61 63 6b 20 4f 70 74 69 6f  fBCallback Optio
3f30: 6e 73 5c 66 52 20 66 6f 72 20 6d 6f 72 65 20 69  ns\fR for more i
3f40: 6e 66 6f 5c 26 2e 0a 2e 52 45 0a 2e 54 50 0a 5c  nfo\&...RE..TP.\
3f50: 66 42 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 5c  fBtls::unimport\
3f60: 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52  fR \fIchannel\fR
3f70: 0a 43 6f 6d 70 6c 69 6d 65 6e 74 20 74 6f 20 5c  .Compliment to \
3f80: 66 42 74 6c 73 3a 3a 69 6d 70 6f 72 74 5c 66 52  fBtls::import\fR
3f90: 5c 26 2e 20 55 73 65 64 20 74 6f 20 72 65 6d 6f  \&. Used to remo
3fa0: 76 65 20 74 68 65 20 74 6f 70 20 6c 65 76 65 6c  ve the top level
3fb0: 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c   stacked channel
3fc0: 0a 66 72 6f 6d 20 5c 66 49 63 68 61 6e 6e 65 6c  .from \fIchannel
3fd0: 5c 66 52 5c 26 2e 20 54 68 69 73 20 75 6e 73 74  \fR\&. This unst
3fe0: 61 63 6b 73 20 74 68 65 20 65 6e 63 72 79 70 74  acks the encrypt
3ff0: 69 6f 6e 20 6f 66 20 61 20 72 65 67 75 6c 61 72  ion of a regular
4000: 20 54 43 4c 20 63 68 61 6e 6e 65 6c 5c 26 2e 20   TCL channel\&. 
4010: 41 6e 0a 65 72 72 6f 72 20 69 73 20 74 68 72 6f  An.error is thro
4020: 77 6e 20 69 66 20 54 4c 53 20 69 73 20 6e 6f 74  wn if TLS is not
4030: 20 74 68 65 20 74 6f 70 20 73 74 61 63 6b 65 64   the top stacked
4040: 20 63 68 61 6e 6e 65 6c 20 74 79 70 65 5c 26 2e   channel type\&.
4050: 0a 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 68 61 6e  ..TP.\fBtls::han
4060: 64 73 68 61 6b 65 5c 66 52 20 5c 66 49 63 68 61  dshake\fR \fIcha
4070: 6e 6e 65 6c 5c 66 52 0a 46 6f 72 63 65 73 20 74  nnel\fR.Forces t
4080: 68 65 20 54 4c 53 20 6e 65 67 6f 74 69 61 74 69  he TLS negotiati
4090: 6f 6e 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20  on handshake to 
40a0: 74 61 6b 65 20 70 6c 61 63 65 20 69 6d 6d 65 64  take place immed
40b0: 69 61 74 65 6c 79 2c 20 61 6e 64 20 72 65 74 75  iately, and retu
40c0: 72 6e 73 20 30 0a 69 66 20 68 61 6e 64 73 68 61  rns 0.if handsha
40d0: 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 70  ke is still in p
40e0: 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f  rogress (non-blo
40f0: 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 20  cking), or 1 if 
4100: 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77 61  the handshake wa
4110: 73 0a 73 75 63 63 65 73 73 66 75 6c 5c 26 2e 20  s.successful\&. 
4120: 49 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65  If the handshake
4130: 20 66 61 69 6c 65 64 2c 20 61 6e 20 65 72 72 6f   failed, an erro
4140: 72 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e  r will be return
4150: 65 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 6c 73  ed\&...TP.\fBtls
4160: 3a 3a 73 74 61 74 75 73 5c 66 52 20 3f 5c 66 42  ::status\fR ?\fB
4170: 2d 6c 6f 63 61 6c 5c 66 52 3f 20 5c 66 49 63 68  -local\fR? \fIch
4180: 61 6e 6e 65 6c 5c 66 52 0a 52 65 74 75 72 6e 73  annel\fR.Returns
4190: 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61   the current sta
41a0: 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68  tus of an SSL ch
41b0: 61 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65 73  annel\&. The res
41c0: 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66  ult is a list of
41d0: 20 6b 65 79 2d 76 61 6c 75 65 0a 70 61 69 72 73   key-value.pairs
41e0: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20   describing the 
41f0: 53 53 4c 2c 20 63 65 72 74 69 66 69 63 61 74 65  SSL, certificate
4200: 2c 20 61 6e 64 20 63 65 72 74 69 66 69 63 61 74  , and certificat
4210: 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 73  e verification s
4220: 74 61 74 75 73 5c 26 2e 20 49 66 0a 74 68 65 20  tatus\&. If.the 
4230: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61  SSL handshake ha
4240: 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65  s not yet comple
4250: 74 65 64 2c 20 61 6e 20 65 6d 70 74 79 20 6c 69  ted, an empty li
4260: 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 5c 26  st is returned\&
4270: 2e 20 49 66 20 74 68 65 0a 5c 66 42 2d 6c 6f 63  . If the.\fB-loc
4280: 61 6c 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73 20  al\fR option is 
4290: 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20  specified, then 
42a0: 74 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69 66  the local certif
42b0: 69 63 61 74 65 20 69 73 20 75 73 65 64 5c 26 2e  icate is used\&.
42c0: 20 52 65 74 75 72 6e 65 64 0a 76 61 6c 75 65 73   Returned.values
42d0: 20 69 6e 63 6c 75 64 65 3a 0a 2e 73 70 0a 53 53   include:..sp.SS
42e0: 4c 20 53 74 61 74 75 73 0a 2e 52 53 0a 2e 54 50  L Status..RS..TP
42f0: 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66 49 70  .\fBalpn\fR \fIp
4300: 72 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68 65 20 70  rotocol\fR.The p
4310: 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64  rotocol selected
4320: 20 61 66 74 65 72 20 41 70 70 6c 69 63 61 74 69   after Applicati
4330: 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f  on-Layer Protoco
4340: 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 41  l Negotiation (A
4350: 4c 50 4e 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 63  LPN)\&...TP.\fBc
4360: 69 70 68 65 72 5c 66 52 20 5c 66 49 63 69 70 68  ipher\fR \fIciph
4370: 65 72 5c 66 52 0a 54 68 65 20 63 75 72 72 65 6e  er\fR.The curren
4380: 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 65 20  t cipher in use 
4390: 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f 6e 5c  for the session\
43a0: 26 2e 0a 2e 54 50 0a 5c 66 42 70 65 65 72 6e 61  &...TP.\fBpeerna
43b0: 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c 66 52  me\fR \fIname\fR
43c0: 0a 54 68 65 20 70 65 65 72 6e 61 6d 65 20 66 72  .The peername fr
43d0: 6f 6d 20 74 68 65 20 63 65 72 74 69 66 69 63 61  om the certifica
43e0: 74 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 72 6f  te\&...TP.\fBpro
43f0: 74 6f 63 6f 6c 5c 66 52 20 5c 66 49 76 65 72 73  tocol\fR \fIvers
4400: 69 6f 6e 5c 66 52 0a 54 68 65 20 70 72 6f 74 6f  ion\fR.The proto
4410: 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65 64  col version used
4420: 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63 74   for the connect
4430: 69 6f 6e 3a 20 53 53 4c 32 2c 20 53 53 4c 33 2c  ion: SSL2, SSL3,
4440: 20 54 4c 53 31 2c 20 54 4c 53 31 5c 26 2e 31 2c   TLS1, TLS1\&.1,
4450: 20 54 4c 53 31 5c 26 2e 32 2c 20 54 4c 53 31 5c   TLS1\&.2, TLS1\
4460: 26 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 5c  &.3, or unknown\
4470: 26 2e 0a 2e 54 50 0a 5c 66 42 73 62 69 74 73 5c  &...TP.\fBsbits\
4480: 66 52 20 5c 66 49 6e 5c 66 52 0a 54 68 65 20 6e  fR \fIn\fR.The n
4490: 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75 73  umber of bits us
44a0: 65 64 20 66 6f 72 20 74 68 65 20 73 65 73 73 69  ed for the sessi
44b0: 6f 6e 20 6b 65 79 5c 26 2e 0a 2e 54 50 0a 5c 66  on key\&...TP.\f
44c0: 42 73 69 67 6e 61 74 75 72 65 48 61 73 68 41 6c  BsignatureHashAl
44d0: 67 6f 72 69 74 68 6d 5c 66 52 20 5c 66 49 61 6c  gorithm\fR \fIal
44e0: 67 6f 72 69 74 68 6d 5c 66 52 0a 54 68 65 20 73  gorithm\fR.The s
44f0: 69 67 6e 61 74 75 72 65 20 68 61 73 68 20 61 6c  ignature hash al
4500: 67 6f 72 69 74 68 6d 5c 26 2e 0a 2e 54 50 0a 5c  gorithm\&...TP.\
4510: 66 42 73 69 67 6e 61 74 75 72 65 54 79 70 65 5c  fBsignatureType\
4520: 66 52 20 5c 66 49 74 79 70 65 5c 66 52 0a 54 68  fR \fItype\fR.Th
4530: 65 20 73 69 67 6e 61 74 75 72 65 20 74 79 70 65  e signature type
4540: 20 76 61 6c 75 65 5c 26 2e 0a 2e 54 50 0a 5c 66   value\&...TP.\f
4550: 42 76 65 72 69 66 79 44 65 70 74 68 5c 66 52 20  BverifyDepth\fR 
4560: 5c 66 49 6e 5c 66 52 0a 4d 61 78 69 6d 75 6d 20  \fIn\fR.Maximum 
4570: 64 65 70 74 68 20 66 6f 72 20 74 68 65 20 63 65  depth for the ce
4580: 72 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 20  rtificate chain 
4590: 76 65 72 69 66 69 63 61 74 69 6f 6e 5c 26 2e 20  verification\&. 
45a0: 44 65 66 61 75 6c 74 20 69 73 20 2d 31 2c 20 74  Default is -1, t
45b0: 6f 20 63 68 65 63 6b 20 61 6c 6c 5c 26 2e 0a 2e  o check all\&...
45c0: 54 50 0a 5c 66 42 76 65 72 69 66 79 4d 6f 64 65  TP.\fBverifyMode
45d0: 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a 4c  \fR \fIlist\fR.L
45e0: 69 73 74 20 6f 66 20 63 65 72 74 69 66 69 63 61  ist of certifica
45f0: 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20  te verification 
4600: 6d 6f 64 65 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42  modes\&...TP.\fB
4610: 76 65 72 69 66 79 52 65 73 75 6c 74 5c 66 52 20  verifyResult\fR 
4620: 5c 66 49 72 65 73 75 6c 74 5c 66 52 0a 43 65 72  \fIresult\fR.Cer
4630: 74 69 66 69 63 61 74 65 20 76 65 72 69 66 69 63  tificate verific
4640: 61 74 69 6f 6e 20 72 65 73 75 6c 74 5c 26 2e 0a  ation result\&..
4650: 2e 54 50 0a 5c 66 42 63 61 5f 6e 61 6d 65 73 5c  .TP.\fBca_names\
4660: 66 52 20 5c 66 49 6c 69 73 74 5c 66 52 0a 4c 69  fR \fIlist\fR.Li
4670: 73 74 20 6f 66 20 74 68 65 20 43 65 72 74 69 66  st of the Certif
4680: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 69 65  icate Authoritie
4690: 73 20 75 73 65 64 20 74 6f 20 63 72 65 61 74 65  s used to create
46a0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
46b0: 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 43 65 72 74  \&...RE..IP.Cert
46c0: 69 66 69 63 61 74 65 20 53 74 61 74 75 73 0a 2e  ificate Status..
46d0: 52 53 0a 2e 54 50 0a 5c 66 42 61 6c 6c 5c 66 52  RS..TP.\fBall\fR
46e0: 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 44 75   \fIstring\fR.Du
46f0: 6d 70 20 6f 66 20 61 6c 6c 20 63 65 72 74 69 66  mp of all certif
4700: 69 63 61 74 65 20 69 6e 66 6f 5c 26 2e 0a 2e 54  icate info\&...T
4710: 50 0a 5c 66 42 76 65 72 73 69 6f 6e 5c 66 52 20  P.\fBversion\fR 
4720: 5c 66 49 76 61 6c 75 65 5c 66 52 0a 54 68 65 20  \fIvalue\fR.The 
4730: 63 65 72 74 69 66 69 63 61 74 65 20 76 65 72 73  certificate vers
4740: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65  ion\&...TP.\fBse
4750: 72 69 61 6c 4e 75 6d 62 65 72 5c 66 52 20 5c 66  rialNumber\fR \f
4760: 49 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 73  Istring\fR.The s
4770: 65 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20  erial number of 
4780: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20  the certificate 
4790: 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 5c  as a hex string\
47a0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 69 67 6e 61 74  &...TP.\fBsignat
47b0: 75 72 65 5c 66 52 20 5c 66 49 61 6c 67 6f 72 69  ure\fR \fIalgori
47c0: 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20 61 6c  thm\fR.Cipher al
47d0: 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f 72  gorithm used for
47e0: 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69 67   certificate sig
47f0: 6e 61 74 75 72 65 5c 26 2e 0a 2e 54 50 0a 5c 66  nature\&...TP.\f
4800: 42 69 73 73 75 65 72 5c 66 52 20 5c 66 49 73 74  Bissuer\fR \fIst
4810: 72 69 6e 67 5c 66 52 0a 54 68 65 20 64 69 73 74  ring\fR.The dist
4820: 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28  inguished name (
4830: 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69  DN) of the certi
4840: 66 69 63 61 74 65 20 69 73 73 75 65 72 5c 26 2e  ficate issuer\&.
4850: 0a 2e 54 50 0a 5c 66 42 6e 6f 74 42 65 66 6f 72  ..TP.\fBnotBefor
4860: 65 5c 66 52 20 5c 66 49 64 61 74 65 5c 66 52 0a  e\fR \fIdate\fR.
4870: 54 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 64 61  The beginning da
4880: 74 65 20 6f 66 20 74 68 65 20 63 65 72 74 69 66  te of the certif
4890: 69 63 61 74 65 20 76 61 6c 69 64 69 74 79 5c 26  icate validity\&
48a0: 2e 0a 2e 54 50 0a 5c 66 42 6e 6f 74 41 66 74 65  ...TP.\fBnotAfte
48b0: 72 5c 66 52 20 5c 66 49 64 61 74 65 5c 66 52 0a  r\fR \fIdate\fR.
48c0: 54 68 65 20 65 78 70 69 72 61 74 69 6f 6e 20 64  The expiration d
48d0: 61 74 65 20 6f 66 20 74 68 65 20 63 65 72 74 69  ate of the certi
48e0: 66 69 63 61 74 65 20 76 61 6c 69 64 69 74 79 5c  ficate validity\
48f0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65 63  &...TP.\fBsubjec
4900: 74 5c 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66  t\fR \fIstring\f
4910: 52 0a 54 68 65 20 64 69 73 74 69 6e 67 75 69 73  R.The distinguis
4920: 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66  hed name (DN) of
4930: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
4940: 20 73 75 62 6a 65 63 74 5c 26 2e 20 46 69 65 6c   subject\&. Fiel
4950: 64 73 20 69 6e 63 6c 75 64 65 3a 20 43 6f 6d 6d  ds include: Comm
4960: 6f 6e 0a 4e 61 6d 65 20 28 43 4e 29 2c 20 4f 72  on.Name (CN), Or
4970: 67 61 6e 69 7a 61 74 69 6f 6e 20 28 4f 29 2c 20  ganization (O), 
4980: 4c 6f 63 61 6c 69 74 79 20 6f 72 20 43 69 74 79  Locality or City
4990: 20 28 4c 29 2c 20 53 74 61 74 65 20 6f 72 20 50   (L), State or P
49a0: 72 6f 76 69 6e 63 65 20 28 53 29 2c 20 61 6e 64  rovince (S), and
49b0: 0a 43 6f 75 6e 74 72 79 20 4e 61 6d 65 20 28 43  .Country Name (C
49c0: 29 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69 73 73 75  )\&...TP.\fBissu
49d0: 65 72 55 6e 69 71 75 65 49 44 5c 66 52 20 5c 66  erUniqueID\fR \f
49e0: 49 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 69  Istring\fR.The i
49f0: 73 73 75 65 72 20 75 6e 69 71 75 65 20 69 64 5c  ssuer unique id\
4a00: 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65 63  &...TP.\fBsubjec
4a10: 74 55 6e 69 71 75 65 49 44 5c 66 52 20 5c 66 49  tUniqueID\fR \fI
4a20: 73 74 72 69 6e 67 5c 66 52 0a 54 68 65 20 73 75  string\fR.The su
4a30: 62 6a 65 63 74 20 75 6e 69 71 75 65 20 69 64 5c  bject unique id\
4a40: 26 2e 0a 2e 54 50 0a 5c 66 42 6e 75 6d 5f 65 78  &...TP.\fBnum_ex
4a50: 74 65 6e 73 69 6f 6e 73 5c 66 52 20 5c 66 49 6e  tensions\fR \fIn
4a60: 5c 66 52 0a 4e 75 6d 62 65 72 20 6f 66 20 63 65  \fR.Number of ce
4a70: 72 74 69 66 69 63 61 74 65 20 65 78 74 65 6e 73  rtificate extens
4a80: 69 6f 6e 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 65  ions\&...TP.\fBe
4a90: 78 74 65 6e 73 69 6f 6e 73 5c 66 52 20 5c 66 49  xtensions\fR \fI
4aa0: 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20  list\fR.List of 
4ab0: 63 65 72 74 69 66 69 63 61 74 65 20 65 78 74 65  certificate exte
4ac0: 6e 73 69 6f 6e 20 6e 61 6d 65 73 5c 26 2e 0a 2e  nsion names\&...
4ad0: 54 50 0a 5c 66 42 61 75 74 68 6f 72 69 74 79 4b  TP.\fBauthorityK
4ae0: 65 79 49 64 65 6e 74 69 66 69 65 72 5c 66 52 20  eyIdentifier\fR 
4af0: 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a 41 75 74  \fIstring\fR.Aut
4b00: 68 6f 72 69 74 79 20 4b 65 79 20 49 64 65 6e 74  hority Key Ident
4b10: 69 66 69 65 72 20 28 41 4b 49 29 20 6f 66 20 74  ifier (AKI) of t
4b20: 68 65 20 49 73 73 75 69 6e 67 20 43 41 20 63 65  he Issuing CA ce
4b30: 72 74 69 66 69 63 61 74 65 20 74 68 61 74 20 73  rtificate that s
4b40: 69 67 6e 65 64 20 74 68 65 0a 53 53 4c 20 63 65  igned the.SSL ce
4b50: 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20 68  rtificate as a h
4b60: 65 78 20 73 74 72 69 6e 67 5c 26 2e 20 54 68 69  ex string\&. Thi
4b70: 73 20 76 61 6c 75 65 20 6d 61 74 63 68 65 73 20  s value matches 
4b80: 74 68 65 20 53 4b 49 20 76 61 6c 75 65 20 6f 66  the SKI value of
4b90: 20 74 68 65 0a 49 6e 74 65 72 6d 65 64 69 61 74   the.Intermediat
4ba0: 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65  e CA certificate
4bb0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65  \&...TP.\fBsubje
4bc0: 63 74 4b 65 79 49 64 65 6e 74 69 66 69 65 72 5c  ctKeyIdentifier\
4bd0: 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a  fR \fIstring\fR.
4be0: 53 75 62 6a 65 63 74 20 4b 65 79 20 49 64 65 6e  Subject Key Iden
4bf0: 74 69 66 69 65 72 20 28 53 4b 49 29 20 68 61 73  tifier (SKI) has
4c00: 68 20 6f 66 20 74 68 65 20 70 75 62 6c 69 63 20  h of the public 
4c10: 6b 65 79 20 69 6e 73 69 64 65 20 74 68 65 20 63  key inside the c
4c20: 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61 0a  ertificate as a.
4c30: 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 20 55 73  hex string\&. Us
4c40: 65 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20 63  ed to identify c
4c50: 65 72 74 69 66 69 63 61 74 65 73 20 74 68 61 74  ertificates that
4c60: 20 63 6f 6e 74 61 69 6e 20 61 20 70 61 72 74 69   contain a parti
4c70: 63 75 6c 61 72 20 70 75 62 6c 69 63 20 6b 65 79  cular public key
4c80: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 75 62 6a 65  \&...TP.\fBsubje
4c90: 63 74 41 6c 74 4e 61 6d 65 5c 66 52 20 5c 66 49  ctAltName\fR \fI
4ca0: 6c 69 73 74 5c 66 52 0a 4c 69 73 74 20 6f 66 20  list\fR.List of 
4cb0: 61 6c 6c 20 6f 66 20 74 68 65 20 53 75 62 6a 65  all of the Subje
4cc0: 63 74 20 41 6c 74 65 72 6e 61 74 69 76 65 20 4e  ct Alternative N
4cd0: 61 6d 65 73 20 28 53 41 4e 29 20 69 6e 63 6c 75  ames (SAN) inclu
4ce0: 64 69 6e 67 20 64 6f 6d 61 69 6e 20 6e 61 6d 65  ding domain name
4cf0: 73 2c 20 73 75 62 0a 64 6f 6d 61 69 6e 73 2c 20  s, sub.domains, 
4d00: 61 6e 64 20 49 50 20 61 64 64 72 65 73 73 65 73  and IP addresses
4d10: 20 74 68 61 74 20 61 72 65 20 73 65 63 75 72 65   that are secure
4d20: 64 20 62 79 20 74 68 65 20 63 65 72 74 69 66 69  d by the certifi
4d30: 63 61 74 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6f  cate\&...TP.\fBo
4d40: 63 73 70 5c 66 52 20 5c 66 49 6c 69 73 74 5c 66  csp\fR \fIlist\f
4d50: 52 0a 4c 69 73 74 20 6f 66 20 61 6c 6c 20 4f 6e  R.List of all On
4d60: 6c 69 6e 65 20 43 65 72 74 69 66 69 63 61 74 65  line Certificate
4d70: 20 53 74 61 74 75 73 20 50 72 6f 74 6f 63 6f 6c   Status Protocol
4d80: 20 28 4f 43 53 50 29 20 55 52 4c 73 20 74 68 61   (OCSP) URLs tha
4d90: 74 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f  t can be used to
4da0: 0a 63 68 65 63 6b 20 74 68 65 20 76 61 6c 69 64  .check the valid
4db0: 69 74 79 20 6f 66 20 74 68 69 73 20 63 65 72 74  ity of this cert
4dc0: 69 66 69 63 61 74 65 5c 26 2e 0a 2e 54 50 0a 5c  ificate\&...TP.\
4dd0: 66 42 63 65 72 74 69 66 69 63 61 74 65 5c 66 52  fBcertificate\fR
4de0: 20 5c 66 49 63 65 72 74 5c 66 52 0a 54 68 65 20   \fIcert\fR.The 
4df0: 50 45 4d 20 65 6e 63 6f 64 65 64 20 63 65 72 74  PEM encoded cert
4e00: 69 66 69 63 61 74 65 5c 26 2e 0a 2e 54 50 0a 5c  ificate\&...TP.\
4e10: 66 42 73 69 67 6e 61 74 75 72 65 41 6c 67 6f 72  fBsignatureAlgor
4e20: 69 74 68 6d 5c 66 52 20 5c 66 49 61 6c 67 6f 72  ithm\fR \fIalgor
4e30: 69 74 68 6d 5c 66 52 0a 43 69 70 68 65 72 20 61  ithm\fR.Cipher a
4e40: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f  lgorithm used fo
4e50: 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  r the certificat
4e60: 65 20 73 69 67 6e 61 74 75 72 65 5c 26 2e 0a 2e  e signature\&...
4e70: 54 50 0a 5c 66 42 73 69 67 6e 61 74 75 72 65 56  TP.\fBsignatureV
4e80: 61 6c 75 65 5c 66 52 20 5c 66 49 73 74 72 69 6e  alue\fR \fIstrin
4e90: 67 5c 66 52 0a 43 65 72 74 69 66 69 63 61 74 65  g\fR.Certificate
4ea0: 20 73 69 67 6e 61 74 75 72 65 20 61 73 20 61 20   signature as a 
4eb0: 68 65 78 20 73 74 72 69 6e 67 5c 26 2e 0a 2e 54  hex string\&...T
4ec0: 50 0a 5c 66 42 73 69 67 6e 61 74 75 72 65 44 69  P.\fBsignatureDi
4ed0: 67 65 73 74 5c 66 52 20 5c 66 49 76 65 72 73 69  gest\fR \fIversi
4ee0: 6f 6e 5c 66 52 0a 43 65 72 74 69 66 69 63 61 74  on\fR.Certificat
4ef0: 65 20 73 69 67 6e 69 6e 67 20 64 69 67 65 73 74  e signing digest
4f00: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67   as a hex string
4f10: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70 75 62 6c 69  \&...TP.\fBpubli
4f20: 63 4b 65 79 41 6c 67 6f 72 69 74 68 6d 5c 66 52  cKeyAlgorithm\fR
4f30: 20 5c 66 49 61 6c 67 6f 72 69 74 68 6d 5c 66 52   \fIalgorithm\fR
4f40: 0a 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67  .Certificate sig
4f50: 6e 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65  nature public ke
4f60: 79 20 61 6c 67 6f 72 69 74 68 6d 5c 26 2e 0a 2e  y algorithm\&...
4f70: 54 50 0a 5c 66 42 70 75 62 6c 69 63 4b 65 79 5c  TP.\fBpublicKey\
4f80: 66 52 20 5c 66 49 73 74 72 69 6e 67 5c 66 52 0a  fR \fIstring\fR.
4f90: 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e  Certificate sign
4fa0: 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65 79  ature public key
4fb0: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67   as a hex string
4fc0: 5c 26 2e 0a 2e 54 50 0a 5c 66 42 62 69 74 73 5c  \&...TP.\fBbits\
4fd0: 66 52 20 5c 66 49 6e 5c 66 52 0a 4e 75 6d 62 65  fR \fIn\fR.Numbe
4fe0: 72 20 6f 66 20 62 69 74 73 20 75 73 65 64 20 66  r of bits used f
4ff0: 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73  or certificate s
5000: 69 67 6e 61 74 75 72 65 20 6b 65 79 5c 26 2e 0a  ignature key\&..
5010: 2e 54 50 0a 5c 66 42 73 65 6c 66 5f 73 69 67 6e  .TP.\fBself_sign
5020: 65 64 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e  ed\fR \fIboolean
5030: 5c 66 52 0a 57 68 65 74 68 65 72 20 74 68 65 20  \fR.Whether the 
5040: 63 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e  certificate sign
5050: 61 74 75 72 65 20 69 73 20 73 65 6c 66 20 73 69  ature is self si
5060: 67 6e 65 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73  gned\&...TP.\fBs
5070: 68 61 31 5f 68 61 73 68 5c 66 52 20 5c 66 49 68  ha1_hash\fR \fIh
5080: 61 73 68 5c 66 52 0a 54 68 65 20 53 48 41 31 20  ash\fR.The SHA1 
5090: 68 61 73 68 20 6f 66 20 74 68 65 20 63 65 72 74  hash of the cert
50a0: 69 66 69 63 61 74 65 20 61 73 20 61 20 68 65 78  ificate as a hex
50b0: 20 73 74 72 69 6e 67 5c 26 2e 0a 2e 54 50 0a 5c   string\&...TP.\
50c0: 66 42 73 68 61 32 35 36 5f 68 61 73 68 5c 66 52  fBsha256_hash\fR
50d0: 20 5c 66 49 68 61 73 68 5c 66 52 0a 54 68 65 20   \fIhash\fR.The 
50e0: 53 48 41 32 35 36 20 68 61 73 68 20 6f 66 20 74  SHA256 hash of t
50f0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 61  he certificate a
5100: 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 5c 26  s a hex string\&
5110: 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 74 6c 73  ...RE..TP.\fBtls
5120: 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 5c 66 52 20  ::connection\fR 
5130: 5c 66 49 63 68 61 6e 6e 65 6c 5c 66 52 0a 52 65  \fIchannel\fR.Re
5140: 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e  turns the curren
5150: 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 61  t connection sta
5160: 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68  tus of an SSL ch
5170: 61 6e 6e 65 6c 5c 26 2e 20 54 68 65 20 72 65 73  annel\&. The res
5180: 75 6c 74 20 69 73 20 61 20 6c 69 73 74 0a 6f 66  ult is a list.of
5190: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73   key-value pairs
51a0: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20   describing the 
51b0: 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e 20 52 65  connection\&. Re
51c0: 74 75 72 6e 65 64 20 76 61 6c 75 65 73 20 69 6e  turned values in
51d0: 63 6c 75 64 65 3a 0a 2e 73 70 0a 53 53 4c 20 53  clude:..sp.SSL S
51e0: 74 61 74 75 73 0a 2e 52 53 0a 2e 54 50 0a 5c 66  tatus..RS..TP.\f
51f0: 42 73 74 61 74 65 5c 66 52 20 5c 66 49 73 74 61  Bstate\fR \fIsta
5200: 74 65 5c 66 52 0a 53 74 61 74 65 20 6f 66 20 74  te\fR.State of t
5210: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 5c 26 2e  he connection\&.
5220: 0a 2e 54 50 0a 5c 66 42 73 65 72 76 65 72 6e 61  ..TP.\fBserverna
5230: 6d 65 5c 66 52 20 5c 66 49 6e 61 6d 65 5c 66 52  me\fR \fIname\fR
5240: 0a 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65  .The name of the
5250: 20 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 73 65   connected to se
5260: 72 76 65 72 5c 26 2e 0a 2e 54 50 0a 5c 66 42 70  rver\&...TP.\fBp
5270: 72 6f 74 6f 63 6f 6c 5c 66 52 20 5c 66 49 76 65  rotocol\fR \fIve
5280: 72 73 69 6f 6e 5c 66 52 0a 54 68 65 20 70 72 6f  rsion\fR.The pro
5290: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73  tocol version us
52a0: 65 64 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65  ed for the conne
52b0: 63 74 69 6f 6e 3a 20 53 53 4c 32 2c 20 53 53 4c  ction: SSL2, SSL
52c0: 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 5c 26 2e  3, TLS1, TLS1\&.
52d0: 31 2c 20 54 4c 53 31 5c 26 2e 32 2c 20 54 4c 53  1, TLS1\&.2, TLS
52e0: 31 5c 26 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77  1\&.3, or unknow
52f0: 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 72 65 6e 65  n\&...TP.\fBrene
5300: 67 6f 74 69 61 74 69 6f 6e 5f 61 6c 6c 6f 77 65  gotiation_allowe
5310: 64 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c  d\fR \fIboolean\
5320: 66 52 0a 57 68 65 74 68 65 72 20 70 72 6f 74 6f  fR.Whether proto
5330: 63 6f 6c 20 72 65 6e 65 67 6f 74 69 61 74 69 6f  col renegotiatio
5340: 6e 20 69 73 20 73 75 70 70 6f 72 74 65 64 20 6f  n is supported o
5350: 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42  r not\&...TP.\fB
5360: 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 5c 66  security_level\f
5370: 52 20 5c 66 49 6c 65 76 65 6c 5c 66 52 0a 54 68  R \fIlevel\fR.Th
5380: 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c  e security level
5390: 20 75 73 65 64 20 66 6f 72 20 73 65 6c 65 63 74   used for select
53a0: 69 6f 6e 20 6f 66 20 63 69 70 68 65 72 73 2c 20  ion of ciphers, 
53b0: 6b 65 79 20 73 69 7a 65 2c 20 65 74 63 5c 26 2e  key size, etc\&.
53c0: 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69 6f 6e 5f  ..TP.\fBsession_
53d0: 72 65 75 73 65 64 5c 66 52 20 5c 66 49 62 6f 6f  reused\fR \fIboo
53e0: 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72 20  lean\fR.Whether 
53f0: 74 68 65 20 73 65 73 73 69 6f 6e 20 68 61 73 20  the session has 
5400: 62 65 65 6e 20 72 65 75 73 65 64 20 6f 72 20 6e  been reused or n
5410: 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42 69 73 5f  ot\&...TP.\fBis_
5420: 73 65 72 76 65 72 5c 66 52 20 5c 66 49 62 6f 6f  server\fR \fIboo
5430: 6c 65 61 6e 5c 66 52 0a 57 68 65 74 68 65 72 20  lean\fR.Whether 
5440: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 69  the connection i
5450: 73 20 63 6f 6e 66 69 67 75 72 65 64 20 61 73 20  s configured as 
5460: 61 20 73 65 72 76 65 72 20 28 31 29 20 6f 72 20  a server (1) or 
5470: 63 6c 69 65 6e 74 20 28 30 29 5c 26 2e 0a 2e 54  client (0)\&...T
5480: 50 0a 5c 66 42 63 6f 6d 70 72 65 73 73 69 6f 6e  P.\fBcompression
5490: 5c 66 52 20 5c 66 49 6d 6f 64 65 5c 66 52 0a 43  \fR \fImode\fR.C
54a0: 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68 6f  ompression metho
54b0: 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 65 78 70 61  d\&...TP.\fBexpa
54c0: 6e 73 69 6f 6e 5c 66 52 20 5c 66 49 6d 6f 64 65  nsion\fR \fImode
54d0: 5c 66 52 0a 45 78 70 61 6e 73 69 6f 6e 20 6d 65  \fR.Expansion me
54e0: 74 68 6f 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 63  thod\&...TP.\fBc
54f0: 61 4c 69 73 74 5c 66 52 20 5c 66 49 6c 69 73 74  aList\fR \fIlist
5500: 5c 66 52 0a 4c 69 73 74 20 6f 66 20 43 65 72 74  \fR.List of Cert
5510: 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74  ificate Authorit
5520: 69 65 73 20 28 43 41 29 20 66 6f 72 20 58 5c 26  ies (CA) for X\&
5530: 2e 35 30 39 20 63 65 72 74 69 66 69 63 61 74 65  .509 certificate
5540: 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 43 69 70 68  \&...RE..IP.Ciph
5550: 65 72 20 49 6e 66 6f 0a 2e 52 53 0a 2e 54 50 0a  er Info..RS..TP.
5560: 5c 66 42 63 69 70 68 65 72 5c 66 52 20 5c 66 49  \fBcipher\fR \fI
5570: 63 69 70 68 65 72 5c 66 52 0a 54 68 65 20 63 75  cipher\fR.The cu
5580: 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e 20  rrent cipher in 
5590: 75 73 65 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e  use for the conn
55a0: 65 63 74 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66  ection\&...TP.\f
55b0: 42 73 74 61 6e 64 61 72 64 5f 6e 61 6d 65 5c 66  Bstandard_name\f
55c0: 52 20 5c 66 49 6e 61 6d 65 5c 66 52 0a 54 68 65  R \fIname\fR.The
55d0: 20 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e 61   standard RFC na
55e0: 6d 65 20 6f 66 20 63 69 70 68 65 72 5c 26 2e 0a  me of cipher\&..
55f0: 2e 54 50 0a 5c 66 42 61 6c 67 6f 72 69 74 68 6d  .TP.\fBalgorithm
5600: 5f 62 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66 52  _bits\fR \fIn\fR
5610: 0a 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70  .The number of p
5620: 72 6f 63 65 73 73 65 64 20 62 69 74 73 20 75 73  rocessed bits us
5630: 65 64 20 66 6f 72 20 63 69 70 68 65 72 5c 26 2e  ed for cipher\&.
5640: 0a 2e 54 50 0a 5c 66 42 73 65 63 72 65 74 5f 62  ..TP.\fBsecret_b
5650: 69 74 73 5c 66 52 20 5c 66 49 6e 5c 66 52 0a 54  its\fR \fIn\fR.T
5660: 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 73 65 63  he number of sec
5670: 72 65 74 20 62 69 74 73 20 75 73 65 64 20 66 6f  ret bits used fo
5680: 72 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54 50 0a  r cipher\&...TP.
5690: 5c 66 42 6d 69 6e 5f 76 65 72 73 69 6f 6e 5c 66  \fBmin_version\f
56a0: 52 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a  R \fIversion\fR.
56b0: 54 68 65 20 6d 69 6e 69 6d 75 6d 20 70 72 6f 74  The minimum prot
56c0: 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 66 6f 72  ocol version for
56d0: 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54 50 0a 5c   cipher\&...TP.\
56e0: 66 42 63 69 70 68 65 72 5f 69 73 5f 61 65 61 64  fBcipher_is_aead
56f0: 5c 66 52 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66  \fR \fIboolean\f
5700: 52 0a 57 68 65 74 68 65 72 20 74 68 65 20 63 69  R.Whether the ci
5710: 70 68 65 72 20 69 73 20 41 75 74 68 65 6e 74 69  pher is Authenti
5720: 63 61 74 65 64 20 45 6e 63 72 79 70 74 69 6f 6e  cated Encryption
5730: 20 77 69 74 68 20 41 73 73 6f 63 69 61 74 65 64   with Associated
5740: 20 44 61 74 61 20 28 41 45 41 44 29 5c 26 2e 0a   Data (AEAD)\&..
5750: 2e 54 50 0a 5c 66 42 63 69 70 68 65 72 5f 69 64  .TP.\fBcipher_id
5760: 5c 66 52 20 5c 66 49 69 64 5c 66 52 0a 54 68 65  \fR \fIid\fR.The
5770: 20 4f 70 65 6e 53 53 4c 20 63 69 70 68 65 72 20   OpenSSL cipher 
5780: 69 64 5c 26 2e 0a 2e 54 50 0a 5c 66 42 64 65 73  id\&...TP.\fBdes
5790: 63 72 69 70 74 69 6f 6e 5c 66 52 20 5c 66 49 73  cription\fR \fIs
57a0: 74 72 69 6e 67 5c 66 52 0a 41 20 74 65 78 74 20  tring\fR.A text 
57b0: 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 66 20 74  description of t
57c0: 68 65 20 63 69 70 68 65 72 5c 26 2e 0a 2e 54 50  he cipher\&...TP
57d0: 0a 5c 66 42 68 61 6e 64 73 68 61 6b 65 5f 64 69  .\fBhandshake_di
57e0: 67 65 73 74 5c 66 52 20 5c 66 49 62 6f 6f 6c 65  gest\fR \fIboole
57f0: 61 6e 5c 66 52 0a 44 69 67 65 73 74 20 75 73 65  an\fR.Digest use
5800: 64 20 64 75 72 69 6e 67 20 68 61 6e 64 73 68 61  d during handsha
5810: 6b 65 5c 26 2e 0a 2e 52 45 0a 2e 49 50 0a 53 65  ke\&...RE..IP.Se
5820: 73 73 69 6f 6e 20 49 6e 66 6f 0a 2e 52 53 0a 2e  ssion Info..RS..
5830: 54 50 0a 5c 66 42 61 6c 70 6e 5c 66 52 20 5c 66  TP.\fBalpn\fR \f
5840: 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 0a 54 68 65  Iprotocol\fR.The
5850: 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74   protocol select
5860: 65 64 20 61 66 74 65 72 20 41 70 70 6c 69 63 61  ed after Applica
5870: 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f  tion-Layer Proto
5880: 63 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20  col Negotiation 
5890: 28 41 4c 50 4e 29 5c 26 2e 0a 2e 54 50 0a 5c 66  (ALPN)\&...TP.\f
58a0: 42 72 65 73 75 6d 61 62 6c 65 5c 66 52 20 5c 66  Bresumable\fR \f
58b0: 49 62 6f 6f 6c 65 61 6e 5c 66 52 0a 57 68 65 74  Iboolean\fR.Whet
58c0: 68 65 72 20 74 68 65 20 73 65 73 73 69 6f 6e 20  her the session 
58d0: 63 61 6e 20 62 65 20 72 65 73 75 6d 65 64 20 6f  can be resumed o
58e0: 72 20 6e 6f 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42  r not\&...TP.\fB
58f0: 73 74 61 72 74 5f 74 69 6d 65 5c 66 52 20 5c 66  start_time\fR \f
5900: 49 73 65 63 6f 6e 64 73 5c 66 52 0a 54 69 6d 65  Iseconds\fR.Time
5910: 20 73 69 6e 63 65 20 73 65 73 73 69 6f 6e 20 73   since session s
5920: 74 61 72 74 65 64 20 69 6e 20 73 65 63 6f 6e 64  tarted in second
5930: 73 20 73 69 6e 63 65 20 65 70 6f 63 68 5c 26 2e  s since epoch\&.
5940: 0a 2e 54 50 0a 5c 66 42 74 69 6d 65 6f 75 74 5c  ..TP.\fBtimeout\
5950: 66 52 20 5c 66 49 73 65 63 6f 6e 64 73 5c 66 52  fR \fIseconds\fR
5960: 0a 4d 61 78 20 64 75 72 61 74 69 6f 6e 20 6f 66  .Max duration of
5970: 20 73 65 73 73 69 6f 6e 20 69 6e 20 73 65 63 6f   session in seco
5980: 6e 64 73 20 62 65 66 6f 72 65 20 74 69 6d 65 2d  nds before time-
5990: 6f 75 74 5c 26 2e 0a 2e 54 50 0a 5c 66 42 6c 69  out\&...TP.\fBli
59a0: 66 65 74 69 6d 65 5c 66 52 20 5c 66 49 73 65 63  fetime\fR \fIsec
59b0: 6f 6e 64 73 5c 66 52 0a 53 65 73 73 69 6f 6e 20  onds\fR.Session 
59c0: 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 20  ticket lifetime 
59d0: 68 69 6e 74 20 69 6e 20 73 65 63 6f 6e 64 73 5c  hint in seconds\
59e0: 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69 6f  &...TP.\fBsessio
59f0: 6e 5f 69 64 5c 66 52 20 5c 66 49 62 69 6e 61 72  n_id\fR \fIbinar
5a00: 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e 69 71  y_string\fR.Uniq
5a10: 75 65 20 73 65 73 73 69 6f 6e 20 69 64 20 66 6f  ue session id fo
5a20: 72 20 75 73 65 20 69 6e 20 72 65 73 75 6d 69 6e  r use in resumin
5a30: 67 20 74 68 65 20 73 65 73 73 69 6f 6e 5c 26 2e  g the session\&.
5a40: 0a 2e 54 50 0a 5c 66 42 73 65 73 73 69 6f 6e 5f  ..TP.\fBsession_
5a50: 74 69 63 6b 65 74 5c 66 52 20 5c 66 49 62 69 6e  ticket\fR \fIbin
5a60: 61 72 79 5f 73 74 72 69 6e 67 5c 66 52 0a 55 6e  ary_string\fR.Un
5a70: 69 71 75 65 20 73 65 73 73 69 6f 6e 20 74 69 63  ique session tic
5a80: 6b 65 74 20 66 6f 72 20 75 73 65 20 69 6e 20 72  ket for use in r
5a90: 65 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73 73  esuming the sess
5aa0: 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74 69  ion\&...TP.\fBti
5ab0: 63 6b 65 74 5f 61 70 70 5f 64 61 74 61 5c 66 52  cket_app_data\fR
5ac0: 20 5c 66 49 62 69 6e 61 72 79 5f 73 74 72 69 6e   \fIbinary_strin
5ad0: 67 5c 66 52 0a 55 6e 69 71 75 65 20 73 65 73 73  g\fR.Unique sess
5ae0: 69 6f 6e 20 74 69 63 6b 65 74 20 61 70 70 6c 69  ion ticket appli
5af0: 63 61 74 69 6f 6e 20 64 61 74 61 5c 26 2e 0a 2e  cation data\&...
5b00: 54 50 0a 5c 66 42 6d 61 73 74 65 72 5f 6b 65 79  TP.\fBmaster_key
5b10: 5c 66 52 20 5c 66 49 62 69 6e 61 72 79 5f 73 74  \fR \fIbinary_st
5b20: 72 69 6e 67 5c 66 52 0a 55 6e 69 71 75 65 20 73  ring\fR.Unique s
5b30: 65 73 73 69 6f 6e 20 6d 61 73 74 65 72 20 6b 65  ession master ke
5b40: 79 5c 26 2e 0a 2e 54 50 0a 5c 66 42 73 65 73 73  y\&...TP.\fBsess
5b50: 69 6f 6e 5f 63 61 63 68 65 5f 6d 6f 64 65 5c 66  ion_cache_mode\f
5b60: 52 20 5c 66 49 6d 6f 64 65 5c 66 52 0a 53 65 72  R \fImode\fR.Ser
5b70: 76 65 72 20 63 61 63 68 65 20 6d 6f 64 65 20 28  ver cache mode (
5b80: 63 6c 69 65 6e 74 2c 20 73 65 72 76 65 72 2c 20  client, server, 
5b90: 6f 72 20 62 6f 74 68 29 5c 26 2e 0a 2e 52 45 0a  or both)\&...RE.
5ba0: 2e 54 50 0a 5c 66 42 74 6c 73 3a 3a 63 69 70 68  .TP.\fBtls::ciph
5bb0: 65 72 73 5c 66 52 20 3f 5c 66 49 70 72 6f 74 6f  ers\fR ?\fIproto
5bc0: 63 6f 6c 5c 66 52 3f 20 3f 5c 66 49 76 65 72 62  col\fR? ?\fIverb
5bd0: 6f 73 65 5c 66 52 3f 20 3f 5c 66 49 73 75 70 70  ose\fR? ?\fIsupp
5be0: 6f 72 74 65 64 5c 66 52 3f 0a 57 69 74 68 6f 75  orted\fR?.Withou
5bf0: 74 20 61 6e 79 20 61 72 67 73 2c 20 72 65 74 75  t any args, retu
5c00: 72 6e 73 20 61 20 6c 69 73 74 20 6f 66 20 61 6c  rns a list of al
5c10: 6c 20 73 79 6d 6d 65 74 72 69 63 20 63 69 70 68  l symmetric ciph
5c20: 65 72 73 20 66 6f 72 20 75 73 65 20 77 69 74 68  ers for use with
5c30: 20 74 68 65 0a 5c 66 49 2d 63 69 70 68 65 72 5c   the.\fI-cipher\
5c40: 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 20 57 69 74  fR option\&. Wit
5c50: 68 20 5c 66 49 70 72 6f 74 6f 63 6f 6c 5c 66 52  h \fIprotocol\fR
5c60: 2c 20 6f 6e 6c 79 20 74 68 65 20 63 69 70 68 65  , only the ciphe
5c70: 72 73 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72  rs supported for
5c80: 20 74 68 61 74 0a 70 72 6f 74 6f 63 6f 6c 20 61   that.protocol a
5c90: 72 65 20 72 65 74 75 72 6e 65 64 5c 26 2e 20 53  re returned\&. S
5ca0: 65 65 20 74 68 65 20 5c 66 42 74 6c 73 3a 3a 70  ee the \fBtls::p
5cb0: 72 6f 74 6f 63 6f 6c 73 5c 66 52 20 63 6f 6d 6d  rotocols\fR comm
5cc0: 61 6e 64 20 66 6f 72 20 74 68 65 20 73 75 70 70  and for the supp
5cd0: 6f 72 74 65 64 0a 70 72 6f 74 6f 63 6f 6c 73 5c  orted.protocols\
5ce0: 26 2e 20 49 66 20 5c 66 49 76 65 72 62 6f 73 65  &. If \fIverbose
5cf0: 5c 66 52 20 69 73 20 73 70 65 63 69 66 69 65 64  \fR is specified
5d00: 20 61 73 20 74 72 75 65 20 74 68 65 6e 20 61 20   as true then a 
5d10: 76 65 72 62 6f 73 65 2c 20 68 75 6d 61 6e 20 72  verbose, human r
5d20: 65 61 64 61 62 6c 65 0a 6c 69 73 74 20 69 73 20  eadable.list is 
5d30: 72 65 74 75 72 6e 65 64 20 77 69 74 68 20 61 64  returned with ad
5d40: 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61  ditional informa
5d50: 74 69 6f 6e 20 6f 6e 20 74 68 65 20 63 69 70 68  tion on the ciph
5d60: 65 72 5c 26 2e 20 49 66 20 5c 66 49 73 75 70 70  er\&. If \fIsupp
5d70: 6f 72 74 65 64 5c 66 52 0a 69 73 20 73 70 65 63  orted\fR.is spec
5d80: 69 66 69 65 64 20 61 73 20 74 72 75 65 2c 20 74  ified as true, t
5d90: 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20 63 69 70  hen only the cip
5da0: 68 65 72 73 20 73 75 70 70 6f 72 74 65 64 20 66  hers supported f
5db0: 6f 72 20 70 72 6f 74 6f 63 6f 6c 20 77 69 6c 6c  or protocol will
5dc0: 20 62 65 20 6c 69 73 74 65 64 5c 26 2e 0a 2e 54   be listed\&...T
5dd0: 50 0a 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63  P.\fBtls::protoc
5de0: 6f 6c 73 5c 66 52 0a 52 65 74 75 72 6e 73 20 61  ols\fR.Returns a
5df0: 20 6c 69 73 74 20 6f 66 20 74 68 65 20 73 75 70   list of the sup
5e00: 70 6f 72 74 65 64 20 53 53 4c 2f 54 4c 53 20 70  ported SSL/TLS p
5e10: 72 6f 74 6f 63 6f 6c 73 5c 26 2e 20 56 61 6c 69  rotocols\&. Vali
5e20: 64 20 76 61 6c 75 65 73 20 61 72 65 3a 0a 5c 66  d values are:.\f
5e30: 42 73 73 6c 32 5c 66 52 2c 20 5c 66 42 73 73 6c  Bssl2\fR, \fBssl
5e40: 33 5c 66 52 2c 20 5c 66 42 74 6c 73 31 5c 66 52  3\fR, \fBtls1\fR
5e50: 2c 20 5c 66 42 74 6c 73 31 5c 26 2e 31 5c 66 52  , \fBtls1\&.1\fR
5e60: 2c 20 5c 66 42 74 6c 73 31 5c 26 2e 32 5c 66 52  , \fBtls1\&.2\fR
5e70: 2c 20 61 6e 64 0a 5c 66 42 74 6c 73 31 5c 26 2e  , and.\fBtls1\&.
5e80: 33 5c 66 52 5c 26 2e 20 45 78 61 63 74 20 6c 69  3\fR\&. Exact li
5e90: 73 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 4f 70  st depends on Op
5ea0: 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 61 6e  enSSL version an
5eb0: 64 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 20 66  d compile time f
5ec0: 6c 61 67 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 74  lags\&...TP.\fBt
5ed0: 6c 73 3a 3a 76 65 72 73 69 6f 6e 5c 66 52 0a 52  ls::version\fR.R
5ee0: 65 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e 53  eturns the OpenS
5ef0: 53 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69 6e  SL version strin
5f00: 67 5c 26 2e 0a 2e 50 50 0a 2e 53 48 20 22 43 45  g\&...PP..SH "CE
5f10: 52 54 49 46 49 43 41 54 45 20 56 41 4c 49 44 41  RTIFICATE VALIDA
5f20: 54 49 4f 4e 22 0a 2e 53 53 20 22 50 4b 49 20 41  TION"..SS "PKI A
5f30: 4e 44 20 43 45 52 54 49 46 49 43 41 54 45 53 22  ND CERTIFICATES"
5f40: 0a 55 73 69 6e 67 20 74 68 65 20 50 75 62 6c 69  .Using the Publi
5f50: 63 20 4b 65 79 20 49 6e 66 72 61 73 74 72 75 63  c Key Infrastruc
5f60: 74 75 72 65 20 28 50 4b 49 29 2c 20 65 61 63 68  ture (PKI), each
5f70: 20 75 73 65 72 20 63 72 65 61 74 65 73 20 61 20   user creates a 
5f80: 70 72 69 76 61 74 65 20 6b 65 79 20 74 68 61 74  private key that
5f90: 0a 6f 6e 6c 79 20 74 68 65 79 20 6b 6e 6f 77 20  .only they know 
5fa0: 61 62 6f 75 74 20 61 6e 64 20 61 20 70 75 62 6c  about and a publ
5fb0: 69 63 20 6b 65 79 20 74 68 65 79 20 63 61 6e 20  ic key they can 
5fc0: 65 78 63 68 61 6e 67 65 20 77 69 74 68 20 6f 74  exchange with ot
5fd0: 68 65 72 73 20 66 6f 72 20 75 73 65 20 69 6e 0a  hers for use in.
5fe0: 65 6e 63 72 79 70 74 69 6e 67 20 61 6e 64 20 64  encrypting and d
5ff0: 65 63 72 79 70 74 69 6e 67 20 64 61 74 61 5c 26  ecrypting data\&
6000: 2e 20 54 68 65 20 70 72 6f 63 65 73 73 20 69 73  . The process is
6010: 20 74 68 65 20 73 65 6e 64 65 72 20 65 6e 63 72   the sender encr
6020: 79 70 74 73 20 74 68 65 69 72 20 64 61 74 61 0a  ypts their data.
6030: 75 73 69 6e 67 20 74 68 65 69 72 20 70 72 69 76  using their priv
6040: 61 74 65 20 6b 65 79 20 61 6e 64 20 74 68 65 20  ate key and the 
6050: 72 65 63 65 69 76 65 72 27 73 20 70 75 62 6c 69  receiver's publi
6060: 63 20 6b 65 79 5c 26 2e 20 54 68 65 20 64 61 74  c key\&. The dat
6070: 61 20 69 73 20 74 68 65 6e 20 73 65 6e 74 0a 74  a is then sent.t
6080: 6f 20 74 68 65 20 72 65 63 65 69 76 65 72 5c 26  o the receiver\&
6090: 2e 20 49 6e 20 61 20 73 69 6d 69 6c 61 72 20 6d  . In a similar m
60a0: 61 6e 6e 65 72 2c 20 74 68 65 20 72 65 63 65 69  anner, the recei
60b0: 76 65 72 20 75 73 65 73 20 74 68 65 69 72 20 70  ver uses their p
60c0: 72 69 76 61 74 65 20 6b 65 79 20 61 6e 64 0a 74  rivate key and.t
60d0: 68 65 20 73 65 6e 64 65 72 27 73 20 70 75 62 6c  he sender's publ
60e0: 69 63 20 6b 65 79 20 74 6f 20 64 65 63 72 79 70  ic key to decryp
60f0: 74 20 74 68 65 20 64 61 74 61 5c 26 2e 20 54 68  t the data\&. Th
6100: 69 73 20 70 72 6f 76 69 64 65 73 20 64 61 74 61  is provides data
6110: 20 69 6e 74 65 67 72 69 74 79 2c 20 74 6f 0a 65   integrity, to.e
6120: 6e 73 75 72 65 20 74 68 65 20 64 61 74 61 20 63  nsure the data c
6130: 61 6e 27 74 20 62 65 20 76 69 65 77 65 64 20 6f  an't be viewed o
6140: 72 20 61 6c 74 65 72 65 64 20 64 75 72 69 6e 67  r altered during
6150: 20 74 72 61 6e 73 70 6f 72 74 5c 26 2e 20 53 65   transport\&. Se
6160: 65 20 74 68 65 0a 5c 66 42 2d 6b 65 79 5c 66 52  e the.\fB-key\fR
6170: 20 61 6e 64 20 5c 66 42 2d 6b 65 79 66 69 6c 65   and \fB-keyfile
6180: 5c 66 52 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20  \fR options for 
6190: 68 6f 77 20 74 6f 20 73 70 65 63 69 66 79 20 74  how to specify t
61a0: 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 5c 26  he private key\&
61b0: 2e 0a 41 6c 73 6f 20 73 65 65 20 74 68 65 20 5c  ..Also see the \
61c0: 66 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 20 6f  fB-password\fR o
61d0: 70 74 69 6f 6e 20 66 6f 72 20 68 6f 77 20 74 6f  ption for how to
61e0: 20 70 72 6f 76 69 64 65 20 74 68 65 20 70 61 73   provide the pas
61f0: 73 77 6f 72 64 5c 26 2e 0a 2e 50 50 0a 49 6e 20  sword\&...PP.In 
6200: 6f 72 64 65 72 20 74 6f 20 70 72 6f 76 69 64 65  order to provide
6210: 20 61 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 2c   authentication,
6220: 20 69 5c 26 2e 65 5c 26 2e 20 65 6e 73 75 72 69   i\&.e\&. ensuri
6230: 6e 67 20 73 6f 6d 65 6f 6e 65 20 69 73 20 77 68  ng someone is wh
6240: 6f 20 74 68 65 79 20 73 61 79 20 74 68 65 79 0a  o they say they.
6250: 61 72 65 2c 20 74 68 65 20 70 75 62 6c 69 63 20  are, the public 
6260: 6b 65 79 20 61 6e 64 20 75 73 65 72 20 69 64 65  key and user ide
6270: 6e 74 69 66 69 63 61 74 69 6f 6e 20 69 6e 66 6f  ntification info
6280: 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 61 20   is stored in a 
6290: 58 5c 26 2e 35 30 39 0a 63 65 72 74 69 66 69 63  X\&.509.certific
62a0: 61 74 65 20 61 6e 64 20 74 68 61 74 20 63 65 72  ate and that cer
62b0: 74 69 66 69 63 61 74 65 20 69 73 20 61 75 74 68  tificate is auth
62c0: 65 6e 74 69 63 61 74 65 64 20 28 69 5c 26 2e 65  enticated (i\&.e
62d0: 5c 26 2e 20 73 69 67 6e 65 64 29 20 62 79 20 61  \&. signed) by a
62e0: 20 43 65 72 74 69 66 69 63 61 74 65 0a 41 75 74   Certificate.Aut
62f0: 68 6f 72 69 74 79 20 28 43 41 29 5c 26 2e 20 55  hority (CA)\&. U
6300: 73 65 72 73 20 63 61 6e 20 74 68 65 6e 20 65 78  sers can then ex
6310: 63 68 61 6e 67 65 20 74 68 65 73 65 20 63 65 72  change these cer
6320: 74 69 66 69 63 61 74 65 73 20 64 75 72 69 6e 67  tificates during
6330: 20 74 68 65 20 54 4c 53 0a 69 6e 69 74 69 61 6c   the TLS.initial
6340: 69 7a 61 74 69 6f 6e 20 70 72 6f 63 65 73 73 20  ization process 
6350: 61 6e 64 20 63 68 65 63 6b 20 74 68 65 6d 20 61  and check them a
6360: 67 61 69 6e 73 74 20 74 68 65 20 72 6f 6f 74 20  gainst the root 
6370: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73 20  CA certificates 
6380: 74 6f 20 65 6e 73 75 72 65 0a 74 68 65 79 20 61  to ensure.they a
6390: 72 65 20 76 61 6c 69 64 5c 26 2e 20 54 68 69 73  re valid\&. This
63a0: 20 69 73 20 68 61 6e 64 6c 65 64 20 62 79 20 4f   is handled by O
63b0: 70 65 6e 53 53 4c 20 76 69 61 20 74 68 65 20 5c  penSSL via the \
63c0: 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20 61 6e  fB-request\fR an
63d0: 64 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c 66 52  d.\fB-require\fR
63e0: 20 6f 70 74 69 6f 6e 73 5c 26 2e 20 53 65 65 20   options\&. See 
63f0: 74 68 65 20 5c 66 42 2d 63 61 64 69 72 5c 66 52  the \fB-cadir\fR
6400: 2c 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c 20  , \fB-cadir\fR, 
6410: 61 6e 64 0a 5c 66 42 2d 63 61 73 74 6f 72 65 5c  and.\fB-castore\
6420: 66 52 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20 68  fR options for h
6430: 6f 77 20 74 70 20 73 70 65 63 69 66 79 20 77 68  ow tp specify wh
6440: 65 72 65 20 74 6f 20 66 69 6e 64 20 74 68 65 20  ere to find the 
6450: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73 5c  CA certificates\
6460: 26 2e 0a 4f 70 74 69 6f 6e 61 6c 6c 79 2c 20 69  &..Optionally, i
6470: 6e 20 61 20 66 75 74 75 72 65 20 72 65 6c 65 61  n a future relea
6480: 73 65 2c 20 74 68 65 79 20 63 61 6e 20 61 6c 73  se, they can als
6490: 6f 20 62 65 20 63 68 65 63 6b 65 64 20 61 67 61  o be checked aga
64a0: 69 6e 73 74 20 74 68 65 20 43 65 72 74 69 66 69  inst the Certifi
64b0: 63 61 74 65 0a 52 65 76 6f 63 61 74 69 6f 6e 20  cate.Revocation 
64c0: 4c 69 73 74 20 28 43 52 4c 29 20 6f 66 20 72 65  List (CRL) of re
64d0: 76 6f 6b 65 64 20 63 65 72 74 69 66 69 63 61 74  voked certificat
64e0: 65 73 5c 26 2e 20 43 65 72 74 69 66 69 63 61 74  es\&. Certificat
64f0: 65 73 20 63 61 6e 20 61 6c 73 6f 20 62 65 0a 73  es can also be.s
6500: 65 6c 66 2d 73 69 67 6e 65 64 2c 20 62 75 74 20  elf-signed, but 
6510: 74 68 65 79 20 61 72 65 20 62 79 20 64 65 66 61  they are by defa
6520: 75 6c 74 20 6e 6f 74 20 74 72 75 73 74 65 64 20  ult not trusted 
6530: 75 6e 6c 65 73 73 20 79 6f 75 20 61 64 64 20 74  unless you add t
6540: 68 65 6d 20 74 6f 20 79 6f 75 72 0a 63 65 72 74  hem to your.cert
6550: 69 66 69 63 61 74 65 20 73 74 6f 72 65 5c 26 2e  ificate store\&.
6560: 0a 2e 50 50 0a 54 79 70 69 63 61 6c 6c 79 20 77  ..PP.Typically w
6570: 68 65 6e 20 76 69 73 69 74 69 6e 67 20 77 65 62  hen visiting web
6580: 20 73 69 74 65 73 2c 20 6f 6e 6c 79 20 74 68 65   sites, only the
6590: 20 63 6c 69 65 6e 74 20 6e 65 65 64 73 20 74 6f   client needs to
65a0: 20 63 68 65 63 6b 20 74 68 65 20 73 65 72 76 65   check the serve
65b0: 72 27 73 0a 63 65 72 74 69 66 69 63 61 74 65 20  r's.certificate 
65c0: 74 6f 20 65 6e 73 75 72 65 20 69 74 20 69 73 20  to ensure it is 
65d0: 76 61 6c 69 64 5c 26 2e 20 54 68 65 20 73 65 72  valid\&. The ser
65e0: 76 65 72 20 64 6f 65 73 6e 27 74 20 6e 65 65 64  ver doesn't need
65f0: 20 74 6f 20 63 68 65 63 6b 20 74 68 65 20 63 6c   to check the cl
6600: 69 65 6e 74 0a 63 65 72 74 69 66 69 63 61 74 65  ient.certificate
6610: 20 75 6e 6c 65 73 73 20 79 6f 75 20 6e 65 65 64   unless you need
6620: 20 74 6f 20 61 75 74 68 65 6e 74 69 63 61 74 65   to authenticate
6630: 20 77 69 74 68 20 74 68 65 6d 20 74 6f 20 6c 6f   with them to lo
6640: 67 69 6e 2c 20 65 74 63 5c 26 2e 20 53 65 65 20  gin, etc\&. See 
6650: 74 68 65 0a 5c 66 42 2d 63 65 72 74 5c 66 52 20  the.\fB-cert\fR 
6660: 61 6e 64 20 5c 66 42 2d 63 65 72 74 66 69 6c 65  and \fB-certfile
6670: 5c 66 52 20 6f 70 74 69 6f 6e 73 20 69 66 20 79  \fR options if y
6680: 6f 75 20 6e 65 65 64 20 74 6f 20 70 72 6f 76 69  ou need to provi
6690: 64 65 20 61 20 63 65 72 74 69 66 69 63 61 74 65  de a certificate
66a0: 5c 26 2e 0a 2e 53 53 20 22 53 55 4d 4d 41 52 59  \&...SS "SUMMARY
66b0: 20 4f 46 20 43 4f 4d 4d 41 4e 44 20 4c 49 4e 45   OF COMMAND LINE
66c0: 20 4f 50 54 49 4f 4e 53 22 0a 54 68 65 20 66 6f   OPTIONS".The fo
66d0: 6c 6c 6f 77 69 6e 67 20 6f 70 74 69 6f 6e 73 20  llowing options 
66e0: 61 72 65 20 75 73 65 64 20 66 6f 72 20 70 65 65  are used for pee
66f0: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61  r certificate va
6700: 6c 69 64 61 74 69 6f 6e 3a 0a 2e 54 50 0a 5c 66  lidation:..TP.\f
6710: 42 2d 63 61 64 69 72 5c 66 52 20 5c 66 49 64 69  B-cadir\fR \fIdi
6720: 72 65 63 74 6f 72 79 5c 66 52 0a 53 70 65 63 69  rectory\fR.Speci
6730: 66 69 65 73 20 74 68 65 20 64 69 72 65 63 74 6f  fies the directo
6740: 72 79 20 77 68 65 72 65 20 74 68 65 20 43 65 72  ry where the Cer
6750: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69  tificate Authori
6760: 74 79 20 28 43 41 29 20 63 65 72 74 69 66 69 63  ty (CA) certific
6770: 61 74 65 73 20 61 72 65 0a 73 74 6f 72 65 64 5c  ates are.stored\
6780: 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69  &. The default i
6790: 73 20 70 6c 61 74 66 6f 72 6d 20 73 70 65 63 69  s platform speci
67a0: 66 69 63 2c 20 62 75 74 20 69 73 20 75 73 75 61  fic, but is usua
67b0: 6c 6c 79 20 22 5c 66 49 2f 65 74 63 2f 73 73 6c  lly "\fI/etc/ssl
67c0: 2f 63 65 72 74 73 5c 66 52 22 20 6f 6e 0a 4c 69  /certs\fR" on.Li
67d0: 6e 75 78 2f 55 6e 69 78 20 73 79 73 74 65 6d 73  nux/Unix systems
67e0: 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20  \&. The default 
67f0: 6c 6f 63 61 74 69 6f 6e 20 63 61 6e 20 62 65 20  location can be 
6800: 6f 76 65 72 72 69 64 64 65 6e 20 62 79 20 74 68  overridden by th
6810: 65 0a 5c 66 42 53 53 4c 5f 43 45 52 54 5f 44 49  e.\fBSSL_CERT_DI
6820: 52 5c 66 52 20 65 6e 76 69 72 6f 6e 6d 65 6e 74  R\fR environment
6830: 20 76 61 72 69 61 62 6c 65 5c 26 2e 0a 2e 54 50   variable\&...TP
6840: 0a 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52 20 5c  .\fB-cafile\fR \
6850: 66 49 66 69 6c 65 6e 61 6d 65 5c 66 52 0a 53 70  fIfilename\fR.Sp
6860: 65 63 69 66 69 65 73 20 74 68 65 20 66 69 6c 65  ecifies the file
6870: 20 77 69 74 68 20 74 68 65 20 43 65 72 74 69 66   with the Certif
6880: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20  icate Authority 
6890: 28 43 41 29 20 63 65 72 74 69 66 69 63 61 74 65  (CA) certificate
68a0: 73 20 74 6f 20 75 73 65 20 69 6e 0a 5c 66 42 50  s to use in.\fBP
68b0: 45 4d 5c 66 52 20 66 69 6c 65 20 66 6f 72 6d 61  EM\fR file forma
68c0: 74 5c 26 2e 20 54 68 65 20 64 65 66 61 75 6c 74  t\&. The default
68d0: 20 69 73 20 22 5c 66 49 63 65 72 74 5c 26 2e 70   is "\fIcert\&.p
68e0: 65 6d 5c 66 52 22 2c 20 69 6e 20 74 68 65 20 4f  em\fR", in the O
68f0: 70 65 6e 53 53 4c 0a 64 69 72 65 63 74 6f 72 79  penSSL.directory
6900: 5c 26 2e 20 4f 6e 20 4c 69 6e 75 78 2f 55 6e 69  \&. On Linux/Uni
6910: 78 20 73 79 73 74 65 6d 73 2c 20 74 68 69 73 20  x systems, this 
6920: 69 73 20 75 73 75 61 6c 6c 79 20 22 5c 66 49 2f  is usually "\fI/
6930: 65 74 63 2f 73 73 6c 2f 63 61 2d 62 75 6e 64 6c  etc/ssl/ca-bundl
6940: 65 5c 26 2e 70 65 6d 5c 66 52 22 5c 26 2e 0a 54  e\&.pem\fR"\&..T
6950: 68 65 20 64 65 66 61 75 6c 74 20 66 69 6c 65 20  he default file 
6960: 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65  can be overridde
6970: 6e 20 62 79 20 74 68 65 20 5c 66 42 53 53 4c 5f  n by the \fBSSL_
6980: 43 45 52 54 5f 46 49 4c 45 5c 66 52 20 65 6e 76  CERT_FILE\fR env
6990: 69 72 6f 6e 6d 65 6e 74 0a 76 61 72 69 61 62 6c  ironment.variabl
69a0: 65 5c 26 2e 0a 2e 54 50 0a 5c 66 42 2d 63 61 73  e\&...TP.\fB-cas
69b0: 74 6f 72 65 5c 66 52 20 5c 66 49 55 52 49 5c 66  tore\fR \fIURI\f
69c0: 52 0a 53 70 65 63 69 66 69 65 73 20 74 68 65 20  R.Specifies the 
69d0: 55 6e 69 66 6f 72 6d 20 52 65 73 6f 75 72 63 65  Uniform Resource
69e0: 20 49 64 65 6e 74 69 66 69 65 72 20 28 55 52 49   Identifier (URI
69f0: 29 20 66 6f 72 20 74 68 65 20 43 65 72 74 69 66  ) for the Certif
6a00: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 0a  icate Authority.
6a10: 28 43 41 29 20 73 74 6f 72 65 2c 20 77 68 69 63  (CA) store, whic
6a20: 68 20 6d 61 79 20 62 65 20 61 20 73 69 6e 67 6c  h may be a singl
6a30: 65 20 63 6f 6e 74 61 69 6e 65 72 20 6f 72 20 61  e container or a
6a40: 20 63 61 74 61 6c 6f 67 20 6f 66 20 63 6f 6e 74   catalog of cont
6a50: 61 69 6e 65 72 73 5c 26 2e 0a 53 74 61 72 74 69  ainers\&..Starti
6a60: 6e 67 20 77 69 74 68 20 4f 70 65 6e 53 53 4c 20  ng with OpenSSL 
6a70: 33 5c 26 2e 32 20 6f 6e 20 4d 53 20 57 69 6e 64  3\&.2 on MS Wind
6a80: 6f 77 73 2c 20 73 65 74 20 74 6f 20 22 5c 66 42  ows, set to "\fB
6a90: 6f 72 67 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e  org\&.openssl\&.
6aa0: 77 69 6e 73 74 6f 72 65 3a 2f 2f 5c 66 52 22 0a  winstore://\fR".
6ab0: 74 6f 20 75 73 65 20 74 68 65 20 62 75 69 6c 74  to use the built
6ac0: 2d 69 6e 20 4d 53 20 57 69 6e 64 6f 77 73 20 43  -in MS Windows C
6ad0: 65 72 74 69 66 69 63 61 74 65 20 53 74 6f 72 65  ertificate Store
6ae0: 5c 26 2e 0a 54 68 69 73 20 73 74 6f 72 65 20 6f  \&..This store o
6af0: 6e 6c 79 20 73 75 70 70 6f 72 74 73 20 72 6f 6f  nly supports roo
6b00: 74 20 63 65 72 74 69 66 69 63 61 74 65 20 73 74  t certificate st
6b10: 6f 72 65 73 5c 26 2e 20 53 65 65 0a 5c 66 42 43  ores\&. See.\fBC
6b20: 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69 64  ertificate Valid
6b30: 61 74 69 6f 6e 5c 66 52 20 66 6f 72 20 6d 6f 72  ation\fR for mor
6b40: 65 20 64 65 74 61 69 6c 73 5c 26 2e 0a 2e 54 50  e details\&...TP
6b50: 0a 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20  .\fB-request\fR 
6b60: 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71 75 65  \fIbool\fR.Reque
6b70: 73 74 20 61 20 63 65 72 74 69 66 69 63 61 74 65  st a certificate
6b80: 20 66 72 6f 6d 20 74 68 65 20 70 65 65 72 20 64   from the peer d
6b90: 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20 68 61  uring the SSL ha
6ba0: 6e 64 73 68 61 6b 65 5c 26 2e 20 54 68 69 73 20  ndshake\&. This 
6bb0: 69 73 20 6e 65 65 64 65 64 0a 74 6f 20 64 6f 20  is needed.to do 
6bc0: 43 65 72 74 69 66 69 63 61 74 65 20 56 61 6c 69  Certificate Vali
6bd0: 64 61 74 69 6f 6e 5c 26 2e 20 53 74 61 72 74 69  dation\&. Starti
6be0: 6e 67 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26  ng in TclTLS 1\&
6bf0: 2e 38 2c 20 74 68 65 20 64 65 66 61 75 6c 74 20  .8, the default 
6c00: 69 73 0a 5c 66 42 74 72 75 65 5c 66 52 5c 26 2e  is.\fBtrue\fR\&.
6c10: 20 49 6e 20 61 64 64 69 74 69 6f 6e 2c 20 74 68   In addition, th
6c20: 65 20 63 6c 69 65 6e 74 20 63 61 6e 20 6d 61 6e  e client can man
6c30: 75 61 6c 6c 79 20 69 6e 73 70 65 63 74 20 61 6e  ually inspect an
6c40: 64 20 61 63 63 65 70 74 20 6f 72 20 72 65 6a 65  d accept or reje
6c50: 63 74 0a 65 61 63 68 20 63 65 72 74 69 66 69 63  ct.each certific
6c60: 61 74 65 20 75 73 69 6e 67 20 74 68 65 20 5c 66  ate using the \f
6c70: 49 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e  I-validatecomman
6c80: 64 5c 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 0a 2e  d\fR option\&...
6c90: 54 50 0a 5c 66 42 2d 72 65 71 75 69 72 65 5c 66  TP.\fB-require\f
6ca0: 52 20 5c 66 49 62 6f 6f 6c 5c 66 52 0a 52 65 71  R \fIbool\fR.Req
6cb0: 75 69 72 65 20 61 20 76 61 6c 69 64 20 63 65 72  uire a valid cer
6cc0: 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20 74 68  tificate from th
6cd0: 65 20 70 65 65 72 20 64 75 72 69 6e 67 20 74 68  e peer during th
6ce0: 65 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 5c  e SSL handshake\
6cf0: 26 2e 20 49 66 20 74 68 69 73 20 69 73 0a 73 65  &. If this is.se
6d00: 74 20 74 6f 20 74 72 75 65 2c 20 74 68 65 6e 20  t to true, then 
6d10: 5c 66 42 2d 72 65 71 75 65 73 74 5c 66 52 20 6d  \fB-request\fR m
6d20: 75 73 74 20 61 6c 73 6f 20 62 65 20 73 65 74 20  ust also be set 
6d30: 74 6f 20 74 72 75 65 20 61 6e 64 20 61 20 65 69  to true and a ei
6d40: 74 68 65 72 0a 5c 66 42 2d 63 61 64 69 72 5c 66  ther.\fB-cadir\f
6d50: 52 2c 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52  R, \fB-cafile\fR
6d60: 2c 20 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66 52  , \fB-castore\fR
6d70: 2c 20 6f 72 20 61 20 70 6c 61 74 66 6f 72 6d 20  , or a platform 
6d80: 64 65 66 61 75 6c 74 0a 6d 75 73 74 20 62 65 20  default.must be 
6d90: 70 72 6f 76 69 64 65 64 20 69 6e 20 6f 72 64 65  provided in orde
6da0: 72 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 67  r to validate ag
6db0: 61 69 6e 73 74 5c 26 2e 20 54 68 65 20 64 65 66  ainst\&. The def
6dc0: 61 75 6c 74 20 69 6e 20 54 63 6c 54 4c 53 20 31  ault in TclTLS 1
6dd0: 5c 26 2e 38 20 61 6e 64 0a 65 61 72 6c 69 65 72  \&.8 and.earlier
6de0: 20 76 65 72 73 69 6f 6e 73 20 69 73 20 5c 66 42   versions is \fB
6df0: 66 61 6c 73 65 5c 66 52 20 73 69 6e 63 65 20 6e  false\fR since n
6e00: 6f 74 20 61 6c 6c 20 70 6c 61 74 66 6f 72 6d 73  ot all platforms
6e10: 20 68 61 76 65 20 63 65 72 74 69 66 69 63 61 74   have certificat
6e20: 65 73 20 74 6f 0a 76 61 6c 69 64 61 74 65 20 61  es to.validate a
6e30: 67 61 69 6e 73 74 20 69 6e 20 61 20 66 6f 72 6d  gainst in a form
6e40: 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68   compatible with
6e50: 20 4f 70 65 6e 53 53 4c 5c 26 2e 0a 2e 50 50 0a   OpenSSL\&...PP.
6e60: 2e 53 53 20 22 57 48 45 4e 20 41 52 45 20 43 4f  .SS "WHEN ARE CO
6e70: 4d 4d 41 4e 44 20 4c 49 4e 45 20 4f 50 54 49 4f  MMAND LINE OPTIO
6e80: 4e 53 20 4e 45 45 44 45 44 3f 22 0a 49 6e 20 54  NS NEEDED?".In T
6e90: 63 6c 54 4c 53 20 31 5c 26 2e 38 20 61 6e 64 20  clTLS 1\&.8 and 
6ea0: 65 61 72 6c 69 65 72 20 76 65 72 73 69 6f 6e 73  earlier versions
6eb0: 2c 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61  , certificate va
6ec0: 6c 69 64 61 74 69 6f 6e 20 69 73 0a 5c 66 49 4e  lidation is.\fIN
6ed0: 4f 54 5c 66 52 20 65 6e 61 62 6c 65 64 20 62 79  OT\fR enabled by
6ee0: 20 64 65 66 61 75 6c 74 5c 26 2e 20 54 68 69 73   default\&. This
6ef0: 20 6c 69 6d 69 74 61 74 69 6f 6e 20 69 73 20 64   limitation is d
6f00: 75 65 20 74 6f 20 74 68 65 20 6c 61 63 6b 20 6f  ue to the lack o
6f10: 66 20 61 20 63 6f 6d 6d 6f 6e 0a 63 72 6f 73 73  f a common.cross
6f20: 20 70 6c 61 74 66 6f 72 6d 20 64 61 74 61 62 61   platform databa
6f30: 73 65 20 6f 66 20 43 65 72 74 69 66 69 63 61 74  se of Certificat
6f40: 65 20 41 75 74 68 6f 72 69 74 79 20 28 43 41 29  e Authority (CA)
6f50: 20 70 72 6f 76 69 64 65 64 20 63 65 72 74 69 66   provided certif
6f60: 69 63 61 74 65 73 20 74 6f 0a 76 61 6c 69 64 61  icates to.valida
6f70: 74 65 20 61 67 61 69 6e 73 74 5c 26 2e 20 4d 61  te against\&. Ma
6f80: 6e 79 20 4c 69 6e 75 78 20 73 79 73 74 65 6d 73  ny Linux systems
6f90: 20 6e 61 74 69 76 65 6c 79 20 73 75 70 70 6f 72   natively suppor
6fa0: 74 20 4f 70 65 6e 53 53 4c 20 61 6e 64 20 74 68  t OpenSSL and th
6fb0: 75 73 20 68 61 76 65 0a 74 68 65 73 65 20 63 65  us have.these ce
6fc0: 72 74 69 66 69 63 61 74 65 73 20 69 6e 73 74 61  rtificates insta
6fd0: 6c 6c 65 64 20 61 73 20 70 61 72 74 20 6f 66 20  lled as part of 
6fe0: 74 68 65 20 4f 53 2c 20 62 75 74 20 4d 61 63 4f  the OS, but MacO
6ff0: 53 20 61 6e 64 20 4d 53 20 57 69 6e 64 6f 77 73  S and MS Windows
7000: 20 64 6f 20 6e 6f 74 5c 26 2e 0a 49 6e 20 6f 72   do not\&..In or
7010: 64 65 72 20 74 6f 20 75 73 65 20 74 68 65 20 5c  der to use the \
7020: 66 42 2d 72 65 71 75 69 72 65 5c 66 52 20 6f 70  fB-require\fR op
7030: 74 69 6f 6e 2c 20 6f 6e 65 20 6f 66 20 74 68 65  tion, one of the
7040: 20 66 6f 6c 6c 6f 77 69 6e 67 0a 6d 75 73 74 20   following.must 
7050: 62 65 20 74 72 75 65 3a 0a 2e 49 50 20 5c 28 62  be true:..IP \(b
7060: 75 0a 4f 6e 20 4c 69 6e 75 78 20 61 6e 64 20 55  u.On Linux and U
7070: 6e 69 78 20 73 79 73 74 65 6d 73 20 77 69 74 68  nix systems with
7080: 20 4f 70 65 6e 53 53 4c 20 61 6c 72 65 61 64 79   OpenSSL already
7090: 20 69 6e 73 74 61 6c 6c 65 64 20 6f 72 20 69 66   installed or if
70a0: 20 74 68 65 20 43 41 0a 63 65 72 74 69 66 69 63   the CA.certific
70b0: 61 74 65 73 20 61 72 65 20 61 76 61 69 6c 61 62  ates are availab
70c0: 6c 65 20 69 6e 20 50 45 4d 20 66 6f 72 6d 61 74  le in PEM format
70d0: 2c 20 61 6e 64 20 69 66 20 74 68 65 79 20 61 72  , and if they ar
70e0: 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 0a  e stored in the.
70f0: 73 74 61 6e 64 61 72 64 20 6c 6f 63 61 74 69 6f  standard locatio
7100: 6e 73 2c 20 6f 72 20 69 66 20 74 68 65 20 5c 66  ns, or if the \f
7110: 42 53 53 4c 5f 43 45 52 54 5f 44 49 52 5c 66 52  BSSL_CERT_DIR\fR
7120: 20 6f 72 20 5c 66 42 53 53 4c 5f 43 45 52 54 5f   or \fBSSL_CERT_
7130: 46 49 4c 45 5c 66 52 0a 65 6e 76 69 72 6f 6e 6d  FILE\fR.environm
7140: 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 61 72  ent variables ar
7150: 65 20 73 65 74 2c 20 74 68 65 6e 20 5c 66 42 2d  e set, then \fB-
7160: 63 61 64 69 72 5c 66 52 2c 20 5c 66 42 2d 63 61  cadir\fR, \fB-ca
7170: 64 69 72 5c 66 52 2c 0a 61 6e 64 20 5c 66 42 2d  dir\fR,.and \fB-
7180: 63 61 73 74 6f 72 65 5c 66 52 20 61 72 65 6e 27  castore\fR aren'
7190: 74 20 6e 65 65 64 65 64 5c 26 2e 0a 2e 49 50 20  t needed\&...IP 
71a0: 5c 28 62 75 0a 49 66 20 4f 70 65 6e 53 53 4c 20  \(bu.If OpenSSL 
71b0: 69 73 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64  is not installed
71c0: 20 69 6e 20 74 68 65 20 64 65 66 61 75 6c 74 20   in the default 
71d0: 6c 6f 63 61 74 69 6f 6e 2c 20 6f 72 20 77 68 65  location, or whe
71e0: 6e 20 75 73 69 6e 67 20 4d 61 63 20 4f 53 0a 6f  n using Mac OS.o
71f0: 72 20 4d 53 20 57 69 6e 64 6f 77 73 20 61 6e 64  r MS Windows and
7200: 20 4f 70 65 6e 53 53 4c 20 69 73 20 69 6e 73 74   OpenSSL is inst
7210: 61 6c 6c 65 64 2c 20 74 68 65 20 5c 66 42 53 53  alled, the \fBSS
7220: 4c 5f 43 45 52 54 5f 44 49 52 5c 66 52 20 61 6e  L_CERT_DIR\fR an
7230: 64 2f 6f 72 0a 5c 66 42 53 53 4c 5f 43 45 52 54  d/or.\fBSSL_CERT
7240: 5f 46 49 4c 45 5c 66 52 20 65 6e 76 69 72 6f 6e  _FILE\fR environ
7250: 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 6f  ment variables o
7260: 72 20 74 68 65 20 6f 6e 65 20 6f 66 20 74 68 65  r the one of the
7270: 20 5c 66 42 2d 63 61 64 69 72 5c 66 52 2c 0a 5c   \fB-cadir\fR,.\
7280: 66 42 2d 63 61 64 69 72 5c 66 52 2c 20 6f 72 20  fB-cadir\fR, or 
7290: 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66 52 20 6f  \fB-castore\fR o
72a0: 70 74 69 6f 6e 73 20 6d 75 73 74 20 62 65 20 64  ptions must be d
72b0: 65 66 69 6e 65 64 5c 26 2e 0a 2e 49 50 20 5c 28  efined\&...IP \(
72c0: 62 75 0a 4f 6e 20 4d 53 20 57 69 6e 64 6f 77 73  bu.On MS Windows
72d0: 2c 20 73 74 61 72 74 69 6e 67 20 69 6e 20 4f 70  , starting in Op
72e0: 65 6e 53 53 4c 20 33 5c 26 2e 32 2c 20 69 74 20  enSSL 3\&.2, it 
72f0: 69 73 20 6e 6f 77 20 70 6f 73 73 69 62 6c 65 20  is now possible 
7300: 74 6f 20 61 63 63 65 73 73 20 74 68 65 0a 62 75  to access the.bu
7310: 69 6c 74 2d 69 6e 20 57 69 6e 64 6f 77 73 20 43  ilt-in Windows C
7320: 65 72 74 69 66 69 63 61 74 65 20 53 74 6f 72 65  ertificate Store
7330: 20 66 72 6f 6d 20 4f 70 65 6e 53 53 4c 5c 26 2e   from OpenSSL\&.
7340: 20 54 68 69 73 20 63 61 6e 20 75 74 69 6c 69 7a   This can utiliz
7350: 65 64 20 62 79 0a 73 65 74 74 69 6e 67 20 74 68  ed by.setting th
7360: 65 20 5c 66 42 2d 63 61 73 74 6f 72 65 5c 66 52  e \fB-castore\fR
7370: 20 6f 70 74 69 6f 6e 20 74 6f 20 22 5c 66 42 6f   option to "\fBo
7380: 72 67 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26 2e 77  rg\&.openssl\&.w
7390: 69 6e 73 74 6f 72 65 3a 2f 2f 5c 66 52 22 5c 26  instore://\fR"\&
73a0: 2e 0a 2e 49 50 20 5c 28 62 75 0a 49 66 20 4f 70  ...IP \(bu.If Op
73b0: 65 6e 53 53 4c 20 69 73 20 6e 6f 74 20 69 6e 73  enSSL is not ins
73c0: 74 61 6c 6c 65 64 20 6f 72 20 74 68 65 20 43 41  talled or the CA
73d0: 20 63 65 72 74 69 66 69 63 61 74 65 73 20 61 72   certificates ar
73e0: 65 20 6e 6f 74 20 61 76 61 69 6c 61 62 6c 65 20  e not available 
73f0: 69 6e 20 50 45 4d 0a 66 6f 72 6d 61 74 2c 20 74  in PEM.format, t
7400: 68 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74  he CA certificat
7410: 65 73 20 6d 75 73 74 20 62 65 20 64 6f 77 6e 6c  es must be downl
7420: 6f 61 64 65 64 20 61 6e 64 20 69 6e 73 74 61 6c  oaded and instal
7430: 6c 65 64 20 77 69 74 68 20 74 68 65 20 75 73 65  led with the use
7440: 72 0a 73 6f 66 74 77 61 72 65 5c 26 2e 20 54 68  r.software\&. Th
7450: 65 20 43 55 52 4c 20 74 65 61 6d 20 6d 61 6b 65  e CURL team make
7460: 73 20 74 68 65 6d 20 61 76 61 69 6c 61 62 6c 65  s them available
7470: 20 61 74 0a 5c 66 49 43 41 20 63 65 72 74 69 66   at.\fICA certif
7480: 69 63 61 74 65 73 20 65 78 74 72 61 63 74 65 64  icates extracted
7490: 0a 66 72 6f 6d 20 4d 6f 7a 69 6c 6c 61 5c 66 52  .from Mozilla\fR
74a0: 20 5b 68 74 74 70 73 3a 2f 2f 63 75 72 6c 5c 26   [https://curl\&
74b0: 2e 73 65 2f 64 6f 63 73 2f 63 61 65 78 74 72 61  .se/docs/caextra
74c0: 63 74 5c 26 2e 68 74 6d 6c 5d 20 69 6e 20 74 68  ct\&.html] in th
74d0: 65 20 22 5c 66 49 63 61 63 65 72 74 5c 26 2e 70  e "\fIcacert\&.p
74e0: 65 6d 5c 66 52 22 20 66 69 6c 65 5c 26 2e 20 59  em\fR" file\&. Y
74f0: 6f 75 20 6d 75 73 74 20 74 68 65 6e 20 65 69 74  ou must then eit
7500: 68 65 72 20 73 65 74 20 74 68 65 0a 5c 66 42 53  her set the.\fBS
7510: 53 4c 5f 43 45 52 54 5f 44 49 52 5c 66 52 20 61  SL_CERT_DIR\fR a
7520: 6e 64 2f 6f 72 20 5c 66 42 53 53 4c 5f 43 45 52  nd/or \fBSSL_CER
7530: 54 5f 46 49 4c 45 5c 66 52 20 65 6e 76 69 72 6f  T_FILE\fR enviro
7540: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20  nment variables 
7550: 6f 72 20 74 68 65 0a 5c 66 42 2d 63 61 64 69 72  or the.\fB-cadir
7560: 5c 66 52 20 6f 72 20 5c 66 42 2d 63 61 66 69 6c  \fR or \fB-cafil
7570: 65 5c 66 52 20 6f 70 74 69 6f 6e 73 20 74 6f 20  e\fR options to 
7580: 74 68 65 20 43 41 20 63 65 72 74 20 66 69 6c 65  the CA cert file
7590: 27 73 20 69 6e 73 74 61 6c 6c 0a 6c 6f 63 61 74  's install.locat
75a0: 69 6f 6e 5c 26 2e 20 49 74 20 69 73 20 79 6f 75  ion\&. It is you
75b0: 72 20 72 65 73 70 6f 6e 73 69 62 69 6c 69 74 79  r responsibility
75c0: 20 74 6f 20 6b 65 65 70 20 74 68 69 73 20 66 69   to keep this fi
75d0: 6c 65 20 75 70 20 74 6f 20 64 61 74 65 5c 26 2e  le up to date\&.
75e0: 0a 2e 50 50 0a 2e 53 48 20 22 43 41 4c 4c 42 41  ..PP..SH "CALLBA
75f0: 43 4b 20 4f 50 54 49 4f 4e 53 22 0a 41 73 20 70  CK OPTIONS".As p
7600: 72 65 76 69 6f 75 73 6c 79 20 64 65 73 63 72 69  reviously descri
7610: 62 65 64 2c 20 65 61 63 68 20 63 68 61 6e 6e 65  bed, each channe
7620: 6c 20 63 61 6e 20 62 65 20 67 69 76 65 6e 20 74  l can be given t
7630: 68 65 69 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63  heir own callbac
7640: 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 20 69 6e 74  ks.to handle int
7650: 65 72 6d 65 64 69 61 74 65 20 70 72 6f 63 65 73  ermediate proces
7660: 73 69 6e 67 20 62 79 20 74 68 65 20 4f 70 65 6e  sing by the Open
7670: 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 75 73 69  SSL library, usi
7680: 6e 67 20 74 68 65 0a 5c 66 42 2d 63 6f 6d 6d 61  ng the.\fB-comma
7690: 6e 64 5c 66 52 2c 20 5c 66 42 2d 70 61 73 73 77  nd\fR, \fB-passw
76a0: 6f 72 64 5c 66 52 2c 20 61 6e 64 20 5c 66 42 2d  ord\fR, and \fB-
76b0: 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64  validate_command
76c0: 5c 66 52 20 6f 70 74 69 6f 6e 73 0a 70 61 73 73  \fR options.pass
76d0: 65 64 20 74 6f 20 65 69 74 68 65 72 20 6f 66 20  ed to either of 
76e0: 5c 66 42 74 6c 73 3a 3a 73 6f 63 6b 65 74 5c 66  \fBtls::socket\f
76f0: 52 20 6f 72 20 5c 66 42 74 6c 73 3a 3a 69 6d 70  R or \fBtls::imp
7700: 6f 72 74 5c 66 52 5c 26 2e 0a 55 6e 6c 69 6b 65  ort\fR\&..Unlike
7710: 20 70 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f   previous versio
7720: 6e 73 20 6f 66 20 54 63 6c 54 4c 53 2c 20 6f 6e  ns of TclTLS, on
7730: 6c 79 20 69 66 20 74 68 65 20 63 61 6c 6c 62 61  ly if the callba
7740: 63 6b 20 67 65 6e 65 72 61 74 65 73 20 61 6e 20  ck generates an 
7750: 65 72 72 6f 72 2c 0a 77 69 6c 6c 20 74 68 65 20  error,.will the 
7760: 5c 66 42 62 67 65 72 72 6f 72 5c 66 52 20 63 6f  \fBbgerror\fR co
7770: 6d 6d 61 6e 64 20 62 65 20 69 6e 76 6f 6b 65 64  mmand be invoked
7780: 20 77 69 74 68 20 74 68 65 20 65 72 72 6f 72 20   with the error 
7790: 69 6e 66 6f 72 6d 61 74 69 6f 6e 5c 26 2e 0a 2e  information\&...
77a0: 53 53 20 22 56 41 4c 55 45 53 20 46 4f 52 20 43  SS "VALUES FOR C
77b0: 4f 4d 4d 41 4e 44 20 43 41 4c 4c 42 41 43 4b 22  OMMAND CALLBACK"
77c0: 0a 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 66 6f  .The callback fo
77d0: 72 20 74 68 65 20 5c 66 42 2d 63 6f 6d 6d 61 6e  r the \fB-comman
77e0: 64 5c 66 52 20 6f 70 74 69 6f 6e 20 69 73 20 69  d\fR option is i
77f0: 6e 76 6f 6b 65 64 20 61 74 20 73 65 76 65 72 61  nvoked at severa
7800: 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20  l points during 
7810: 74 68 65 0a 4f 70 65 6e 53 53 4c 20 68 61 6e 64  the.OpenSSL hand
7820: 73 68 61 6b 65 20 61 6e 64 20 64 75 72 69 6e 67  shake and during
7830: 20 72 6f 75 74 69 6e 65 20 6f 70 65 72 61 74 69   routine operati
7840: 6f 6e 73 5c 26 2e 20 53 65 65 20 62 65 6c 6f 77  ons\&. See below
7850: 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62 6c   for the possibl
7860: 65 0a 61 72 67 75 6d 65 6e 74 73 20 70 61 73 73  e.arguments pass
7870: 65 64 20 74 6f 20 74 68 65 20 63 61 6c 6c 62 61  ed to the callba
7880: 63 6b 20 73 63 72 69 70 74 5c 26 2e 20 56 61 6c  ck script\&. Val
7890: 75 65 73 20 72 65 74 75 72 6e 65 64 20 66 72 6f  ues returned fro
78a0: 6d 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 61  m the callback a
78b0: 72 65 0a 69 67 6e 6f 72 65 64 5c 26 2e 0a 2e 54  re.ignored\&...T
78c0: 50 0a 5c 66 42 65 72 72 6f 72 5c 66 52 20 5c 66  P.\fBerror\fR \f
78d0: 49 63 68 61 6e 6e 65 6c 49 64 20 6d 65 73 73 61  IchannelId messa
78e0: 67 65 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d 20  ge\fR.This form 
78f0: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
7900: 6e 76 6f 6b 65 64 20 77 68 65 6e 65 76 65 72 20  nvoked whenever 
7910: 61 6e 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20  an error occurs 
7920: 64 75 72 69 6e 67 20 74 68 65 20 69 6e 69 74 69  during the initi
7930: 61 6c 0a 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 68  al.connection, h
7940: 61 6e 64 73 68 61 6b 65 2c 20 6f 72 20 49 2f 4f  andshake, or I/O
7950: 20 6f 70 65 72 61 74 69 6f 6e 73 5c 26 2e 20 54   operations\&. T
7960: 68 65 20 5c 66 49 6d 65 73 73 61 67 65 5c 66 52  he \fImessage\fR
7970: 20 61 72 67 75 6d 65 6e 74 20 63 61 6e 20 62 65   argument can be
7980: 0a 66 72 6f 6d 20 74 68 65 20 54 63 6c 5f 45 72  .from the Tcl_Er
7990: 72 6e 6f 4d 73 67 2c 20 4f 70 65 6e 53 53 4c 20  rnoMsg, OpenSSL 
79a0: 66 75 6e 63 74 69 6f 6e 20 5c 66 42 45 52 52 5f  function \fBERR_
79b0: 72 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72  reason_error_str
79c0: 69 6e 67 28 29 5c 66 52 2c 0a 6f 72 20 61 20 63  ing()\fR,.or a c
79d0: 75 73 74 6f 6d 20 6d 65 73 73 61 67 65 5c 26 2e  ustom message\&.
79e0: 20 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69   This callback i
79f0: 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53  s new for TclTLS
7a00: 20 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66   1\&.8\&...TP.\f
7a10: 42 69 6e 66 6f 5c 66 52 20 5c 66 49 63 68 61 6e  Binfo\fR \fIchan
7a20: 6e 65 6c 49 64 20 6d 61 6a 6f 72 20 6d 69 6e 6f  nelId major mino
7a30: 72 20 6d 65 73 73 61 67 65 20 74 79 70 65 5c 66  r message type\f
7a40: 52 0a 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63  R.This form of c
7a50: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b  allback is invok
7a60: 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53  ed by the OpenSS
7a70: 4c 20 66 75 6e 63 74 69 6f 6e 0a 5c 66 42 53 53  L function.\fBSS
7a80: 4c 5f 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62  L_set_info_callb
7a90: 61 63 6b 28 29 5c 66 52 20 64 75 72 69 6e 67 20  ack()\fR during 
7aa0: 74 68 65 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e  the initial conn
7ab0: 65 63 74 69 6f 6e 20 61 6e 64 20 68 61 6e 64 73  ection and hands
7ac0: 68 61 6b 65 0a 6f 70 65 72 61 74 69 6f 6e 73 5c  hake.operations\
7ad0: 26 2e 20 54 68 65 20 61 72 67 75 6d 65 6e 74 73  &. The arguments
7ae0: 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66   are:..RS..TP.\f
7af0: 49 6d 61 6a 6f 72 5c 66 52 0a 4d 61 6a 6f 72 20  Imajor\fR.Major 
7b00: 63 61 74 65 67 6f 72 79 20 66 6f 72 20 65 72 72  category for err
7b10: 6f 72 5c 26 2e 20 56 61 6c 69 64 20 65 6e 75 6d  or\&. Valid enum
7b20: 73 20 61 72 65 3a 20 5c 66 42 68 61 6e 64 73 68  s are: \fBhandsh
7b30: 61 6b 65 5c 66 52 2c 20 5c 66 42 61 6c 65 72 74  ake\fR, \fBalert
7b40: 5c 66 52 2c 0a 5c 66 42 63 6f 6e 6e 65 63 74 5c  \fR,.\fBconnect\
7b50: 66 52 2c 20 5c 66 42 61 63 63 65 70 74 5c 66 52  fR, \fBaccept\fR
7b60: 5c 26 2e 0a 2e 54 50 0a 5c 66 49 6d 69 6e 6f 72  \&...TP.\fIminor
7b70: 5c 66 52 0a 4d 69 6e 6f 72 20 63 61 74 65 67 6f  \fR.Minor catego
7b80: 72 79 20 66 6f 72 20 65 72 72 6f 72 5c 26 2e 20  ry for error\&. 
7b90: 56 61 6c 69 64 20 65 6e 75 6d 73 20 61 72 65 3a  Valid enums are:
7ba0: 20 5c 66 42 73 74 61 72 74 5c 66 52 2c 20 5c 66   \fBstart\fR, \f
7bb0: 42 64 6f 6e 65 5c 66 52 2c 20 5c 66 42 72 65 61  Bdone\fR, \fBrea
7bc0: 64 5c 66 52 2c 0a 5c 66 42 77 72 69 74 65 5c 66  d\fR,.\fBwrite\f
7bd0: 52 2c 20 5c 66 42 6c 6f 6f 70 5c 66 52 2c 20 5c  R, \fBloop\fR, \
7be0: 66 42 65 78 69 74 5c 66 52 5c 26 2e 0a 2e 54 50  fBexit\fR\&...TP
7bf0: 0a 5c 66 49 6d 65 73 73 61 67 65 5c 66 52 0a 44  .\fImessage\fR.D
7c00: 65 73 63 72 69 70 74 69 76 65 20 6d 65 73 73 61  escriptive messa
7c10: 67 65 20 73 74 72 69 6e 67 20 77 68 69 63 68 20  ge string which 
7c20: 6d 61 79 20 62 65 20 67 65 6e 65 72 61 74 65 64  may be generated
7c30: 20 65 69 74 68 65 72 20 62 79 0a 5c 66 42 53 53   either by.\fBSS
7c40: 4c 5f 73 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c  L_state_string_l
7c50: 6f 6e 67 28 29 5c 66 52 20 6f 72 20 5c 66 42 53  ong()\fR or \fBS
7c60: 53 4c 5f 61 6c 65 72 74 5f 64 65 73 63 5f 73 74  SL_alert_desc_st
7c70: 72 69 6e 67 5f 6c 6f 6e 67 28 29 5c 66 52 2c 0a  ring_long()\fR,.
7c80: 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65  depending on the
7c90: 20 63 6f 6e 74 65 78 74 5c 26 2e 0a 2e 54 50 0a   context\&...TP.
7ca0: 5c 66 49 74 79 70 65 5c 66 52 0a 46 6f 72 20 61  \fItype\fR.For a
7cb0: 6c 65 72 74 73 2c 20 74 68 65 20 70 6f 73 73 69  lerts, the possi
7cc0: 62 6c 65 20 76 61 6c 75 65 73 20 61 72 65 3a 20  ble values are: 
7cd0: 5c 66 42 77 61 72 6e 69 6e 67 5c 66 52 2c 0a 5c  \fBwarning\fR,.\
7ce0: 66 42 66 61 74 61 6c 5c 66 52 2c 20 61 6e 64 20  fBfatal\fR, and 
7cf0: 5c 66 42 75 6e 6b 6e 6f 77 6e 5c 66 52 5c 26 2e  \fBunknown\fR\&.
7d00: 20 46 6f 72 20 6f 74 68 65 72 73 2c 20 5c 66 42   For others, \fB
7d10: 69 6e 66 6f 5c 66 52 20 69 73 20 75 73 65 64 5c  info\fR is used\
7d20: 26 2e 0a 54 68 69 73 20 61 72 67 75 6d 65 6e 74  &..This argument
7d30: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
7d40: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a  LS 1\&.8\&...RE.
7d50: 2e 54 50 0a 5c 66 42 6d 65 73 73 61 67 65 5c 66  .TP.\fBmessage\f
7d60: 52 20 5c 66 49 63 68 61 6e 6e 65 6c 49 64 20 64  R \fIchannelId d
7d70: 69 72 65 63 74 69 6f 6e 20 76 65 72 73 69 6f 6e  irection version
7d80: 20 63 6f 6e 74 65 6e 74 5f 74 79 70 65 20 6d 65   content_type me
7d90: 73 73 61 67 65 5c 66 52 0a 54 68 69 73 20 66 6f  ssage\fR.This fo
7da0: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
7db0: 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65  s invoked by the
7dc0: 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f   OpenSSL functio
7dd0: 6e 0a 5c 66 42 53 53 4c 5f 73 65 74 5f 6d 73 67  n.\fBSSL_set_msg
7de0: 5f 63 61 6c 6c 62 61 63 6b 28 29 5c 66 52 20 77  _callback()\fR w
7df0: 68 65 6e 65 76 65 72 20 61 20 6d 65 73 73 61 67  henever a messag
7e00: 65 20 69 73 20 73 65 6e 74 20 6f 72 20 72 65 63  e is sent or rec
7e10: 65 69 76 65 64 20 64 75 72 69 6e 67 20 74 68 65  eived during the
7e20: 0a 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74  .initial connect
7e30: 69 6f 6e 2c 20 68 61 6e 64 73 68 61 6b 65 2c 20  ion, handshake, 
7e40: 6f 72 20 49 2f 4f 20 6f 70 65 72 61 74 69 6f 6e  or I/O operation
7e50: 73 5c 26 2e 20 49 74 20 69 73 20 6f 6e 6c 79 20  s\&. It is only 
7e60: 61 76 61 69 6c 61 62 6c 65 20 77 68 65 6e 0a 4f  available when.O
7e70: 70 65 6e 53 53 4c 20 69 73 20 63 6f 6d 70 6c 69  penSSL is compli
7e80: 65 64 20 77 69 74 68 20 74 68 65 20 5c 66 42 65  ed with the \fBe
7e90: 6e 61 62 6c 65 2d 73 73 6c 2d 74 72 61 63 65 5c  nable-ssl-trace\
7ea0: 66 52 20 6f 70 74 69 6f 6e 5c 26 2e 20 54 68 69  fR option\&. Thi
7eb0: 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 0a 6e 65  s callback is.ne
7ec0: 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c 26  w for TclTLS 1\&
7ed0: 2e 38 5c 26 2e 20 54 68 65 20 61 72 67 75 6d 65  .8\&. The argume
7ee0: 6e 74 73 20 61 72 65 3a 0a 2e 52 53 0a 2e 54 50  nts are:..RS..TP
7ef0: 0a 5c 66 49 64 69 72 65 63 74 69 6f 6e 5c 66 52  .\fIdirection\fR
7f00: 0a 44 69 72 65 63 74 69 6f 6e 20 69 73 20 65 69  .Direction is ei
7f10: 74 68 65 72 20 5c 66 42 53 65 6e 74 5c 66 52 20  ther \fBSent\fR 
7f20: 6f 72 20 5c 66 42 52 65 63 65 69 76 65 64 5c 66  or \fBReceived\f
7f30: 52 5c 26 2e 0a 2e 54 50 0a 5c 66 49 76 65 72 73  R\&...TP.\fIvers
7f40: 69 6f 6e 5c 66 52 0a 56 65 72 73 69 6f 6e 20 69  ion\fR.Version i
7f50: 73 20 74 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76  s the protocol v
7f60: 65 72 73 69 6f 6e 5c 26 2e 0a 2e 54 50 0a 5c 66  ersion\&...TP.\f
7f70: 49 63 6f 6e 74 65 6e 74 5f 74 79 70 65 5c 66 52  Icontent_type\fR
7f80: 0a 43 6f 6e 74 65 6e 74 20 74 79 70 65 20 69 73  .Content type is
7f90: 20 74 68 65 20 6d 65 73 73 61 67 65 20 63 6f 6e   the message con
7fa0: 74 65 6e 74 20 74 79 70 65 5c 26 2e 0a 2e 54 50  tent type\&...TP
7fb0: 0a 5c 66 49 6d 65 73 73 61 67 65 5c 66 52 0a 4d  .\fImessage\fR.M
7fc0: 65 73 73 61 67 65 20 69 73 20 6d 6f 72 65 20 69  essage is more i
7fd0: 6e 66 6f 20 66 72 6f 6d 20 74 68 65 20 5c 66 42  nfo from the \fB
7fe0: 53 53 4c 5f 74 72 61 63 65 5c 66 52 20 41 50 49  SSL_trace\fR API
7ff0: 5c 26 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 73  \&...RE..TP.\fBs
8000: 65 73 73 69 6f 6e 5c 66 52 20 5c 66 49 63 68 61  ession\fR \fIcha
8010: 6e 6e 65 6c 49 64 20 73 65 73 73 69 6f 6e 5f 69  nnelId session_i
8020: 64 20 73 65 73 73 69 6f 6e 5f 74 69 63 6b 65 74  d session_ticket
8030: 20 6c 69 66 65 74 69 6d 65 5c 66 52 0a 54 68 69   lifetime\fR.Thi
8040: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
8050: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79  ck is invoked by
8060: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e   the OpenSSL fun
8070: 63 74 69 6f 6e 0a 5c 66 42 53 53 4c 5f 43 54 58  ction.\fBSSL_CTX
8080: 5f 73 65 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62  _sess_set_new_cb
8090: 28 29 5c 66 52 20 77 68 65 6e 65 76 65 72 20 61  ()\fR whenever a
80a0: 20 6e 65 77 20 73 65 73 73 69 6f 6e 20 69 64 20   new session id 
80b0: 69 73 20 73 65 6e 74 20 62 79 20 74 68 65 0a 73  is sent by the.s
80c0: 65 72 76 65 72 20 64 75 72 69 6e 67 20 74 68 65  erver during the
80d0: 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74   initial connect
80e0: 69 6f 6e 20 61 6e 64 20 68 61 6e 64 73 68 61 6b  ion and handshak
80f0: 65 20 61 6e 64 20 61 6c 73 6f 20 64 75 72 69 6e  e and also durin
8100: 67 20 74 68 65 20 73 65 73 73 69 6f 6e 0a 69 66  g the session.if
8110: 20 74 68 65 20 5c 66 42 2d 70 6f 73 74 5f 68 61   the \fB-post_ha
8120: 6e 64 73 68 61 6b 65 5c 66 52 20 6f 70 74 69 6f  ndshake\fR optio
8130: 6e 20 69 73 20 73 65 74 20 74 6f 20 74 72 75 65  n is set to true
8140: 5c 26 2e 20 54 68 69 73 20 63 61 6c 6c 62 61 63  \&. This callbac
8150: 6b 20 69 73 20 6e 65 77 20 66 6f 72 0a 54 63 6c  k is new for.Tcl
8160: 54 4c 53 20 31 5c 26 2e 38 5c 26 2e 20 54 68 65  TLS 1\&.8\&. The
8170: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a   arguments are:.
8180: 2e 52 53 0a 2e 54 50 0a 5c 66 49 73 65 73 73 69  .RS..TP.\fIsessi
8190: 6f 6e 5f 69 64 5c 66 52 0a 53 65 73 73 69 6f 6e  on_id\fR.Session
81a0: 20 49 64 20 69 73 20 74 68 65 20 63 75 72 72 65   Id is the curre
81b0: 6e 74 20 73 65 73 73 69 6f 6e 20 69 64 65 6e 74  nt session ident
81c0: 69 66 69 65 72 0a 2e 54 50 0a 5c 66 49 73 65 73  ifier..TP.\fIses
81d0: 73 69 6f 6e 5f 74 69 63 6b 65 74 5c 66 52 0a 54  sion_ticket\fR.T
81e0: 69 63 6b 65 74 20 69 73 20 74 68 65 20 73 65 73  icket is the ses
81f0: 73 69 6f 6e 20 74 69 63 6b 65 74 20 69 6e 66 6f  sion ticket info
8200: 0a 2e 54 50 0a 5c 66 49 6c 69 66 65 74 69 6d 65  ..TP.\fIlifetime
8210: 5c 66 52 0a 4c 69 66 65 74 69 6d 65 20 69 73 20  \fR.Lifetime is 
8220: 74 68 65 20 74 69 63 6b 65 74 20 6c 69 66 65 74  the ticket lifet
8230: 69 6d 65 20 69 6e 20 73 65 63 6f 6e 64 73 5c 26  ime in seconds\&
8240: 2e 0a 2e 52 45 0a 2e 54 50 0a 5c 66 42 76 65 72  ...RE..TP.\fBver
8250: 69 66 79 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65  ify\fR \fIchanne
8260: 6c 49 64 20 64 65 70 74 68 20 63 65 72 74 20 73  lId depth cert s
8270: 74 61 74 75 73 20 65 72 72 6f 72 5c 66 52 0a 54  tatus error\fR.T
8280: 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 77 61 73  his callback was
8290: 20 6d 6f 76 65 64 20 74 6f 20 5c 66 42 2d 76 61   moved to \fB-va
82a0: 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 5c 66 52  lidatecommand\fR
82b0: 20 69 6e 20 54 63 6c 54 4c 53 20 31 5c 26 2e 38   in TclTLS 1\&.8
82c0: 5c 26 2e 0a 2e 50 50 0a 2e 53 53 20 22 56 41 4c  \&...PP..SS "VAL
82d0: 55 45 53 20 46 4f 52 20 50 41 53 53 57 4f 52 44  UES FOR PASSWORD
82e0: 20 43 41 4c 4c 42 41 43 4b 22 0a 54 68 65 20 63   CALLBACK".The c
82f0: 61 6c 6c 62 61 63 6b 20 66 6f 72 20 74 68 65 20  allback for the 
8300: 5c 66 42 2d 70 61 73 73 77 6f 72 64 5c 66 52 20  \fB-password\fR 
8310: 6f 70 74 69 6f 6e 20 69 73 20 69 6e 76 6f 6b 65  option is invoke
8320: 64 20 62 79 20 54 63 6c 54 4c 53 20 77 68 65 6e  d by TclTLS when
8330: 65 76 65 72 20 4f 70 65 6e 53 53 4c 20 6e 65 65  ever OpenSSL nee
8340: 64 73 0a 74 6f 20 6f 62 74 61 69 6e 20 61 20 70  ds.to obtain a p
8350: 61 73 73 77 6f 72 64 5c 26 2e 20 53 65 65 20 62  assword\&. See b
8360: 65 6c 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73  elow for the pos
8370: 73 69 62 6c 65 20 61 72 67 75 6d 65 6e 74 73 20  sible arguments 
8380: 70 61 73 73 65 64 20 74 6f 20 74 68 65 0a 63 61  passed to the.ca
8390: 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 5c 26 2e  llback script\&.
83a0: 20 54 68 65 20 75 73 65 72 20 70 72 6f 76 69 64   The user provid
83b0: 65 64 20 70 61 73 73 77 6f 72 64 20 69 73 20 65  ed password is e
83c0: 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 72 65  xpected to be re
83d0: 74 75 72 6e 65 64 20 62 79 20 74 68 65 0a 63 61  turned by the.ca
83e0: 6c 6c 62 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c 66  llback\&...TP.\f
83f0: 42 70 61 73 73 77 6f 72 64 5c 66 52 20 5c 66 49  Bpassword\fR \fI
8400: 72 77 66 6c 61 67 20 73 69 7a 65 5c 66 52 0a 49  rwflag size\fR.I
8410: 6e 76 6f 6b 65 64 20 77 68 65 6e 20 6c 6f 61 64  nvoked when load
8420: 69 6e 67 20 6f 72 20 73 74 6f 72 69 6e 67 20 61  ing or storing a
8430: 6e 20 65 6e 63 72 79 70 74 65 64 20 50 45 4d 20  n encrypted PEM 
8440: 63 65 72 74 69 66 69 63 61 74 65 5c 26 2e 20 54  certificate\&. T
8450: 68 65 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65  he arguments are
8460: 3a 0a 2e 52 53 0a 2e 54 50 0a 5c 66 49 72 77 66  :..RS..TP.\fIrwf
8470: 6c 61 67 5c 66 52 0a 54 68 65 20 72 65 61 64 2f  lag\fR.The read/
8480: 77 72 69 74 65 20 66 6c 61 67 20 69 73 20 30 20  write flag is 0 
8490: 66 6f 72 20 72 65 61 64 69 6e 67 2f 64 65 63 72  for reading/decr
84a0: 79 70 74 69 6f 6e 20 6f 72 20 31 20 66 6f 72 20  yption or 1 for 
84b0: 77 72 69 74 69 6e 67 2f 65 6e 63 72 79 70 74 69  writing/encrypti
84c0: 6f 6e 5c 26 2e 0a 54 68 65 20 6c 61 74 74 65 72  on\&..The latter
84d0: 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20   can be used to 
84e0: 64 65 74 65 72 6d 69 6e 65 20 77 68 65 6e 20 74  determine when t
84f0: 6f 20 70 72 6f 6d 70 74 20 74 68 65 20 75 73 65  o prompt the use
8500: 72 20 74 6f 20 63 6f 6e 66 69 72 6d 5c 26 2e 0a  r to confirm\&..
8510: 54 68 69 73 20 61 72 67 75 6d 65 6e 74 20 69 73  This argument is
8520: 20 6e 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20   new for TclTLS 
8530: 31 5c 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 49  1\&.8\&...TP.\fI
8540: 73 69 7a 65 5c 66 52 0a 54 68 65 20 73 69 7a 65  size\fR.The size
8550: 20 69 73 20 74 68 65 20 6d 61 78 69 6d 75 6d 20   is the maximum 
8560: 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20 70 61  length of the pa
8570: 73 73 77 6f 72 64 20 69 6e 20 62 79 74 65 73 5c  ssword in bytes\
8580: 26 2e 0a 54 68 69 73 20 61 72 67 75 6d 65 6e 74  &..This argument
8590: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 63 6c 54   is new for TclT
85a0: 4c 53 20 31 5c 26 2e 38 5c 26 2e 0a 2e 52 45 0a  LS 1\&.8\&...RE.
85b0: 2e 50 50 0a 2e 53 53 20 22 56 41 4c 55 45 53 20  .PP..SS "VALUES 
85c0: 46 4f 52 20 56 41 4c 49 44 41 54 45 20 43 4f 4d  FOR VALIDATE COM
85d0: 4d 41 4e 44 20 43 41 4c 4c 42 41 43 4b 22 0a 54  MAND CALLBACK".T
85e0: 68 65 20 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20  he callback for 
85f0: 74 68 65 20 5c 66 42 2d 76 61 6c 69 64 61 74 65  the \fB-validate
8600: 63 6f 6d 6d 61 6e 64 5c 66 52 20 6f 70 74 69 6f  command\fR optio
8610: 6e 20 69 73 20 69 6e 76 6f 6b 65 64 20 64 75 72  n is invoked dur
8620: 69 6e 67 20 74 68 65 20 68 61 6e 64 73 68 61 6b  ing the handshak
8630: 65 0a 70 72 6f 63 65 73 73 20 69 6e 20 6f 72 64  e.process in ord
8640: 65 72 20 66 6f 72 20 74 68 65 20 61 70 70 6c 69  er for the appli
8650: 63 61 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61  cation to valida
8660: 74 65 20 74 68 65 20 70 72 6f 76 69 64 65 64 20  te the provided 
8670: 76 61 6c 75 65 28 73 29 5c 26 2e 20 53 65 65 0a  value(s)\&. See.
8680: 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 20 70 6f  below for the po
8690: 73 73 69 62 6c 65 20 61 72 67 75 6d 65 6e 74 73  ssible arguments
86a0: 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 63   passed to the c
86b0: 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 5c 26  allback script\&
86c0: 2e 20 49 66 20 6e 6f 74 0a 73 70 65 63 69 66 69  . If not.specifi
86d0: 65 64 2c 20 4f 70 65 6e 53 53 4c 20 77 69 6c 6c  ed, OpenSSL will
86e0: 20 61 63 63 65 70 74 20 61 6c 6c 20 76 61 6c 69   accept all vali
86f0: 64 20 63 65 72 74 69 66 69 63 61 74 65 73 20 61  d certificates a
8700: 6e 64 20 65 78 74 65 6e 73 69 6f 6e 73 5c 26 2e  nd extensions\&.
8710: 20 54 6f 20 72 65 6a 65 63 74 0a 74 68 65 20 76   To reject.the v
8720: 61 6c 75 65 20 61 6e 64 20 61 62 6f 72 74 20 74  alue and abort t
8730: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 74  he connection, t
8740: 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75  he callback shou
8750: 6c 64 20 72 65 74 75 72 6e 20 30 5c 26 2e 20 54  ld return 0\&. T
8760: 6f 20 61 63 63 65 70 74 20 74 68 65 0a 76 61 6c  o accept the.val
8770: 75 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20  ue and continue 
8780: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20  the connection, 
8790: 69 74 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  it should return
87a0: 20 31 5c 26 2e 20 54 6f 20 72 65 6a 65 63 74 20   1\&. To reject 
87b0: 74 68 65 20 76 61 6c 75 65 2c 20 62 75 74 0a 63  the value, but.c
87c0: 6f 6e 74 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e  ontinue the conn
87d0: 65 63 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c  ection, it shoul
87e0: 64 20 72 65 74 75 72 6e 20 32 5c 26 2e 20 54 68  d return 2\&. Th
87f0: 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e  is callback is n
8800: 65 77 20 66 6f 72 20 54 63 6c 54 4c 53 20 31 5c  ew for TclTLS 1\
8810: 26 2e 38 5c 26 2e 0a 2e 54 50 0a 5c 66 42 61 6c  &.8\&...TP.\fBal
8820: 70 6e 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  pn\fR \fIchannel
8830: 49 64 20 70 72 6f 74 6f 63 6f 6c 20 6d 61 74 63  Id protocol matc
8840: 68 5c 66 52 0a 46 6f 72 20 73 65 72 76 65 72 73  h\fR.For servers
8850: 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63  , this form of c
8860: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b  allback is invok
8870: 65 64 20 77 68 65 6e 20 74 68 65 20 63 6c 69 65  ed when the clie
8880: 6e 74 20 41 4c 50 4e 20 65 78 74 65 6e 73 69 6f  nt ALPN extensio
8890: 6e 20 69 73 0a 72 65 63 65 69 76 65 64 5c 26 2e  n is.received\&.
88a0: 20 49 66 20 5c 66 49 6d 61 74 63 68 5c 66 52 20   If \fImatch\fR 
88b0: 69 73 20 74 72 75 65 2c 20 74 68 65 6e 20 5c 66  is true, then \f
88c0: 49 70 72 6f 74 6f 63 6f 6c 5c 66 52 20 69 73 20  Iprotocol\fR is 
88d0: 74 68 65 20 66 69 72 73 74 0a 5c 66 42 2d 61 6c  the first.\fB-al
88e0: 70 6e 5c 66 52 20 70 72 6f 74 6f 63 6f 6c 20 6f  pn\fR protocol o
88f0: 70 74 69 6f 6e 20 69 6e 20 63 6f 6d 6d 6f 6e 20  ption in common 
8900: 74 6f 20 62 6f 74 68 20 74 68 65 20 63 6c 69 65  to both the clie
8910: 6e 74 20 61 6e 64 20 73 65 72 76 65 72 5c 26 2e  nt and server\&.
8920: 0a 49 66 20 6e 6f 74 2c 20 74 68 65 20 66 69 72  .If not, the fir
8930: 73 74 20 63 6c 69 65 6e 74 20 73 70 65 63 69 66  st client specif
8940: 69 65 64 20 70 72 6f 74 6f 63 6f 6c 20 69 73 20  ied protocol is 
8950: 75 73 65 64 5c 26 2e 20 54 68 69 73 20 63 61 6c  used\&. This cal
8960: 6c 62 61 63 6b 20 69 73 20 63 61 6c 6c 65 64 0a  lback is called.
8970: 61 66 74 65 72 20 74 68 65 20 48 65 6c 6c 6f 20  after the Hello 
8980: 61 6e 64 20 41 4c 50 4e 20 63 61 6c 6c 62 61 63  and ALPN callbac
8990: 6b 73 5c 26 2e 0a 2e 54 50 0a 5c 66 42 68 65 6c  ks\&...TP.\fBhel
89a0: 6c 6f 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  lo\fR \fIchannel
89b0: 49 64 20 73 65 72 76 65 72 6e 61 6d 65 5c 66 52  Id servername\fR
89c0: 0a 46 6f 72 20 73 65 72 76 65 72 73 2c 20 74 68  .For servers, th
89d0: 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62  is form of callb
89e0: 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 64  ack is invoked d
89f0: 75 72 69 6e 67 20 63 6c 69 65 6e 74 20 68 65 6c  uring client hel
8a00: 6c 6f 20 6d 65 73 73 61 67 65 0a 70 72 6f 63 65  lo message.proce
8a10: 73 73 69 6e 67 5c 26 2e 20 54 68 65 20 70 75 72  ssing\&. The pur
8a20: 70 6f 73 65 20 69 73 20 73 6f 20 74 68 65 20 73  pose is so the s
8a30: 65 72 76 65 72 20 63 61 6e 20 73 65 6c 65 63 74  erver can select
8a40: 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65   the appropriate
8a50: 20 63 65 72 74 69 66 69 63 61 74 65 0a 74 6f 20   certificate.to 
8a60: 70 72 65 73 65 6e 74 20 74 6f 20 74 68 65 20 63  present to the c
8a70: 6c 69 65 6e 74 2c 20 61 6e 64 20 74 6f 20 6d 61  lient, and to ma
8a80: 6b 65 20 6f 74 68 65 72 20 63 6f 6e 66 69 67 75  ke other configu
8a90: 72 61 74 69 6f 6e 20 61 64 6a 75 73 74 6d 65 6e  ration adjustmen
8aa0: 74 73 20 72 65 6c 65 76 61 6e 74 0a 74 6f 20 74  ts relevant.to t
8ab0: 68 61 74 20 73 65 72 76 65 72 20 6e 61 6d 65 20  hat server name 
8ac0: 61 6e 64 20 69 74 73 20 63 6f 6e 66 69 67 75 72  and its configur
8ad0: 61 74 69 6f 6e 5c 26 2e 20 49 74 20 69 73 20 63  ation\&. It is c
8ae0: 61 6c 6c 65 64 20 62 65 66 6f 72 65 20 74 68 65  alled before the
8af0: 20 53 4e 49 20 61 6e 64 20 41 4c 50 4e 0a 63 61   SNI and ALPN.ca
8b00: 6c 6c 62 61 63 6b 73 5c 26 2e 0a 2e 54 50 0a 5c  llbacks\&...TP.\
8b10: 66 42 73 6e 69 5c 66 52 20 5c 66 49 63 68 61 6e  fBsni\fR \fIchan
8b20: 6e 65 6c 49 64 20 73 65 72 76 65 72 6e 61 6d 65  nelId servername
8b30: 5c 66 52 0a 46 6f 72 20 73 65 72 76 65 72 73 2c  \fR.For servers,
8b40: 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61   this form of ca
8b50: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65  llback is invoke
8b60: 64 20 77 68 65 6e 20 74 68 65 20 53 65 72 76 65  d when the Serve
8b70: 72 20 4e 61 6d 65 20 49 6e 64 69 63 61 74 69 6f  r Name Indicatio
8b80: 6e 0a 28 53 4e 49 29 20 65 78 74 65 6e 73 69 6f  n.(SNI) extensio
8b90: 6e 20 69 73 20 72 65 63 65 69 76 65 64 5c 26 2e  n is received\&.
8ba0: 20 54 68 65 20 5c 66 49 73 65 72 76 65 72 6e 61   The \fIserverna
8bb0: 6d 65 5c 66 52 20 61 72 67 75 6d 65 6e 74 20 69  me\fR argument i
8bc0: 73 20 74 68 65 20 63 6c 69 65 6e 74 0a 70 72 6f  s the client.pro
8bd0: 76 69 64 65 64 20 73 65 72 76 65 72 20 6e 61 6d  vided server nam
8be0: 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 74  e specified in t
8bf0: 68 65 20 5c 66 42 2d 73 65 72 76 65 72 6e 61 6d  he \fB-servernam
8c00: 65 3c 2f 62 3e 5c 66 52 20 6f 70 74 69 6f 6e 5c  e</b>\fR option\
8c10: 26 2e 20 54 68 65 0a 70 75 72 70 6f 73 65 20 69  &. The.purpose i
8c20: 73 20 73 6f 20 77 68 65 6e 20 61 20 73 65 72 76  s so when a serv
8c30: 65 72 20 73 75 70 70 6f 72 74 73 20 6d 75 6c 74  er supports mult
8c40: 69 70 6c 65 20 6e 61 6d 65 73 2c 20 74 68 65 20  iple names, the 
8c50: 72 69 67 68 74 20 63 65 72 74 69 66 69 63 61 74  right certificat
8c60: 65 0a 63 61 6e 20 62 65 20 75 73 65 64 5c 26 2e  e.can be used\&.
8c70: 20 49 74 20 69 73 20 63 61 6c 6c 65 64 20 61 66   It is called af
8c80: 74 65 72 20 74 68 65 20 68 65 6c 6c 6f 20 63 61  ter the hello ca
8c90: 6c 6c 62 61 63 6b 20 62 75 74 20 62 65 66 6f 72  llback but befor
8ca0: 65 20 74 68 65 20 41 4c 50 4e 0a 63 61 6c 6c 62  e the ALPN.callb
8cb0: 61 63 6b 5c 26 2e 0a 2e 54 50 0a 5c 66 42 76 65  ack\&...TP.\fBve
8cc0: 72 69 66 79 5c 66 52 20 5c 66 49 63 68 61 6e 6e  rify\fR \fIchann
8cd0: 65 6c 49 64 20 64 65 70 74 68 20 63 65 72 74 20  elId depth cert 
8ce0: 73 74 61 74 75 73 20 65 72 72 6f 72 5c 66 52 0a  status error\fR.
8cf0: 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c  This form of cal
8d00: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64  lback is invoked
8d10: 20 62 79 20 4f 70 65 6e 53 53 4c 20 77 68 65 6e   by OpenSSL when
8d20: 20 61 20 6e 65 77 20 63 65 72 74 69 66 69 63 61   a new certifica
8d30: 74 65 20 69 73 20 72 65 63 65 69 76 65 64 0a 66  te is received.f
8d40: 72 6f 6d 20 74 68 65 20 70 65 65 72 5c 26 2e 20  rom the peer\&. 
8d50: 49 74 20 61 6c 6c 6f 77 73 20 74 68 65 20 63 6c  It allows the cl
8d60: 69 65 6e 74 20 74 6f 20 63 68 65 63 6b 20 74 68  ient to check th
8d70: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 76 65  e certificate ve
8d80: 72 69 66 69 63 61 74 69 6f 6e 0a 72 65 73 75 6c  rification.resul
8d90: 74 73 20 61 6e 64 20 63 68 6f 6f 73 65 20 77 68  ts and choose wh
8da0: 65 74 68 65 72 20 74 6f 20 63 6f 6e 74 69 6e 75  ether to continu
8db0: 65 20 6f 72 20 6e 6f 74 5c 26 2e 20 49 74 20 69  e or not\&. It i
8dc0: 73 20 63 61 6c 6c 65 64 20 66 6f 72 20 65 61 63  s called for eac
8dd0: 68 0a 63 65 72 74 69 66 69 63 61 74 65 20 69 6e  h.certificate in
8de0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
8df0: 20 63 68 61 69 6e 5c 26 2e 20 54 68 69 73 20 63   chain\&. This c
8e00: 61 6c 6c 62 61 63 6b 20 77 61 73 20 6d 6f 76 65  allback was move
8e10: 64 20 66 72 6f 6d 0a 5c 66 42 2d 63 6f 6d 6d 61  d from.\fB-comma
8e20: 6e 64 5c 66 52 20 69 6e 20 54 63 6c 54 4c 53 20  nd\fR in TclTLS 
8e30: 31 5c 26 2e 38 5c 26 2e 20 54 68 65 20 61 72 67  1\&.8\&. The arg
8e40: 75 6d 65 6e 74 73 20 61 72 65 3a 0a 2e 52 53 0a  uments are:..RS.
8e50: 2e 54 50 0a 5c 66 49 64 65 70 74 68 5c 66 52 0a  .TP.\fIdepth\fR.
8e60: 54 68 65 20 64 65 70 74 68 20 69 73 20 74 68 65  The depth is the
8e70: 20 69 6e 74 65 67 65 72 20 64 65 70 74 68 20 6f   integer depth o
8e80: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
8e90: 65 20 69 6e 20 74 68 65 20 63 65 72 74 69 66 69  e in the certifi
8ea0: 63 61 74 65 20 63 68 61 69 6e 2c 0a 77 68 65 72  cate chain,.wher
8eb0: 65 20 30 20 69 73 20 74 68 65 20 70 65 65 72 20  e 0 is the peer 
8ec0: 63 65 72 74 69 66 69 63 61 74 65 20 61 6e 64 20  certificate and 
8ed0: 68 69 67 68 65 72 20 76 61 6c 75 65 73 20 67 6f  higher values go
8ee0: 69 6e 67 20 75 70 20 74 6f 20 74 68 65 20 43 65  ing up to the Ce
8ef0: 72 74 69 66 69 63 61 74 65 0a 41 75 74 68 6f 72  rtificate.Author
8f00: 69 74 79 20 28 43 41 29 5c 26 2e 0a 2e 54 50 0a  ity (CA)\&...TP.
8f10: 5c 66 49 63 65 72 74 5c 66 52 0a 54 68 65 20 63  \fIcert\fR.The c
8f20: 65 72 74 20 61 72 67 75 6d 65 6e 74 20 69 73 20  ert argument is 
8f30: 61 20 6c 69 73 74 20 6f 66 20 6b 65 79 2d 76 61  a list of key-va
8f40: 6c 75 65 20 70 61 69 72 73 20 73 69 6d 69 6c 61  lue pairs simila
8f50: 72 20 74 6f 20 74 68 6f 73 65 20 72 65 74 75 72  r to those retur
8f60: 6e 65 64 20 62 79 0a 5c 66 42 74 6c 73 3a 3a 73  ned by.\fBtls::s
8f70: 74 61 74 75 73 5c 66 52 5c 26 2e 0a 2e 54 50 0a  tatus\fR\&...TP.
8f80: 5c 66 49 73 74 61 74 75 73 5c 66 52 0a 54 68 65  \fIstatus\fR.The
8f90: 20 73 74 61 74 75 73 20 61 72 67 75 6d 65 6e 74   status argument
8fa0: 20 69 73 20 74 68 65 20 62 6f 6f 6c 65 61 6e 20   is the boolean 
8fb0: 76 61 6c 69 64 69 74 79 20 6f 66 20 74 68 65 20  validity of the 
8fc0: 63 75 72 72 65 6e 74 20 63 65 72 74 69 66 69 63  current certific
8fd0: 61 74 65 20 77 68 65 72 65 20 30 0a 69 73 20 69  ate where 0.is i
8fe0: 6e 76 61 6c 69 64 20 61 6e 64 20 31 20 69 73 20  nvalid and 1 is 
8ff0: 76 61 6c 69 64 5c 26 2e 0a 2e 54 50 0a 5c 66 49  valid\&...TP.\fI
9000: 65 72 72 6f 72 5c 66 52 0a 54 68 65 20 65 72 72  error\fR.The err
9010: 6f 72 20 61 72 67 75 6d 65 6e 74 20 69 73 20 74  or argument is t
9020: 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65  he error message
9030: 2c 20 69 66 20 61 6e 79 2c 20 67 65 6e 65 72 61  , if any, genera
9040: 74 65 64 20 62 79 0a 5c 66 42 58 35 30 39 5f 53  ted by.\fBX509_S
9050: 54 4f 52 45 5f 43 54 58 5f 67 65 74 5f 65 72 72  TORE_CTX_get_err
9060: 6f 72 28 29 5c 66 52 5c 26 2e 0a 2e 52 45 0a 2e  or()\fR\&...RE..
9070: 50 50 0a 52 65 66 65 72 65 6e 63 65 20 69 6d 70  PP.Reference imp
9080: 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20  lementations of 
9090: 74 68 65 73 65 20 63 61 6c 6c 62 61 63 6b 73 20  these callbacks 
90a0: 61 72 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20  are provided in 
90b0: 22 5c 66 49 74 6c 73 5c 26 2e 74 63 6c 5c 66 52  "\fItls\&.tcl\fR
90c0: 22 0a 61 73 20 5c 66 42 74 6c 73 3a 3a 63 61 6c  ".as \fBtls::cal
90d0: 6c 62 61 63 6b 5c 66 52 2c 20 5c 66 42 74 6c 73  lback\fR, \fBtls
90e0: 3a 3a 70 61 73 73 77 6f 72 64 5c 66 52 2c 20 61  ::password\fR, a
90f0: 6e 64 20 5c 66 42 74 6c 73 3a 3a 76 61 6c 69 64  nd \fBtls::valid
9100: 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52 0a 72  ate_command\fR.r
9110: 65 73 70 65 63 74 69 76 65 6c 79 5c 26 2e 20 4e  espectively\&. N
9120: 6f 74 65 20 74 68 61 74 20 74 68 65 73 65 20 61  ote that these a
9130: 72 65 20 6f 6e 6c 79 20 5c 66 49 73 61 6d 70 6c  re only \fIsampl
9140: 65 5c 66 52 20 69 6d 70 6c 65 6d 65 6e 74 61 74  e\fR implementat
9150: 69 6f 6e 73 5c 26 2e 20 49 6e 20 61 20 6d 6f 72  ions\&. In a mor
9160: 65 0a 72 65 61 6c 69 73 74 69 63 20 64 65 70 6c  e.realistic depl
9170: 6f 79 6d 65 6e 74 20 79 6f 75 20 77 6f 75 6c 64  oyment you would
9180: 20 73 70 65 63 69 66 79 20 79 6f 75 72 20 6f 77   specify your ow
9190: 6e 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70  n callback scrip
91a0: 74 73 20 6f 6e 20 65 61 63 68 20 54 4c 53 0a 63  ts on each TLS.c
91b0: 68 61 6e 6e 65 6c 20 75 73 69 6e 67 20 74 68 65  hannel using the
91c0: 20 5c 66 42 2d 63 6f 6d 6d 61 6e 64 5c 66 52 2c   \fB-command\fR,
91d0: 20 5c 66 42 2d 70 61 73 73 77 6f 72 64 5c 66 52   \fB-password\fR
91e0: 2c 20 61 6e 64 0a 5c 66 42 2d 76 61 6c 69 64 61  , and.\fB-valida
91f0: 74 65 5f 63 6f 6d 6d 61 6e 64 5c 66 52 20 6f 70  te_command\fR op
9200: 74 69 6f 6e 73 5c 26 2e 0a 2e 50 50 0a 54 68 65  tions\&...PP.The
9210: 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f   default behavio
9220: 72 20 77 68 65 6e 20 74 68 65 20 5c 66 42 2d 63  r when the \fB-c
9230: 6f 6d 6d 61 6e 64 5c 66 52 20 61 6e 64 20 5c 66  ommand\fR and \f
9240: 42 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  B-validate_comma
9250: 6e 64 5c 66 52 0a 6f 70 74 69 6f 6e 73 20 61 72  nd\fR.options ar
9260: 65 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 2c  e not specified,
9270: 20 69 73 20 66 6f 72 20 54 63 6c 54 4c 53 20 74   is for TclTLS t
9280: 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 61 73  o process the as
9290: 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 72 79  sociated library
92a0: 0a 63 61 6c 6c 62 61 63 6b 73 20 69 6e 74 65 72  .callbacks inter
92b0: 6e 61 6c 6c 79 5c 26 2e 20 54 68 65 20 64 65 66  nally\&. The def
92c0: 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68  ault behavior wh
92d0: 65 6e 20 74 68 65 20 5c 66 42 2d 70 61 73 73 77  en the \fB-passw
92e0: 6f 72 64 5c 66 52 20 6f 70 74 69 6f 6e 0a 69 73  ord\fR option.is
92f0: 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20 69   not specified i
9300: 73 20 66 6f 72 20 54 63 6c 54 4c 53 20 74 6f 20  s for TclTLS to 
9310: 70 72 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f  process the asso
9320: 63 69 61 74 65 64 20 6c 69 62 72 61 72 79 20 63  ciated library c
9330: 61 6c 6c 62 61 63 6b 73 20 62 79 0a 61 74 74 65  allbacks by.atte
9340: 6d 70 74 69 6e 67 20 74 6f 20 63 61 6c 6c 20 5c  mpting to call \
9350: 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 5c  fBtls::password\
9360: 66 52 5c 26 2e 20 54 68 65 20 64 69 66 66 65 72  fR\&. The differ
9370: 65 6e 63 65 20 62 65 74 77 65 65 6e 20 74 68 65  ence between the
9380: 73 65 20 74 77 6f 0a 62 65 68 61 76 69 6f 72 73  se two.behaviors
9390: 20 69 73 20 61 20 63 6f 6e 73 65 71 75 65 6e 63   is a consequenc
93a0: 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e 69 6e 67  e of maintaining
93b0: 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 77   compatibility w
93c0: 69 74 68 20 65 61 72 6c 69 65 72 0a 69 6d 70 6c  ith earlier.impl
93d0: 65 6d 65 6e 74 61 74 69 6f 6e 73 5c 26 2e 0a 2e  ementations\&...
93e0: 50 50 0a 5c 66 49 54 68 65 20 75 73 65 20 6f 66  PP.\fIThe use of
93f0: 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 20 63   the reference c
9400: 61 6c 6c 62 61 63 6b 73 20 5c 66 42 74 6c 73 3a  allbacks \fBtls:
9410: 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 2c 20 5c 66  :callback\fR, \f
9420: 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 5c 66  Btls::password\f
9430: 52 2c 0a 61 6e 64 20 5c 66 42 74 6c 73 3a 3a 76  R,.and \fBtls::v
9440: 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 5c  alidate_command\
9450: 66 52 20 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d  fR is not recomm
9460: 65 6e 64 65 64 5c 26 2e 20 54 68 65 79 20 6d 61  ended\&. They ma
9470: 79 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f  y be removed fro
9480: 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 73 65  m future release
9490: 73 5c 26 2e 5c 66 52 0a 2e 53 48 20 44 45 42 55  s\&.\fR..SH DEBU
94a0: 47 0a 46 6f 72 20 6d 6f 73 74 20 64 65 62 75 67  G.For most debug
94b0: 67 69 6e 67 20 6e 65 65 64 73 2c 20 74 68 65 20  ging needs, the 
94c0: 5c 66 42 2d 63 61 6c 6c 62 61 63 6b 5c 66 52 20  \fB-callback\fR 
94d0: 6f 70 74 69 6f 6e 20 63 61 6e 20 62 65 20 75 73  option can be us
94e0: 65 64 20 74 6f 20 70 72 6f 76 69 64 65 0a 73 75  ed to provide.su
94f0: 66 66 69 63 69 65 6e 74 20 69 6e 73 69 67 68 74  fficient insight
9500: 20 61 6e 64 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   and information
9510: 20 6f 6e 20 74 68 65 20 54 4c 53 20 68 61 6e 64   on the TLS hand
9520: 73 68 61 6b 65 20 61 6e 64 20 70 72 6f 67 72 65  shake and progre
9530: 73 73 5c 26 2e 20 49 66 0a 66 75 72 74 68 65 72  ss\&. If.further
9540: 20 74 72 6f 75 62 6c 65 73 68 6f 6f 74 69 6e 67   troubleshooting
9550: 20 69 6e 73 69 67 68 74 20 69 73 20 6e 65 65 64   insight is need
9560: 65 64 2c 20 74 68 65 20 63 6f 6d 70 69 6c 65 20  ed, the compile 
9570: 74 69 6d 65 20 6f 70 74 69 6f 6e 0a 5c 66 42 2d  time option.\fB-
9580: 2d 65 6e 61 62 6c 65 2d 64 65 62 75 67 5c 66 52  -enable-debug\fR
9590: 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20   can be used to 
95a0: 67 65 74 20 64 65 74 61 69 6c 65 64 20 65 78 65  get detailed exe
95b0: 63 75 74 69 6f 6e 20 66 6c 6f 77 20 73 74 61 74  cution flow stat
95c0: 75 73 5c 26 2e 0a 2e 50 50 0a 54 4c 53 20 6b 65  us\&...PP.TLS ke
95d0: 79 20 6c 6f 67 67 69 6e 67 20 63 61 6e 20 62 65  y logging can be
95e0: 20 65 6e 61 62 6c 65 64 20 62 79 20 73 65 74 74   enabled by sett
95f0: 69 6e 67 20 74 68 65 20 65 6e 76 69 72 6f 6e 6d  ing the environm
9600: 65 6e 74 20 76 61 72 69 61 62 6c 65 0a 5c 66 42  ent variable.\fB
9610: 53 53 4c 4b 45 59 4c 4f 47 46 49 4c 45 5c 66 52  SSLKEYLOGFILE\fR
9620: 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f 66 20   to the name of 
9630: 74 68 65 20 66 69 6c 65 20 74 6f 20 6c 6f 67 20  the file to log 
9640: 74 6f 5c 26 2e 20 54 68 65 6e 20 77 68 65 6e 65  to\&. Then whene
9650: 76 65 72 20 54 4c 53 20 6b 65 79 0a 6d 61 74 65  ver TLS key.mate
9660: 72 69 61 6c 20 69 73 20 67 65 6e 65 72 61 74 65  rial is generate
9670: 64 20 6f 72 20 72 65 63 65 69 76 65 64 20 69 74  d or received it
9680: 20 77 69 6c 6c 20 62 65 20 6c 6f 67 67 65 64 20   will be logged 
9690: 74 6f 20 74 68 65 20 66 69 6c 65 5c 26 2e 20 54  to the file\&. T
96a0: 68 69 73 20 69 73 20 75 73 65 66 75 6c 0a 66 6f  his is useful.fo
96b0: 72 20 6c 6f 67 67 69 6e 67 20 6b 65 79 20 64 61  r logging key da
96c0: 74 61 20 66 6f 72 20 6e 65 74 77 6f 72 6b 20 6c  ta for network l
96d0: 6f 67 67 69 6e 67 20 74 6f 6f 6c 73 20 74 6f 20  ogging tools to 
96e0: 75 73 65 20 74 6f 20 64 65 63 72 79 70 74 20 74  use to decrypt t
96f0: 68 65 20 64 61 74 61 5c 26 2e 0a 2e 50 50 0a 54  he data\&...PP.T
9700: 68 65 20 5c 66 42 74 6c 73 3a 3a 64 65 62 75 67  he \fBtls::debug
9710: 5c 66 52 20 76 61 72 69 61 62 6c 65 20 70 72 6f  \fR variable pro
9720: 76 69 64 65 73 20 73 6f 6d 65 20 61 64 64 69 74  vides some addit
9730: 69 6f 6e 61 6c 20 63 6f 6e 74 72 6f 6c 20 6f 76  ional control ov
9740: 65 72 20 74 68 65 0a 64 65 62 75 67 20 6c 6f 67  er the.debug log
9750: 67 69 6e 67 20 69 6e 20 74 68 65 20 5c 66 42 74  ging in the \fBt
9760: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 5c 66 52 2c  ls::callback\fR,
9770: 20 5c 66 42 74 6c 73 3a 3a 70 61 73 73 77 6f 72   \fBtls::passwor
9780: 64 5c 66 52 2c 20 61 6e 64 0a 5c 66 42 74 6c 73  d\fR, and.\fBtls
9790: 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  ::validate_comma
97a0: 6e 64 5c 66 52 20 64 65 66 61 75 6c 74 20 68 61  nd\fR default ha
97b0: 6e 64 6c 65 72 73 20 69 6e 20 22 5c 66 49 74 6c  ndlers in "\fItl
97c0: 73 5c 26 2e 74 63 6c 5c 66 52 22 5c 26 2e 0a 54  s\&.tcl\fR"\&..T
97d0: 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65  he default value
97e0: 20 69 73 20 30 20 77 69 74 68 20 68 69 67 68 65   is 0 with highe
97f0: 72 20 76 61 6c 75 65 73 20 70 72 6f 64 75 63 69  r values produci
9800: 6e 67 20 6d 6f 72 65 20 64 69 61 67 6e 6f 73 74  ng more diagnost
9810: 69 63 20 6f 75 74 70 75 74 2c 0a 61 6e 64 20 77  ic output,.and w
9820: 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 63 65 20 74  ill also force t
9830: 68 65 20 76 65 72 69 66 79 20 6d 65 74 68 6f 64  he verify method
9840: 20 69 6e 20 5c 66 42 74 6c 73 3a 3a 63 61 6c 6c   in \fBtls::call
9850: 62 61 63 6b 5c 66 52 20 74 6f 20 61 63 63 65 70  back\fR to accep
9860: 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 74  t the.certificat
9870: 65 2c 20 65 76 65 6e 20 69 66 20 69 74 20 69 73  e, even if it is
9880: 20 69 6e 76 61 6c 69 64 20 77 68 65 6e 20 74 68   invalid when th
9890: 65 20 5c 66 42 2d 76 61 6c 69 64 61 74 65 63 6f  e \fB-validateco
98a0: 6d 6d 61 6e 64 5c 66 52 0a 6f 70 74 69 6f 6e 20  mmand\fR.option 
98b0: 69 73 20 73 65 74 20 74 6f 20 5c 66 42 74 6c 73  is set to \fBtls
98c0: 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  ::validate_comma
98d0: 6e 64 5c 66 52 5c 26 2e 0a 2e 50 50 0a 5c 66 49  nd\fR\&...PP.\fI
98e0: 54 68 65 20 75 73 65 20 6f 66 20 74 68 65 20 76  The use of the v
98f0: 61 72 69 61 62 6c 65 20 5c 66 42 74 6c 73 3a 3a  ariable \fBtls::
9900: 64 65 62 75 67 5c 66 52 20 69 73 20 6e 6f 74 20  debug\fR is not 
9910: 72 65 63 6f 6d 6d 65 6e 64 65 64 5c 26 2e 0a 49  recommended\&..I
9920: 74 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64  t may be removed
9930: 20 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c   from future rel
9940: 65 61 73 65 73 5c 26 2e 5c 66 52 0a 2e 53 48 20  eases\&.\fR..SH 
9950: 22 48 54 54 50 20 50 41 43 4b 41 47 45 20 45 58  "HTTP PACKAGE EX
9960: 41 4d 50 4c 45 53 22 0a 54 68 65 20 66 6f 6c 6c  AMPLES".The foll
9970: 6f 77 69 6e 67 20 61 72 65 20 65 78 61 6d 70 6c  owing are exampl
9980: 65 20 73 63 72 69 70 74 73 20 74 6f 20 64 6f 77  e scripts to dow
9990: 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67 65 20  nload a webpage 
99a0: 61 6e 64 20 66 69 6c 65 20 75 73 69 6e 67 20 74  and file using t
99b0: 68 65 0a 68 74 74 70 20 70 61 63 6b 61 67 65 5c  he.http package\
99c0: 26 2e 20 53 65 65 20 5c 66 42 43 65 72 74 69 66  &. See \fBCertif
99d0: 69 63 61 74 65 20 56 61 6c 69 64 61 74 69 6f 6e  icate Validation
99e0: 5c 66 52 20 66 6f 72 20 77 68 65 74 68 65 72 20  \fR for whether 
99f0: 74 68 65 0a 5c 66 42 2d 63 61 64 69 72 5c 66 52  the.\fB-cadir\fR
9a00: 2c 20 5c 66 42 2d 63 61 66 69 6c 65 5c 66 52 2c  , \fB-cafile\fR,
9a10: 20 61 6e 64 20 5c 66 42 2d 63 61 73 74 6f 72 65   and \fB-castore
9a20: 5c 66 52 20 6f 70 74 69 6f 6e 73 20 61 72 65 20  \fR options are 
9a30: 61 6c 73 6f 0a 6e 65 65 64 65 64 5c 26 2e 20 53  also.needed\&. S
9a40: 65 65 20 74 68 65 20 64 65 6d 6f 73 20 64 69 72  ee the demos dir
9a50: 65 63 74 6f 72 79 20 66 6f 72 20 6d 6f 72 65 20  ectory for more 
9a60: 65 78 61 6d 70 6c 65 20 73 63 72 69 70 74 73 5c  example scripts\
9a70: 26 2e 0a 2e 50 50 0a 45 78 61 6d 70 6c 65 20 23  &...PP.Example #
9a80: 31 3a 20 44 6f 77 6e 6c 6f 61 64 20 61 20 77 65  1: Download a we
9a90: 62 20 70 61 67 65 0a 2e 43 53 0a 0a 0a 0a 70 61  b page..CS....pa
9aa0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 68 74  ckage require ht
9ab0: 74 70 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69  tp.package requi
9ac0: 72 65 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c 20  re tls..set url 
9ad0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 5c 26 2e 74  "https://www\&.t
9ae0: 63 6c 5c 26 2e 74 6b 2f 22 0a 68 74 74 70 3a 3a  cl\&.tk/".http::
9af0: 72 65 67 69 73 74 65 72 20 68 74 74 70 73 20 34  register https 4
9b00: 34 33 20 5b 6c 69 73 74 20 3a 3a 74 6c 73 3a 3a  43 [list ::tls::
9b10: 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65 72 76  socket -autoserv
9b20: 65 72 6e 61 6d 65 20 31 20 2d 72 65 71 75 69 72  ername 1 -requir
9b30: 65 20 31 5d 0a 0a 23 20 47 65 74 20 55 52 4c 0a  e 1]..# Get URL.
9b40: 73 65 74 20 74 6f 6b 65 6e 20 5b 68 74 74 70 3a  set token [http:
9b50: 3a 67 65 74 75 72 6c 20 24 75 72 6c 5d 0a 0a 23  :geturl $url]..#
9b60: 20 43 68 65 63 6b 20 66 6f 72 20 65 72 72 6f 72   Check for error
9b70: 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73 74 61 74  .if {[http::stat
9b80: 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65 20 22 6f  us $token] ne "o
9b90: 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74 73 20 5b  k"} {.    puts [
9ba0: 66 6f 72 6d 61 74 20 22 45 72 72 6f 72 20 25 73  format "Error %s
9bb0: 22 20 5b 68 74 74 70 3a 3a 73 74 61 74 75 73 20  " [http::status 
9bc0: 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20 53 61  $token]].}..# Sa
9bd0: 76 65 20 77 65 62 20 70 61 67 65 20 74 6f 20 66  ve web page to f
9be0: 69 6c 65 0a 73 65 74 20 63 68 20 5b 6f 70 65 6e  ile.set ch [open
9bf0: 20 65 78 61 6d 70 6c 65 5c 26 2e 68 74 6d 6c 20   example\&.html 
9c00: 77 62 5d 0a 70 75 74 73 20 24 63 68 20 5b 68 74  wb].puts $ch [ht
9c10: 74 70 3a 3a 64 61 74 61 20 24 74 6f 6b 65 6e 5d  tp::data $token]
9c20: 0a 63 6c 6f 73 65 20 24 63 68 0a 0a 23 20 43 6c  .close $ch..# Cl
9c30: 65 61 6e 75 70 0a 3a 3a 68 74 74 70 3a 3a 63 6c  eanup.::http::cl
9c40: 65 61 6e 75 70 20 24 74 6f 6b 65 6e 0a 0a 2e 43  eanup $token...C
9c50: 45 0a 45 78 61 6d 70 6c 65 20 23 32 3a 20 44 6f  E.Example #2: Do
9c60: 77 6e 6c 6f 61 64 20 61 20 66 69 6c 65 0a 2e 43  wnload a file..C
9c70: 53 0a 0a 0a 0a 70 61 63 6b 61 67 65 20 72 65 71  S....package req
9c80: 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67  uire http.packag
9c90: 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 73  e require tls..s
9ca0: 65 74 20 75 72 6c 20 22 68 74 74 70 73 3a 2f 2f  et url "https://
9cb0: 77 69 6b 69 5c 26 2e 74 63 6c 2d 6c 61 6e 67 5c  wiki\&.tcl-lang\
9cc0: 26 2e 6f 72 67 2f 73 69 74 65 6d 61 70 5c 26 2e  &.org/sitemap\&.
9cd0: 78 6d 6c 22 0a 68 74 74 70 3a 3a 72 65 67 69 73  xml".http::regis
9ce0: 74 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c  ter https 443 [l
9cf0: 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65  ist ::tls::socke
9d00: 74 20 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d  t -autoservernam
9d10: 65 20 31 20 2d 72 65 71 75 69 72 65 20 31 5d 0a  e 1 -require 1].
9d20: 0a 23 20 4f 70 65 6e 20 6f 75 74 70 75 74 20 66  .# Open output f
9d30: 69 6c 65 0a 73 65 74 20 66 69 6c 65 6e 61 6d 65  ile.set filename
9d40: 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 75 72 6c   [file tail $url
9d50: 5d 0a 73 65 74 20 63 68 20 5b 6f 70 65 6e 20 24  ].set ch [open $
9d60: 66 69 6c 65 6e 61 6d 65 20 77 62 5d 0a 0a 23 20  filename wb]..# 
9d70: 47 65 74 20 66 69 6c 65 0a 73 65 74 20 74 6f 6b  Get file.set tok
9d80: 65 6e 20 5b 3a 3a 68 74 74 70 3a 3a 67 65 74 75  en [::http::getu
9d90: 72 6c 20 24 75 72 6c 20 2d 62 6c 6f 63 6b 73 69  rl $url -blocksi
9da0: 7a 65 20 36 35 35 33 36 20 2d 63 68 61 6e 6e 65  ze 65536 -channe
9db0: 6c 20 24 63 68 5d 0a 0a 23 20 43 68 65 63 6b 20  l $ch]..# Check 
9dc0: 66 6f 72 20 65 72 72 6f 72 0a 69 66 20 7b 5b 68  for error.if {[h
9dd0: 74 74 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b  ttp::status $tok
9de0: 65 6e 5d 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a 20  en] ne "ok"} {. 
9df0: 20 20 20 70 75 74 73 20 5b 66 6f 72 6d 61 74 20     puts [format 
9e00: 22 45 72 72 6f 72 20 25 73 22 20 5b 68 74 74 70  "Error %s" [http
9e10: 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d  ::status $token]
9e20: 5d 0a 7d 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 63  ].}..# Cleanup.c
9e30: 6c 6f 73 65 20 24 63 68 0a 3a 3a 68 74 74 70 3a  lose $ch.::http:
9e40: 3a 63 6c 65 61 6e 75 70 20 24 74 6f 6b 65 6e 0a  :cleanup $token.
9e50: 0a 2e 43 45 0a 2e 53 48 20 22 53 50 45 43 49 41  ..CE..SH "SPECIA
9e60: 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53  L CONSIDERATIONS
9e70: 22 0a 54 68 65 20 63 61 70 61 62 69 6c 69 74 69  ".The capabiliti
9e80: 65 73 20 6f 66 20 74 68 69 73 20 70 61 63 6b 61  es of this packa
9e90: 67 65 20 63 61 6e 20 76 61 72 79 20 65 6e 6f 72  ge can vary enor
9ea0: 6d 6f 75 73 6c 79 20 62 61 73 65 64 20 75 70 6f  mously based upo
9eb0: 6e 20 68 6f 77 20 74 68 65 0a 6c 69 6e 6b 65 64  n how the.linked
9ec0: 20 74 6f 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72   to OpenSSL libr
9ed0: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72  ary was configur
9ee0: 65 64 20 61 6e 64 20 62 75 69 6c 74 5c 26 2e 20  ed and built\&. 
9ef0: 4e 65 77 20 76 65 72 73 69 6f 6e 73 20 6d 61 79  New versions may
9f00: 20 6f 62 73 6f 6c 65 74 65 0a 6f 6c 64 65 72 20   obsolete.older 
9f10: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e  protocol version
9f20: 73 2c 20 61 64 64 20 6f 72 20 72 65 6d 6f 76 65  s, add or remove
9f30: 20 63 69 70 68 65 72 73 2c 20 63 68 61 6e 67 65   ciphers, change
9f40: 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 73 2c   default values,
9f50: 20 65 74 63 5c 26 2e 0a 55 73 65 20 74 68 65 20   etc\&..Use the 
9f60: 5c 66 42 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c  \fBtls::protocol
9f70: 73 5c 66 52 20 63 6f 6d 6d 61 6e 64 73 20 74 6f  s\fR commands to
9f80: 20 6f 62 74 61 69 6e 20 74 68 65 20 73 75 70 70   obtain the supp
9f90: 6f 72 74 65 64 0a 70 72 6f 74 6f 63 6f 6c 20 76  orted.protocol v
9fa0: 65 72 73 69 6f 6e 73 5c 26 2e 0a 2e 53 48 20 22  ersions\&...SH "
9fb0: 53 45 45 20 41 4c 53 4f 22 0a 5c 66 49 4f 70 65  SEE ALSO".\fIOpe
9fc0: 6e 53 53 4c 5c 66 52 20 5b 68 74 74 70 73 3a 2f  nSSL\fR [https:/
9fd0: 2f 77 77 77 5c 26 2e 6f 70 65 6e 73 73 6c 5c 26  /www\&.openssl\&
9fe0: 2e 6f 72 67 2f 5d 2c 20 68 74 74 70 2c 20 73 6f  .org/], http, so
9ff0: 63 6b 65 74 0a 2e 53 48 20 4b 45 59 57 4f 52 44  cket..SH KEYWORD
a000: 53 0a 49 2f 4f 2c 20 49 50 20 41 64 64 72 65 73  S.I/O, IP Addres
a010: 73 2c 20 4f 70 65 6e 53 53 4c 2c 20 53 53 4c 2c  s, OpenSSL, SSL,
a020: 20 54 43 50 2c 20 54 4c 53 2c 20 54 63 6c 54 4c   TCP, TLS, TclTL
a030: 53 2c 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 20  S, asynchronous 
a040: 49 2f 4f 2c 20 62 69 6e 64 2c 20 63 65 72 74 69  I/O, bind, certi
a050: 66 69 63 61 74 65 2c 20 63 68 61 6e 6e 65 6c 2c  ficate, channel,
a060: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 64 6f 6d   connection, dom
a070: 61 69 6e 20 6e 61 6d 65 2c 20 68 6f 73 74 2c 20  ain name, host, 
a080: 68 74 74 70 73 2c 20 6e 65 74 77 6f 72 6b 2c 20  https, network, 
a090: 6e 65 74 77 6f 72 6b 20 61 64 64 72 65 73 73 2c  network address,
a0a0: 20 73 6f 63 6b 65 74 2c 20 74 6c 73 0a 2e 53 48   socket, tls..SH
a0b0: 20 43 41 54 45 47 4f 52 59 0a 74 6c 73 0a 2e 53   CATEGORY.tls..S
a0c0: 48 20 43 4f 50 59 52 49 47 48 54 0a 2e 6e 66 0a  H COPYRIGHT..nf.
a0d0: 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 31 39  Copyright (c) 19
a0e0: 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 0a 43  99 Matt Newman.C
a0f0: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30  opyright (c) 200
a100: 34 20 53 74 61 72 66 69 73 68 20 53 79 73 74 65  4 Starfish Syste
a110: 6d 73 0a 43 6f 70 79 72 69 67 68 74 20 28 63 29  ms.Copyright (c)
a120: 20 32 30 32 34 20 42 72 69 61 6e 20 4f 27 48 61   2024 Brian O'Ha
a130: 67 61 6e 0a 0a 2e 66 69 0a                       gan...fi.