0000: 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0a  <!DOCTYPE html>.
0010: 3c 68 74 6d 6c 20 6c 61 6e 67 3d 22 65 6e 22 3e  <html lang="en">
0020: 0a 3c 68 65 61 64 3e 0a 3c 6d 65 74 61 20 68 74  .<head>.<meta ht
0030: 74 70 2d 65 71 75 69 76 3d 22 43 6f 6e 74 65 6e  tp-equiv="Conten
0040: 74 2d 54 79 70 65 22 20 63 6f 6e 74 65 6e 74 3d  t-Type" content=
0050: 22 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72  "text/html; char
0060: 73 65 74 3d 75 74 66 2d 38 22 3e 0a 3c 6d 65 74  set=utf-8">.<met
0070: 61 20 6e 61 6d 65 3d 22 43 6f 70 79 72 69 67 68  a name="Copyrigh
0080: 74 22 20 63 6f 6e 74 65 6e 74 3d 22 31 39 39 39  t" content="1999
0090: 20 4d 61 74 74 20 4e 65 77 6d 61 6e 20 2f 20 32   Matt Newman / 2
00a0: 30 30 34 20 53 74 61 72 66 69 73 68 20 53 79 73  004 Starfish Sys
00b0: 74 65 6d 73 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c  tems">.<title>TL
00c0: 53 20 28 53 53 4c 29 20 54 43 4c 20 43 6f 6d 6d  S (SSL) TCL Comm
00d0: 61 6e 64 73 3c 2f 74 69 74 6c 65 3e 0a 3c 6c 69  ands</title>.<li
00e0: 6e 6b 20 72 65 6c 3d 22 73 74 79 6c 65 73 68 65  nk rel="styleshe
00f0: 65 74 22 20 68 72 65 66 3d 22 64 6f 63 73 2e 63  et" href="docs.c
0100: 73 73 22 20 74 79 70 65 3d 22 74 65 78 74 2f 63  ss" type="text/c
0110: 73 73 22 20 6d 65 64 69 61 3d 22 61 6c 6c 22 3e  ss" media="all">
0120: 0a 3c 2f 68 65 61 64 3e 0a 0a 3c 62 6f 64 79 20  .</head>..<body 
0130: 63 6c 61 73 73 3d 22 76 73 63 2d 69 6e 69 74 69  class="vsc-initi
0140: 61 6c 69 7a 65 64 22 3e 0a 0a 3c 68 32 3e 54 43  alized">..<h2>TC
0150: 4c 20 54 6c 73 20 45 78 74 65 6e 73 69 6f 6e 20  L Tls Extension 
0160: 44 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 3c 2f 68  Documentation</h
0170: 32 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 64  2>..<dl>.    <dd
0180: 3e 3c 61 20 68 72 65 66 3d 22 23 4e 41 4d 45 22  ><a href="#NAME"
0190: 3e 4e 41 4d 45 3c 2f 61 3e 0a 20 20 20 20 3c 64  >NAME</a>.    <d
01a0: 6c 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3c 2f  l>..<dd><b>tls</
01b0: 62 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20  b> - binding to 
01c0: 3c 62 3e 4f 70 65 6e 53 53 4c 3c 2f 62 3e 20 6c  <b>OpenSSL</b> l
01d0: 69 62 72 61 72 79 0a 09 66 6f 72 20 65 6e 63 72  ibrary..for encr
01e0: 79 70 74 65 64 20 73 6f 63 6b 65 74 20 61 6e 64  ypted socket and
01f0: 20 49 2f 4f 20 63 68 61 6e 6e 65 6c 20 63 6f 6d   I/O channel com
0200: 6d 75 6e 69 63 61 74 69 6f 6e 73 2e 3c 2f 64 64  munications.</dd
0210: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20  >.    </dl>.    
0220: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61  </dd>.    <dd><a
0230: 20 68 72 65 66 3d 22 23 53 59 4e 4f 50 53 49 53   href="#SYNOPSIS
0240: 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 3e 20 3c  ">SYNOPSIS</a> <
0250: 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 64 6c  /dd>.    <dd><dl
0260: 3e 0a 09 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67  >..<dd><b>packag
0270: 65 20 72 65 71 75 69 72 65 20 54 63 6c 3c 2f 62  e require Tcl</b
0280: 3e 20 3c 65 6d 3e 3f 3c 62 3e 38 2e 35 2d 3c 2f  > <em>?<b>8.5-</
0290: 62 3e 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c  b>?</em></dd>..<
02a0: 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 65  dd><b>package re
02b0: 71 75 69 72 65 20 74 6c 73 3c 2f 62 3e 20 3c 65  quire tls</b> <e
02c0: 6d 3e 3f 3c 62 3e 31 2e 38 2d 3c 2f 62 3e 3f 3c  m>?<b>1.8-</b>?<
02d0: 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 26  /em></dd>..<dt>&
02e0: 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 3c 64 64 3e  nbsp;</dt>..<dd>
02f0: 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f 62 3e  <b>tls::init</b>
0300: 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f   <em>?options?</
0310: 65 6d 3e 20 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c  em> </dd>..<dd><
0320: 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62  b>tls::socket</b
0330: 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20  > <em>?options? 
0340: 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f  host port</em></
0350: 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3a  dd>..<dd><b>tls:
0360: 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e  :socket</b> <em>
0370: 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64  ?-server command
0380: 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74  ? ?options? port
0390: 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64 64 3e  </em></dd>..<dd>
03a0: 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b  <b>tls::handshak
03b0: 65 3c 2f 62 3e 20 3c 65 6d 3e 20 63 68 61 6e 6e  e</b> <em> chann
03c0: 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64  el</em></dd>..<d
03d0: 64 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73  d><b>tls::status
03e0: 3c 2f 62 3e 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c  </b> <em>?-local
03f0: 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f  ? channel</em></
0400: 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3a  dd>..<dd><b>tls:
0410: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c 2f 62 3e 20  :connection</b> 
0420: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e  <em>channel</em>
0430: 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c  </dd>..<dd><b>tl
0440: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65  s::import</b> <e
0450: 6d 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f  m>channel ?optio
0460: 6e 73 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c  ns?</em></dd>..<
0470: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70  dd><b>tls::unimp
0480: 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63 68 61 6e  ort</b> <em>chan
0490: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c  nel</em></dd>..<
04a0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09  dt> </dt>..
04b0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 70 72 6f 74  <dd><b>tls::prot
04c0: 6f 63 6f 6c 73 3c 2f 62 3e 3c 2f 64 64 3e 0a 09  ocols</b></dd>..
04d0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73  <dd><b>tls::vers
04e0: 69 6f 6e 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20  ion</b></dd>.   
04f0: 20 3c 2f 64 6c 3e 3c 2f 64 64 3e 0a 20 20 20 20   </dl></dd>.    
0500: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 4f  <dd><a href="#CO
0510: 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e 44 53  MMANDS">COMMANDS
0520: 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64  </a></dd>.    <d
0530: 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c  d><a href="#CALL
0540: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41  BACK OPTIONS">CA
0550: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f  LLBACK OPTIONS</
0560: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  a></dd>.    <dd>
0570: 3c 61 20 68 72 65 66 3d 22 23 48 54 54 50 53 20  <a href="#HTTPS 
0580: 45 58 41 4d 50 4c 45 22 3e 48 54 54 50 53 20 45  EXAMPLE">HTTPS E
0590: 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 64 64 3e 0a  XAMPLE</a></dd>.
05a0: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
05b0: 22 23 53 45 45 20 41 4c 53 4f 22 3e 53 50 45 43  "#SEE ALSO">SPEC
05c0: 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f  IAL CONSIDERATIO
05d0: 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20  NS</a></dd>.    
05e0: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 45  <dd><a href="#SE
05f0: 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f  E ALSO">SEE ALSO
0600: 3c 2f 61 3e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a  </a></dd>.</dl>.
0610: 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61  .<hr>..<h3><a na
0620: 6d 65 3d 22 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f  me="NAME">NAME</
0630: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72  a></h3>..<p><str
0640: 6f 6e 67 3e 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e  ong>tls</strong>
0650: 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 73   - binding to <s
0660: 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73  trong>OpenSSL</s
0670: 74 72 6f 6e 67 3e 20 6c 69 62 72 61 72 79 0a 66  trong> library.f
0680: 6f 72 20 65 6e 63 72 79 70 74 65 64 20 73 6f 63  or encrypted soc
0690: 6b 65 74 20 61 6e 64 20 49 2f 4f 20 63 68 61 6e  ket and I/O chan
06a0: 6e 65 6c 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f  nel communicatio
06b0: 6e 73 2e 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c  ns.</p>..<hr>..<
06c0: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 59 4e 4f  h3><a name="SYNO
06d0: 50 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f  PSIS">SYNOPSIS</
06e0: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 62 3e 70  a></h3>..<p><b>p
06f0: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 54  ackage require T
0700: 63 6c 3c 2f 62 3e 20 3c 65 6d 3e 3f 3c 62 3e 38  cl</b> <em>?<b>8
0710: 2e 35 2d 3c 2f 62 3e 3f 3c 2f 65 6d 3e 3c 62 72  .5-</b>?</em><br
0720: 3e 0a 3c 62 3e 70 61 63 6b 61 67 65 20 72 65 71  >.<b>package req
0730: 75 69 72 65 20 74 6c 73 3c 2f 62 3e 20 3c 65 6d  uire tls</b> <em
0740: 3e 3f 3c 62 3e 31 2e 38 2d 3c 2f 62 3e 3f 3c 2f  >?<b>1.8-</b>?</
0750: 65 6d 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20  em><br>.<br>.<a 
0760: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74  href="#tls::init
0770: 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f  "><b>tls::init</
0780: 62 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c  b> <i>?options?<
0790: 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68  /i></a><br>.<a h
07a0: 72 65 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65  ref="#tls::socke
07b0: 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65  t"><b>tls::socke
07c0: 74 3c 2f 62 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e  t</b> <i>?option
07d0: 73 3f 20 68 6f 73 74 20 70 6f 72 74 3c 2f 69 3e  s? host port</i>
07e0: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74  <br>.<a href="#t
07f0: 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74  ls::socket"><b>t
0800: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c  ls::socket</b> <
0810: 69 3e 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61  i>?-server comma
0820: 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f  nd? ?options? po
0830: 72 74 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c  rt</i></a><br>.<
0840: 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74  a href="#tls::st
0850: 61 74 75 73 22 3e 3c 62 3e 74 6c 73 3a 3a 73 74  atus"><b>tls::st
0860: 61 74 75 73 3c 2f 62 3e 20 3c 69 3e 3f 2d 6c 6f  atus</b> <i>?-lo
0870: 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 69 3e  cal? channel</i>
0880: 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66  </a><br>.<a href
0890: 3d 22 23 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69  ="#tls::connecti
08a0: 6f 6e 22 3e 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e  on"><b>tls::conn
08b0: 65 63 74 69 6f 6e 3c 2f 62 3e 20 3c 69 3e 63 68  ection</b> <i>ch
08c0: 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72  annel</i></a><br
08d0: 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a  >.<a href="#tls:
08e0: 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c 62 3e 74  :handshake"><b>t
08f0: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62  ls::handshake</b
0900: 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e  > <i>channel</i>
0910: 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66  </a><br>.<a href
0920: 3d 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e  ="#tls::import">
0930: 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f  <b>tls::import</
0940: 62 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 20 3f 6f  b> <i>channel ?o
0950: 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c  ptions?</i></a><
0960: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
0970: 73 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e  s::unimport"><b>
0980: 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 3c 2f 62  tls::unimport</b
0990: 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e  > <i>channel</i>
09a0: 3c 2f 61 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61  </a><br>.<br>.<a
09b0: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 70 72 6f   href="#tls::pro
09c0: 74 6f 63 6f 6c 73 22 3e 3c 62 3e 74 6c 73 3a 3a  tocols"><b>tls::
09d0: 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62 3e 3c 2f 61  protocols</b></a
09e0: 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23  ><br>.<a href="#
09f0: 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 3e 3c 62  tls::version"><b
0a00: 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 62  >tls::version</b
0a10: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 2f 70 3e 0a 0a  ></a><br>.</p>..
0a20: 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d  <hr>..<h3><a nam
0a30: 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e 22 3e  e="DESCRIPTION">
0a40: 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e 3c  DESCRIPTION</a><
0a50: 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73 20 65 78  /h3>..<p>This ex
0a60: 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64 65 73  tension provides
0a70: 20 54 43 4c 20 73 63 72 69 70 74 20 61 63 63 65   TCL script acce
0a80: 73 73 20 74 6f 20 73 65 63 75 72 65 20 73 6f 63  ss to secure soc
0a90: 6b 65 74 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f  ket communicatio
0aa0: 6e 73 0a 75 73 69 6e 67 20 74 68 65 20 54 72 61  ns.using the Tra
0ab0: 6e 73 70 6f 72 74 20 4c 61 79 65 72 20 53 65 63  nsport Layer Sec
0ac0: 75 72 69 74 79 20 28 54 4c 53 29 20 70 72 6f 74  urity (TLS) prot
0ad0: 6f 63 6f 6c 2e 20 49 74 20 70 72 6f 76 69 64 65  ocol. It provide
0ae0: 73 20 61 20 67 65 6e 65 72 69 63 0a 62 69 6e 64  s a generic.bind
0af0: 69 6e 67 20 74 6f 20 3c 61 20 68 72 65 66 3d 22  ing to <a href="
0b00: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 6f 70 65 6e  https://www.open
0b10: 73 73 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e 53 53  ssl.org/">OpenSS
0b20: 4c 3c 2f 61 3e 2c 20 75 74 69 6c 69 7a 69 6e 67  L</a>, utilizing
0b30: 20 74 68 65 0a 3c 73 74 72 6f 6e 67 3e 54 63 6c   the.<strong>Tcl
0b40: 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73  _StackChannel</s
0b50: 74 72 6f 6e 67 3e 20 41 50 49 20 69 6e 20 54 43  trong> API in TC
0b60: 4c 20 38 2e 34 20 61 6e 64 20 68 69 67 68 65 72  L 8.4 and higher
0b70: 2e 0a 54 68 65 73 65 20 73 6f 63 6b 65 74 73 20  ..These sockets 
0b80: 62 65 68 61 76 65 20 65 78 61 63 74 6c 79 20 74  behave exactly t
0b90: 68 65 20 73 61 6d 65 20 61 73 20 63 68 61 6e 6e  he same as chann
0ba0: 65 6c 73 20 63 72 65 61 74 65 64 20 75 73 69 6e  els created usin
0bb0: 67 20 74 68 65 20 62 75 69 6c 74 2d 69 6e 0a 3c  g the built-in.<
0bc0: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
0bd0: 74 72 6f 6e 67 3e 20 63 6f 6d 6d 61 6e 64 2c 20  trong> command, 
0be0: 61 6c 6f 6e 67 20 77 69 74 68 20 61 64 64 69 74  along with addit
0bf0: 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 66 6f  ional options fo
0c00: 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 0a 74 68  r controlling.th
0c10: 65 20 53 53 4c 2f 54 4c 53 20 73 65 73 73 69 6f  e SSL/TLS sessio
0c20: 6e 2e 0a 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c  n..</p>..<hr>..<
0c30: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 4f 4d 4d  h3><a name="COMM
0c40: 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 3c 2f  ANDS">COMMANDS</
0c50: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 79 70 69  a></h3>..<p>Typi
0c60: 63 61 6c 6c 79 20 6f 6e 65 20 77 6f 75 6c 64 20  cally one would 
0c70: 75 73 65 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e  use the <strong>
0c80: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 73 74  tls::socket </st
0c90: 72 6f 6e 67 3e 63 6f 6d 6d 61 6e 64 0a 77 68 69  rong>command.whi
0ca0: 63 68 20 70 72 6f 76 69 64 65 73 20 63 6f 6d 70  ch provides comp
0cb0: 61 74 69 62 69 6c 69 74 79 20 77 69 74 68 20 74  atibility with t
0cc0: 68 65 20 6e 61 74 69 76 65 20 54 43 4c 20 3c 73  he native TCL <s
0cd0: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74  trong>socket</st
0ce0: 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 2e 20 49  rong>.command. I
0cf0: 6e 20 73 75 63 68 20 63 61 73 65 73 20 3c 73 74  n such cases <st
0d00: 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74  rong>tls::import
0d10: 3c 2f 73 74 72 6f 6e 67 3e 20 73 68 6f 75 6c 64  </strong> should
0d20: 20 6e 6f 74 20 62 65 0a 75 73 65 64 20 64 69 72   not be.used dir
0d30: 65 63 74 6c 79 2e 3c 2f 70 3e 0a 3c 64 6c 3e 0a  ectly.</p>.<dl>.
0d40: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
0d50: 22 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74  "tls::init"><b>t
0d60: 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e  ls::init </b><i>
0d70: 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61  ?options?</i></a
0d80: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 4f  ></dt>.    <dd>O
0d90: 70 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f 6e  ptional function
0da0: 20 74 6f 20 73 65 74 20 74 68 65 20 64 65 66 61   to set the defa
0db0: 75 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65 64  ult options used
0dc0: 20 62 79 0a 09 3c 73 74 72 6f 6e 67 3e 74 6c 73   by..<strong>tls
0dd0: 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67  ::socket</strong
0de0: 3e 2e 20 49 66 20 79 6f 75 20 63 61 6c 6c 20 3c  >. If you call <
0df0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f  strong>tls::impo
0e00: 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a 09 64 69 72  rt</strong>..dir
0e10: 65 63 74 6c 79 2c 20 74 68 69 73 20 63 6f 6d 6d  ectly, this comm
0e20: 61 6e 64 20 68 61 73 20 6e 6f 20 65 66 66 65 63  and has no effec
0e30: 74 2e 20 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20  t. This command 
0e40: 73 75 70 70 6f 72 74 73 20 61 6c 6c 20 6f 66 20  supports all of 
0e50: 74 68 65 0a 09 73 61 6d 65 20 6f 70 74 69 6f 6e  the..same option
0e60: 73 20 61 73 20 74 68 65 20 3c 73 74 72 6f 6e 67  s as the <strong
0e70: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74  >tls::socket</st
0e80: 72 6f 6e 67 3e 20 63 6f 6d 6d 61 6e 64 2c 20 74  rong> command, t
0e90: 68 6f 75 67 68 20 79 6f 75 0a 09 73 68 6f 75 6c  hough you..shoul
0ea0: 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70 74  d limit your opt
0eb0: 69 6f 6e 73 20 74 6f 20 6f 6e 6c 79 20 54 4c 53  ions to only TLS
0ec0: 20 72 65 6c 61 74 65 64 20 6f 6e 65 73 2e 3c 2f   related ones.</
0ed0: 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73  dd>.    <dt>&nbs
0ee0: 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e  p;</dt>.    <dt>
0ef0: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 6f  <a name="tls::so
0f00: 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f  cket"><b>tls::so
0f10: 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70  cket </b><em>?op
0f20: 74 69 6f 6e 73 3f 0a 09 68 6f 73 74 20 70 6f 72  tions?..host por
0f30: 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a  t</em></a></dt>.
0f40: 20 20 20 20 3c 64 74 3e 3c 62 3e 74 6c 73 3a 3a      <dt><b>tls::
0f50: 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f  socket</b><em> ?
0f60: 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f  -server command?
0f70: 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c   ?options? port<
0f80: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  /em></dt>.    <d
0f90: 64 3e 54 68 69 73 20 69 73 20 61 20 68 65 6c 70  d>This is a help
0fa0: 65 72 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74  er function that
0fb0: 20 75 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e   utilizes the un
0fc0: 64 65 72 6c 79 69 6e 67 20 63 6f 6d 6d 61 6e 64  derlying command
0fd0: 73 0a 09 28 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b  s..(<strong>sock
0fe0: 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 20  et</strong> and 
0ff0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70  <strong>tls::imp
1000: 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 29 20 74 6f  ort</strong>) to
1010: 20 63 72 65 61 74 65 0a 09 74 68 65 20 63 6f 6e   create..the con
1020: 6e 65 63 74 69 6f 6e 2e 20 49 74 20 62 65 68 61  nection. It beha
1030: 76 65 73 20 74 68 65 20 73 61 6d 65 20 61 73 20  ves the same as 
1040: 74 68 65 20 6e 61 74 69 76 65 20 54 43 4c 20 3c  the native TCL <
1050: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
1060: 74 72 6f 6e 67 3e 0a 09 63 6f 6d 6d 61 6e 64 2c  trong>..command,
1070: 20 62 75 74 20 61 6c 73 6f 20 73 75 70 70 6f 72   but also suppor
1080: 74 73 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22  ts the <a href="
1090: 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 73  #tls::import"><s
10a0: 74 72 6f 6e 67 3e 74 6c 73 3a 69 6d 70 6f 72 74  trong>tls:import
10b0: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 0a 09 63  </strong></a>..c
10c0: 6f 6d 6d 61 6e 64 20 6f 70 74 69 6f 6e 73 20 61  ommand options a
10d0: 6e 64 20 6f 6e 65 20 61 64 64 69 74 69 6f 6e 61  nd one additiona
10e0: 6c 20 6f 70 74 69 6f 6e 3a 3c 2f 64 64 3e 0a 20  l option:</dd>. 
10f0: 20 20 20 3c 64 6c 3e 3c 62 6c 6f 63 6b 71 75 6f     <dl><blockquo
1100: 74 65 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  te>..<dt><strong
1110: 3e 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65  >-autoservername
1120: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
1130: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ol</em></dt>..<d
1140: 64 3e 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20  d>Automatically 
1150: 73 65 74 20 74 68 65 20 2d 73 65 72 76 65 72 6e  set the -servern
1160: 61 6d 65 20 61 72 67 75 6d 65 6e 74 20 74 6f 20  ame argument to 
1170: 74 68 65 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d  the <em>host</em
1180: 3e 0a 09 61 72 67 75 6d 65 6e 74 20 28 64 65 66  >..argument (def
1190: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73  ault is <em>fals
11a0: 65 3c 2f 65 6d 3e 29 2e 3c 2f 64 64 3e 0a 20 20  e</em>).</dd>.  
11b0: 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c    </blockquote><
11c0: 2f 64 6c 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61  /dl>..    <dt><a
11d0: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 69 6d 70 6f   name="tls::impo
11e0: 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f  rt"><b>tls::impo
11f0: 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65  rt </b><i>channe
1200: 6c 0a 09 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e  l..?options?</i>
1210: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  </a></dt>.    <d
1220: 64 3e 41 64 64 20 53 53 4c 2f 54 4c 53 20 65 6e  d>Add SSL/TLS en
1230: 63 72 79 70 74 69 6f 6e 20 74 6f 20 61 20 72 65  cryption to a re
1240: 67 75 6c 61 72 20 54 43 4c 20 63 68 61 6e 6e 65  gular TCL channe
1250: 6c 2e 20 49 74 20 6e 65 65 64 0a 09 6e 6f 74 20  l. It need..not 
1260: 62 65 20 61 20 73 6f 63 6b 65 74 2c 20 62 75 74  be a socket, but
1270: 20 6d 75 73 74 20 70 72 6f 76 69 64 65 20 62 69   must provide bi
1280: 2d 64 69 72 65 63 74 69 6f 6e 61 6c 20 66 6c 6f  -directional flo
1290: 77 2e 20 41 6c 73 6f 0a 09 73 65 74 20 73 65 73  w. Also..set ses
12a0: 73 69 6f 6e 20 70 61 72 61 6d 65 74 65 72 73 20  sion parameters 
12b0: 66 6f 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b  for SSL handshak
12c0: 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 6c 3e  e.</dd>.    <dl>
12d0: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 09 3c 64  <blockquote>..<d
12e0: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 6c 70 6e 3c  t><strong>-alpn<
12f0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73  /strong> <em>lis
1300: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  t</em></dt>..<dd
1310: 3e 4c 69 73 74 20 6f 66 20 70 72 6f 74 6f 63 6f  >List of protoco
1320: 6c 73 20 74 6f 20 6f 66 66 65 72 20 64 75 72 69  ls to offer duri
1330: 6e 67 20 41 70 70 6c 69 63 61 74 69 6f 6e 2d 4c  ng Application-L
1340: 61 79 65 72 0a 09 20 20 20 20 50 72 6f 74 6f 63  ayer..    Protoc
1350: 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28  ol Negotiation (
1360: 41 4c 50 4e 29 2e 20 46 6f 72 20 65 78 61 6d 70  ALPN). For examp
1370: 6c 65 3a 20 3c 65 6d 3e 68 32 3c 2f 65 6d 3e 20  le: <em>h2</em> 
1380: 61 6e 64 0a 09 20 20 20 20 3c 65 6d 3e 68 74 74  and..    <em>htt
1390: 70 2f 31 2e 31 3c 2f 65 6d 3e 2c 20 62 75 74 20  p/1.1</em>, but 
13a0: 6e 6f 74 20 3c 65 6d 3e 68 33 3c 2f 65 6d 3e 20  not <em>h3</em> 
13b0: 6f 72 20 3c 65 6d 3e 71 75 69 63 3c 2f 65 6d 3e  or <em>quic</em>
13c0: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
13d0: 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f 73 74 72 6f  ong>-cadir</stro
13e0: 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c 2f 65 6d 3e  ng> <em>dir</em>
13f0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69  </dt>..<dd>Speci
1400: 66 69 65 73 20 74 68 65 20 64 69 72 65 63 74 6f  fies the directo
1410: 72 79 20 77 68 65 72 65 20 74 68 65 20 43 65 72  ry where the Cer
1420: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69  tificate Authori
1430: 74 79 20 28 43 41 29 0a 09 20 20 20 20 63 65 72  ty (CA)..    cer
1440: 74 69 66 69 63 61 74 65 73 20 61 72 65 20 73 74  tificates are st
1450: 6f 72 65 64 2e 20 54 68 65 20 64 65 66 61 75 6c  ored. The defaul
1460: 74 20 69 73 20 70 6c 61 74 66 6f 72 6d 20 73 70  t is platform sp
1470: 65 63 69 66 69 63 20 61 6e 64 20 63 61 6e 20 62  ecific and can b
1480: 65 0a 09 20 20 20 20 73 65 74 20 61 74 20 63 6f  e..    set at co
1490: 6d 70 69 6c 65 20 74 69 6d 65 2e 20 54 68 69 73  mpile time. This
14a0: 20 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64   can be overridd
14b0: 65 6e 20 76 69 61 20 74 68 65 20 3c 62 3e 53 53  en via the <b>SS
14c0: 4c 5f 43 45 52 54 5f 44 49 52 3c 2f 62 3e 0a 09  L_CERT_DIR</b>..
14d0: 20 20 20 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20      environment 
14e0: 76 61 72 69 61 62 6c 65 2e 3c 2f 64 64 3e 0a 09  variable.</dd>..
14f0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66  <dt><strong>-caf
1500: 69 6c 65 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d  ile </strong><em
1510: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1520: 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69  dt>..<dd>Specifi
1530: 65 73 20 74 68 65 20 66 69 6c 65 20 77 69 74 68  es the file with
1540: 20 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65   the Certificate
1550: 20 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 20   Authority (CA) 
1560: 63 65 72 74 69 66 69 63 61 74 65 73 0a 09 20 20  certificates..  
1570: 20 20 74 6f 20 75 73 65 2e 20 54 68 65 20 64 65    to use. The de
1580: 66 61 75 6c 74 20 69 73 20 3c 62 3e 63 65 72 74  fault is <b>cert
1590: 2e 70 65 6d 3c 2f 62 3e 2c 20 69 6e 20 74 68 65  .pem</b>, in the
15a0: 20 4f 70 65 6e 53 53 4c 20 64 69 72 65 63 74 6f   OpenSSL directo
15b0: 72 79 2e 20 54 68 69 73 20 63 61 6e 0a 09 20 20  ry. This can..  
15c0: 20 20 61 6c 73 6f 20 62 65 20 6f 76 65 72 72 69    also be overri
15d0: 64 64 65 6e 20 76 69 61 20 74 68 65 20 3c 62 3e  dden via the <b>
15e0: 53 53 4c 5f 43 45 52 54 5f 46 49 4c 45 3c 2f 62  SSL_CERT_FILE</b
15f0: 3e 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61  > environment va
1600: 72 69 61 62 6c 65 2e 3c 2f 64 64 3e 0a 09 3c 64  riable.</dd>..<d
1610: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 66  t><strong>-certf
1620: 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ile</strong> <em
1630: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1640: 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69  dt>..<dd>Specifi
1650: 65 73 20 74 68 65 20 66 69 6c 65 20 77 69 74 68  es the file with
1660: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
1670: 20 74 6f 20 75 73 65 20 69 6e 20 50 45 4d 20 66   to use in PEM f
1680: 6f 72 6d 61 74 2e 0a 09 20 20 20 20 54 68 69 73  ormat...    This
1690: 20 61 6c 73 6f 20 63 6f 6e 74 61 69 6e 73 20 74   also contains t
16a0: 68 65 20 70 75 62 6c 69 63 20 6b 65 79 2e 3c 2f  he public key.</
16b0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
16c0: 3e 2d 63 65 72 74 3c 2f 73 74 72 6f 6e 67 3e 20  >-cert</strong> 
16d0: 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 72 69 6e  <em>binary_strin
16e0: 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  g</em></dt>..<dd
16f0: 3e 53 70 65 63 69 66 69 65 73 20 74 68 65 20 63  >Specifies the c
1700: 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73  ertificate to us
1710: 65 20 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64  e as a DER encod
1720: 65 64 20 73 74 72 69 6e 67 20 28 58 2e 35 30 39  ed string (X.509
1730: 20 44 45 52 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74   DER).</dd>..<dt
1740: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72  ><strong>-cipher
1750: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74  </strong> <em>st
1760: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  ring</em></dt>..
1770: 3c 64 64 3e 53 70 65 63 69 66 69 65 73 20 74 68  <dd>Specifies th
1780: 65 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72  e list of cipher
1790: 73 20 74 6f 20 75 73 65 20 66 6f 72 20 54 4c 53  s to use for TLS
17a0: 20 31 2e 32 20 61 6e 64 20 65 61 72 6c 69 65 72   1.2 and earlier
17b0: 2e 20 53 74 72 69 6e 67 20 69 73 20 61 0a 09 20  . String is a.. 
17c0: 20 20 20 63 6f 6c 6f 6e 20 28 22 3a 22 29 20 73     colon (":") s
17d0: 65 70 61 72 61 74 65 64 20 6c 69 73 74 20 6f 66  eparated list of
17e0: 20 63 69 70 68 65 72 73 2e 20 43 69 70 68 65 72   ciphers. Cipher
17f0: 73 20 63 61 6e 20 62 65 20 63 6f 6d 62 69 6e 65  s can be combine
1800: 64 20 75 73 69 6e 67 20 74 68 65 0a 09 20 20 20  d using the..   
1810: 20 3c 62 3e 2b 3c 2f 62 3e 20 63 68 61 72 61 63   <b>+</b> charac
1820: 74 65 72 2e 20 50 72 65 66 69 78 65 73 20 63 61  ter. Prefixes ca
1830: 6e 20 62 65 20 75 73 65 64 20 74 6f 20 70 65 72  n be used to per
1840: 6d 61 6e 65 6e 74 6c 79 20 72 65 6d 6f 76 65 20  manently remove 
1850: 28 22 21 22 29 2c 0a 09 20 20 20 20 64 65 6c 65  ("!"),..    dele
1860: 74 65 20 28 22 2d 22 29 2c 20 6f 72 20 6d 6f 76  te ("-"), or mov
1870: 65 20 61 20 63 69 70 68 65 72 20 74 6f 20 74 68  e a cipher to th
1880: 65 20 65 6e 64 20 6f 66 20 74 68 65 20 6c 69 73  e end of the lis
1890: 74 20 28 22 2b 22 29 2e 20 4b 65 79 77 6f 72 64  t ("+"). Keyword
18a0: 73 0a 09 20 20 20 20 3c 62 3e 40 53 54 52 45 4e  s..    <b>@STREN
18b0: 47 54 48 3c 2f 62 3e 20 28 73 6f 72 74 20 62 79  GTH</b> (sort by
18c0: 20 61 6c 67 6f 72 69 74 68 6d 20 6b 65 79 20 6c   algorithm key l
18d0: 65 6e 67 74 68 29 2c 20 3c 62 3e 40 53 45 43 4c  ength), <b>@SECL
18e0: 45 56 45 4c 3d 3c 2f 62 3e 3c 69 3e 6e 3c 2f 69  EVEL=</b><i>n</i
18f0: 3e 0a 09 20 20 20 20 28 73 65 74 20 73 65 63 75  >..    (set secu
1900: 72 69 74 79 20 6c 65 76 65 6c 20 74 6f 20 6e 29  rity level to n)
1910: 2c 20 61 6e 64 20 3c 62 3e 44 45 46 41 55 4c 54  , and <b>DEFAULT
1920: 3c 2f 62 3e 20 28 75 73 65 20 64 65 66 61 75 6c  </b> (use defaul
1930: 74 20 63 69 70 68 65 72 20 6c 69 73 74 2c 0a 09  t cipher list,..
1940: 20 20 20 20 61 74 20 73 74 61 72 74 20 6f 6e 6c      at start onl
1950: 79 29 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 73  y) can also be s
1960: 70 65 63 69 66 69 65 64 2e 20 53 65 65 20 4f 70  pecified. See Op
1970: 65 6e 53 53 4c 20 64 6f 63 75 6d 65 6e 74 61 74  enSSL documentat
1980: 69 6f 6e 20 66 6f 72 20 74 68 65 0a 09 20 20 20  ion for the..   
1990: 20 66 75 6c 6c 20 6c 69 73 74 20 6f 66 20 76 61   full list of va
19a0: 6c 69 64 20 76 61 6c 75 65 73 2e 3c 2f 64 64 3e  lid values.</dd>
19b0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63  ..<dt><strong>-c
19c0: 69 70 68 65 72 73 75 69 74 65 73 3c 2f 73 74 72  iphersuites</str
19d0: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
19e0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53  /em></dt>..<dd>S
19f0: 70 65 63 69 66 69 65 73 20 74 68 65 20 6c 69 73  pecifies the lis
1a00: 74 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74  t of cipher suit
1a10: 65 73 20 74 6f 20 75 73 65 20 66 6f 72 20 54 4c  es to use for TL
1a20: 53 20 31 2e 33 2e 20 53 74 72 69 6e 67 20 69 73  S 1.3. String is
1a30: 20 61 20 63 6f 6c 6f 6e 0a 09 20 20 20 20 28 22   a colon..    ("
1a40: 3a 22 29 20 73 65 70 61 72 61 74 65 64 20 6c 69  :") separated li
1a50: 73 74 20 6f 66 20 63 69 70 68 65 72 20 73 75 69  st of cipher sui
1a60: 74 65 20 6e 61 6d 65 73 2e 3c 2f 64 64 3e 0a 09  te names.</dd>..
1a70: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d  <dt><strong>-com
1a80: 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  mand</strong> <e
1a90: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c  m>callback</em><
1aa0: 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66  /dt>..<dd>Specif
1ab0: 69 65 73 20 74 68 65 20 63 61 6c 6c 62 61 63 6b  ies the callback
1ac0: 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 62 65 20 69   command to be i
1ad0: 6e 76 6f 6b 65 64 20 61 74 20 73 65 76 65 72 61  nvoked at severa
1ae0: 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20  l points during 
1af0: 74 68 65 0a 09 20 20 20 20 68 61 6e 64 73 68 61  the..    handsha
1b00: 6b 65 20 74 6f 20 70 61 73 73 20 65 72 72 6f 72  ke to pass error
1b10: 73 2c 20 74 72 61 63 69 6e 67 20 69 6e 66 6f 72  s, tracing infor
1b20: 6d 61 74 69 6f 6e 2c 20 61 6e 64 20 70 72 6f 74  mation, and prot
1b30: 6f 63 6f 6c 20 6d 65 73 73 61 67 65 73 2e 0a 09  ocol messages...
1b40: 20 20 20 20 53 65 65 20 3c 61 20 68 72 65 66 3d      See <a href=
1b50: 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f  "#CALLBACK OPTIO
1b60: 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54  NS">CALLBACK OPT
1b70: 49 4f 4e 53 3c 2f 61 3e 20 66 6f 72 20 6d 6f 72  IONS</a> for mor
1b80: 65 20 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 09 3c 64  e info.</dd>..<d
1b90: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 64 68 70 61 72  t><strong>-dhpar
1ba0: 61 6d 73 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d  ams </strong><em
1bb0: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1bc0: 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69  dt>..<dd>Specifi
1bd0: 65 73 20 74 68 65 20 44 69 66 66 69 65 2d 48 65  es the Diffie-He
1be0: 6c 6c 6d 61 6e 20 28 44 48 29 20 70 61 72 61 6d  llman (DH) param
1bf0: 65 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64 3e  eters file.</dd>
1c00: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b  ..<dt><strong>-k
1c10: 65 79 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20  eyfile</strong> 
1c20: 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d  <em>filename</em
1c30: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63  ></dt>..<dd>Spec
1c40: 69 66 69 65 73 20 74 68 65 20 70 72 69 76 61 74  ifies the privat
1c50: 65 20 6b 65 79 20 66 69 6c 65 2e 20 28 64 65 66  e key file. (def
1c60: 61 75 6c 74 20 69 73 20 76 61 6c 75 65 20 6f 66  ault is value of
1c70: 20 2d 63 65 72 74 66 69 6c 65 29 2e 3c 2f 64 64   -certfile).</dd
1c80: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d  >..<dt><strong>-
1c90: 6b 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  key</strong> <em
1ca0: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1cb0: 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69  dt>..<dd>Specifi
1cc0: 65 73 20 74 68 65 20 70 72 69 76 61 74 65 20 6b  es the private k
1cd0: 65 79 20 74 6f 20 75 73 65 20 61 73 20 61 20 44  ey to use as a D
1ce0: 45 52 20 65 6e 63 6f 64 65 64 20 73 74 72 69 6e  ER encoded strin
1cf0: 67 20 28 50 4b 43 53 23 31 20 44 45 52 29 2e 3c  g (PKCS#1 DER).<
1d00: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
1d10: 67 3e 2d 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e 67  g>-model</strong
1d20: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65  > <em>channel</e
1d30: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 46 6f 72  m></dt>..<dd>For
1d40: 63 65 20 74 68 69 73 20 63 68 61 6e 6e 65 6c 20  ce this channel 
1d50: 74 6f 20 73 68 61 72 65 20 74 68 65 20 73 61 6d  to share the sam
1d60: 65 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53  e <em><strong>SS
1d70: 4c 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  L_CTX</strong></
1d80: 65 6d 3e 0a 09 20 20 20 20 73 74 72 75 63 74 75  em>..    structu
1d90: 72 65 20 61 73 20 74 68 65 20 73 70 65 63 69 66  re as the specif
1da0: 69 65 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c  ied <em>channel<
1db0: 2f 65 6d 3e 2c 20 61 6e 64 0a 09 20 20 20 20 74  /em>, and..    t
1dc0: 68 65 72 65 66 6f 72 65 20 73 68 61 72 65 20 63  herefore share c
1dd0: 61 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64  allbacks etc.</d
1de0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
1df0: 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e  -password</stron
1e00: 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c  g> <em>callback<
1e10: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53  /em></dt>..<dd>S
1e20: 70 65 63 69 66 69 65 73 20 74 68 65 20 63 61 6c  pecifies the cal
1e30: 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f  lback command to
1e40: 20 69 6e 76 6f 6b 65 20 77 68 65 6e 20 4f 70 65   invoke when Ope
1e50: 6e 53 53 4c 20 6e 65 65 64 73 20 74 6f 0a 09 20  nSSL needs to.. 
1e60: 20 20 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73     obtain a pass
1e70: 77 6f 72 64 2e 20 54 68 69 73 20 69 73 20 74 79  word. This is ty
1e80: 70 69 63 61 6c 6c 79 20 75 73 65 64 20 74 6f 20  pically used to 
1e90: 75 6e 6c 6f 63 6b 20 74 68 65 20 70 72 69 76 61  unlock the priva
1ea0: 74 65 20 6b 65 79 20 6f 66 0a 09 20 20 20 20 61  te key of..    a
1eb0: 20 63 65 72 74 69 66 69 63 61 74 65 2e 20 54 68   certificate. Th
1ec0: 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c  e callback shoul
1ed0: 64 20 72 65 74 75 72 6e 20 61 20 70 61 73 73 77  d return a passw
1ee0: 6f 72 64 20 73 74 72 69 6e 67 2e 0a 09 20 20 20  ord string...   
1ef0: 20 53 65 65 20 3c 61 20 68 72 65 66 3d 22 23 43   See <a href="#C
1f00: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22  ALLBACK OPTIONS"
1f10: 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  >CALLBACK OPTION
1f20: 53 3c 2f 61 3e 20 66 6f 72 20 6d 6f 72 65 20 69  S</a> for more i
1f30: 6e 66 6f 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  nfo.</dd>..<dt><
1f40: 73 74 72 6f 6e 67 3e 2d 70 6f 73 74 5f 68 61 6e  strong>-post_han
1f50: 64 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20  dshake</strong> 
1f60: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64  <em>bool</em></d
1f70: 74 3e 0a 09 3c 64 64 3e 41 6c 6c 6f 77 20 70 6f  t>..<dd>Allow po
1f80: 73 74 2d 68 61 6e 64 73 68 61 6b 65 20 73 65 73  st-handshake ses
1f90: 73 69 6f 6e 20 74 69 63 6b 65 74 20 75 70 64 61  sion ticket upda
1fa0: 74 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  tes.</dd>..<dt><
1fb0: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 20  strong>-request 
1fc0: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f  </strong><em>boo
1fd0: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  l</em></dt>..<dd
1fe0: 3e 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69  >Request a certi
1ff0: 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72  ficate from peer
2000: 20 64 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20   during the SSL 
2010: 68 61 6e 64 73 68 61 6b 65 2e 20 54 68 69 73 20  handshake. This 
2020: 69 73 0a 09 20 20 20 20 6e 65 65 64 65 64 20 74  is..    needed t
2030: 6f 20 64 6f 20 63 65 72 74 69 66 69 63 61 74 65  o do certificate
2040: 20 76 61 6c 69 64 61 74 69 6f 6e 2e 20 28 64 65   validation. (de
2050: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75  fault is <em>tru
2060: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64  e</em>)</dd>..<d
2070: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69  t><strong>-requi
2080: 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  re</strong> <em>
2090: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  bool</em></dt>..
20a0: 3c 64 64 3e 52 65 71 75 69 72 65 20 61 20 76 61  <dd>Require a va
20b0: 6c 69 64 20 63 65 72 74 69 66 69 63 61 74 65 20  lid certificate 
20c0: 66 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67  from peer during
20d0: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 20   SSL handshake. 
20e0: 49 66 20 74 68 69 73 0a 09 20 20 20 20 69 73 20  If this..    is 
20f0: 73 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68 65  set to true, the
2100: 6e 20 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65  n <strong>-reque
2110: 73 74 3c 2f 73 74 72 6f 6e 67 3e 20 6d 75 73 74  st</strong> must
2120: 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 6f 20   also be set to 
2130: 74 72 75 65 0a 09 20 20 20 20 61 6e 64 20 61 20  true..    and a 
2140: 65 69 74 68 65 72 20 61 20 2d 63 61 64 69 72 2c  either a -cadir,
2150: 20 2d 63 61 66 69 6c 65 2c 20 6f 72 20 70 6c 61   -cafile, or pla
2160: 74 66 6f 72 6d 20 64 65 66 61 75 6c 74 20 6d 75  tform default mu
2170: 73 74 20 62 65 20 70 72 6f 76 69 64 65 64 20 69  st be provided i
2180: 6e 0a 09 20 20 20 20 6f 72 64 65 72 20 74 6f 20  n..    order to 
2190: 76 61 6c 69 64 61 74 65 20 61 67 61 69 6e 73 74  validate against
21a0: 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65  . (default is <e
21b0: 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64  m>false</em>)</d
21c0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
21d0: 2d 73 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 3c  -security_level<
21e0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 69 6e 74  /strong> <em>int
21f0: 65 67 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  eger</em></dt>..
2200: 3c 64 64 3e 53 70 65 63 69 66 69 65 73 20 74 68  <dd>Specifies th
2210: 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c  e security level
2220: 20 28 76 61 6c 75 65 20 66 72 6f 6d 20 30 20 74   (value from 0 t
2230: 6f 20 35 29 2e 20 54 68 65 20 73 65 63 75 72 69  o 5). The securi
2240: 74 79 20 6c 65 76 65 6c 0a 09 20 20 20 20 61 66  ty level..    af
2250: 66 65 63 74 73 20 74 68 65 20 63 69 70 68 65 72  fects the cipher
2260: 20 73 75 69 74 65 20 65 6e 63 72 79 70 74 69 6f   suite encryptio
2270: 6e 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20 73 75  n algorithms, su
2280: 70 70 6f 72 74 65 64 20 45 43 43 20 63 75 72 76  pported ECC curv
2290: 65 73 2c 0a 09 20 20 20 20 73 75 70 70 6f 72 74  es,..    support
22a0: 65 64 20 73 69 67 6e 61 74 75 72 65 20 61 6c 67  ed signature alg
22b0: 6f 72 69 74 68 6d 73 2c 20 44 48 20 70 61 72 61  orithms, DH para
22c0: 6d 65 74 65 72 20 73 69 7a 65 73 2c 20 63 65 72  meter sizes, cer
22d0: 74 69 66 69 63 61 74 65 20 6b 65 79 0a 09 20 20  tificate key..  
22e0: 20 20 73 69 7a 65 73 20 61 6e 64 20 73 69 67 6e    sizes and sign
22f0: 61 74 75 72 65 20 61 6c 67 6f 72 69 74 68 6d 73  ature algorithms
2300: 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73  . The default is
2310: 20 31 2e 20 4c 65 76 65 6c 20 33 20 61 6e 64 20   1. Level 3 and 
2320: 68 69 67 68 65 72 0a 09 20 20 20 20 64 69 73 61  higher..    disa
2330: 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20  ble support for 
2340: 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 73 20  session tickets 
2350: 61 6e 64 20 6f 6e 6c 79 20 61 63 63 65 70 74 20  and only accept 
2360: 63 69 70 68 65 72 20 73 75 69 74 65 73 20 74 68  cipher suites th
2370: 61 74 0a 09 20 20 20 20 70 72 6f 76 69 64 65 20  at..    provide 
2380: 66 6f 72 77 61 72 64 20 73 65 63 72 65 63 79 2e  forward secrecy.
2390: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
23a0: 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73 74 72 6f  ng>-server</stro
23b0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
23c0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63  ></dt>..<dd>Spec
23d0: 69 66 69 65 73 20 77 68 65 74 68 65 72 20 74 6f  ifies whether to
23e0: 20 61 63 74 20 61 73 20 61 20 73 65 72 76 65 72   act as a server
23f0: 20 61 6e 64 20 72 65 73 70 6f 6e 64 20 77 69 74   and respond wit
2400: 68 20 61 20 73 65 72 76 65 72 0a 09 20 20 20 20  h a server..    
2410: 68 61 6e 64 73 68 61 6b 65 20 77 68 65 6e 20 61  handshake when a
2420: 20 63 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74 73   client connects
2430: 20 61 6e 64 20 70 72 6f 76 69 64 65 73 20 61 20   and provides a 
2440: 63 6c 69 65 6e 74 20 68 61 6e 64 73 68 61 6b 65  client handshake
2450: 2e 0a 09 20 20 20 20 28 64 65 66 61 75 6c 74 20  ...    (default 
2460: 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d  is <em>false</em
2470: 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  >)</dd>..<dt><st
2480: 72 6f 6e 67 3e 2d 73 65 72 76 65 72 6e 61 6d 65  rong>-servername
2490: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f  </strong> <em>ho
24a0: 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  st</em></dt>..<d
24b0: 64 3e 53 70 65 63 69 66 79 20 73 65 72 76 65 72  d>Specify server
24c0: 27 73 20 68 6f 73 74 6e 61 6d 65 2e 20 54 68 69  's hostname. Thi
24d0: 73 20 69 73 20 75 73 65 64 20 74 6f 20 73 65 74  s is used to set
24e0: 20 74 68 65 20 54 4c 53 20 53 65 72 76 65 72 20   the TLS Server 
24f0: 4e 61 6d 65 0a 09 20 20 20 20 49 6e 64 69 63 61  Name..    Indica
2500: 74 69 6f 6e 20 28 53 4e 49 29 20 65 78 74 65 6e  tion (SNI) exten
2510: 73 69 6f 6e 2e 20 53 65 74 20 74 68 69 73 20 74  sion. Set this t
2520: 6f 20 74 68 65 20 65 78 70 65 63 74 65 64 20 73  o the expected s
2530: 65 72 76 65 72 6e 61 6d 65 20 69 6e 20 74 68 65  ervername in the
2540: 0a 09 20 20 20 73 65 72 76 65 72 27 73 20 63 65  ..   server's ce
2550: 72 74 69 66 69 63 61 74 65 20 6f 72 20 6f 6e 65  rtificate or one
2560: 20 6f 66 20 74 68 65 20 73 75 62 6a 65 63 74 41   of the subjectA
2570: 6c 74 4e 61 6d 65 20 61 6c 74 65 72 6e 61 74 65  ltName alternate
2580: 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  s.</dd>..<dt><st
2590: 72 6f 6e 67 3e 2d 73 65 73 73 69 6f 6e 5f 69 64  rong>-session_id
25a0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74  </strong> <em>st
25b0: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  ring</em></dt>..
25c0: 3c 64 64 3e 53 70 65 63 69 66 69 65 73 20 74 68  <dd>Specifies th
25d0: 65 20 73 65 73 73 69 6f 6e 20 69 64 20 74 6f 20  e session id to 
25e0: 72 65 73 75 6d 65 20 73 65 73 73 69 6f 6e 2e 3c  resume session.<
25f0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
2600: 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e  g>-ssl2</strong>
2610: 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f   <em>bool</em></
2620: 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20  dt>..<dd>Enable 
2630: 75 73 65 20 6f 66 20 53 53 4c 20 76 32 2e 20 28  use of SSL v2. (
2640: 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66  default is <em>f
2650: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a  alse</em>)</dd>.
2660: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73  .<dt><strong>-ss
2670: 6c 33 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e  l3 </strong><em>
2680: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  bool</em></dt>..
2690: 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f  <dd>Enable use o
26a0: 66 20 53 53 4c 20 76 33 2e 20 28 64 65 66 61 75  f SSL v3. (defau
26b0: 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c  lt is <em>false<
26c0: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e  /em>)</dd>..<dt>
26d0: 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73  -<strong>tls1</s
26e0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
26f0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45  /em></dt>..<dd>E
2700: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53  nable use of TLS
2710: 20 76 31 2e 20 28 64 65 66 61 75 6c 74 20 69 73   v1. (default is
2720: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c   <em>true</em>)<
2730: 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c 73 74 72 6f  /dd>..<dt>-<stro
2740: 6e 67 3e 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e  ng>tls1.1</stron
2750: 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e  g> <em>bool</em>
2760: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c  </dt>..<dd>Enabl
2770: 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e  e use of TLS v1.
2780: 31 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65  1 (default is <e
2790: 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64  m>true</em>)</dd
27a0: 3e 0a 09 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e  >..<dt>-<strong>
27b0: 74 6c 73 31 2e 32 3c 2f 73 74 72 6f 6e 67 3e 20  tls1.2</strong> 
27c0: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64  <em>bool</em></d
27d0: 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75  t>..<dd>Enable u
27e0: 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 32 20 28  se of TLS v1.2 (
27f0: 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74  default is <em>t
2800: 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09  rue</em>)</dd>..
2810: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73  <dt>-<strong>tls
2820: 31 2e 33 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  1.3</strong> <em
2830: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
2840: 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20  .<dd>Enable use 
2850: 6f 66 20 54 4c 53 20 76 31 2e 33 20 28 64 65 66  of TLS v1.3 (def
2860: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65  ault is <em>true
2870: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74  </em>)</dd>..<dt
2880: 3e 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61  ><strong>-valida
2890: 74 65 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e  tecommand</stron
28a0: 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c  g> <em>callback<
28b0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53  /em></dt>..<dd>S
28c0: 70 65 63 69 66 69 65 73 20 74 68 65 20 63 61 6c  pecifies the cal
28d0: 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f  lback command to
28e0: 20 69 6e 76 6f 6b 65 20 74 6f 20 76 61 6c 69 64   invoke to valid
28f0: 61 74 65 20 70 72 6f 74 6f 63 6f 6c 0a 09 20 20  ate protocol..  
2900: 20 20 63 6f 6e 66 69 67 20 70 61 72 61 6d 65 74    config paramet
2910: 65 72 73 20 64 75 72 69 6e 67 20 74 68 65 20 70  ers during the p
2920: 72 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61 74  rotocol negotiat
2930: 69 6f 6e 20 70 68 61 73 65 2e 20 54 68 69 73 20  ion phase. This 
2940: 63 61 6e 20 62 65 0a 09 20 20 20 20 75 73 65 64  can be..    used
2950: 20 62 79 20 54 43 4c 20 73 63 72 69 70 74 73 20   by TCL scripts 
2960: 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72  to perform their
2970: 20 6f 77 6e 20 63 65 72 74 69 66 69 63 61 74 65   own certificate
2980: 20 76 61 6c 69 64 61 74 69 6f 6e 20 74 6f 0a 09   validation to..
2990: 20 20 20 20 73 75 70 70 6c 65 6d 65 6e 74 20 74      supplement t
29a0: 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64  he default valid
29b0: 61 74 69 6f 6e 20 70 72 6f 76 69 64 65 64 20 62  ation provided b
29c0: 79 20 4f 70 65 6e 53 53 4c 2e 20 54 68 65 20 73  y OpenSSL. The s
29d0: 63 72 69 70 74 20 6d 75 73 74 0a 09 20 20 20 20  cript must..    
29e0: 72 65 74 75 72 6e 20 61 20 62 6f 6f 6c 65 61 6e  return a boolean
29f0: 20 74 72 75 65 20 74 6f 20 63 6f 6e 74 69 6e 75   true to continu
2a00: 65 20 74 68 65 20 6e 65 67 6f 74 69 61 74 69 6f  e the negotiatio
2a10: 6e 2e 20 53 65 65 0a 09 20 20 20 20 3c 61 20 68  n. See..    <a h
2a20: 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f  ref="#CALLBACK O
2a30: 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b  PTIONS">CALLBACK
2a40: 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 20 66 6f 72   OPTIONS</a> for
2a50: 20 6d 6f 72 65 20 69 6e 66 6f 2e 3c 2f 64 64 3e   more info.</dd>
2a60: 0a 20 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74  .    </blockquot
2a70: 65 3e 3c 2f 64 6c 3e 0a 20 20 20 20 3c 64 74 3e  e></dl>.    <dt>
2a80: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 75 6e  <a name="tls::un
2a90: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a  import"><b>tls::
2aa0: 75 6e 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e  unimport </b><i>
2ab0: 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c  channel</i></a><
2ac0: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 50 72 6f  /dt>.    <dd>Pro
2ad0: 76 69 64 65 64 20 66 6f 72 20 73 79 6d 6d 65 74  vided for symmet
2ae0: 72 79 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 74 6c  ry to <strong>tl
2af0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e  s::import</stron
2b00: 67 3e 2c 20 74 68 69 73 0a 09 75 6e 73 74 61 63  g>, this..unstac
2b10: 6b 73 20 74 68 65 20 65 6e 63 72 79 70 74 69 6f  ks the encryptio
2b20: 6e 20 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54  n of a regular T
2b30: 43 4c 20 63 68 61 6e 6e 65 6c 2e 20 41 6e 20 65  CL channel. An e
2b40: 72 72 6f 72 0a 09 69 73 20 74 68 72 6f 77 6e 20  rror..is thrown 
2b50: 69 66 20 54 4c 53 20 69 73 20 6e 6f 74 20 74 68  if TLS is not th
2b60: 65 20 74 6f 70 20 73 74 61 63 6b 65 64 20 63 68  e top stacked ch
2b70: 61 6e 6e 65 6c 20 74 79 70 65 2e 3c 2f 64 64 3e  annel type.</dd>
2b80: 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c  .    <dt> <
2b90: 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20  /dt>.    <dt><a 
2ba0: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 68 61 6e 64 73  name="tls::hands
2bb0: 68 61 6b 65 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c  hake"><strong>tl
2bc0: 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 73 74  s::handshake</st
2bd0: 72 6f 6e 67 3e 0a 09 3c 65 6d 3e 63 68 61 6e 6e  rong>..<em>chann
2be0: 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e  el</em></a></dt>
2bf0: 0a 20 20 20 20 3c 64 64 3e 46 6f 72 63 65 73 20  .    <dd>Forces 
2c00: 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 74 61 6b  handshake to tak
2c10: 65 20 70 6c 61 63 65 2c 20 61 6e 64 20 72 65 74  e place, and ret
2c20: 75 72 6e 73 20 30 20 69 66 0a 09 68 61 6e 64 73  urns 0 if..hands
2c30: 68 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e  hake is still in
2c40: 20 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62   progress (non-b
2c50: 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69  locking), or 1 i
2c60: 66 0a 09 74 68 65 20 68 61 6e 64 73 68 61 6b 65  f..the handshake
2c70: 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2e   was successful.
2c80: 20 49 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b   If the handshak
2c90: 65 20 66 61 69 6c 65 64 0a 09 74 68 69 73 20 72  e failed..this r
2ca0: 6f 75 74 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f  outine will thro
2cb0: 77 20 61 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e  w an error.</dd>
2cc0: 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c  .    <dt> <
2cd0: 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20  /dt>.    <dt><a 
2ce0: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75  name="tls::statu
2cf0: 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  s"><strong>tls::
2d00: 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a  status</strong>.
2d10: 09 3c 65 6d 3e 3f 3c 2f 65 6d 3e 3c 62 3e 2d 6c  .<em>?</em><b>-l
2d20: 6f 63 61 6c 3c 2f 62 3e 3c 65 6d 3e 3f 20 63 68  ocal</b><em>? ch
2d30: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f  annel</em></a></
2d40: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75  dt>.    <dd>Retu
2d50: 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 20  rns the current 
2d60: 73 74 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c  status of an SSL
2d70: 20 63 68 61 6e 6e 65 6c 2e 20 54 68 65 20 72 65   channel. The re
2d80: 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 0a 09  sult is a list..
2d90: 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69  of key-value pai
2da0: 72 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 68  rs describing th
2db0: 65 20 53 53 4c 2c 20 63 65 72 74 69 66 69 63 61  e SSL, certifica
2dc0: 74 65 2c 20 61 6e 64 20 63 65 72 74 69 66 69 63  te, and certific
2dd0: 61 74 65 0a 09 76 65 72 69 66 69 63 61 74 69 6f  ate..verificatio
2de0: 6e 20 73 74 61 74 75 73 2e 20 49 66 20 74 68 65  n status. If the
2df0: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68   SSL handshake h
2e00: 61 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c  as not yet compl
2e10: 65 74 65 64 2c 0a 09 61 6e 20 65 6d 70 74 79 20  eted,..an empty 
2e20: 6c 69 73 74 20 69 73 20 72 65 74 75 72 6e 65 64  list is returned
2e30: 2e 20 49 66 20 3c 62 3e 2d 6c 6f 63 61 6c 3c 2f  . If <b>-local</
2e40: 62 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 2c  b> is specified,
2e50: 20 74 68 65 6e 20 74 68 65 0a 09 6c 6f 63 61 6c   then the..local
2e60: 20 63 65 72 74 69 66 69 63 61 74 65 20 69 73 20   certificate is 
2e70: 75 73 65 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c  used.</dd>.    <
2e80: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20  blockquote>.    
2e90: 3c 62 3e 53 53 4c 20 53 74 61 74 75 73 3c 2f 62  <b>SSL Status</b
2ea0: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e  >.    <dl>..<dt>
2eb0: 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74  <strong>alpn</st
2ec0: 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63  rong> <em>protoc
2ed0: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ol</em></dt>..<d
2ee0: 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73  d>The protocol s
2ef0: 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 70  elected after Ap
2f00: 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20  plication-Layer 
2f10: 50 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65  Protocol..    Ne
2f20: 67 6f 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29  gotiation (ALPN)
2f30: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
2f40: 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f  ong>cipher</stro
2f50: 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f  ng> <em>cipher</
2f60: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68  em></dt>..<dd>Th
2f70: 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 72  e current cipher
2f80: 20 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20   in use for the 
2f90: 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c  session.</dd>..<
2fa0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 70 65 65 72 6e  dt><strong>peern
2fb0: 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ame</strong> <em
2fc0: 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >name</em></dt>.
2fd0: 09 3c 64 64 3e 54 68 65 20 70 65 65 72 6e 61 6d  .<dd>The peernam
2fe0: 65 20 66 72 6f 6d 20 74 68 65 20 63 65 72 74 69  e from the certi
2ff0: 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64  ficate.</dd>..<d
3000: 74 3e 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63  t><strong>protoc
3010: 6f 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ol</strong> <em>
3020: 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74  version</em></dt
3030: 3e 0a 09 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f  >..<dd>The proto
3040: 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65 64  col version used
3050: 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63 74   for the connect
3060: 69 6f 6e 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20  ion:..    SSL2, 
3070: 53 53 4c 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31  SSL3, TLS1, TLS1
3080: 2e 31 2c 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31  .1, TLS1.2, TLS1
3090: 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c  .3, or unknown.<
30a0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
30b0: 67 3e 73 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e  g>sbits</strong>
30c0: 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e   <em>n</em></dt>
30d0: 0a 09 3c 64 64 3e 54 68 65 20 6e 75 6d 62 65 72  ..<dd>The number
30e0: 20 6f 66 20 62 69 74 73 20 75 73 65 64 20 66 6f   of bits used fo
30f0: 72 20 74 68 65 20 73 65 73 73 69 6f 6e 20 6b 65  r the session ke
3100: 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  y.</dd>..<dt><st
3110: 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 48 61  rong>signatureHa
3120: 73 68 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72  shAlgorithm</str
3130: 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74  ong> <em>algorit
3140: 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  hm</em></dt>..<d
3150: 64 3e 54 68 65 20 73 69 67 6e 61 74 75 72 65 20  d>The signature 
3160: 68 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 2e 3c  hash algorithm.<
3170: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3180: 67 3e 73 69 67 6e 61 74 75 72 65 54 79 70 65 3c  g>signatureType<
3190: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 74 79 70  /strong> <em>typ
31a0: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  e</em></dt>..<dd
31b0: 3e 54 68 65 20 73 69 67 6e 61 74 75 72 65 20 74  >The signature t
31c0: 79 70 65 20 76 61 6c 75 65 2e 3c 2f 64 64 3e 0a  ype value.</dd>.
31d0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72  .<dt><strong>ver
31e0: 69 66 79 44 65 70 74 68 3c 2f 73 74 72 6f 6e 67  ifyDepth</strong
31f0: 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74  > <em>n</em></dt
3200: 3e 0a 09 3c 64 64 3e 4d 61 78 69 6d 75 6d 20 64  >..<dd>Maximum d
3210: 65 70 74 68 20 66 6f 72 20 74 68 65 20 63 65 72  epth for the cer
3220: 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 20 76  tificate chain v
3230: 65 72 69 66 69 63 61 74 69 6f 6e 2e 0a 09 20 20  erification...  
3240: 20 20 44 65 66 61 75 6c 74 20 69 73 20 2d 31 2c    Default is -1,
3250: 20 74 6f 20 63 68 65 63 6b 20 61 6c 6c 2e 3c 2f   to check all.</
3260: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
3270: 3e 76 65 72 69 66 79 4d 6f 64 65 3c 2f 73 74 72  >verifyMode</str
3280: 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65  ong> <em>list</e
3290: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73  m></dt>..<dd>Lis
32a0: 74 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 65  t of certificate
32b0: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 6d 6f   verification mo
32c0: 64 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  des.</dd>..<dt><
32d0: 73 74 72 6f 6e 67 3e 76 65 72 69 66 79 52 65 73  strong>verifyRes
32e0: 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ult</strong> <em
32f0: 3e 72 65 73 75 6c 74 3c 2f 65 6d 3e 3c 2f 64 74  >result</em></dt
3300: 3e 0a 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61  >..<dd>Certifica
3310: 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20  te verification 
3320: 72 65 73 75 6c 74 2e 3c 2f 64 64 3e 0a 09 3c 64  result.</dd>..<d
3330: 74 3e 3c 73 74 72 6f 6e 67 3e 63 61 5f 6e 61 6d  t><strong>ca_nam
3340: 65 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  es</strong> <em>
3350: 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  list</em></dt>..
3360: 3c 64 64 3e 4c 69 73 74 20 6f 66 20 74 68 65 20  <dd>List of the 
3370: 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68  Certificate Auth
3380: 6f 72 69 74 69 65 73 20 75 73 65 64 20 74 6f 20  orities used to 
3390: 63 72 65 61 74 65 20 74 68 65 20 63 65 72 74 69  create the certi
33a0: 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20  ficate.</dd>.   
33b0: 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 62 3e 43 65   </dl>.    <b>Ce
33c0: 72 74 69 66 69 63 61 74 65 20 53 74 61 74 75 73  rtificate Status
33d0: 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c  </b>.    <dl>..<
33e0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 6c 6c 3c 2f  dt><strong>all</
33f0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69  strong> <em>stri
3400: 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ng</em></dt>..<d
3410: 64 3e 44 75 6d 70 20 6f 66 20 61 6c 6c 20 63 65  d>Dump of all ce
3420: 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f 2e 3c  rtificate info.<
3430: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3440: 67 3e 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e  g>version</stron
3450: 67 3e 20 3c 65 6d 3e 76 61 6c 75 65 3c 2f 65 6d  g> <em>value</em
3460: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
3470: 63 65 72 74 69 66 69 63 61 74 65 20 76 65 72 73  certificate vers
3480: 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  ion.</dd>..<dt><
3490: 73 74 72 6f 6e 67 3e 73 65 72 69 61 6c 4e 75 6d  strong>serialNum
34a0: 62 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ber</strong> <em
34b0: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  >n</em></dt>..<d
34c0: 64 3e 54 68 65 20 73 65 72 69 61 6c 20 6e 75 6d  d>The serial num
34d0: 62 65 72 20 6f 66 20 74 68 65 20 63 65 72 74 69  ber of the certi
34e0: 66 69 63 61 74 65 20 61 73 20 61 20 68 65 78 20  ficate as a hex 
34f0: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64  string.</dd>..<d
3500: 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74  t><strong>signat
3510: 75 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ure</strong> <em
3520: 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e 3c  >algorithm</em><
3530: 2f 64 74 3e 0a 09 3c 64 64 3e 43 69 70 68 65 72  /dt>..<dd>Cipher
3540: 20 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20   algorithm used 
3550: 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20  for certificate 
3560: 73 69 67 6e 61 74 75 72 65 2e 3c 2f 64 64 3e 0a  signature.</dd>.
3570: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73  .<dt><strong>iss
3580: 75 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  uer</strong> <em
3590: 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  >dn</em></dt>..<
35a0: 64 64 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69  dd>The distingui
35b0: 73 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f  shed name (DN) o
35c0: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
35d0: 65 20 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 09  e issuer.</dd>..
35e0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 42  <dt><strong>notB
35f0: 65 66 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  efore</strong> <
3600: 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74  em>date</em></dt
3610: 3e 0a 09 3c 64 64 3e 54 68 65 20 62 65 67 69 6e  >..<dd>The begin
3620: 6e 69 6e 67 20 64 61 74 65 20 6f 66 20 74 68 65  ning date of the
3630: 20 63 65 72 74 69 66 69 63 61 74 65 20 76 61 6c   certificate val
3640: 69 64 69 74 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74  idity.</dd>..<dt
3650: 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 41 66 74 65  ><strong>notAfte
3660: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64  r</strong> <em>d
3670: 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ate</em></dt>..<
3680: 64 64 3e 54 68 65 20 65 78 70 69 72 61 74 69 6f  dd>The expiratio
3690: 6e 20 64 61 74 65 20 6f 66 20 74 68 65 20 63 65  n date of the ce
36a0: 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 69  rtificate validi
36b0: 74 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  ty.</dd>..<dt><s
36c0: 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73  trong>subject</s
36d0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65  trong> <em>dn</e
36e0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65  m></dt>..<dd>The
36f0: 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e   distinguished n
3700: 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20  ame (DN) of the 
3710: 63 65 72 74 69 66 69 63 61 74 65 20 73 75 62 6a  certificate subj
3720: 65 63 74 2e 0a 09 20 20 20 20 46 69 65 6c 64 73  ect...    Fields
3730: 20 69 6e 63 6c 75 64 65 3a 20 43 6f 6d 6d 6f 6e   include: Common
3740: 20 4e 61 6d 65 20 28 43 4e 29 2c 20 4f 72 67 61   Name (CN), Orga
3750: 6e 69 7a 61 74 69 6f 6e 20 28 4f 29 2c 20 4c 6f  nization (O), Lo
3760: 63 61 6c 69 74 79 0a 09 20 20 20 20 6f 72 20 43  cality..    or C
3770: 69 74 79 20 28 4c 29 2c 20 53 74 61 74 65 20 6f  ity (L), State o
3780: 72 20 50 72 6f 76 69 6e 63 65 20 28 53 29 2c 20  r Province (S), 
3790: 61 6e 64 20 43 6f 75 6e 74 72 79 20 4e 61 6d 65  and Country Name
37a0: 20 28 43 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e   (C).</dd>..<dt>
37b0: 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 55 6e  <strong>issuerUn
37c0: 69 71 75 65 49 44 3c 2f 73 74 72 6f 6e 67 3e 20  iqueID</strong> 
37d0: 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c  <em>string</em><
37e0: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 69 73  /dt>..<dd>The is
37f0: 73 75 65 72 20 75 6e 69 71 75 65 20 69 64 2e 3c  suer unique id.<
3800: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3810: 67 3e 73 75 62 6a 65 63 74 55 6e 69 71 75 65 49  g>subjectUniqueI
3820: 44 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73  D</strong> <em>s
3830: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  tring</em></dt>.
3840: 09 3c 64 64 3e 54 68 65 20 73 75 62 6a 65 63 74  .<dd>The subject
3850: 20 75 6e 69 71 75 65 20 69 64 2e 3c 2f 64 64 3e   unique id.</dd>
3860: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 75  ..<dt><strong>nu
3870: 6d 5f 65 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 74  m_extensions</st
3880: 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e  rong> <em>n</em>
3890: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4e 75 6d 62 65  </dt>..<dd>Numbe
38a0: 72 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 65  r of certificate
38b0: 20 65 78 74 65 6e 73 69 6f 6e 73 2e 3c 2f 64 64   extensions.</dd
38c0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 65  >..<dt><strong>e
38d0: 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 74 72 6f 6e  xtensions</stron
38e0: 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e  g> <em>list</em>
38f0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20  </dt>..<dd>List 
3900: 6f 66 20 63 65 72 74 69 66 69 63 61 74 65 20 65  of certificate e
3910: 78 74 65 6e 73 69 6f 6e 20 6e 61 6d 65 73 2e 3c  xtension names.<
3920: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3930: 67 3e 61 75 74 68 6f 72 69 74 79 4b 65 79 49 64  g>authorityKeyId
3940: 65 6e 74 69 66 69 65 72 3c 2f 73 74 72 6f 6e 67  entifier</strong
3950: 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d  > <em>string</em
3960: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 28 41 4b 49  ></dt>..<dd>(AKI
3970: 29 20 4b 65 79 20 69 64 65 6e 74 69 66 69 65 72  ) Key identifier
3980: 20 6f 66 20 74 68 65 20 49 73 73 75 69 6e 67 20   of the Issuing 
3990: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 20 74  CA certificate t
39a0: 68 61 74 20 73 69 67 6e 65 64 0a 09 20 20 20 20  hat signed..    
39b0: 74 68 65 20 53 53 4c 20 63 65 72 74 69 66 69 63  the SSL certific
39c0: 61 74 65 20 61 73 20 61 20 68 65 78 20 73 74 72  ate as a hex str
39d0: 69 6e 67 2e 20 54 68 69 73 20 76 61 6c 75 65 20  ing. This value 
39e0: 6d 61 74 63 68 65 73 20 74 68 65 20 53 4b 49 0a  matches the SKI.
39f0: 09 20 20 20 20 76 61 6c 75 65 20 6f 66 20 74 68  .    value of th
3a00: 65 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20 43  e Intermediate C
3a10: 41 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f  A certificate.</
3a20: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
3a30: 3e 73 75 62 6a 65 63 74 4b 65 79 49 64 65 6e 74  >subjectKeyIdent
3a40: 69 66 69 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  ifier</strong> <
3a50: 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f  em>string</em></
3a60: 64 74 3e 0a 09 3c 64 64 3e 28 53 4b 49 29 20 48  dt>..<dd>(SKI) H
3a70: 61 73 68 20 6f 66 20 74 68 65 20 70 75 62 6c 69  ash of the publi
3a80: 63 20 6b 65 79 20 69 6e 73 69 64 65 20 74 68 65  c key inside the
3a90: 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20   certificate as 
3aa0: 61 20 68 65 78 0a 09 20 20 20 20 73 74 72 69 6e  a hex..    strin
3ab0: 67 2e 20 55 73 65 64 20 74 6f 20 69 64 65 6e 74  g. Used to ident
3ac0: 69 66 79 20 63 65 72 74 69 66 69 63 61 74 65 73  ify certificates
3ad0: 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 20 61 20   that contain a 
3ae0: 70 61 72 74 69 63 75 6c 61 72 0a 09 20 20 20 20  particular..    
3af0: 70 75 62 6c 69 63 20 6b 65 79 2e 3c 2f 64 64 3e  public key.</dd>
3b00: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75  ..<dt><strong>su
3b10: 62 6a 65 63 74 41 6c 74 4e 61 6d 65 3c 2f 73 74  bjectAltName</st
3b20: 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f  rong> <em>list</
3b30: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69  em></dt>..<dd>Li
3b40: 73 74 20 6f 66 20 61 6c 6c 20 6f 66 20 74 68 65  st of all of the
3b50: 20 61 6c 74 65 72 6e 61 74 69 76 65 20 64 6f 6d   alternative dom
3b60: 61 69 6e 20 6e 61 6d 65 73 2c 20 73 75 62 20 64  ain names, sub d
3b70: 6f 6d 61 69 6e 73 2c 0a 09 20 20 20 20 61 6e 64  omains,..    and
3b80: 20 49 50 20 61 64 64 72 65 73 73 65 73 20 74 68   IP addresses th
3b90: 61 74 20 61 72 65 20 73 65 63 75 72 65 64 20 62  at are secured b
3ba0: 79 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  y the certificat
3bb0: 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  e.</dd>..<dt><st
3bc0: 72 6f 6e 67 3e 6f 63 73 70 3c 2f 73 74 72 6f 6e  rong>ocsp</stron
3bd0: 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e  g> <em>list</em>
3be0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20  </dt>..<dd>List 
3bf0: 6f 66 20 61 6c 6c 20 4f 6e 6c 69 6e 65 20 43 65  of all Online Ce
3c00: 72 74 69 66 69 63 61 74 65 20 53 74 61 74 75 73  rtificate Status
3c10: 20 50 72 6f 74 6f 63 6f 6c 20 28 4f 43 53 50 29   Protocol (OCSP)
3c20: 20 55 52 4c 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74   URLs.</dd>..<dt
3c30: 3e 3c 73 74 72 6f 6e 67 3e 63 65 72 74 69 66 69  ><strong>certifi
3c40: 63 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  cate</strong> <e
3c50: 6d 3e 63 65 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e  m>cert</em></dt>
3c60: 0a 09 3c 64 64 3e 54 68 65 20 50 45 4d 20 65 6e  ..<dd>The PEM en
3c70: 63 6f 64 65 64 20 63 65 72 74 69 66 69 63 61 74  coded certificat
3c80: 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  e.</dd>..<dt><st
3c90: 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 41 6c  rong>signatureAl
3ca0: 67 6f 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e  gorithm</strong>
3cb0: 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f   <em>algorithm</
3cc0: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 69  em></dt>..<dd>Ci
3cd0: 70 68 65 72 20 61 6c 67 6f 72 69 74 68 6d 20 75  pher algorithm u
3ce0: 73 65 64 20 66 6f 72 20 74 68 65 20 63 65 72 74  sed for the cert
3cf0: 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72  ificate signatur
3d00: 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  e.</dd>..<dt><st
3d10: 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 56 61  rong>signatureVa
3d20: 6c 75 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  lue</strong> <em
3d30: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  >string</em></dt
3d40: 3e 0a 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61  >..<dd>Certifica
3d50: 74 65 20 73 69 67 6e 61 74 75 72 65 20 61 73 20  te signature as 
3d60: 61 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64  a hex string.</d
3d70: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
3d80: 73 69 67 6e 61 74 75 72 65 44 69 67 65 73 74 3c  signatureDigest<
3d90: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72  /strong> <em>ver
3da0: 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  sion</em></dt>..
3db0: 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 20  <dd>Certificate 
3dc0: 73 69 67 6e 69 6e 67 20 64 69 67 65 73 74 20 61  signing digest a
3dd0: 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 2e 3c  s a hex string.<
3de0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3df0: 67 3e 70 75 62 6c 69 63 4b 65 79 41 6c 67 6f 72  g>publicKeyAlgor
3e00: 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  ithm</strong> <e
3e10: 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e  m>algorithm</em>
3e20: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 65 72 74 69  </dt>..<dd>Certi
3e30: 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65  ficate signature
3e40: 20 70 75 62 6c 69 63 20 6b 65 79 20 61 6c 67 6f   public key algo
3e50: 72 69 74 68 6d 2e 3c 2f 64 64 3e 0a 09 3c 64 74  rithm.</dd>..<dt
3e60: 3e 3c 73 74 72 6f 6e 67 3e 70 75 62 6c 69 63 4b  ><strong>publicK
3e70: 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ey</strong> <em>
3e80: 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e  string</em></dt>
3e90: 0a 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74  ..<dd>Certificat
3ea0: 65 20 73 69 67 6e 61 74 75 72 65 20 70 75 62 6c  e signature publ
3eb0: 69 63 20 6b 65 79 20 61 73 20 61 20 68 65 78 20  ic key as a hex 
3ec0: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64  string.</dd>..<d
3ed0: 74 3e 3c 73 74 72 6f 6e 67 3e 62 69 74 73 3c 2f  t><strong>bits</
3ee0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65  strong> <em>n</e
3ef0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4e 75 6d  m></dt>..<dd>Num
3f00: 62 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 64  ber of bits used
3f10: 20 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 65   for certificate
3f20: 20 73 69 67 6e 61 74 75 72 65 20 6b 65 79 2e 3c   signature key.<
3f30: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3f40: 67 3e 73 65 6c 66 5f 73 69 67 6e 65 64 3c 2f 73  g>self_signed</s
3f50: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65  trong> <em>boole
3f60: 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  an</em></dt>..<d
3f70: 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 63 65  d>Whether the ce
3f80: 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74  rtificate signat
3f90: 75 72 65 20 69 73 20 73 65 6c 66 20 73 69 67 6e  ure is self sign
3fa0: 65 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  ed.</dd>..<dt><s
3fb0: 74 72 6f 6e 67 3e 73 68 61 31 5f 68 61 73 68 3c  trong>sha1_hash<
3fc0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61 73  /strong> <em>has
3fd0: 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  h</em></dt>..<dd
3fe0: 3e 54 68 65 20 53 48 41 31 20 68 61 73 68 20 6f  >The SHA1 hash o
3ff0: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
4000: 65 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e  e as a hex strin
4010: 67 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  g.</dd>..<dt><st
4020: 72 6f 6e 67 3e 73 68 61 32 35 36 5f 68 61 73 68  rong>sha256_hash
4030: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61  </strong> <em>ha
4040: 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  sh</em></dt>..<d
4050: 64 3e 54 68 65 20 53 48 41 32 35 36 20 68 61 73  d>The SHA256 has
4060: 68 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69  h of the certifi
4070: 63 61 74 65 20 61 73 20 61 20 68 65 78 20 73 74  cate as a hex st
4080: 72 69 6e 67 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c  ring.</dd>.    <
4090: 2f 64 6c 3e 0a 20 20 20 20 3c 2f 62 6c 6f 63 6b  /dl>.    </block
40a0: 71 75 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74 3e  quote>..    <dt>
40b0: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 6f  <a name="tls::co
40c0: 6e 6e 65 63 74 69 6f 6e 22 3e 3c 73 74 72 6f 6e  nnection"><stron
40d0: 67 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f  g>tls::connectio
40e0: 6e 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c  n</strong>.    <
40f0: 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c  em>channel</em><
4100: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
4110: 3e 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 72  >Returns the cur
4120: 72 65 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20  rent connection 
4130: 73 74 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c  status of an SSL
4140: 20 63 68 61 6e 6e 65 6c 2e 20 54 68 65 0a 09 72   channel. The..r
4150: 65 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20  esult is a list 
4160: 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69  of key-value pai
4170: 72 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 68  rs describing th
4180: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64  e connection.</d
4190: 64 3e 0a 20 20 20 20 3c 62 6c 6f 63 6b 71 75 6f  d>.    <blockquo
41a0: 74 65 3e 0a 20 20 20 20 3c 62 3e 53 53 4c 20 53  te>.    <b>SSL S
41b0: 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20 3c 64  tatus</b>.    <d
41c0: 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  l>..<dt><strong>
41d0: 73 74 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  state</strong> <
41e0: 65 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f 64  em>state</em></d
41f0: 74 3e 0a 09 3c 64 64 3e 53 74 61 74 65 20 6f 66  t>..<dd>State of
4200: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e   the connection.
4210: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
4220: 6e 67 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73  ng>servername</s
4230: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c  trong> <em>name<
4240: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54  /em></dt>..<dd>T
4250: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 63  he name of the c
4260: 6f 6e 6e 65 63 74 65 64 20 74 6f 20 73 65 72 76  onnected to serv
4270: 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  er.</dd>..<dt><s
4280: 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c 2f  trong>protocol</
4290: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73  strong> <em>vers
42a0: 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ion</em></dt>..<
42b0: 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20  dd>The protocol 
42c0: 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72  version used for
42d0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a   the connection:
42e0: 0a 09 20 20 20 20 53 53 4c 32 2c 20 53 53 4c 33  ..    SSL2, SSL3
42f0: 2c 20 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c 20  , TLS1, TLS1.1, 
4300: 54 4c 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c 20  TLS1.2, TLS1.3, 
4310: 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64 3e  or unknown.</dd>
4320: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 72 65  ..<dt><strong>re
4330: 6e 65 67 6f 74 69 61 74 69 6f 6e 5f 61 6c 6c 6f  negotiation_allo
4340: 77 65 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  wed</strong> <em
4350: 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64  >boolean</em></d
4360: 74 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72 20  t>..<dd>Whether 
4370: 70 72 6f 74 6f 63 6f 6c 20 72 65 6e 65 67 6f 74  protocol renegot
4380: 69 61 74 69 6f 6e 20 69 73 20 73 75 70 70 6f 72  iation is suppor
4390: 74 65 64 20 6f 72 20 6e 6f 74 2e 3c 2f 64 64 3e  ted or not.</dd>
43a0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65  ..<dt><strong>se
43b0: 63 75 72 69 74 79 5f 6c 65 76 65 6c 3c 2f 73 74  curity_level</st
43c0: 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 65 76 65 6c 3c  rong> <em>level<
43d0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54  /em></dt>..<dd>T
43e0: 68 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65  he security leve
43f0: 6c 20 75 73 65 64 20 66 6f 72 20 73 65 6c 65 63  l used for selec
4400: 74 69 6f 6e 20 6f 66 20 63 69 70 68 65 72 73 2c  tion of ciphers,
4410: 20 6b 65 79 20 73 69 7a 65 2c 20 65 74 63 2e 3c   key size, etc.<
4420: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
4430: 67 3e 73 65 73 73 69 6f 6e 5f 72 65 75 73 65 64  g>session_reused
4440: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
4450: 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  olean</em></dt>.
4460: 09 3c 64 64 3e 57 68 65 74 68 65 72 20 74 68 65  .<dd>Whether the
4470: 20 73 65 73 73 69 6f 6e 20 68 61 73 20 62 65 65   session has bee
4480: 6e 20 72 65 75 73 65 64 20 6f 72 20 6e 6f 74 2e  n reused or not.
4490: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
44a0: 6e 67 3e 69 73 5f 73 65 72 76 65 72 3c 2f 73 74  ng>is_server</st
44b0: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61  rong> <em>boolea
44c0: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  n</em></dt>..<dd
44d0: 3e 57 68 65 74 68 65 72 20 74 68 65 20 63 6f 6e  >Whether the con
44e0: 6e 65 63 74 69 6f 6e 20 69 73 20 63 6f 6e 66 69  nection is confi
44f0: 67 75 72 65 64 20 61 73 20 61 20 73 65 72 76 65  gured as a serve
4500: 72 20 28 31 29 20 6f 72 20 63 6c 69 65 6e 74 20  r (1) or client 
4510: 28 30 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  (0).</dd>..<dt><
4520: 73 74 72 6f 6e 67 3e 63 6f 6d 70 72 65 73 73 69  strong>compressi
4530: 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  on</strong> <em>
4540: 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  mode</em></dt>..
4550: 3c 64 64 3e 43 6f 6d 70 72 65 73 73 69 6f 6e 20  <dd>Compression 
4560: 6d 65 74 68 6f 64 2e 3c 2f 64 64 3e 0a 09 3c 64  method.</dd>..<d
4570: 74 3e 3c 73 74 72 6f 6e 67 3e 65 78 70 61 6e 73  t><strong>expans
4580: 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ion</strong> <em
4590: 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >mode</em></dt>.
45a0: 09 3c 64 64 3e 45 78 70 61 6e 73 69 6f 6e 20 6d  .<dd>Expansion m
45b0: 65 74 68 6f 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74  ethod.</dd>..<dt
45c0: 3e 3c 73 74 72 6f 6e 67 3e 63 61 4c 69 73 74 3c  ><strong>caList<
45d0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73  /strong> <em>lis
45e0: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  t</em></dt>..<dd
45f0: 3e 4c 69 73 74 20 6f 66 20 43 65 72 74 69 66 69  >List of Certifi
4600: 63 61 74 65 20 41 75 74 68 6f 72 69 74 69 65 73  cate Authorities
4610: 20 28 43 41 29 20 66 6f 72 20 58 2e 35 30 39 20   (CA) for X.509 
4620: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64  certificate.</dd
4630: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20  >.    </dl>.    
4640: 3c 62 3e 43 69 70 68 65 72 20 49 6e 66 6f 3c 2f  <b>Cipher Info</
4650: 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74  b>.    <dl>..<dt
4660: 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c  ><strong>cipher<
4670: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70  /strong> <em>cip
4680: 68 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  her</em></dt>..<
4690: 64 64 3e 54 68 65 20 63 75 72 72 65 6e 74 20 63  dd>The current c
46a0: 69 70 68 65 72 20 69 6e 20 75 73 65 20 66 6f 72  ipher in use for
46b0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e   the connection.
46c0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
46d0: 6e 67 3e 73 74 61 6e 64 61 72 64 5f 6e 61 6d 65  ng>standard_name
46e0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61  </strong> <em>na
46f0: 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  me</em></dt>..<d
4700: 64 3e 54 68 65 20 73 74 61 6e 64 61 72 64 20 52  d>The standard R
4710: 46 43 20 6e 61 6d 65 20 6f 66 20 63 69 70 68 65  FC name of ciphe
4720: 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  r.</dd>..<dt><st
4730: 72 6f 6e 67 3e 61 6c 67 6f 72 69 74 68 6d 5f 62  rong>algorithm_b
4740: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  its</strong> <em
4750: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  >n</em></dt>..<d
4760: 64 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20  d>The number of 
4770: 70 72 6f 63 65 73 73 65 64 20 62 69 74 73 20 75  processed bits u
4780: 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c  sed for cipher.<
4790: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
47a0: 67 3e 73 65 63 72 65 74 5f 62 69 74 73 3c 2f 73  g>secret_bits</s
47b0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d  trong> <em>n</em
47c0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
47d0: 6e 75 6d 62 65 72 20 6f 66 20 73 65 63 72 65 74  number of secret
47e0: 20 62 69 74 73 20 75 73 65 64 20 66 6f 72 20 63   bits used for c
47f0: 69 70 68 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74  ipher.</dd>..<dt
4800: 3e 3c 73 74 72 6f 6e 67 3e 6d 69 6e 5f 76 65 72  ><strong>min_ver
4810: 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  sion</strong> <e
4820: 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f  m>version</em></
4830: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 6d 69 6e  dt>..<dd>The min
4840: 69 6d 75 6d 20 70 72 6f 74 6f 63 6f 6c 20 76 65  imum protocol ve
4850: 72 73 69 6f 6e 20 66 6f 72 20 63 69 70 68 65 72  rsion for cipher
4860: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4870: 6f 6e 67 3e 63 69 70 68 65 72 5f 69 73 5f 61 65  ong>cipher_is_ae
4880: 61 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ad</strong> <em>
4890: 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74  boolean</em></dt
48a0: 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72 20 74  >..<dd>Whether t
48b0: 68 65 20 63 69 70 68 65 72 20 69 73 20 41 75 74  he cipher is Aut
48c0: 68 65 6e 74 69 63 61 74 65 64 20 45 6e 63 72 79  henticated Encry
48d0: 70 74 69 6f 6e 20 77 69 74 68 0a 09 20 20 20 20  ption with..    
48e0: 41 73 73 6f 63 69 61 74 65 64 20 44 61 74 61 20  Associated Data 
48f0: 28 41 45 41 44 29 2e 3c 2f 64 64 3e 0a 09 3c 64  (AEAD).</dd>..<d
4900: 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72  t><strong>cipher
4910: 5f 69 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  _id</strong> <em
4920: 3e 69 64 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  >id</em></dt>..<
4930: 64 64 3e 54 68 65 20 4f 70 65 6e 53 53 4c 20 63  dd>The OpenSSL c
4940: 69 70 68 65 72 20 69 64 2e 3c 2f 64 64 3e 0a 09  ipher id.</dd>..
4950: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 64 65 73 63  <dt><strong>desc
4960: 72 69 70 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e  ription</strong>
4970: 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e   <em>string</em>
4980: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 41 20 74 65 78  </dt>..<dd>A tex
4990: 74 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 66  t description of
49a0: 20 74 68 65 20 63 69 70 68 65 72 2e 3c 2f 64 64   the cipher.</dd
49b0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 68  >..<dt><strong>h
49c0: 61 6e 64 73 68 61 6b 65 5f 64 69 67 65 73 74 3c  andshake_digest<
49d0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f  /strong> <em>boo
49e0: 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  lean</em></dt>..
49f0: 3c 64 64 3e 44 69 67 65 73 74 20 75 73 65 64 20  <dd>Digest used 
4a00: 64 75 72 69 6e 67 20 68 61 6e 64 73 68 61 6b 65  during handshake
4a10: 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e  .</dd>.    </dl>
4a20: 0a 20 20 20 20 3c 62 3e 53 65 73 73 69 6f 6e 20  .    <b>Session 
4a30: 49 6e 66 6f 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c  Info</b>.    <dl
4a40: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61  >..<dt><strong>a
4a50: 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  lpn</strong> <em
4a60: 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c 2f  >protocol</em></
4a70: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 70 72 6f  dt>..<dd>The pro
4a80: 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64 20 61  tocol selected a
4a90: 66 74 65 72 20 41 70 70 6c 69 63 61 74 69 6f 6e  fter Application
4aa0: 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c 0a  -Layer Protocol.
4ab0: 09 20 20 20 20 4e 65 67 6f 74 69 61 74 69 6f 6e  .    Negotiation
4ac0: 20 28 41 4c 50 4e 29 2e 3c 2f 64 64 3e 0a 09 3c   (ALPN).</dd>..<
4ad0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 72 65 73 75 6d  dt><strong>resum
4ae0: 61 62 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  able</strong> <e
4af0: 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f  m>boolean</em></
4b00: 64 74 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72  dt>..<dd>Whether
4b10: 20 74 68 65 20 73 65 73 73 69 6f 6e 20 63 61 6e   the session can
4b20: 20 62 65 20 72 65 73 75 6d 65 64 20 6f 72 20 6e   be resumed or n
4b30: 6f 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  ot.</dd>..<dt><s
4b40: 74 72 6f 6e 67 3e 73 74 61 72 74 5f 74 69 6d 65  trong>start_time
4b50: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65  </strong> <em>se
4b60: 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  conds</em></dt>.
4b70: 09 3c 64 64 3e 54 69 6d 65 20 73 69 6e 63 65 20  .<dd>Time since 
4b80: 73 65 73 73 69 6f 6e 20 73 74 61 72 74 65 64 20  session started 
4b90: 69 6e 20 73 65 63 6f 6e 64 73 20 73 69 6e 63 65  in seconds since
4ba0: 20 65 70 6f 63 68 2e 3c 2f 64 64 3e 0a 09 3c 64   epoch.</dd>..<d
4bb0: 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 6d 65 6f 75  t><strong>timeou
4bc0: 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73  t</strong> <em>s
4bd0: 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e  econds</em></dt>
4be0: 0a 09 3c 64 64 3e 4d 61 78 20 64 75 72 61 74 69  ..<dd>Max durati
4bf0: 6f 6e 20 6f 66 20 73 65 73 73 69 6f 6e 20 69 6e  on of session in
4c00: 20 73 65 63 6f 6e 64 73 20 62 65 66 6f 72 65 20   seconds before 
4c10: 74 69 6d 65 2d 6f 75 74 2e 3c 2f 64 64 3e 0a 09  time-out.</dd>..
4c20: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6c 69 66 65  <dt><strong>life
4c30: 74 69 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  time</strong> <e
4c40: 6d 3e 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f  m>seconds</em></
4c50: 64 74 3e 0a 09 3c 64 64 3e 53 65 73 73 69 6f 6e  dt>..<dd>Session
4c60: 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65   ticket lifetime
4c70: 20 68 69 6e 74 20 69 6e 20 73 65 63 6f 6e 64 73   hint in seconds
4c80: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4c90: 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f 69 64 3c 2f  ong>session_id</
4ca0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61  strong> <em>bina
4cb0: 72 79 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f  ry_string</em></
4cc0: 64 74 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20  dt>..<dd>Unique 
4cd0: 73 65 73 73 69 6f 6e 20 69 64 20 66 6f 72 20 75  session id for u
4ce0: 73 65 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74  se in resuming t
4cf0: 68 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e  he session.</dd>
4d00: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65  ..<dt><strong>se
4d10: 73 73 69 6f 6e 5f 74 69 63 6b 65 74 3c 2f 73 74  ssion_ticket</st
4d20: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79  rong> <em>binary
4d30: 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  _string</em></dt
4d40: 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65  >..<dd>Unique se
4d50: 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 66 6f 72  ssion ticket for
4d60: 20 75 73 65 20 69 6e 20 72 65 73 75 6d 69 6e 67   use in resuming
4d70: 20 74 68 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64   the session.</d
4d80: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
4d90: 74 69 63 6b 65 74 5f 61 70 70 5f 64 61 74 61 3c  ticket_app_data<
4da0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e  /strong> <em>bin
4db0: 61 72 79 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c  ary_string</em><
4dc0: 2f 64 74 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65  /dt>..<dd>Unique
4dd0: 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20   session ticket 
4de0: 61 70 70 6c 69 63 61 74 69 6f 6e 20 64 61 74 61  application data
4df0: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4e00: 6f 6e 67 3e 6d 61 73 74 65 72 5f 6b 65 79 3c 2f  ong>master_key</
4e10: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61  strong> <em>bina
4e20: 72 79 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f  ry_string</em></
4e30: 64 74 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20  dt>..<dd>Unique 
4e40: 73 65 73 73 69 6f 6e 20 6d 61 73 74 65 72 20 6b  session master k
4e50: 65 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  ey.</dd>..<dt><s
4e60: 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f 63 61  trong>session_ca
4e70: 63 68 65 5f 6d 6f 64 65 3c 2f 73 74 72 6f 6e 67  che_mode</strong
4e80: 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c  > <em>mode</em><
4e90: 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 72 76 65 72  /dt>..<dd>Server
4ea0: 20 63 61 63 68 65 20 6d 6f 64 65 20 28 63 6c 69   cache mode (cli
4eb0: 65 6e 74 2c 20 73 65 72 76 65 72 2c 20 6f 72 20  ent, server, or 
4ec0: 62 6f 74 68 29 2e 3c 2f 64 64 3e 0a 20 20 20 20  both).</dd>.    
4ed0: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 62 6c 6f 63  </dl>.    </bloc
4ee0: 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74  kquote>..    <dt
4ef0: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 70  ><a name="tls::p
4f00: 72 6f 74 6f 63 6f 6c 73 22 3e 3c 73 74 72 6f 6e  rotocols"><stron
4f10: 67 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73  g>tls::protocols
4f20: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64  </strong></a></d
4f30: 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72  t>.    <dd>Retur
4f40: 6e 73 20 61 20 6c 69 73 74 20 6f 66 20 74 68 65  ns a list of the
4f50: 20 73 75 70 70 6f 72 74 65 64 20 53 53 4c 2f 54   supported SSL/T
4f60: 4c 53 20 70 72 6f 74 6f 63 6f 6c 73 2e 20 56 61  LS protocols. Va
4f70: 6c 69 64 20 76 61 6c 75 65 73 20 61 72 65 3a 0a  lid values are:.
4f80: 09 3c 62 3e 73 73 6c 32 3c 2f 62 3e 2c 20 3c 62  .<b>ssl2</b>, <b
4f90: 3e 73 73 6c 33 3c 2f 62 3e 2c 20 3c 62 3e 74 6c  >ssl3</b>, <b>tl
4fa0: 73 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 2e  s1</b>, <b>tls1.
4fb0: 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 2e 32  1</b>, <b>tls1.2
4fc0: 3c 2f 62 3e 2c 0a 09 61 6e 64 20 3c 62 3e 74 6c  </b>,..and <b>tl
4fd0: 73 31 2e 33 3c 2f 62 3e 2e 20 45 78 61 63 74 20  s1.3</b>. Exact 
4fe0: 6c 69 73 74 20 64 65 70 65 6e 64 73 20 6f 6e 20  list depends on 
4ff0: 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20  OpenSSL version 
5000: 61 6e 64 0a 09 63 6f 6d 70 69 6c 65 20 74 69 6d  and..compile tim
5010: 65 20 66 6c 61 67 73 2e 3c 2f 64 64 3e 0a 20 20  e flags.</dd>.  
5020: 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74    <dt> </dt
5030: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  >.    <dt><a nam
5040: 65 3d 22 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22  e="tls::version"
5050: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 65  ><strong>tls::ve
5060: 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  rsion</strong></
5070: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  a></dt>.    <dd>
5080: 52 65 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e  Returns the Open
5090: 53 53 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69  SSL version stri
50a0: 6e 67 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a  ng.</dd>.</dl>..
50b0: 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d  <hr>..<h3><a nam
50c0: 65 3d 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49  e="CALLBACK OPTI
50d0: 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50  ONS">CALLBACK OP
50e0: 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a  TIONS</a></h3>..
50f0: 3c 70 3e 0a 41 73 20 69 6e 64 69 63 61 74 65 64  <p>.As indicated
5100: 20 61 62 6f 76 65 2c 20 69 6e 64 69 76 69 64 75   above, individu
5110: 61 6c 20 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20  al channels can 
5120: 62 65 20 67 69 76 65 6e 20 74 68 65 69 72 20 6f  be given their o
5130: 77 6e 20 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20  wn callbacks.to 
5140: 68 61 6e 64 6c 65 20 69 6e 74 65 72 6d 65 64 69  handle intermedi
5150: 61 74 65 20 70 72 6f 63 65 73 73 69 6e 67 20 62  ate processing b
5160: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69  y the OpenSSL li
5170: 62 72 61 72 79 2c 20 75 73 69 6e 67 20 74 68 65  brary, using the
5180: 0a 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e  .<strong>-comman
5190: 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72  d</strong>, <str
51a0: 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73  ong>-password</s
51b0: 74 72 6f 6e 67 3e 2c 20 61 6e 64 0a 3c 73 74 72  trong>, and.<str
51c0: 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f  ong>-validate_co
51d0: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f  mmand</strong> o
51e0: 70 74 69 6f 6e 73 20 70 61 73 73 65 64 20 74 6f  ptions passed to
51f0: 20 65 69 74 68 65 72 20 6f 66 0a 3c 73 74 72 6f   either of.<stro
5200: 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  ng>tls::socket</
5210: 73 74 72 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f  strong> or <stro
5220: 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f  ng>tls::import</
5230: 73 74 72 6f 6e 67 3e 2e 0a 49 66 20 74 68 65 20  strong>..If the 
5240: 63 61 6c 6c 62 61 63 6b 20 67 65 6e 65 72 61 74  callback generat
5250: 65 73 20 61 6e 20 65 72 72 6f 72 2c 20 74 68 65  es an error, the
5260: 20 3c 62 3e 62 67 65 72 72 6f 72 3c 2f 62 3e 20   <b>bgerror</b> 
5270: 63 6f 6d 6d 61 6e 64 20 77 69 6c 6c 20 62 65 0a  command will be.
5280: 69 6e 76 6f 6b 65 64 20 77 69 74 68 20 74 68 65  invoked with the
5290: 20 65 72 72 6f 72 20 69 6e 66 6f 72 6d 61 74 69   error informati
52a0: 6f 6e 2e 0a 3c 2f 70 3e 0a 0a 3c 64 6c 3e 0a 20  on..</p>..<dl>. 
52b0: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
52c0: 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e  command</strong>
52d0: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65   <em>callback</e
52e0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  m></dt>.    <dd>
52f0: 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70  ..Invokes the sp
5300: 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c  ecified <em>call
5310: 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74  back</em> script
5320: 20 61 74 20 73 65 76 65 72 61 6c 20 70 6f 69 6e   at several poin
5330: 74 73 0a 09 64 75 72 69 6e 67 20 74 68 65 20 4f  ts..during the O
5340: 70 65 6e 53 53 4c 20 68 61 6e 64 73 68 61 6b 65  penSSL handshake
5350: 20 61 6e 64 20 75 73 65 2e 20 53 65 65 20 62 65   and use. See be
5360: 6c 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73  low for the poss
5370: 69 62 6c 65 0a 09 61 72 67 75 6d 65 6e 74 73 20  ible..arguments 
5380: 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 63 61  passed to the ca
5390: 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 2e 20 56  llback script. V
53a0: 61 6c 75 65 73 20 72 65 74 75 72 6e 65 64 20 66  alues returned f
53b0: 72 6f 6d 20 74 68 65 0a 09 63 61 6c 6c 62 61 63  rom the..callbac
53c0: 6b 20 61 72 65 20 69 67 6e 6f 72 65 64 2e 0a 20  k are ignored.. 
53d0: 20 20 20 3c 62 72 3e 0a 20 20 20 20 3c 64 6c 3e     <br>.    <dl>
53e0: 0a 09 3c 64 74 3e 0a 09 3c 73 74 72 6f 6e 67 3e  ..<dt>..<strong>
53f0: 65 72 72 6f 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  error</strong> <
5400: 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 6d 65 73  em>channelId mes
5410: 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e  sage</em>..</dt>
5420: 0a 09 3c 64 64 3e 0a 09 20 20 20 20 54 68 69 73  ..<dd>..    This
5430: 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63   form of callbac
5440: 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65  k is invoked whe
5450: 6e 65 76 65 72 20 61 6e 20 65 72 72 6f 72 20 6f  never an error o
5460: 63 63 75 72 73 20 64 75 72 69 6e 67 20 74 68 65  ccurs during the
5470: 0a 09 20 20 20 20 69 6e 69 74 69 61 6c 20 63 6f  ..    initial co
5480: 6e 6e 65 63 74 69 6f 6e 2c 20 68 61 6e 64 73 68  nnection, handsh
5490: 61 6b 65 2c 20 6f 72 20 49 2f 4f 20 6f 70 65 72  ake, or I/O oper
54a0: 61 74 69 6f 6e 73 2e 20 54 68 65 20 3c 65 6d 3e  ations. The <em>
54b0: 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 20 20  message</em>..  
54c0: 20 20 61 72 67 75 6d 65 6e 74 20 63 61 6e 20 62    argument can b
54d0: 65 20 66 72 6f 6d 20 74 68 65 20 54 63 6c 5f 45  e from the Tcl_E
54e0: 72 72 6e 6f 4d 73 67 2c 20 4f 70 65 6e 53 53 4c  rrnoMsg, OpenSSL
54f0: 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 20 20 3c   function..    <
5500: 63 6f 64 65 3e 45 52 52 5f 72 65 61 73 6f 6e 5f  code>ERR_reason_
5510: 65 72 72 6f 72 5f 73 74 72 69 6e 67 28 29 3c 2f  error_string()</
5520: 63 6f 64 65 3e 2c 20 6f 72 20 61 20 63 75 73 74  code>, or a cust
5530: 6f 6d 20 6d 65 73 73 61 67 65 2e 0a 09 3c 2f 64  om message...</d
5540: 64 3e 0a 09 3c 62 72 3e 0a 09 3c 64 74 3e 0a 09  d>..<br>..<dt>..
5550: 20 20 20 20 3c 73 74 72 6f 6e 67 3e 69 6e 66 6f      <strong>info
5560: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68  </strong> <em>ch
5570: 61 6e 6e 65 6c 49 64 20 6d 61 6a 6f 72 20 6d 69  annelId major mi
5580: 6e 6f 72 20 6d 65 73 73 61 67 65 20 74 79 70 65  nor message type
5590: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64  </em>..</dt>..<d
55a0: 64 3e 0a 09 20 20 20 20 20 54 68 69 73 20 66 6f  d>..     This fo
55b0: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
55c0: 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65  s invoked by the
55d0: 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f   OpenSSL functio
55e0: 6e 0a 09 20 20 20 20 3c 63 6f 64 65 3e 53 53 4c  n..    <code>SSL
55f0: 5f 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61  _set_info_callba
5600: 63 6b 28 29 3c 2f 63 6f 64 65 3e 20 64 75 72 69  ck()</code> duri
5610: 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c 20 63  ng the initial c
5620: 6f 6e 6e 65 63 74 69 6f 6e 0a 09 20 20 20 20 61  onnection..    a
5630: 6e 64 20 68 61 6e 64 73 68 61 6b 65 20 6f 70 65  nd handshake ope
5640: 72 61 74 69 6f 6e 73 2e 20 54 68 65 20 3c 65 6d  rations. The <em
5650: 3e 74 79 70 65 3c 2f 65 6d 3e 20 61 72 67 75 6d  >type</em> argum
5660: 65 6e 74 20 69 73 20 6e 65 77 20 66 6f 72 0a 09  ent is new for..
5670: 20 20 20 20 54 4c 53 20 31 2e 38 2e 20 54 68 65      TLS 1.8. The
5680: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 0a   arguments are:.
5690: 09 3c 62 72 3e 0a 09 3c 75 6c 3e 0a 09 3c 6c 69  .<br>..<ul>..<li
56a0: 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 73  >Possible values
56b0: 20 66 6f 72 20 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f   for <em>major</
56c0: 65 6d 3e 20 61 72 65 3a 0a 09 20 20 20 20 3c 63  em> are:..    <c
56d0: 6f 64 65 3e 68 61 6e 64 73 68 61 6b 65 2c 20 61  ode>handshake, a
56e0: 6c 65 72 74 2c 20 63 6f 6e 6e 65 63 74 2c 20 61  lert, connect, a
56f0: 63 63 65 70 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c  ccept</code>.</l
5700: 69 3e 0a 09 3c 6c 69 3e 50 6f 73 73 69 62 6c 65  i>..<li>Possible
5710: 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e   values for <em>
5720: 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 0a  minor</em> are:.
5730: 09 20 20 20 20 3c 63 6f 64 65 3e 73 74 61 72 74  .    <code>start
5740: 2c 20 64 6f 6e 65 2c 20 72 65 61 64 2c 20 77 72  , done, read, wr
5750: 69 74 65 2c 20 6c 6f 6f 70 2c 20 65 78 69 74 3c  ite, loop, exit<
5760: 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a 09 3c 6c  /code>.</li>..<l
5770: 69 3e 54 68 65 20 3c 65 6d 3e 6d 65 73 73 61 67  i>The <em>messag
5780: 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20  e</em> argument 
5790: 69 73 20 61 20 64 65 73 63 72 69 70 74 69 76 65  is a descriptive
57a0: 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61   string which ma
57b0: 79 0a 09 20 20 20 20 62 65 20 67 65 6e 65 72 61  y..    be genera
57c0: 74 65 64 20 65 69 74 68 65 72 20 62 79 20 3c 63  ted either by <c
57d0: 6f 64 65 3e 53 53 4c 5f 73 74 61 74 65 5f 73 74  ode>SSL_state_st
57e0: 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64  ring_long()</cod
57f0: 65 3e 20 6f 72 20 62 79 0a 09 20 20 20 20 3c 63  e> or by..    <c
5800: 6f 64 65 3e 53 53 4c 5f 61 6c 65 72 74 5f 64 65  ode>SSL_alert_de
5810: 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29  sc_string_long()
5820: 3c 2f 63 6f 64 65 3e 2c 20 64 65 70 65 6e 64 69  </code>, dependi
5830: 6e 67 20 6f 6e 20 74 68 65 20 63 6f 6e 74 65 78  ng on the contex
5840: 74 2e 3c 2f 6c 69 3e 0a 09 3c 6c 69 3e 46 6f 72  t.</li>..<li>For
5850: 20 61 6c 65 72 74 73 2c 20 74 68 65 20 70 6f 73   alerts, the pos
5860: 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72  sible values for
5870: 20 3c 65 6d 3e 74 79 70 65 3c 2f 65 6d 3e 20 61   <em>type</em> a
5880: 72 65 3a 0a 09 20 20 20 20 3c 63 6f 64 65 3e 77  re:..    <code>w
5890: 61 72 6e 69 6e 67 2c 20 66 61 74 61 6c 2c 20 61  arning, fatal, a
58a0: 6e 64 20 75 6e 6b 6e 6f 77 6e 3c 2f 63 6f 64 65  nd unknown</code
58b0: 3e 2e 20 46 6f 72 20 6f 74 68 65 72 73 2c 0a 09  >. For others,..
58c0: 20 20 20 20 3c 63 6f 64 65 3e 69 6e 66 6f 3c 2f      <code>info</
58d0: 63 6f 64 65 3e 20 69 73 20 75 73 65 64 2e 3c 2f  code> is used.</
58e0: 6c 69 3e 0a 09 3c 2f 75 6c 3e 0a 09 3c 2f 64 64  li>..</ul>..</dd
58f0: 3e 0a 09 3c 64 74 3e 0a 09 3c 73 74 72 6f 6e 67  >..<dt>..<strong
5900: 3e 6d 65 73 73 61 67 65 3c 2f 73 74 72 6f 6e 67  >message</strong
5910: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20  > <em>channelId 
5920: 64 69 72 65 63 74 69 6f 6e 20 76 65 72 73 69 6f  direction versio
5930: 6e 20 63 6f 6e 74 65 6e 74 5f 74 79 70 65 20 6d  n content_type m
5940: 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64  essage</em>..</d
5950: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 20 20 54 68  t>..<dd>..    Th
5960: 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62  is form of callb
5970: 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62  ack is invoked b
5980: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75  y the OpenSSL fu
5990: 6e 63 74 69 6f 6e 0a 09 20 20 20 20 3c 63 6f 64  nction..    <cod
59a0: 65 3e 53 53 4c 5f 73 65 74 5f 6d 73 67 5f 63 61  e>SSL_set_msg_ca
59b0: 6c 6c 62 61 63 6b 28 29 3c 2f 63 6f 64 65 3e 20  llback()</code> 
59c0: 77 68 65 6e 65 76 65 72 20 61 20 6d 65 73 73 61  whenever a messa
59d0: 67 65 20 69 73 20 73 65 6e 74 20 6f 72 0a 09 20  ge is sent or.. 
59e0: 20 20 20 72 65 63 65 69 76 65 64 20 64 75 72 69     received duri
59f0: 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c 20 63  ng the initial c
5a00: 6f 6e 6e 65 63 74 69 6f 6e 2c 20 68 61 6e 64 73  onnection, hands
5a10: 68 61 6b 65 2c 20 6f 72 20 49 2f 4f 20 6f 70 65  hake, or I/O ope
5a20: 72 61 74 69 6f 6e 73 2e 0a 09 20 20 20 20 49 74  rations...    It
5a30: 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62   is only availab
5a40: 6c 65 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20  le when OpenSSL 
5a50: 69 73 20 63 6f 6d 70 6c 69 65 64 20 77 69 74 68  is complied with
5a60: 20 74 68 65 0a 09 20 20 20 20 3c 65 6d 3e 65 6e   the..    <em>en
5a70: 61 62 6c 65 2d 73 73 6c 2d 74 72 61 63 65 3c 2f  able-ssl-trace</
5a80: 65 6d 3e 20 6f 70 74 69 6f 6e 2e 20 41 72 67 75  em> option. Argu
5a90: 6d 65 6e 74 73 20 61 72 65 3a 20 3c 65 6d 3e 64  ments are: <em>d
5aa0: 69 72 65 63 74 69 6f 6e 3c 2f 65 6d 3e 0a 09 20  irection</em>.. 
5ab0: 20 20 20 69 73 20 3c 62 3e 53 65 6e 74 3c 2f 62     is <b>Sent</b
5ac0: 3e 20 6f 72 20 3c 62 3e 52 65 63 65 69 76 65 64  > or <b>Received
5ad0: 3c 2f 62 3e 2c 20 3c 65 6d 3e 76 65 72 73 69 6f  </b>, <em>versio
5ae0: 6e 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 70 72  n</em> is the pr
5af0: 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 76 65 72 73  otocol..    vers
5b00: 69 6f 6e 2c 20 3c 65 6d 3e 63 6f 6e 74 65 6e 74  ion, <em>content
5b10: 5f 74 79 70 65 3c 2f 65 6d 3e 20 69 73 20 74 68  _type</em> is th
5b20: 65 20 6d 65 73 73 61 67 65 20 63 6f 6e 74 65 6e  e message conten
5b30: 74 20 74 79 70 65 2c 20 61 6e 64 0a 09 20 20 20  t type, and..   
5b40: 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d   <em>message</em
5b50: 3e 20 69 73 20 6d 6f 72 65 20 69 6e 66 6f 20 66  > is more info f
5b60: 72 6f 6d 20 74 68 65 20 3c 63 6f 64 65 3e 53 53  rom the <code>SS
5b70: 4c 5f 74 72 61 63 65 3c 2f 63 6f 64 65 3e 20 41  L_trace</code> A
5b80: 50 49 2e 0a 09 20 20 20 20 54 68 69 73 20 63 61  PI...    This ca
5b90: 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 20 66 6f  llback is new fo
5ba0: 72 20 54 4c 53 20 31 2e 38 2e 0a 09 3c 2f 64 64  r TLS 1.8...</dd
5bb0: 3e 0a 09 3c 62 72 3e 0a 09 3c 64 74 3e 0a 09 3c  >..<br>..<dt>..<
5bc0: 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 3c 2f  strong>session</
5bd0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e  strong> <em>chan
5be0: 6e 65 6c 49 64 20 73 65 73 73 69 6f 6e 5f 69 64  nelId session_id
5bf0: 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65   ticket lifetime
5c00: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64  </em>..</dt>..<d
5c10: 64 3e 0a 09 20 20 20 20 54 68 69 73 20 66 6f 72  d>..    This for
5c20: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73  m of callback is
5c30: 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20   invoked by the 
5c40: 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e  OpenSSL function
5c50: 0a 09 20 20 20 20 3c 63 6f 64 65 3e 53 53 4c 5f  ..    <code>SSL_
5c60: 43 54 58 5f 73 65 73 73 5f 73 65 74 5f 6e 65 77  CTX_sess_set_new
5c70: 5f 63 62 28 29 3c 2f 63 6f 64 65 3e 20 77 68 65  _cb()</code> whe
5c80: 6e 65 76 65 72 20 61 20 6e 65 77 20 73 65 73 73  never a new sess
5c90: 69 6f 6e 20 69 64 20 69 73 0a 09 20 20 20 20 73  ion id is..    s
5ca0: 65 6e 74 20 62 79 20 74 68 65 20 73 65 72 76 65  ent by the serve
5cb0: 72 20 64 75 72 69 6e 67 20 74 68 65 20 69 6e 69  r during the ini
5cc0: 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 20  tial connection 
5cd0: 61 6e 64 20 68 61 6e 64 73 68 61 6b 65 2c 20 62  and handshake, b
5ce0: 75 74 0a 09 20 20 20 20 63 61 6e 20 61 6c 73 6f  ut..    can also
5cf0: 20 62 65 20 72 65 63 65 69 76 65 64 20 6c 61 74   be received lat
5d00: 65 72 20 69 66 20 74 68 65 20 3c 62 3e 2d 70 6f  er if the <b>-po
5d10: 73 74 5f 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e  st_handshake</b>
5d20: 20 6f 70 74 69 6f 6e 20 69 73 0a 09 20 20 20 20   option is..    
5d30: 75 73 65 64 2e 20 41 72 67 75 6d 65 6e 74 73 20  used. Arguments 
5d40: 61 72 65 3a 20 3c 65 6d 3e 73 65 73 73 69 6f 6e  are: <em>session
5d50: 5f 69 64 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20  _id</em> is the 
5d60: 63 75 72 72 65 6e 74 0a 09 20 20 20 20 73 65 73  current..    ses
5d70: 73 69 6f 6e 20 69 64 65 6e 74 69 66 69 65 72 2c  sion identifier,
5d80: 20 3c 65 6d 3e 74 69 63 6b 65 74 3c 2f 65 6d 3e   <em>ticket</em>
5d90: 20 69 73 20 74 68 65 20 73 65 73 73 69 6f 6e 20   is the session 
5da0: 74 69 63 6b 65 74 20 69 6e 66 6f 2c 20 61 6e 64  ticket info, and
5db0: 0a 09 20 20 20 20 3c 65 6d 3e 6c 69 66 65 74 69  ..    <em>lifeti
5dc0: 6d 65 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 74  me</em> is the t
5dd0: 68 65 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69  he ticket lifeti
5de0: 6d 65 20 69 6e 20 73 65 63 6f 6e 64 73 2e 0a 09  me in seconds...
5df0: 20 20 20 20 54 68 69 73 20 63 61 6c 6c 62 61 63      This callbac
5e00: 6b 20 69 73 20 6e 65 77 20 66 6f 72 20 54 4c 53  k is new for TLS
5e10: 20 31 2e 38 2e 0a 09 3c 2f 64 64 3e 0a 20 20 20   1.8...</dd>.   
5e20: 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e   </dl>.    </dd>
5e30: 0a 3c 2f 64 6c 3e 0a 3c 62 72 3e 0a 3c 64 6c 3e  .</dl>.<br>.<dl>
5e40: 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67  .    <dt><strong
5e50: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f  >-password</stro
5e60: 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b  ng> <em>callback
5e70: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c  </em></dt>.    <
5e80: 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65  dd>..Invokes the
5e90: 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63   specified <em>c
5ea0: 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72  allback</em> scr
5eb0: 69 70 74 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c  ipt when OpenSSL
5ec0: 20 6e 65 65 64 73 20 74 6f 0a 09 6f 62 74 61 69   needs to..obtai
5ed0: 6e 20 61 20 70 61 73 73 77 6f 72 64 2e 20 53 65  n a password. Se
5ee0: 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 20  e below for the 
5ef0: 70 6f 73 73 69 62 6c 65 20 61 72 67 75 6d 65 6e  possible argumen
5f00: 74 73 20 70 61 73 73 65 64 20 74 6f 0a 09 74 68  ts passed to..th
5f10: 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70  e callback scrip
5f20: 74 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f 72  t. See below for
5f30: 20 76 61 6c 69 64 20 72 65 74 75 72 6e 20 76 61   valid return va
5f40: 6c 75 65 73 2e 0a 09 3c 62 72 3e 0a 09 3c 64 6c  lues...<br>..<dl
5f50: 3e 0a 09 20 20 20 20 3c 64 74 3e 0a 09 20 20 20  >..    <dt>..   
5f60: 20 3c 73 74 72 6f 6e 67 3e 70 61 73 73 77 6f 72   <strong>passwor
5f70: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 72  d</strong> <em>r
5f80: 77 66 6c 61 67 20 73 69 7a 65 3c 2f 65 6d 3e 0a  wflag size</em>.
5f90: 09 20 20 20 20 3c 2f 64 74 3e 0a 09 20 20 20 20  .    </dt>..    
5fa0: 3c 64 64 3e 0a 09 09 49 6e 76 6f 6b 65 64 20 77  <dd>...Invoked w
5fb0: 68 65 6e 20 6c 6f 61 64 69 6e 67 20 6f 72 20 73  hen loading or s
5fc0: 74 6f 72 69 6e 67 20 61 20 50 45 4d 20 63 65 72  toring a PEM cer
5fd0: 74 69 66 69 63 61 74 65 20 77 69 74 68 20 65 6e  tificate with en
5fe0: 63 72 79 70 74 69 6f 6e 2e 0a 09 09 57 68 65 72  cryption....Wher
5ff0: 65 20 3c 65 6d 3e 72 77 66 6c 61 67 3c 2f 65 6d  e <em>rwflag</em
6000: 3e 20 69 73 20 30 20 66 6f 72 20 72 65 61 64 69  > is 0 for readi
6010: 6e 67 2f 64 65 63 72 79 70 74 69 6f 6e 20 6f 72  ng/decryption or
6020: 20 31 20 66 6f 72 0a 09 09 77 72 69 74 69 6e 67   1 for...writing
6030: 2f 65 6e 63 72 79 70 74 69 6f 6e 20 28 63 61 6e  /encryption (can
6040: 20 70 72 6f 6d 70 74 20 75 73 65 72 20 74 6f 20   prompt user to 
6050: 63 6f 6e 66 69 72 6d 29 20 61 6e 64 20 3c 65 6d  confirm) and <em
6060: 3e 73 69 7a 65 3c 2f 65 6d 3e 20 69 73 0a 09 09  >size</em> is...
6070: 74 68 65 20 6d 61 78 20 70 61 73 73 77 6f 72 64  the max password
6080: 20 6c 65 6e 67 74 68 20 69 6e 20 62 79 74 65 73   length in bytes
6090: 2e 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 73  . The callback s
60a0: 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 74 68 65  hould return the
60b0: 0a 09 09 70 61 73 73 77 6f 72 64 20 61 73 20 61  ...password as a
60c0: 20 73 74 72 69 6e 67 2e 20 42 6f 74 68 20 61 72   string. Both ar
60d0: 67 75 6d 65 6e 74 73 20 61 72 65 20 6e 65 77 20  guments are new 
60e0: 66 6f 72 20 54 4c 53 20 31 2e 38 2e 0a 09 20 20  for TLS 1.8...  
60f0: 20 20 3c 2f 64 64 3e 0a 09 3c 2f 64 6c 3e 0a 20    </dd>..</dl>. 
6100: 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c     </dd>.</dl>.<
6110: 62 72 3e 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74  br>.<dl>.    <dt
6120: 3e 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61  ><strong>-valida
6130: 74 65 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e  tecommand</stron
6140: 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c  g> <em>callback<
6150: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  /em></dt>.    <d
6160: 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65 20  d>..Invokes the 
6170: 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 61  specified <em>ca
6180: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69  llback</em> scri
6190: 70 74 20 64 75 72 69 6e 67 20 68 61 6e 64 73 68  pt during handsh
61a0: 61 6b 65 20 69 6e 0a 09 6f 72 64 65 72 20 74 6f  ake in..order to
61b0: 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 70 72   validate the pr
61c0: 6f 76 69 64 65 64 20 76 61 6c 75 65 28 73 29 2e  ovided value(s).
61d0: 20 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 20 74   See below for t
61e0: 68 65 20 70 6f 73 73 69 62 6c 65 0a 09 61 72 67  he possible..arg
61f0: 75 6d 65 6e 74 73 20 70 61 73 73 65 64 20 74 6f  uments passed to
6200: 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 63   the callback sc
6210: 72 69 70 74 2e 20 49 66 20 6e 6f 74 20 73 70 65  ript. If not spe
6220: 63 69 66 69 65 64 2c 20 4f 70 65 6e 53 53 4c 0a  cified, OpenSSL.
6230: 09 77 69 6c 6c 20 61 63 63 65 70 74 20 76 61 6c  .will accept val
6240: 69 64 20 63 65 72 74 69 66 69 63 61 74 65 73 20  id certificates 
6250: 61 6e 64 20 65 78 74 65 6e 73 69 6f 6e 73 2e 0a  and extensions..
6260: 09 54 6f 20 72 65 6a 65 63 74 20 74 68 65 20 76  .To reject the v
6270: 61 6c 75 65 20 61 6e 64 20 61 62 6f 72 74 20 74  alue and abort t
6280: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 74  he connection, t
6290: 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75  he callback shou
62a0: 6c 64 20 72 65 74 75 72 6e 20 30 2e 0a 09 54 6f  ld return 0...To
62b0: 20 61 63 63 65 70 74 20 74 68 65 20 76 61 6c 75   accept the valu
62c0: 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20 74  e and continue t
62d0: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69  he connection, i
62e0: 74 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20  t should return 
62f0: 31 2e 0a 09 54 6f 20 72 65 6a 65 63 74 20 74 68  1...To reject th
6300: 65 20 76 61 6c 75 65 2c 20 62 75 74 20 63 6f 6e  e value, but con
6310: 74 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65 63  tinue the connec
6320: 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64 20  tion, it should 
6330: 72 65 74 75 72 6e 20 32 2e 0a 09 3c 62 72 3e 0a  return 2...<br>.
6340: 09 3c 64 6c 3e 0a 09 20 20 20 20 3c 64 74 3e 0a  .<dl>..    <dt>.
6350: 09 09 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f  ..<strong>alpn</
6360: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e  strong> <em>chan
6370: 6e 65 6c 49 64 20 70 72 6f 74 6f 63 6f 6c 20 6d  nelId protocol m
6380: 61 74 63 68 3c 2f 65 6d 3e 0a 09 09 3c 2f 64 74  atch</em>...</dt
6390: 3e 0a 09 20 20 20 20 3c 64 64 3e 0a 09 09 46 6f  >..    <dd>...Fo
63a0: 72 20 73 65 72 76 65 72 73 2c 20 74 68 69 73 20  r servers, this 
63b0: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b  form of callback
63c0: 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e   is invoked when
63d0: 20 74 68 65 20 63 6c 69 65 6e 74 20 41 4c 50 4e   the client ALPN
63e0: 0a 09 09 65 78 74 65 6e 73 69 6f 6e 20 69 73 20  ...extension is 
63f0: 72 65 63 65 69 76 65 64 2e 20 49 66 20 3c 65 6d  received. If <em
6400: 3e 6d 61 74 63 68 3c 2f 65 6d 3e 20 69 73 20 74  >match</em> is t
6410: 72 75 65 2c 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f  rue, <em>protoco
6420: 6c 3c 2f 65 6d 3e 0a 09 09 69 73 20 74 68 65 20  l</em>...is the 
6430: 66 69 72 73 74 20 3c 62 3e 2d 61 6c 70 6e 3c 2f  first <b>-alpn</
6440: 62 3e 20 6f 70 74 69 6f 6e 20 73 70 65 63 69 66  b> option specif
6450: 69 65 64 20 70 72 6f 74 6f 63 6f 6c 20 63 6f 6d  ied protocol com
6460: 6d 6f 6e 20 74 6f 20 62 6f 74 68 0a 09 09 74 68  mon to both...th
6470: 65 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72  e client and ser
6480: 76 65 72 2e 20 49 66 20 6e 6f 74 2c 20 74 68 65  ver. If not, the
6490: 20 66 69 72 73 74 20 63 6c 69 65 6e 74 20 73 70   first client sp
64a0: 65 63 69 66 69 65 64 20 70 72 6f 74 6f 63 6f 6c  ecified protocol
64b0: 20 69 73 0a 09 09 75 73 65 64 2e 20 49 74 20 69   is...used. It i
64c0: 73 20 63 61 6c 6c 65 64 20 61 66 74 65 72 20 74  s called after t
64d0: 68 65 20 68 65 6c 6c 6f 20 61 6e 64 20 41 4c 50  he hello and ALP
64e0: 4e 20 63 61 6c 6c 62 61 63 6b 73 2e 0a 09 09 54  N callbacks....T
64f0: 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20  his callback is 
6500: 6e 65 77 20 66 6f 72 20 54 4c 53 20 31 2e 38 2e  new for TLS 1.8.
6510: 0a 09 20 20 20 20 3c 2f 64 64 3e 0a 09 20 20 20  ..    </dd>..   
6520: 20 3c 62 72 3e 0a 09 20 20 20 20 3c 64 74 3e 0a   <br>..    <dt>.
6530: 09 09 3c 73 74 72 6f 6e 67 3e 68 65 6c 6c 6f 3c  ..<strong>hello<
6540: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61  /strong> <em>cha
6550: 6e 6e 65 6c 49 64 20 73 65 72 76 65 72 6e 61 6d  nnelId servernam
6560: 65 3c 2f 65 6d 3e 0a 09 20 20 20 20 3c 2f 64 74  e</em>..    </dt
6570: 3e 0a 09 20 20 20 20 3c 64 64 3e 0a 09 09 46 6f  >..    <dd>...Fo
6580: 72 20 73 65 72 76 65 72 73 2c 20 74 68 69 73 20  r servers, this 
6590: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b  form of callback
65a0: 20 69 73 20 69 6e 76 6f 6b 65 64 20 64 75 72 69   is invoked duri
65b0: 6e 67 20 63 6c 69 65 6e 74 20 68 65 6c 6c 6f 0a  ng client hello.
65c0: 09 09 6d 65 73 73 61 67 65 20 70 72 6f 63 65 73  ..message proces
65d0: 73 69 6e 67 2e 20 54 68 65 20 70 75 72 70 6f 73  sing. The purpos
65e0: 65 20 69 73 20 73 6f 20 74 68 65 20 73 65 72 76  e is so the serv
65f0: 65 72 20 63 61 6e 20 73 65 6c 65 63 74 20 74 68  er can select th
6600: 65 0a 09 09 61 70 70 72 6f 70 72 69 61 74 65 20  e...appropriate 
6610: 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 70  certificate to p
6620: 72 65 73 65 6e 74 20 74 6f 20 74 68 65 20 63 6c  resent to the cl
6630: 69 65 6e 74 2c 20 61 6e 64 20 74 6f 20 6d 61 6b  ient, and to mak
6640: 65 20 6f 74 68 65 72 0a 09 09 63 6f 6e 66 69 67  e other...config
6650: 75 72 61 74 69 6f 6e 20 61 64 6a 75 73 74 6d 65  uration adjustme
6660: 6e 74 73 20 72 65 6c 65 76 61 6e 74 20 74 6f 20  nts relevant to 
6670: 74 68 61 74 20 73 65 72 76 65 72 20 6e 61 6d 65  that server name
6680: 20 61 6e 64 20 69 74 73 0a 09 09 63 6f 6e 66 69   and its...confi
6690: 67 75 72 61 74 69 6f 6e 2e 20 49 74 20 69 73 20  guration. It is 
66a0: 63 61 6c 6c 65 64 20 62 65 66 6f 72 65 20 74 68  called before th
66b0: 65 20 53 4e 49 20 61 6e 64 20 41 4c 50 4e 20 63  e SNI and ALPN c
66c0: 61 6c 6c 62 61 63 6b 73 2e 0a 09 09 54 68 69 73  allbacks....This
66d0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77   callback is new
66e0: 20 66 6f 72 20 54 4c 53 20 31 2e 38 2e 0a 09 20   for TLS 1.8... 
66f0: 20 20 20 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 62     </dd>..    <b
6700: 72 3e 0a 09 20 20 20 20 3c 64 74 3e 0a 09 09 3c  r>..    <dt>...<
6710: 73 74 72 6f 6e 67 3e 73 6e 69 3c 2f 73 74 72 6f  strong>sni</stro
6720: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49  ng> <em>channelI
6730: 64 20 73 65 72 76 65 72 6e 61 6d 65 3c 2f 65 6d  d servername</em
6740: 3e 0a 09 20 20 20 20 3c 2f 64 74 3e 0a 09 20 20  >..    </dt>..  
6750: 20 20 3c 64 64 3e 0a 09 09 46 6f 72 20 73 65 72    <dd>...For ser
6760: 76 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20  vers, this form 
6770: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
6780: 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74 68 65 20  nvoked when the 
6790: 53 65 72 76 65 72 20 4e 61 6d 65 0a 09 09 49 6e  Server Name...In
67a0: 64 69 63 61 74 69 6f 6e 20 28 53 4e 49 29 20 65  dication (SNI) e
67b0: 78 74 65 6e 73 69 6f 6e 20 69 73 20 72 65 63 65  xtension is rece
67c0: 69 76 65 64 2e 20 54 68 65 20 3c 65 6d 3e 73 65  ived. The <em>se
67d0: 72 76 65 72 6e 61 6d 65 3c 2f 65 6d 3e 0a 09 09  rvername</em>...
67e0: 61 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20  argument is the 
67f0: 63 6c 69 65 6e 74 20 70 72 6f 76 69 64 65 64 20  client provided 
6800: 73 65 72 76 65 72 20 6e 61 6d 65 20 69 6e 20 74  server name in t
6810: 68 65 20 3c 62 3e 2d 73 65 72 76 65 72 6e 61 6d  he <b>-servernam
6820: 65 3c 2f 62 3e 0a 09 09 6f 70 74 69 6f 6e 2e 20  e</b>...option. 
6830: 54 68 65 20 70 75 72 70 6f 73 65 20 69 73 20 73  The purpose is s
6840: 6f 20 77 68 65 6e 20 61 20 73 65 72 76 65 72 20  o when a server 
6850: 73 75 70 70 6f 72 74 73 20 6d 75 6c 74 69 70 6c  supports multipl
6860: 65 20 6e 61 6d 65 73 2c 20 74 68 65 0a 09 09 72  e names, the...r
6870: 69 67 68 74 20 63 65 72 74 69 66 69 63 61 74 65  ight certificate
6880: 20 63 61 6e 20 62 65 20 75 73 65 64 2e 20 49 74   can be used. It
6890: 20 69 73 20 63 61 6c 6c 65 64 20 61 66 74 65 72   is called after
68a0: 20 74 68 65 20 68 65 6c 6c 6f 20 63 61 6c 6c 62   the hello callb
68b0: 61 63 6b 0a 09 09 62 75 74 20 62 65 66 6f 72 65  ack...but before
68c0: 20 74 68 65 20 41 4c 50 4e 20 63 61 6c 6c 62 61   the ALPN callba
68d0: 63 6b 2e 0a 09 09 54 68 69 73 20 63 61 6c 6c 62  ck....This callb
68e0: 61 63 6b 20 69 73 20 6e 65 77 20 66 6f 72 20 54  ack is new for T
68f0: 4c 53 20 31 2e 38 2e 0a 09 20 20 20 20 3c 2f 64  LS 1.8...    </d
6900: 64 3e 0a 09 20 20 20 20 3c 62 72 3e 0a 09 20 20  d>..    <br>..  
6910: 20 20 3c 64 74 3e 0a 09 09 3c 73 74 72 6f 6e 67    <dt>...<strong
6920: 3e 76 65 72 69 66 79 3c 2f 73 74 72 6f 6e 67 3e  >verify</strong>
6930: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 64   <em>channelId d
6940: 65 70 74 68 20 63 65 72 74 20 73 74 61 74 75 73  epth cert status
6950: 20 65 72 72 6f 72 3c 2f 65 6d 3e 0a 09 20 20 20   error</em>..   
6960: 20 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 3e   </dt>..    <dd>
6970: 0a 09 09 54 68 69 73 20 66 6f 72 6d 20 6f 66 20  ...This form of 
6980: 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f  callback is invo
6990: 6b 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 20 77  ked by OpenSSL w
69a0: 68 65 6e 20 61 20 6e 65 77 20 63 65 72 74 69 66  hen a new certif
69b0: 69 63 61 74 65 0a 09 09 69 73 20 72 65 63 65 69  icate...is recei
69c0: 76 65 64 20 66 72 6f 6d 20 74 68 65 20 70 65 65  ved from the pee
69d0: 72 2e 20 49 74 20 61 6c 6c 6f 77 73 20 74 68 65  r. It allows the
69e0: 20 63 6c 69 65 6e 74 20 74 6f 20 63 68 65 63 6b   client to check
69f0: 20 74 68 65 0a 09 09 63 65 72 74 69 66 69 63 61   the...certifica
6a00: 74 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20  te verification 
6a10: 72 65 73 75 6c 74 73 20 61 6e 64 20 63 68 6f 6f  results and choo
6a20: 73 65 20 77 68 65 74 68 65 72 20 74 6f 20 63 6f  se whether to co
6a30: 6e 74 69 6e 75 65 0a 09 09 6f 72 20 6e 6f 74 2e  ntinue...or not.
6a40: 20 49 74 20 69 73 20 63 61 6c 6c 65 64 20 66 6f   It is called fo
6a50: 72 20 65 61 63 68 20 63 65 72 74 69 66 69 63 61  r each certifica
6a60: 74 65 20 69 6e 20 74 68 65 20 63 65 72 74 69 66  te in the certif
6a70: 69 63 61 74 65 20 63 68 61 69 6e 2e 0a 09 09 3c  icate chain....<
6a80: 75 6c 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 3c 65  ul>...<li>The <e
6a90: 6d 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 72 67  m>depth</em> arg
6aa0: 75 6d 65 6e 74 20 69 73 20 74 68 65 20 69 6e 74  ument is the int
6ab0: 65 67 65 72 20 64 65 70 74 68 20 6f 66 20 74 68  eger depth of th
6ac0: 65 0a 09 09 63 65 72 74 69 66 69 63 61 74 65 20  e...certificate 
6ad0: 69 6e 20 74 68 65 20 63 65 72 74 69 66 69 63 61  in the certifica
6ae0: 74 65 20 63 68 61 69 6e 2c 20 77 68 65 72 65 20  te chain, where 
6af0: 30 20 69 73 20 74 68 65 20 70 65 65 72 20 63 65  0 is the peer ce
6b00: 72 74 69 66 69 63 61 74 65 0a 09 09 61 6e 64 20  rtificate...and 
6b10: 68 69 67 68 65 72 20 76 61 6c 75 65 73 20 67 6f  higher values go
6b20: 69 6e 67 20 75 70 20 74 6f 20 74 68 65 20 43 65  ing up to the Ce
6b30: 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72  rtificate Author
6b40: 69 74 79 20 28 43 41 29 2e 3c 2f 6c 69 3e 0a 09  ity (CA).</li>..
6b50: 09 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e 63 65 72  .<li>The <em>cer
6b60: 74 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20  t</em> argument 
6b70: 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79  is a list of key
6b80: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 73 69 6d  -value pairs sim
6b90: 69 6c 61 72 0a 09 09 74 6f 20 74 68 6f 73 65 20  ilar...to those 
6ba0: 72 65 74 75 72 6e 65 64 20 62 79 0a 09 09 3c 61  returned by...<a
6bb0: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61   href="#tls::sta
6bc0: 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  tus"><strong>tls
6bd0: 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67  ::status</strong
6be0: 3e 3c 2f 61 3e 2e 3c 2f 6c 69 3e 0a 09 09 3c 6c  ></a>.</li>...<l
6bf0: 69 3e 54 68 65 20 3c 65 6d 3e 73 74 61 74 75 73  i>The <em>status
6c00: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69  </em> argument i
6c10: 73 20 74 68 65 20 62 6f 6f 6c 65 61 6e 20 76 61  s the boolean va
6c20: 6c 69 64 69 74 79 20 6f 66 20 74 68 65 0a 09 09  lidity of the...
6c30: 63 75 72 72 65 6e 74 20 63 65 72 74 69 66 69 63  current certific
6c40: 61 74 65 20 77 68 65 72 65 20 30 20 69 73 20 69  ate where 0 is i
6c50: 6e 76 61 6c 69 64 20 61 6e 64 20 31 20 69 73 20  nvalid and 1 is 
6c60: 76 61 6c 69 64 2e 3c 2f 6c 69 3e 0a 09 09 3c 6c  valid.</li>...<l
6c70: 69 3e 54 68 65 20 3c 65 6d 3e 65 72 72 6f 72 3c  i>The <em>error<
6c80: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73  /em> argument is
6c90: 20 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61   the error messa
6ca0: 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 65 6e 65  ge, if any, gene
6cb0: 72 61 74 65 64 0a 09 09 62 79 20 3c 63 6f 64 65  rated...by <code
6cc0: 3e 58 35 30 39 5f 53 54 4f 52 45 5f 43 54 58 5f  >X509_STORE_CTX_
6cd0: 67 65 74 5f 65 72 72 6f 72 28 29 3c 2f 63 6f 64  get_error()</cod
6ce0: 65 3e 2e 3c 2f 6c 69 3e 0a 09 09 3c 2f 75 6c 3e  e>.</li>...</ul>
6cf0: 0a 09 20 20 20 20 3c 2f 64 64 3e 0a 09 20 20 20  ..    </dd>..   
6d00: 20 3c 62 72 3e 0a 09 3c 2f 64 6c 3e 0a 20 20 20   <br>..</dl>.   
6d10: 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 70   </dd>.</dl>..<p
6d20: 3e 0a 52 65 66 65 72 65 6e 63 65 20 69 6d 70 6c  >.Reference impl
6d30: 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20 74  ementations of t
6d40: 68 65 73 65 20 63 61 6c 6c 62 61 63 6b 73 20 61  hese callbacks a
6d50: 72 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20 74  re provided in t
6d60: 68 65 0a 64 69 73 74 72 69 62 75 74 69 6f 6e 20  he.distribution 
6d70: 61 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  as <strong>tls::
6d80: 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67  callback</strong
6d90: 3e 2c 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  >, <strong>tls::
6da0: 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67  password</strong
6db0: 3e 2c 0a 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 74  >,.and <strong>t
6dc0: 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d  ls::validate_com
6dd0: 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 72 65  mand</strong> re
6de0: 73 70 65 63 74 69 76 65 6c 79 2e 20 4e 6f 74 65  spectively. Note
6df0: 20 74 68 61 74 20 74 68 65 73 65 20 61 72 65 0a   that these are.
6e00: 3c 65 6d 3e 73 61 6d 70 6c 65 3c 2f 65 6d 3e 20  <em>sample</em> 
6e10: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20  implementations 
6e20: 6f 6e 6c 79 2e 20 49 6e 20 61 20 6d 6f 72 65 20  only. In a more 
6e30: 72 65 61 6c 69 73 74 69 63 20 64 65 70 6c 6f 79  realistic deploy
6e40: 6d 65 6e 74 0a 79 6f 75 20 77 6f 75 6c 64 20 73  ment.you would s
6e50: 70 65 63 69 66 79 20 79 6f 75 72 20 6f 77 6e 20  pecify your own 
6e60: 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 73  callback scripts
6e70: 20 6f 6e 20 65 61 63 68 20 54 4c 53 20 63 68 61   on each TLS cha
6e80: 6e 6e 65 6c 20 75 73 69 6e 67 20 74 68 65 0a 3c  nnel using the.<
6e90: 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c  strong>-command<
6ea0: 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e  /strong>, <stron
6eb0: 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72  g>-password</str
6ec0: 6f 6e 67 3e 2c 20 61 6e 64 0a 3c 73 74 72 6f 6e  ong>, and.<stron
6ed0: 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d  g>-validate_comm
6ee0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 74  and</strong> opt
6ef0: 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 54  ions..</p>.<p>.T
6f00: 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76  he default behav
6f10: 69 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 73 74  ior when the <st
6f20: 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73  rong>-command</s
6f30: 74 72 6f 6e 67 3e 20 61 6e 64 20 3c 73 74 72 6f  trong> and <stro
6f40: 6e 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d  ng>-validate_com
6f50: 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 0a 6f 70  mand</strong>.op
6f60: 74 69 6f 6e 73 20 61 72 65 20 6e 6f 74 20 73 70  tions are not sp
6f70: 65 63 69 66 69 65 64 20 69 73 20 66 6f 72 20 54  ecified is for T
6f80: 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68  LS to process th
6f90: 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62  e associated lib
6fa0: 72 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 0a 69  rary callbacks.i
6fb0: 6e 74 65 72 6e 61 6c 6c 79 2e 20 54 68 65 20 64  nternally. The d
6fc0: 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20  efault behavior 
6fd0: 77 68 65 6e 20 74 68 65 20 3c 73 74 72 6f 6e 67  when the <strong
6fe0: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f  >-password</stro
6ff0: 6e 67 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f  ng> option is no
7000: 74 0a 73 70 65 63 69 66 69 65 64 20 69 73 20 66  t.specified is f
7010: 6f 72 20 54 4c 53 20 74 6f 20 70 72 6f 63 65 73  or TLS to proces
7020: 73 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64  s the associated
7030: 20 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63   library callbac
7040: 6b 73 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67  ks by attempting
7050: 0a 74 6f 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67  .to call <strong
7060: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f  >tls::password</
7070: 73 74 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66  strong>..The dif
7080: 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20  ference between 
7090: 74 68 65 73 65 20 74 77 6f 20 62 65 68 61 76 69  these two behavi
70a0: 6f 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75  ors is a consequ
70b0: 65 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e  ence of maintain
70c0: 69 6e 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74  ing.compatibilit
70d0: 79 20 77 69 74 68 20 65 61 72 6c 69 65 72 20 69  y with earlier i
70e0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a  mplementations..
70f0: 3c 2f 70 3e 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68  </p>.<p>.<em>.Th
7100: 65 20 75 73 65 20 6f 66 20 74 68 65 20 72 65 66  e use of the ref
7110: 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73  erence callbacks
7120: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61   <strong>tls::ca
7130: 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c  llback</strong>,
7140: 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61  .<strong>tls::pa
7150: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c  ssword</strong>,
7160: 20 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73   and <strong>tls
7170: 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  ::validate_comma
7180: 6e 64 3c 2f 73 74 72 6f 6e 67 3e 0a 69 73 20 6e  nd</strong>.is n
7190: 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20  ot recommended. 
71a0: 54 68 65 79 20 6d 61 79 20 62 65 20 72 65 6d 6f  They may be remo
71b0: 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 20  ved from future 
71c0: 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a  releases..</em>.
71d0: 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e  </p>..<hr>..<h3>
71e0: 3c 61 20 6e 61 6d 65 3d 22 44 45 42 55 47 22 3e  <a name="DEBUG">
71f0: 44 45 42 55 47 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a  DEBUG</a></h3>..
7200: 54 4c 53 20 6b 65 79 20 6c 6f 67 67 69 6e 67 20  TLS key logging 
7210: 63 61 6e 20 62 65 20 65 6e 61 62 6c 65 64 20 62  can be enabled b
7220: 79 20 73 65 74 74 69 6e 67 20 74 68 65 20 65 6e  y setting the en
7230: 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62  vironment variab
7240: 6c 65 0a 3c 62 3e 53 53 4c 4b 45 59 4c 4f 47 46  le.<b>SSLKEYLOGF
7250: 49 4c 45 3c 2f 62 3e 20 74 6f 20 74 68 65 20 6e  ILE</b> to the n
7260: 61 6d 65 20 6f 66 20 74 68 65 20 66 69 6c 65 20  ame of the file 
7270: 74 6f 20 6c 6f 67 20 74 6f 2e 20 54 68 65 6e 20  to log to. Then 
7280: 77 68 65 6e 65 76 65 72 20 54 4c 53 0a 6b 65 79  whenever TLS.key
7290: 20 6d 61 74 65 72 69 61 6c 20 69 73 20 67 65 6e   material is gen
72a0: 65 72 61 74 65 64 20 6f 72 20 72 65 63 65 69 76  erated or receiv
72b0: 65 64 20 69 74 20 77 69 6c 6c 20 62 65 20 6c 6f  ed it will be lo
72c0: 67 67 65 64 20 74 6f 20 74 68 65 20 66 69 6c 65  gged to the file
72d0: 2e 20 54 68 69 73 0a 69 73 20 75 73 65 66 75 6c  . This.is useful
72e0: 20 66 6f 72 20 6c 6f 67 67 69 6e 67 20 6b 65 79   for logging key
72f0: 20 64 61 74 61 20 66 6f 72 20 6e 65 74 77 6f 72   data for networ
7300: 6b 20 6c 6f 67 67 69 6e 67 20 74 6f 6f 6c 73 20  k logging tools 
7310: 74 6f 20 75 73 65 20 74 6f 0a 64 65 63 72 79 70  to use to.decryp
7320: 74 20 74 68 65 20 64 61 74 61 2e 0a 3c 70 3e 0a  t the data..<p>.
7330: 54 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  The <strong>tls:
7340: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20  :debug</strong> 
7350: 76 61 72 69 61 62 6c 65 20 70 72 6f 76 69 64 65  variable provide
7360: 73 20 73 6f 6d 65 20 61 64 64 69 74 69 6f 6e 61  s some additiona
7370: 6c 0a 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20 74  l.control over t
7380: 68 65 73 65 20 72 65 66 65 72 65 6e 63 65 20 63  hese reference c
7390: 61 6c 6c 62 61 63 6b 73 2e 20 49 74 73 20 76 61  allbacks. Its va
73a0: 6c 75 65 20 69 73 20 7a 65 72 6f 20 62 79 20 64  lue is zero by d
73b0: 65 66 61 75 6c 74 2e 0a 48 69 67 68 65 72 20 76  efault..Higher v
73c0: 61 6c 75 65 73 20 70 72 6f 64 75 63 65 20 6d 6f  alues produce mo
73d0: 72 65 20 64 69 61 67 6e 6f 73 74 69 63 20 6f 75  re diagnostic ou
73e0: 74 70 75 74 2c 20 61 6e 64 20 77 69 6c 6c 20 61  tput, and will a
73f0: 6c 73 6f 20 66 6f 72 63 65 20 74 68 65 0a 76 65  lso force the.ve
7400: 72 69 66 79 20 6d 65 74 68 6f 64 20 69 6e 20 3c  rify method in <
7410: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c  strong>tls::call
7420: 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 74 6f  back</strong> to
7430: 20 61 63 63 65 70 74 20 74 68 65 0a 63 65 72 74   accept the.cert
7440: 69 66 69 63 61 74 65 2c 20 65 76 65 6e 20 77 68  ificate, even wh
7450: 65 6e 20 69 74 20 69 73 20 69 6e 76 61 6c 69 64  en it is invalid
7460: 20 69 66 20 74 68 65 20 3c 62 3e 74 6c 73 3a 3a   if the <b>tls::
7470: 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64  validate_command
7480: 3c 2f 62 3e 0a 63 61 6c 6c 62 61 63 6b 20 69 73  </b>.callback is
7490: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 3c 62   used for the <b
74a0: 3e 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e  >-validatecomman
74b0: 64 3c 2f 62 3e 20 6f 70 74 69 6f 6e 2e 0a 3c 2f  d</b> option..</
74c0: 70 3e 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20  p>.<p>.<em>.The 
74d0: 75 73 65 20 6f 66 20 74 68 65 20 76 61 72 69 61  use of the varia
74e0: 62 6c 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  ble <strong>tls:
74f0: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20  :debug</strong> 
7500: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64  is not recommend
7510: 65 64 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65  ed..It may be re
7520: 6d 6f 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72  moved from futur
7530: 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d  e releases..</em
7540: 3e 0a 3c 2f 70 3e 0a 0a 3c 68 34 3e 3c 61 20 6e  >.</p>..<h4><a n
7550: 61 6d 65 3d 22 44 45 42 55 47 5f 45 58 41 4d 50  ame="DEBUG_EXAMP
7560: 4c 45 53 22 3e 44 65 62 75 67 20 45 78 61 6d 70  LES">Debug Examp
7570: 6c 65 73 3c 2f 61 3e 3c 2f 68 34 3e 0a 0a 3c 70  les</a></h4>..<p
7580: 3e 54 68 65 73 65 20 65 78 61 6d 70 6c 65 73 20  >These examples 
7590: 75 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 20  use the default 
75a0: 55 6e 69 78 20 70 6c 61 74 66 6f 72 6d 20 53 53  Unix platform SS
75b0: 4c 20 63 65 72 74 69 66 69 63 61 74 65 73 2e 20  L certificates. 
75c0: 46 6f 72 20 73 74 61 6e 64 61 72 64 0a 69 6e 73  For standard.ins
75d0: 74 61 6c 6c 61 74 69 6f 6e 73 2c 20 2d 63 61 64  tallations, -cad
75e0: 69 72 20 61 6e 64 20 2d 63 61 66 69 6c 65 20 73  ir and -cafile s
75f0: 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20 6e 65 65  hould not be nee
7600: 64 65 64 2e 20 49 66 20 79 6f 75 72 20 63 65 72  ded. If your cer
7610: 74 69 66 69 63 61 74 65 73 0a 61 72 65 20 69 6e  tificates.are in
7620: 20 6e 6f 6e 2d 73 74 61 6e 64 61 72 64 20 6c 6f   non-standard lo
7630: 63 61 74 69 6f 6e 73 2c 20 75 70 64 61 74 65 20  cations, update 
7640: 2d 63 61 64 69 72 20 6f 72 20 75 73 65 20 2d 63  -cadir or use -c
7650: 61 66 69 6c 65 20 61 73 20 6e 65 65 64 65 64 2e  afile as needed.
7660: 3c 2f 70 3e 0a 3c 62 72 3e 0a 0a 3c 70 3e 45 78  </p>.<br>..<p>Ex
7670: 61 6d 70 6c 65 20 23 31 3a 20 55 73 65 20 48 54  ample #1: Use HT
7680: 54 50 20 70 61 63 6b 61 67 65 3c 2f 70 3e 0a 3c  TP package</p>.<
7690: 70 72 65 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61  pre><code>.packa
76a0: 67 65 20 72 65 71 75 69 72 65 20 68 74 74 70 0a  ge require http.
76b0: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
76c0: 74 6c 73 0a 73 65 74 20 75 72 6c 20 22 68 74 74  tls.set url "htt
76d0: 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 6b 2f  ps://www.tcl.tk/
76e0: 22 0a 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65  "..http::registe
76f0: 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73  r https 443 [lis
7700: 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  t ::tls::socket 
7710: 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20  -autoservername 
7720: 74 72 75 65 20 2d 72 65 71 75 69 72 65 20 74 72  true -require tr
7730: 75 65 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73  ue -cadir /etc/s
7740: 73 6c 2f 63 65 72 74 73 20 5c 0a 20 20 20 20 2d  sl/certs \.    -
7750: 63 6f 6d 6d 61 6e 64 20 3a 3a 74 6c 73 3a 3a 63  command ::tls::c
7760: 61 6c 6c 62 61 63 6b 20 2d 70 61 73 73 77 6f 72  allback -passwor
7770: 64 20 3a 3a 74 6c 73 3a 3a 70 61 73 73 77 6f 72  d ::tls::passwor
7780: 64 20 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61  d -validatecomma
7790: 6e 64 20 3a 3a 74 6c 73 3a 3a 76 61 6c 69 64 61  nd ::tls::valida
77a0: 74 65 5f 63 6f 6d 6d 61 6e 64 5d 0a 0a 23 20 43  te_command]..# C
77b0: 68 65 63 6b 20 66 6f 72 20 65 72 72 6f 72 0a 73  heck for error.s
77c0: 65 74 20 74 6f 6b 65 6e 20 5b 68 74 74 70 3a 3a  et token [http::
77d0: 67 65 74 75 72 6c 20 24 75 72 6c 5d 0a 69 66 20  geturl $url].if 
77e0: 7b 5b 68 74 74 70 3a 3a 73 74 61 74 75 73 20 24  {[http::status $
77f0: 74 6f 6b 65 6e 5d 20 6e 65 20 22 6f 6b 22 7d 20  token] ne "ok"} 
7800: 7b 0a 20 20 20 20 70 75 74 73 20 5b 66 6f 72 6d  {.    puts [form
7810: 61 74 20 22 45 72 72 6f 72 20 25 73 22 20 5b 68  at "Error %s" [h
7820: 74 74 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b  ttp::status $tok
7830: 65 6e 5d 5d 0a 7d 0a 0a 23 20 47 65 74 20 77 65  en]].}..# Get we
7840: 62 20 70 61 67 65 0a 73 65 74 20 64 61 74 61 20  b page.set data 
7850: 5b 68 74 74 70 3a 3a 64 61 74 61 20 24 74 6f 6b  [http::data $tok
7860: 65 6e 5d 0a 70 75 74 73 20 5b 73 74 72 69 6e 67  en].puts [string
7870: 20 6c 65 6e 67 74 68 20 24 64 61 74 61 5d 0a 0a   length $data]..
7880: 23 20 43 6c 65 61 6e 75 70 0a 3a 3a 68 74 74 70  # Cleanup.::http
7890: 3a 3a 63 6c 65 61 6e 75 70 20 24 74 6f 6b 65 6e  ::cleanup $token
78a0: 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a  .</code></pre>..
78b0: 3c 70 3e 45 78 61 6d 70 6c 65 20 23 32 3a 20 55  <p>Example #2: U
78c0: 73 65 20 72 61 77 20 73 6f 63 6b 65 74 3c 2f 70  se raw socket</p
78d0: 3e 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 0a 70 61  >.<pre><code>.pa
78e0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c  ckage require tl
78f0: 73 0a 0a 73 65 74 20 75 72 6c 20 22 77 77 77 2e  s..set url "www.
7900: 74 63 6c 2d 6c 61 6e 67 2e 6f 72 67 22 0a 73 65  tcl-lang.org".se
7910: 74 20 70 6f 72 74 20 34 34 33 0a 0a 73 65 74 20  t port 443..set 
7920: 63 68 20 5b 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  ch [tls::socket 
7930: 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20  -autoservername 
7940: 31 20 2d 73 65 72 76 65 72 6e 61 6d 65 20 24 75  1 -servername $u
7950: 72 6c 20 2d 72 65 71 75 65 73 74 20 31 20 2d 72  rl -request 1 -r
7960: 65 71 75 69 72 65 20 31 20 5c 0a 20 20 20 20 2d  equire 1 \.    -
7970: 61 6c 70 6e 20 7b 68 74 74 70 2f 31 2e 31 7d 20  alpn {http/1.1} 
7980: 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c 2f  -cadir /etc/ssl/
7990: 63 65 72 74 73 20 2d 63 6f 6d 6d 61 6e 64 20 3a  certs -command :
79a0: 3a 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 20 5c  :tls::callback \
79b0: 0a 20 20 20 20 2d 70 61 73 73 77 6f 72 64 20 3a  .    -password :
79c0: 3a 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 20 2d  :tls::password -
79d0: 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 20  validatecommand 
79e0: 3a 3a 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f  ::tls::validate_
79f0: 63 6f 6d 6d 61 6e 64 20 24 75 72 6c 20 24 70 6f  command $url $po
7a00: 72 74 5d 0a 63 68 61 6e 20 63 6f 6e 66 69 67 75  rt].chan configu
7a10: 72 65 20 24 63 68 20 2d 62 75 66 66 65 72 73 69  re $ch -buffersi
7a20: 7a 65 20 36 35 35 33 36 0a 74 6c 73 3a 3a 68 61  ze 65536.tls::ha
7a30: 6e 64 73 68 61 6b 65 20 24 63 68 0a 0a 70 75 74  ndshake $ch..put
7a40: 73 20 24 63 68 20 22 47 45 54 20 2f 20 48 54 54  s $ch "GET / HTT
7a50: 50 2f 31 2e 31 22 0a 66 6c 75 73 68 20 24 63 68  P/1.1".flush $ch
7a60: 0a 61 66 74 65 72 20 35 30 30 0a 73 65 74 20 64  .after 500.set d
7a70: 61 74 61 20 5b 72 65 61 64 20 24 63 68 5d 0a 0a  ata [read $ch]..
7a80: 61 72 72 61 79 20 73 65 74 20 73 74 61 74 75 73  array set status
7a90: 20 5b 74 6c 73 3a 3a 73 74 61 74 75 73 20 24 63   [tls::status $c
7aa0: 68 5d 0a 61 72 72 61 79 20 73 65 74 20 63 6f 6e  h].array set con
7ab0: 6e 20 5b 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69  n [tls::connecti
7ac0: 6f 6e 20 24 63 68 5d 0a 61 72 72 61 79 20 73 65  on $ch].array se
7ad0: 74 20 63 68 61 6e 20 5b 63 68 61 6e 20 63 6f 6e  t chan [chan con
7ae0: 66 69 67 75 72 65 20 24 63 68 5d 0a 63 6c 6f 73  figure $ch].clos
7af0: 65 20 24 63 68 0a 70 61 72 72 61 79 20 73 74 61  e $ch.parray sta
7b00: 74 75 73 0a 70 61 72 72 61 79 20 63 6f 6e 6e 0a  tus.parray conn.
7b10: 70 61 72 72 61 79 20 63 68 61 6e 0a 3c 2f 63 6f  parray chan.</co
7b20: 64 65 3e 3c 2f 70 72 65 3e 0a 0a 3c 68 72 3e 0a  de></pre>..<hr>.
7b30: 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 48 54  .<h3><a name="HT
7b40: 54 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54 54  TPS EXAMPLE">HTT
7b50: 50 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f  PS EXAMPLE</a></
7b60: 68 33 3e 0a 0a 3c 70 3e 54 68 65 73 65 20 65 78  h3>..<p>These ex
7b70: 61 6d 70 6c 65 73 20 75 73 65 20 74 68 65 20 64  amples use the d
7b80: 65 66 61 75 6c 74 20 55 6e 69 78 20 70 6c 61 74  efault Unix plat
7b90: 66 6f 72 6d 20 53 53 4c 20 63 65 72 74 69 66 69  form SSL certifi
7ba0: 63 61 74 65 73 2e 20 46 6f 72 20 73 74 61 6e 64  cates. For stand
7bb0: 61 72 64 0a 69 6e 73 74 61 6c 6c 61 74 69 6f 6e  ard.installation
7bc0: 73 2c 20 2d 63 61 64 69 72 20 61 6e 64 20 2d 63  s, -cadir and -c
7bd0: 61 66 69 6c 65 20 73 68 6f 75 6c 64 20 6e 6f 74  afile should not
7be0: 20 62 65 20 6e 65 65 64 65 64 2e 20 49 66 20 79   be needed. If y
7bf0: 6f 75 72 20 63 65 72 74 69 66 69 63 61 74 65 73  our certificates
7c00: 0a 61 72 65 20 69 6e 20 6e 6f 6e 2d 73 74 61 6e  .are in non-stan
7c10: 64 61 72 64 20 6c 6f 63 61 74 69 6f 6e 73 2c 20  dard locations, 
7c20: 75 70 64 61 74 65 20 2d 63 61 64 69 72 20 6f 72  update -cadir or
7c30: 20 75 73 65 20 2d 63 61 66 69 6c 65 20 61 73 20   use -cafile as 
7c40: 6e 65 65 64 65 64 2e 3c 2f 70 3e 0a 0a 3c 70 3e  needed.</p>..<p>
7c50: 45 78 61 6d 70 6c 65 20 23 31 3a 20 47 65 74 20  Example #1: Get 
7c60: 77 65 62 20 70 61 67 65 3c 2f 70 3e 0a 3c 70 72  web page</p>.<pr
7c70: 65 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65  e><code>.package
7c80: 20 72 65 71 75 69 72 65 20 68 74 74 70 0a 70 61   require http.pa
7c90: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c  ckage require tl
7ca0: 73 0a 73 65 74 20 75 72 6c 20 22 68 74 74 70 73  s.set url "https
7cb0: 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 6b 2f 22 0a  ://www.tcl.tk/".
7cc0: 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20  .http::register 
7cd0: 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20  https 443 [list 
7ce0: 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61  ::tls::socket -a
7cf0: 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72  utoservername tr
7d00: 75 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 65  ue -require true
7d10: 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c   -cadir /etc/ssl
7d20: 2f 63 65 72 74 73 5d 0a 0a 23 20 43 68 65 63 6b  /certs]..# Check
7d30: 20 66 6f 72 20 65 72 72 6f 72 0a 73 65 74 20 74   for error.set t
7d40: 6f 6b 65 6e 20 5b 68 74 74 70 3a 3a 67 65 74 75  oken [http::getu
7d50: 72 6c 20 24 75 72 6c 5d 0a 69 66 20 7b 5b 68 74  rl $url].if {[ht
7d60: 74 70 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65  tp::status $toke
7d70: 6e 5d 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a 20 20  n] ne "ok"} {.  
7d80: 20 20 70 75 74 73 20 5b 66 6f 72 6d 61 74 20 22    puts [format "
7d90: 45 72 72 6f 72 20 25 73 22 20 5b 68 74 74 70 3a  Error %s" [http:
7da0: 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d 5d  :status $token]]
7db0: 0a 7d 0a 0a 23 20 47 65 74 20 77 65 62 20 70 61  .}..# Get web pa
7dc0: 67 65 0a 73 65 74 20 64 61 74 61 20 5b 68 74 74  ge.set data [htt
7dd0: 70 3a 3a 64 61 74 61 20 24 74 6f 6b 65 6e 5d 0a  p::data $token].
7de0: 70 75 74 73 20 24 64 61 74 61 0a 0a 23 20 43 6c  puts $data..# Cl
7df0: 65 61 6e 75 70 0a 3a 3a 68 74 74 70 3a 3a 63 6c  eanup.::http::cl
7e00: 65 61 6e 75 70 20 24 74 6f 6b 65 6e 0a 3c 2f 63  eanup $token.</c
7e10: 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 3c 70 3e 45  ode></pre>..<p>E
7e20: 78 61 6d 70 6c 65 20 23 32 3a 20 44 6f 77 6e 6c  xample #2: Downl
7e30: 6f 61 64 20 66 69 6c 65 3c 2f 70 3e 0a 3c 70 72  oad file</p>.<pr
7e40: 65 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65  e><code>.package
7e50: 20 72 65 71 75 69 72 65 20 68 74 74 70 0a 70 61   require http.pa
7e60: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c  ckage require tl
7e70: 73 0a 0a 73 65 74 20 75 72 6c 20 22 68 74 74 70  s..set url "http
7e80: 73 3a 2f 2f 77 69 6b 69 2e 74 63 6c 2d 6c 61 6e  s://wiki.tcl-lan
7e90: 67 2e 6f 72 67 2f 73 69 74 65 6d 61 70 2e 78 6d  g.org/sitemap.xm
7ea0: 6c 22 0a 73 65 74 20 66 69 6c 65 6e 61 6d 65 20  l".set filename 
7eb0: 5b 66 69 6c 65 20 74 61 69 6c 20 24 75 72 6c 5d  [file tail $url]
7ec0: 0a 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72  ..http::register
7ed0: 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74   https 443 [list
7ee0: 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d   ::tls::socket -
7ef0: 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74  autoservername t
7f00: 72 75 65 20 2d 72 65 71 75 69 72 65 20 74 72 75  rue -require tru
7f10: 65 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73  e -cadir /etc/ss
7f20: 6c 2f 63 65 72 74 73 5d 0a 0a 23 20 47 65 74 20  l/certs]..# Get 
7f30: 66 69 6c 65 0a 73 65 74 20 63 68 20 5b 6f 70 65  file.set ch [ope
7f40: 6e 20 24 66 69 6c 65 6e 61 6d 65 20 77 62 5d 0a  n $filename wb].
7f50: 73 65 74 20 74 6f 6b 65 6e 20 5b 3a 3a 68 74 74  set token [::htt
7f60: 70 3a 3a 67 65 74 75 72 6c 20 24 75 72 6c 20 2d  p::geturl $url -
7f70: 62 6c 6f 63 6b 73 69 7a 65 20 36 35 35 33 36 20  blocksize 65536 
7f80: 2d 63 68 61 6e 6e 65 6c 20 24 63 68 5d 0a 0a 23  -channel $ch]..#
7f90: 20 43 6c 65 61 6e 75 70 0a 63 6c 6f 73 65 20 24   Cleanup.close $
7fa0: 63 68 0a 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e  ch.::http::clean
7fb0: 75 70 20 24 74 6f 6b 65 6e 0a 3c 2f 63 6f 64 65  up $token.</code
7fc0: 3e 3c 2f 70 72 65 3e 0a 0a 3c 68 72 3e 0a 0a 3c  ></pre>..<hr>..<
7fd0: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 50 45 43  h3><a name="SPEC
7fe0: 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f  IAL CONSIDERATIO
7ff0: 4e 53 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53  NS">SPECIAL CONS
8000: 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f  IDERATIONS</a></
8010: 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 63 61 70 61  h3>..<p>The capa
8020: 62 69 6c 69 74 69 65 73 20 6f 66 20 74 68 69 73  bilities of this
8030: 20 70 61 63 6b 61 67 65 20 63 61 6e 20 76 61 72   package can var
8040: 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 62 61 73  y enormously bas
8050: 65 64 20 75 70 6f 6e 20 68 6f 77 20 74 68 65 0a  ed upon how the.
8060: 6c 69 6e 6b 65 64 20 74 6f 20 4f 70 65 6e 53 53  linked to OpenSS
8070: 4c 20 6c 69 62 72 61 72 79 20 77 61 73 20 63 6f  L library was co
8080: 6e 66 69 67 75 72 65 64 20 61 6e 64 20 62 75 69  nfigured and bui
8090: 6c 74 2e 20 4e 65 77 20 76 65 72 73 69 6f 6e 73  lt. New versions
80a0: 20 6d 61 79 20 6f 62 73 6f 6c 65 74 65 0a 6f 6c   may obsolete.ol
80b0: 64 65 72 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72  der protocol ver
80c0: 73 69 6f 6e 73 2c 20 61 64 64 20 6f 72 20 72 65  sions, add or re
80d0: 6d 6f 76 65 20 63 69 70 68 65 72 73 2c 20 63 68  move ciphers, ch
80e0: 61 6e 67 65 20 64 65 66 61 75 6c 74 20 76 61 6c  ange default val
80f0: 75 65 73 2c 20 65 74 63 2e 0a 55 73 65 20 74 68  ues, etc..Use th
8100: 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70  e <strong>tls::p
8110: 72 6f 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67  rotocols</strong
8120: 3e 20 63 6f 6d 6d 61 6e 64 73 20 74 6f 20 6f 62  > commands to ob
8130: 74 61 69 6e 20 74 68 65 20 73 75 70 70 6f 72 74  tain the support
8140: 65 64 0a 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73  ed.protocol vers
8150: 69 6f 6e 73 2e 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a  ions.</p>..<hr>.
8160: 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45  .<h3><a name="SE
8170: 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f  E ALSO">SEE ALSO
8180: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73  </a></h3>..<p><s
8190: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74  trong>socket</st
81a0: 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66  rong>, <strong>f
81b0: 69 6c 65 65 76 65 6e 74 3c 2f 73 74 72 6f 6e 67  ileevent</strong
81c0: 3e 2c 20 3c 73 74 72 6f 6e 67 3e 68 74 74 70 3c  >, <strong>http<
81d0: 2f 73 74 72 6f 6e 67 3e 2c 0a 3c 61 20 68 72 65  /strong>,.<a hre
81e0: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 6f  f="https://www.o
81f0: 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 3c 73 74  penssl.org/"><st
8200: 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74  rong>OpenSSL</st
8210: 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70 3e 0a 0a 3c  rong></a></p>..<
8220: 68 72 3e 0a 0a 3c 70 72 65 3e 0a 43 6f 70 79 72  hr>..<pre>.Copyr
8230: 69 67 68 74 20 26 63 6f 70 79 3b 20 31 39 39 39  ight © 1999
8240: 20 4d 61 74 74 20 4e 65 77 6d 61 6e 2e 0a 43 6f   Matt Newman..Co
8250: 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b 20 32  pyright © 2
8260: 30 30 34 20 53 74 61 72 66 69 73 68 20 53 79 73  004 Starfish Sys
8270: 74 65 6d 73 2e 0a 43 6f 70 79 72 69 67 68 74 20  tems..Copyright 
8280: 26 63 6f 70 79 3b 20 32 30 32 33 20 42 72 69 61  © 2023 Bria
8290: 6e 20 4f 27 48 61 67 61 6e 2e 0a 3c 2f 70 72 65  n O'Hagan..</pre
82a0: 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c  >.</body>.</html
82b0: 3e 0a                                            >.