Hex Artifact Content

Artifact 4994e38911bb0f452836bc87ef511edcdf295888a55b0e43278cb7872368e06b:


0000: 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 20 70  <!doctype html p
0010: 75 62 6c 69 63 20 22 2d 2f 2f 57 33 43 2f 2f 44  ublic "-//W3C//D
0020: 54 44 20 48 54 4d 4c 20 34 2e 30 20 54 72 61 6e  TD HTML 4.0 Tran
0030: 73 69 74 69 6f 6e 61 6c 2f 2f 45 4e 22 3e 0a 0a  sitional//EN">..
0040: 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a 3c  <html>..<head>.<
0050: 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d  meta http-equiv=
0060: 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a 63  "Content-Type".c
0070: 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 6d  ontent="text/htm
0080: 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d 38  l; charset=iso-8
0090: 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e 61  859-1">.<meta na
00a0: 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20 63  me="Copyright" c
00b0: 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61 74  ontent="1999 Mat
00c0: 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34 20  t Newman / 2004 
00d0: 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d 73  Starfish Systems
00e0: 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28 53  ">.<title>TLS (S
00f0: 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64 73  SL) Tcl Commands
0100: 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 3e  </title>.</head>
0110: 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72 3d  ..<body bgcolor=
0120: 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c 3e  "#FFFFFF">..<dl>
0130: 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66  .    <dd><a href
0140: 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61  ="#NAME">NAME</a
0150: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20  >.    <dl>.     
0160: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3c 2f 62     <dd><b>tls</b
0170: 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c  > - binding to <
0180: 62 3e 4f 70 65 6e 53 53 4c 3c 2f 62 3e 20 74 6f  b>OpenSSL</b> to
0190: 6f 6c 6b 69 74 2e 3c 2f 64 64 3e 0a 20 20 20 20  olkit.</dd>.    
01a0: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a  </dl>.    </dd>.
01b0: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
01c0: 22 23 53 59 4e 4f 50 53 49 53 22 3e 53 59 4e 4f  "#SYNOPSIS">SYNO
01d0: 50 53 49 53 3c 2f 61 3e 20 3c 2f 64 64 3e 0a 20  PSIS</a> </dd>. 
01e0: 20 20 20 3c 64 64 3e 3c 64 6c 3e 0a 20 20 20 20     <dd><dl>.    
01f0: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 70          <dd><b>p
0200: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 54  ackage require T
0210: 63 6c 3c 2f 62 3e 20 3c 65 6d 3e 3f 38 2e 34 3f  cl</b> <em>?8.4?
0220: 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20  </em></dd>.     
0230: 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 70 61         <dd><b>pa
0240: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c  ckage require tl
0250: 73 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20 20 20  s</b></dd>.     
0260: 20 20 20 20 20 20 20 3c 64 74 3e 26 6e 62 73 70         <dt>&nbsp
0270: 3b 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 20  ;</dt>.         
0280: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69     <dd><b>tls::i
0290: 6e 69 74 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f 70 74  nit</b> <em>?opt
02a0: 69 6f 6e 73 3f 3c 2f 65 6d 3e 20 3c 2f 64 64 3e  ions?</em> </dd>
02b0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64  .            <dd
02c0: 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c  ><b>tls::socket<
02d0: 2f 62 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73  /b> <em>?options
02e0: 3f 20 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e  ? host port</em>
02f0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20  </dd>.          
0300: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f    <dd><b>tls::so
0310: 63 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e 20 3f 2d  cket</b> <em> ?-
0320: 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20  server command? 
0330: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f  ?options? port</
0340: 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  em></dd>.       
0350: 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a       <dd><b>tls:
0360: 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e 20 3c  :handshake</b> <
0370: 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e  em> channel</em>
0380: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20  </dd>.          
0390: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 74    <dd><b>tls::st
03a0: 61 74 75 73 20 3c 2f 62 3e 20 3c 65 6d 3e 3f 2d  atus </b> <em>?-
03b0: 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f  local? channel</
03c0: 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  em></dd>.       
03d0: 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a       <dd><b>tls:
03e0: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 20 3c 2f 62 3e  :connection </b>
03f0: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d   <em>channel</em
0400: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20  ></dd>.         
0410: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69     <dd><b>tls::i
0420: 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63 68  mport</b> <em>ch
0430: 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c  annel ?options?<
0440: 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  /em></dd>.      
0450: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73        <dd><b>tls
0460: 3a 3a 75 6e 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c  ::unimport</b> <
0470: 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c  em>channel</em><
0480: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20  /dd>.           
0490: 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e   <dt>&nbsp;</dt>
04a0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64  .            <dd
04b0: 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73  ><b>tls::ciphers
04c0: 20 3c 2f 62 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63   </b> <em>protoc
04d0: 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75  ol ?verbose? ?su
04e0: 70 70 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 64  pported?</em></d
04f0: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  d>.            <
0500: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 70 72 6f 74 6f  dd><b>tls::proto
0510: 63 6f 6c 73 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20  cols</b></dd>.  
0520: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62            <dd><b
0530: 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 62  >tls::version</b
0540: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  ></dd>.        <
0550: 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 20  /dl>.    </dd>. 
0560: 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22     <dd><a href="
0570: 23 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41  #COMMANDS">COMMA
0580: 4e 44 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20  NDS</a></dd>.   
0590: 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 43   <dd><a href="#C
05a0: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22  ALLBACK OPTIONS"
05b0: 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  >CALLBACK OPTION
05c0: 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c  S</a></dd>.    <
05d0: 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 48 54 54  dd><a href="#HTT
05e0: 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54 54 50  PS EXAMPLE">HTTP
05f0: 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 64  S EXAMPLE</a></d
0600: 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72  d>.    <dd><a hr
0610: 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e 53  ef="#SEE ALSO">S
0620: 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41  PECIAL CONSIDERA
0630: 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20  TIONS</a></dd>. 
0640: 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22     <dd><a href="
0650: 23 53 45 45 20 41 4c 53 4f 22 3e 53 45 45 20 41  #SEE ALSO">SEE A
0660: 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 3e 0a 3c 2f 64  LSO</a></dd>.</d
0670: 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61  l>..<hr>..<h3><a
0680: 20 6e 61 6d 65 3d 22 4e 41 4d 45 22 3e 4e 41 4d   name="NAME">NAM
0690: 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c  E</a></h3>..<p><
06a0: 73 74 72 6f 6e 67 3e 74 6c 73 3c 2f 73 74 72 6f  strong>tls</stro
06b0: 6e 67 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f  ng> - binding to
06c0: 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c   <strong>OpenSSL
06d0: 3c 2f 73 74 72 6f 6e 67 3e 0a 74 6f 6f 6c 6b 69  </strong>.toolki
06e0: 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e  t.</p>..<h3><a n
06f0: 61 6d 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53  ame="SYNOPSIS">S
0700: 59 4e 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e  YNOPSIS</a></h3>
0710: 0a 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20  ..<p><b>package 
0720: 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 34 3c  require Tcl 8.4<
0730: 2f 62 3e 3c 62 72 3e 0a 3c 62 3e 70 61 63 6b 61  /b><br>.<b>packa
0740: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f  ge require tls</
0750: 62 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68  b><br>.<br>.<a h
0760: 72 65 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22  ref="#tls::init"
0770: 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f 62  ><b>tls::init</b
0780: 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f  > <i>?options?</
0790: 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72  i></a><br>.<a hr
07a0: 65 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74  ef="#tls::socket
07b0: 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74  "><b>tls::socket
07c0: 3c 2f 62 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73  </b> <i>?options
07d0: 3f 20 68 6f 73 74 20 70 6f 72 74 3c 2f 69 3e 3c  ? host port</i><
07e0: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
07f0: 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c  s::socket"><b>tl
0800: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 69  s::socket</b> <i
0810: 3e 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e  >?-server comman
0820: 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72  d? ?options? por
0830: 74 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61  t</i></a><br>.<a
0840: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61   href="#tls::sta
0850: 74 75 73 22 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61  tus"><b>tls::sta
0860: 74 75 73 3c 2f 62 3e 20 3c 69 3e 3f 2d 6c 6f 63  tus</b> <i>?-loc
0870: 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c  al? channel</i><
0880: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d  /a><br>.<a href=
0890: 22 23 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f  "#tls::connectio
08a0: 6e 22 3e 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e 65  n"><b>tls::conne
08b0: 63 74 69 6f 6e 3c 2f 62 3e 20 3c 69 3e 63 68 61  ction</b> <i>cha
08c0: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e  nnel</i></a><br>
08d0: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
08e0: 68 61 6e 64 73 68 61 6b 65 22 3e 3c 62 3e 74 6c  handshake"><b>tl
08f0: 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e  s::handshake</b>
0900: 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c   <i>channel</i><
0910: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d  /a><br>.<a href=
0920: 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c  "#tls::import"><
0930: 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62  b>tls::import</b
0940: 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70  > <i>channel ?op
0950: 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62  tions?</i></a><b
0960: 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73  r>.<a href="#tls
0970: 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e 74  ::unimport"><b>t
0980: 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 3c 2f 62 3e  ls::unimport</b>
0990: 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c   <i>channel</i><
09a0: 2f 61 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20  /a><br>.<br>.<a 
09b0: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 63 69 70 68  href="#tls::ciph
09c0: 65 72 73 22 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70  ers"><b>tls::cip
09d0: 68 65 72 73 3c 2f 62 3e 20 3c 69 3e 70 72 6f 74  hers</b> <i>prot
09e0: 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 20 3f  ocol ?verbose? ?
09f0: 73 75 70 70 6f 72 74 65 64 3f 3c 2f 69 3e 3c 2f  supported?</i></
0a00: 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22  a><br>.<a href="
0a10: 23 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22  #tls::protocols"
0a20: 3e 3c 62 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f  ><b>tls::protoco
0a30: 6c 73 3c 2f 62 3e 3c 2f 61 3e 0a 3c 61 20 68 72  ls</b></a>.<a hr
0a40: 65 66 3d 22 23 74 6c 73 3a 3a 76 65 72 73 69 6f  ef="#tls::versio
0a50: 6e 22 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69  n"><b>tls::versi
0a60: 6f 6e 3c 2f 62 3e 3c 2f 61 3e 0a 3c 2f 70 3e 0a  on</b></a>.</p>.
0a70: 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45  .<h3><a name="DE
0a80: 53 43 52 49 50 54 49 4f 4e 22 3e 44 45 53 43 52  SCRIPTION">DESCR
0a90: 49 50 54 49 4f 4e 3c 2f 61 3e 3c 2f 68 33 3e 0a  IPTION</a></h3>.
0aa0: 0a 3c 70 3e 54 68 69 73 20 65 78 74 65 6e 73 69  .<p>This extensi
0ab0: 6f 6e 20 70 72 6f 76 69 64 65 73 20 61 20 67 65  on provides a ge
0ac0: 6e 65 72 69 63 20 62 69 6e 64 69 6e 67 20 74 6f  neric binding to
0ad0: 20 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f   <a.href="http:/
0ae0: 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67  /www.openssl.org
0af0: 2f 22 3e 4f 70 65 6e 53 53 4c 3c 2f 61 3e 2c 20  /">OpenSSL</a>, 
0b00: 75 74 69 6c 69 7a 69 6e 67 20 74 68 65 0a 3c 73  utilizing the.<s
0b10: 74 72 6f 6e 67 3e 54 63 6c 5f 53 74 61 63 6b 43  trong>Tcl_StackC
0b20: 68 61 6e 6e 65 6c 3c 2f 73 74 72 6f 6e 67 3e 0a  hannel</strong>.
0b30: 41 50 49 20 66 6f 72 20 54 63 6c 20 38 2e 34 20  API for Tcl 8.4 
0b40: 61 6e 64 20 68 69 67 68 65 72 2e 20 54 68 65 20  and higher. The 
0b50: 73 6f 63 6b 65 74 73 20 62 65 68 61 76 65 20 65  sockets behave e
0b60: 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 0a  xactly the same.
0b70: 61 73 20 63 68 61 6e 6e 65 6c 73 20 63 72 65 61  as channels crea
0b80: 74 65 64 20 75 73 69 6e 67 20 54 63 6c 27 73 20  ted using Tcl's 
0b90: 62 75 69 6c 74 2d 69 6e 20 3c 73 74 72 6f 6e 67  built-in <strong
0ba0: 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e  >socket</strong>
0bb0: 0a 63 6f 6d 6d 61 6e 64 20 77 69 74 68 20 61 64  .command with ad
0bc0: 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73  ditional options
0bd0: 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67   for controlling
0be0: 20 74 68 65 20 53 53 4c 20 73 65 73 73 69 6f 6e   the SSL session
0bf0: 2e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e  ..</p>..<h3><a n
0c00: 61 6d 65 3d 22 43 4f 4d 4d 41 4e 44 53 22 3e 43  ame="COMMANDS">C
0c10: 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 68 33 3e  OMMANDS</a></h3>
0c20: 0a 0a 3c 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f  ..<p>Typically o
0c30: 6e 65 20 77 6f 75 6c 64 20 75 73 65 20 74 68 65  ne would use the
0c40: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f   <strong>tls::so
0c50: 63 6b 65 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f  cket </strong>co
0c60: 6d 6d 61 6e 64 0a 77 68 69 63 68 20 70 72 6f 76  mmand.which prov
0c70: 69 64 65 73 20 63 6f 6d 70 61 74 69 62 69 6c 69  ides compatibili
0c80: 74 79 20 77 69 74 68 20 74 68 65 20 6e 61 74 69  ty with the nati
0c90: 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73  ve Tcl <strong>s
0ca0: 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63  ocket</strong>.c
0cb0: 6f 6d 6d 61 6e 64 2e 20 49 6e 20 73 75 63 68 20  ommand. In such 
0cc0: 63 61 73 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c  cases <strong>tl
0cd0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e  s::import</stron
0ce0: 67 3e 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65  g> should not be
0cf0: 0a 75 73 65 64 20 64 69 72 65 63 74 6c 79 2e 3c  .used directly.<
0d00: 2f 70 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64  /p>..<dl>.    <d
0d10: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
0d20: 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e  init"><b>tls::in
0d30: 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f  it </b><i>?optio
0d40: 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e  ns?</i></a></dt>
0d50: 0a 20 20 20 20 3c 64 64 3e 4f 70 74 69 6f 6e 61  .    <dd>Optiona
0d60: 6c 20 66 75 6e 63 74 69 6f 6e 20 74 6f 20 73 65  l function to se
0d70: 74 20 74 68 65 20 64 65 66 61 75 6c 74 20 6f 70  t the default op
0d80: 74 69 6f 6e 73 20 75 73 65 64 20 62 79 0a 09 3c  tions used by..<
0d90: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b  strong>tls::sock
0da0: 65 74 3c 2f 73 74 72 6f 6e 67 3e 2e 20 49 66 20  et</strong>. If 
0db0: 79 6f 75 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67  you call <strong
0dc0: 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74  >tls::import</st
0dd0: 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 64 69  rong>.        di
0de0: 72 65 63 74 6c 79 20 74 68 69 73 20 72 6f 75 74  rectly this rout
0df0: 69 6e 65 20 68 61 73 20 6e 6f 20 65 66 66 65 63  ine has no effec
0e00: 74 2e 20 41 6e 79 20 6f 66 20 74 68 65 20 6f 70  t. Any of the op
0e10: 74 69 6f 6e 73 0a 20 20 20 20 20 20 20 20 74 68  tions.        th
0e20: 61 74 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  at <strong>tls::
0e30: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20  socket</strong> 
0e40: 61 63 63 65 70 74 73 20 63 61 6e 20 62 65 20 73  accepts can be s
0e50: 65 74 0a 20 20 20 20 20 20 20 20 75 73 69 6e 67  et.        using
0e60: 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c 20 74   this command, t
0e70: 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75 6c 64  hough you should
0e80: 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70 74 69   limit your opti
0e90: 6f 6e 73 0a 20 20 20 20 20 20 20 20 74 6f 20 6f  ons.        to o
0ea0: 6e 6c 79 20 54 4c 53 20 72 65 6c 61 74 65 64 20  nly TLS related 
0eb0: 6f 6e 65 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c  ones.</dd>.    <
0ec0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20  dt>&nbsp;</dt>. 
0ed0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22     <dt><a name="
0ee0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e  tls::socket"><b>
0ef0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e  tls::socket </b>
0f00: 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 0a 20 20  <em>?options?.  
0f10: 20 20 20 20 20 20 68 6f 73 74 20 70 6f 72 74 3c        host port<
0f20: 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20  /em></a></dt>.  
0f30: 20 20 3c 64 74 3e 3c 62 3e 74 6c 73 3a 3a 73 6f    <dt><b>tls::so
0f40: 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73  cket</b><em> ?-s
0f50: 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f  erver command? ?
0f60: 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65  options? port</e
0f70: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  m></dt>.    <dd>
0f80: 54 68 69 73 20 69 73 20 61 20 68 65 6c 70 65 72  This is a helper
0f90: 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20 75   function that u
0fa0: 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e 64 65  tilizes the unde
0fb0: 72 6c 79 69 6e 67 0a 20 20 20 20 20 20 20 20 63  rlying.        c
0fc0: 6f 6d 6d 61 6e 64 73 20 28 3c 73 74 72 6f 6e 67  ommands (<strong
0fd0: 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74  >tls::import</st
0fe0: 72 6f 6e 67 3e 29 2e 20 49 74 20 62 65 68 61 76  rong>). It behav
0ff0: 65 73 0a 20 20 20 20 20 20 20 20 65 78 61 63 74  es.        exact
1000: 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 20 74  ly the same as t
1010: 68 65 20 6e 61 74 69 76 65 20 54 63 6c 20 3c 73  he native Tcl <s
1020: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74  trong>socket</st
1030: 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 63 6f  rong>.        co
1040: 6d 6d 61 6e 64 20 65 78 63 65 70 74 20 74 68 61  mmand except tha
1050: 74 20 74 68 65 20 6f 70 74 69 6f 6e 73 20 63 61  t the options ca
1060: 6e 20 69 6e 63 6c 75 64 65 20 61 6e 79 20 6f 66  n include any of
1070: 20 74 68 65 0a 20 20 20 20 20 20 20 20 61 70 70   the.        app
1080: 6c 69 63 61 62 6c 65 20 3c 61 20 68 72 65 66 3d  licable <a href=
1090: 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c  "#tls::import"><
10a0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 69 6d 70 6f 72  strong>tls:impor
10b0: 74 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 0a 20  t</strong></a>. 
10c0: 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 20 77         options w
10d0: 69 74 68 20 6f 6e 65 20 61 64 64 69 74 69 6f 6e  ith one addition
10e0: 61 6c 20 6f 70 74 69 6f 6e 3a 0a 3c 62 6c 6f 63  al option:.<bloc
10f0: 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c 3e  kquote>.    <dl>
1100: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1110: 72 6f 6e 67 3e 2d 61 75 74 6f 73 65 72 76 65 72  rong>-autoserver
1120: 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  name</strong> <e
1130: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e  m>bool</em></dt>
1140: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 41 75 74  .        <dd>Aut
1150: 6f 6d 61 74 69 63 61 6c 6c 79 20 73 65 6e 64 20  omatically send 
1160: 74 68 65 20 2d 73 65 72 76 65 72 6e 61 6d 65 20  the -servername 
1170: 61 73 20 74 68 65 20 3c 65 6d 3e 68 6f 73 74 3c  as the <em>host<
1180: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 0a 20 20  /em> argument.  
1190: 20 20 20 20 20 20 20 20 20 20 28 64 65 66 61 75            (defau
11a0: 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c  lt is <em>false<
11b0: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 3c  /em>)</dd>.    <
11c0: 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74  /dl>.</blockquot
11d0: 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e  e>..    <dt><a n
11e0: 61 6d 65 3d 22 74 6c 73 3a 3a 69 6d 70 6f 72 74  ame="tls::import
11f0: 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74  "><b>tls::import
1200: 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0a   </b><i>channel.
1210: 20 20 20 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73          ?options
1220: 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20  ?</i></a></dt>. 
1230: 20 20 20 3c 64 64 3e 53 53 4c 2d 65 6e 61 62 6c     <dd>SSL-enabl
1240: 65 20 61 20 72 65 67 75 6c 61 72 20 54 63 6c 20  e a regular Tcl 
1250: 63 68 61 6e 6e 65 6c 20 2d 20 69 74 20 6e 65 65  channel - it nee
1260: 64 20 6e 6f 74 20 62 65 20 61 0a 20 20 20 20 20  d not be a.     
1270: 20 20 20 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d     socket, but m
1280: 75 73 74 20 70 72 6f 76 69 64 65 20 62 69 2d 64  ust provide bi-d
1290: 69 72 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e  irectional flow.
12a0: 20 41 6c 73 6f 0a 20 20 20 20 20 20 20 20 73 65   Also.        se
12b0: 74 74 69 6e 67 20 73 65 73 73 69 6f 6e 20 70 61  tting session pa
12c0: 72 61 6d 65 74 65 72 73 20 66 6f 72 20 53 53 4c  rameters for SSL
12d0: 20 68 61 6e 64 73 68 61 6b 65 2e 3c 2f 64 64 3e   handshake.</dd>
12e0: 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20  ..<blockquote>. 
12f0: 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20     <dl>.        
1300: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 6c 70  <dt><strong>-alp
1310: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c  n</strong> <em>l
1320: 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ist</em></dt>.  
1330: 20 20 20 20 20 20 3c 64 64 3e 4c 69 73 74 20 6f        <dd>List o
1340: 66 20 70 72 6f 74 6f 63 6f 6c 73 20 74 6f 20 6f  f protocols to o
1350: 66 66 65 72 20 64 75 72 69 6e 67 20 41 70 70 6c  ffer during Appl
1360: 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 0a 09 20  ication-Layer.. 
1370: 20 20 20 50 72 6f 74 6f 63 6f 6c 20 4e 65 67 6f     Protocol Nego
1380: 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 20  tiation (ALPN). 
1390: 46 6f 72 20 65 78 61 6d 70 6c 65 3a 20 68 32 2c  For example: h2,
13a0: 20 68 74 74 70 2f 31 2e 31 2c 20 65 74 63 2e 3c   http/1.1, etc.<
13b0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
13c0: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c  ><strong>-cadir<
13d0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72  /strong> <em>dir
13e0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
13f0: 20 20 20 3c 64 64 3e 53 70 65 63 69 66 79 20 74     <dd>Specify t
1400: 68 65 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e  he directory con
1410: 74 61 69 6e 69 6e 67 20 74 68 65 20 43 41 20 63  taining the CA c
1420: 65 72 74 69 66 69 63 61 74 65 73 2e 20 54 68 65  ertificates. The
1430: 0a 09 20 20 20 20 64 65 66 61 75 6c 74 20 64 69  ..    default di
1440: 72 65 63 74 6f 72 79 20 69 73 20 70 6c 61 74 66  rectory is platf
1450: 6f 72 6d 20 73 70 65 63 69 66 69 63 20 61 6e 64  orm specific and
1460: 20 63 61 6e 20 62 65 20 73 65 74 20 61 74 0a 09   can be set at..
1470: 20 20 20 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65      compile time
1480: 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 6f 76  . This can be ov
1490: 65 72 72 69 64 64 65 6e 20 76 69 61 20 74 68 65  erridden via the
14a0: 20 3c 62 3e 53 53 4c 5f 43 45 52 54 5f 44 49 52   <b>SSL_CERT_DIR
14b0: 3c 2f 62 3e 0a 09 20 20 20 20 65 6e 76 69 72 6f  </b>..    enviro
14c0: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 2e 3c  nment variable.<
14d0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
14e0: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65  ><strong>-cafile
14f0: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69   </strong><em>fi
1500: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e  lename</em></dt>
1510: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 65  .        <dd>Spe
1520: 63 69 66 79 20 74 68 65 20 63 65 72 74 69 66 69  cify the certifi
1530: 63 61 74 65 20 61 75 74 68 6f 72 69 74 79 20 28  cate authority (
1540: 43 41 29 20 66 69 6c 65 20 74 6f 20 75 73 65 2e  CA) file to use.
1550: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
1560: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 66  t><strong>-certf
1570: 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ile</strong> <em
1580: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1590: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
15a0: 53 70 65 63 69 66 79 20 74 68 65 20 66 69 6c 65  Specify the file
15b0: 6e 61 6d 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20  name containing 
15c0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20  the certificate 
15d0: 74 6f 20 75 73 65 2e 20 54 68 65 0a 09 20 20 20  to use. The..   
15e0: 20 64 65 66 61 75 6c 74 20 6e 61 6d 65 20 69 73   default name is
15f0: 20 3c 62 3e 63 65 72 74 2e 70 65 6d 3c 2f 62 3e   <b>cert.pem</b>
1600: 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 6f 76  . This can be ov
1610: 65 72 72 69 64 64 65 6e 20 76 69 61 0a 09 20 20  erridden via..  
1620: 20 20 74 68 65 20 3c 62 3e 53 53 4c 5f 43 45 52    the <b>SSL_CER
1630: 54 5f 46 49 4c 45 3c 2f 62 3e 20 65 6e 76 69 72  T_FILE</b> envir
1640: 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 2e  onment variable.
1650: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
1660: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 3c  t><strong>-cert<
1670: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c  /strong> <em>fil
1680: 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  ename</em></dt>.
1690: 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 65 63          <dd>Spec
16a0: 69 66 79 20 74 68 65 20 63 6f 6e 74 65 6e 74 73  ify the contents
16b0: 20 6f 66 20 61 20 63 65 72 74 69 66 69 63 61 74   of a certificat
16c0: 65 20 74 6f 20 75 73 65 2c 20 61 73 20 61 20 44  e to use, as a D
16d0: 45 52 0a 09 20 20 20 20 65 6e 63 6f 64 65 64 20  ER..    encoded 
16e0: 62 69 6e 61 72 79 20 76 61 6c 75 65 20 28 58 2e  binary value (X.
16f0: 35 30 39 20 44 45 52 29 2e 3c 2f 64 64 3e 0a 20  509 DER).</dd>. 
1700: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
1710: 6e 67 3e 2d 63 69 70 68 65 72 3c 2f 73 74 72 6f  ng>-cipher</stro
1720: 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f  ng> <em>string</
1730: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
1740: 20 3c 64 64 3e 4c 69 73 74 20 6f 66 20 63 69 70   <dd>List of cip
1750: 68 65 72 73 20 74 6f 20 75 73 65 2e 20 53 74 72  hers to use. Str
1760: 69 6e 67 20 69 73 20 61 20 63 6f 6c 6f 6e 20 28  ing is a colon (
1770: 22 3a 22 29 20 73 65 70 61 72 61 74 65 64 20 6c  ":") separated l
1780: 69 73 74 0a 09 20 20 20 20 6f 66 20 63 69 70 68  ist..    of ciph
1790: 65 72 73 20 6f 72 20 63 69 70 68 65 72 20 73 75  ers or cipher su
17a0: 69 74 65 73 2e 20 43 69 70 68 65 72 20 73 75 69  ites. Cipher sui
17b0: 74 65 73 20 63 61 6e 20 62 65 20 63 6f 6d 62 69  tes can be combi
17c0: 6e 65 64 0a 09 20 20 20 20 75 73 69 6e 67 20 74  ned..    using t
17d0: 68 65 20 3c 62 3e 2b 3c 2f 62 3e 20 63 68 61 72  he <b>+</b> char
17e0: 61 63 74 65 72 2e 20 50 72 65 66 69 78 65 73 20  acter. Prefixes 
17f0: 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 70  can be used to p
1800: 65 72 6d 61 6e 65 6e 74 6c 79 0a 09 20 20 20 20  ermanently..    
1810: 72 65 6d 6f 76 65 20 28 22 21 22 29 2c 20 64 65  remove ("!"), de
1820: 6c 65 74 65 20 28 22 2d 22 29 2c 20 6f 72 20 6d  lete ("-"), or m
1830: 6f 76 65 20 61 20 63 79 70 68 65 72 20 74 6f 20  ove a cypher to 
1840: 74 68 65 20 65 6e 64 20 6f 66 0a 09 20 20 20 20  the end of..    
1850: 74 68 65 20 6c 69 73 74 20 28 22 2b 22 29 2e 20  the list ("+"). 
1860: 4b 65 79 77 6f 72 64 73 20 3c 62 3e 40 53 54 52  Keywords <b>@STR
1870: 45 4e 47 54 48 3c 2f 62 3e 20 28 73 6f 72 74 20  ENGTH</b> (sort 
1880: 62 79 20 61 6c 67 6f 72 69 74 68 6d 0a 09 20 20  by algorithm..  
1890: 20 20 6b 65 79 20 6c 65 6e 67 74 68 29 2c 20 3c    key length), <
18a0: 62 3e 40 53 45 43 4c 45 56 45 4c 3d 3c 2f 62 3e  b>@SECLEVEL=</b>
18b0: 3c 69 3e 6e 3c 2f 69 3e 20 28 73 65 74 20 73 65  <i>n</i> (set se
18c0: 63 75 72 69 74 79 20 6c 65 76 65 6c 20 74 6f 0a  curity level to.
18d0: 09 20 20 20 20 6e 29 2c 20 61 6e 64 20 3c 62 3e  .    n), and <b>
18e0: 44 45 46 41 55 4c 54 3c 2f 62 3e 20 28 75 73 65  DEFAULT</b> (use
18f0: 20 64 65 66 61 75 6c 74 20 63 69 70 68 65 72 20   default cipher 
1900: 6c 69 73 74 2c 20 61 74 20 73 74 61 72 74 20 6f  list, at start o
1910: 6e 6c 79 29 0a 09 20 20 20 20 63 61 6e 20 61 6c  nly)..    can al
1920: 73 6f 20 62 65 20 73 70 65 63 69 66 69 65 64 2e  so be specified.
1930: 20 53 65 65 20 4f 70 65 6e 53 53 4c 20 64 6f 63   See OpenSSL doc
1940: 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72 20 74  umentation for t
1950: 68 65 20 66 75 6c 6c 0a 09 20 20 20 20 6c 69 73  he full..    lis
1960: 74 20 6f 66 20 76 61 6c 69 64 20 76 61 6c 75 65  t of valid value
1970: 73 2e 20 28 54 4c 53 20 31 2e 32 20 61 6e 64 20  s. (TLS 1.2 and 
1980: 65 61 72 6c 69 65 72 20 6f 6e 6c 79 29 3c 2f 64  earlier only)</d
1990: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
19a0: 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72 73 75  strong>-ciphersu
19b0: 69 74 65 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  ites</strong> <e
19c0: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64  m>string</em></d
19d0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 4c  t>.        <dd>L
19e0: 69 73 74 20 6f 66 20 63 69 70 68 65 72 20 73 75  ist of cipher su
19f0: 69 74 65 73 20 74 6f 20 75 73 65 2e 20 53 74 72  ites to use. Str
1a00: 69 6e 67 20 69 73 20 61 20 63 6f 6c 6f 6e 20 28  ing is a colon (
1a10: 22 3a 22 29 0a 09 20 20 20 20 73 65 70 61 72 61  ":")..    separa
1a20: 74 65 64 20 6c 69 73 74 20 6f 66 20 63 69 70 68  ted list of ciph
1a30: 65 72 20 73 75 69 74 65 20 6e 61 6d 65 73 2e 20  er suite names. 
1a40: 28 54 4c 53 20 31 2e 33 20 6f 6e 6c 79 29 3c 2f  (TLS 1.3 only)</
1a50: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
1a60: 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64  <strong>-command
1a70: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61  </strong> <em>ca
1a80: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e  llback</em></dt>
1a90: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 43 61 6c  .        <dd>Cal
1aa0: 6c 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20  lback to invoke 
1ab0: 61 74 20 73 65 76 65 72 61 6c 20 70 6f 69 6e 74  at several point
1ac0: 73 20 64 75 72 69 6e 67 20 74 68 65 20 68 61 6e  s during the han
1ad0: 64 73 68 61 6b 65 2e 0a 09 20 20 20 20 54 68 69  dshake...    Thi
1ae0: 73 20 69 73 20 75 73 65 64 20 74 6f 20 70 61 73  s is used to pas
1af0: 73 20 65 72 72 6f 72 73 20 61 6e 64 20 74 72 61  s errors and tra
1b00: 63 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  cing information
1b10: 2c 20 61 6e 64 0a 09 20 20 20 20 69 74 20 63 61  , and..    it ca
1b20: 6e 20 61 6c 6c 6f 77 20 54 63 6c 20 73 63 72 69  n allow Tcl scri
1b30: 70 74 73 20 74 6f 20 70 65 72 66 6f 72 6d 20 74  pts to perform t
1b40: 68 65 69 72 20 6f 77 6e 20 63 65 72 74 69 66 69  heir own certifi
1b50: 63 61 74 65 0a 09 20 20 20 20 76 61 6c 69 64 61  cate..    valida
1b60: 74 69 6f 6e 20 69 6e 20 70 6c 61 63 65 20 6f 66  tion in place of
1b70: 20 74 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c   the default val
1b80: 69 64 61 74 69 6f 6e 20 70 72 6f 76 69 64 65 64  idation provided
1b90: 20 62 79 0a 09 20 20 20 20 4f 70 65 6e 53 53 4c   by..    OpenSSL
1ba0: 2e 20 53 65 65 20 3c 61 20 68 72 65 66 3d 22 23  . See <a href="#
1bb0: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53  CALLBACK OPTIONS
1bc0: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f  ">CALLBACK OPTIO
1bd0: 4e 53 3c 2f 61 3e 0a 09 20 20 20 20 66 6f 72 20  NS</a>..    for 
1be0: 66 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69  further discussi
1bf0: 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  on.</dd>.       
1c00: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 64 68   <dt><strong>-dh
1c10: 70 61 72 61 6d 73 20 3c 2f 73 74 72 6f 6e 67 3e  params </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 20 20 20 20 20 20 20 20 3c  ></dt>.        <
1c40: 64 64 3e 53 70 65 63 69 66 79 20 74 68 65 20 44  dd>Specify the D
1c50: 69 66 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 70 61  iffie-Hellman pa
1c60: 72 61 6d 65 74 65 72 73 20 66 69 6c 65 2e 3c 2f  rameters file.</
1c70: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
1c80: 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79 66 69 6c 65  <strong>-keyfile
1c90: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69  </strong> <em>fi
1ca0: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e  lename</em></dt>
1cb0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 65  .        <dd>Spe
1cc0: 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74 65  cify the private
1cd0: 20 6b 65 79 20 66 69 6c 65 2e 20 28 64 65 66 61   key file. (defa
1ce0: 75 6c 74 20 69 73 0a 20 20 20 20 20 20 20 20 20  ult is.         
1cf0: 20 20 20 76 61 6c 75 65 20 6f 66 20 2d 63 65 72     value of -cer
1d00: 74 66 69 6c 65 29 3c 2f 64 64 3e 0a 20 20 20 20  tfile)</dd>.    
1d10: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
1d20: 2d 6b 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  -key</strong> <e
1d30: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c  m>filename</em><
1d40: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
1d50: 3e 53 70 65 63 69 66 79 20 74 68 65 20 70 72 69  >Specify the pri
1d60: 76 61 74 65 20 6b 65 79 20 74 6f 20 75 73 65 20  vate key to use 
1d70: 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64  as a DER encoded
1d80: 20 76 61 6c 75 65 20 28 50 4b 43 53 23 31 20 44   value (PKCS#1 D
1d90: 45 52 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ER)</dd>.       
1da0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6d 6f   <dt><strong>-mo
1db0: 64 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  del</strong> <em
1dc0: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64  >channel</em></d
1dd0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 46  t>.        <dd>F
1de0: 6f 72 63 65 20 74 68 69 73 20 63 68 61 6e 6e 65  orce this channe
1df0: 6c 20 74 6f 20 73 68 61 72 65 20 74 68 65 20 73  l to share the s
1e00: 61 6d 65 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e  ame <em><strong>
1e10: 53 53 4c 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e  SSL_CTX</strong>
1e20: 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20 20 20  </em>.          
1e30: 20 20 73 74 72 75 63 74 75 72 65 20 61 73 20 74    structure as t
1e40: 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d  he specified <em
1e50: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 2c 20 61  >channel</em>, a
1e60: 6e 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 74  nd.            t
1e70: 68 65 72 65 66 6f 72 65 20 73 68 61 72 65 20 63  herefore share c
1e80: 61 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64  allbacks etc.</d
1e90: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1ea0: 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64  strong>-password
1eb0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61  </strong> <em>ca
1ec0: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e  llback</em></dt>
1ed0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 43 61 6c  .        <dd>Cal
1ee0: 6c 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20  lback to invoke 
1ef0: 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65  when OpenSSL nee
1f00: 64 73 20 74 6f 20 6f 62 74 61 69 6e 20 61 20 70  ds to obtain a p
1f10: 61 73 73 77 6f 72 64 2c 0a 09 20 20 20 20 74 79  assword,..    ty
1f20: 70 69 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63  pically to unloc
1f30: 6b 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65  k the private ke
1f40: 79 20 6f 66 20 61 20 63 65 72 74 69 66 69 63 61  y of a certifica
1f50: 74 65 2e 20 54 68 65 0a 20 20 20 20 20 20 20 20  te. The.        
1f60: 20 20 20 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f      callback sho
1f70: 75 6c 64 20 72 65 74 75 72 6e 20 61 20 73 74 72  uld return a str
1f80: 69 6e 67 20 77 68 69 63 68 20 72 65 70 72 65 73  ing which repres
1f90: 65 6e 74 73 20 74 68 65 20 70 61 73 73 77 6f 72  ents the passwor
1fa0: 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 6f  d.            to
1fb0: 20 62 65 20 75 73 65 64 2e 20 53 65 65 20 3c 61   be used. See <a
1fc0: 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b   href="#CALLBACK
1fd0: 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41   OPTIONS">CALLBA
1fe0: 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 0a 09  CK OPTIONS</a>..
1ff0: 20 20 20 20 66 6f 72 20 66 75 72 74 68 65 72 20      for further 
2000: 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e  discussion.</dd>
2010: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70  ..<dt><strong>-p
2020: 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 3c 2f 73  ost_handshake</s
2030: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
2040: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 41  /em></dt>..<dd>A
2050: 6c 6c 6f 77 20 70 6f 73 74 2d 68 61 6e 64 73 68  llow post-handsh
2060: 61 6b 65 20 74 69 63 6b 65 74 20 75 70 64 61 74  ake ticket updat
2070: 65 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  es.</dd>.       
2080: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65   <dt><strong>-re
2090: 71 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67 3e 3c  quest </strong><
20a0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
20b0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 52 65  >.        <dd>Re
20c0: 71 75 65 73 74 20 61 20 63 65 72 74 69 66 69 63  quest a certific
20d0: 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64 75  ate from peer du
20e0: 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73 68 61  ring SSL handsha
20f0: 6b 65 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20  ke..            
2100: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e  (default is <em>
2110: 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a  true</em>)</dd>.
2120: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
2130: 6f 6e 67 3e 2d 72 65 71 75 69 72 65 3c 2f 73 74  ong>-require</st
2140: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f  rong> <em>bool</
2150: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
2160: 20 3c 64 64 3e 52 65 71 75 69 72 65 20 61 20 76   <dd>Require a v
2170: 61 6c 69 64 20 63 65 72 74 69 66 69 63 61 74 65  alid certificate
2180: 20 66 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e   from peer durin
2190: 67 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e  g SSL handshake.
21a0: 0a 09 20 20 20 20 49 66 20 74 68 69 73 20 69 73  ..    If this is
21b0: 20 73 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68   set to true, th
21c0: 65 6e 20 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75  en <strong>-requ
21d0: 65 73 74 3c 2f 73 74 72 6f 6e 67 3e 20 6d 75 73  est</strong> mus
21e0: 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 6c  t.            al
21f0: 73 6f 20 62 65 20 73 65 74 20 74 6f 20 74 72 75  so be set to tru
2200: 65 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c  e. (default is <
2210: 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f  em>false</em>)</
2220: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
2230: 3c 73 74 72 6f 6e 67 3e 2d 73 65 63 75 72 69 74  <strong>-securit
2240: 79 6c 65 76 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20  ylevel</strong> 
2250: 3c 65 6d 3e 69 6e 74 65 67 65 72 3c 2f 65 6d 3e  <em>integer</em>
2260: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
2270: 64 3e 53 65 74 20 73 65 63 75 72 69 74 79 20 6c  d>Set security l
2280: 65 76 65 6c 2e 20 4d 75 73 74 20 62 65 20 30 20  evel. Must be 0 
2290: 74 6f 20 35 2e 20 54 68 65 20 73 65 63 75 72 69  to 5. The securi
22a0: 74 79 20 6c 65 76 65 6c 20 61 66 66 65 63 74 73  ty level affects
22b0: 0a 09 20 20 20 20 63 69 70 68 65 72 20 73 75 69  ..    cipher sui
22c0: 74 65 20 65 6e 63 72 79 70 74 69 6f 6e 20 61 6c  te encryption al
22d0: 67 6f 72 69 74 68 6d 73 2c 20 73 75 70 70 6f 72  gorithms, suppor
22e0: 74 65 64 20 45 43 43 20 63 75 72 76 65 73 2c 0a  ted ECC curves,.
22f0: 09 20 20 20 20 73 75 70 70 6f 72 74 65 64 20 73  .    supported s
2300: 69 67 6e 61 74 75 72 65 20 61 6c 67 6f 72 69 74  ignature algorit
2310: 68 6d 73 2c 20 44 48 20 70 61 72 61 6d 65 74 65  hms, DH paramete
2320: 72 20 73 69 7a 65 73 2c 20 63 65 72 74 69 66 69  r sizes, certifi
2330: 63 61 74 65 0a 09 20 20 20 20 6b 65 79 20 73 69  cate..    key si
2340: 7a 65 73 20 61 6e 64 20 73 69 67 6e 61 74 75 72  zes and signatur
2350: 65 20 61 6c 67 6f 72 69 74 68 6d 73 2e 20 54 68  e algorithms. Th
2360: 65 20 64 65 66 61 75 6c 74 20 69 73 20 31 2e 0a  e default is 1..
2370: 09 20 20 20 20 4c 65 76 65 6c 20 33 20 61 6e 64  .    Level 3 and
2380: 20 68 69 67 68 65 72 20 64 69 73 61 62 6c 65 20   higher disable 
2390: 73 75 70 70 6f 72 74 20 66 6f 72 20 73 65 73 73  support for sess
23a0: 69 6f 6e 20 74 69 63 6b 65 74 73 20 61 6e 64 20  ion tickets and 
23b0: 6f 6e 6c 79 0a 09 20 20 20 20 61 63 63 65 70 74  only..    accept
23c0: 20 63 69 70 68 65 72 20 73 75 69 74 65 73 20 74   cipher suites t
23d0: 68 61 74 20 70 72 6f 76 69 64 65 20 66 6f 72 77  hat provide forw
23e0: 61 72 64 20 73 65 63 72 65 63 79 2e 3c 2f 64 64  ard secrecy.</dd
23f0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
2400: 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73  trong>-server</s
2410: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
2420: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2430: 20 20 3c 64 64 3e 48 61 6e 64 73 68 61 6b 65 20    <dd>Handshake 
2440: 61 73 20 73 65 72 76 65 72 20 69 66 20 74 72 75  as server if tru
2450: 65 2c 20 65 6c 73 65 20 68 61 6e 64 73 68 61 6b  e, else handshak
2460: 65 20 61 73 0a 20 20 20 20 20 20 20 20 20 20 20  e as.           
2470: 20 63 6c 69 65 6e 74 2e 20 28 64 65 66 61 75 6c   client. (defaul
2480: 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f  t is <em>false</
2490: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20  em>)</dd>.      
24a0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73    <dt><strong>-s
24b0: 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74 72 6f 6e  ervername</stron
24c0: 67 3e 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e  g> <em>host</em>
24d0: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
24e0: 64 3e 53 70 65 63 69 66 79 20 73 65 72 76 65 72  d>Specify server
24f0: 20 68 6f 73 74 6e 61 6d 65 2e 20 4f 6e 6c 79 20   hostname. Only 
2500: 61 76 61 69 6c 61 62 6c 65 20 69 66 20 74 68 65  available if the
2510: 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 79   OpenSSL library
2520: 0a 09 20 20 20 20 74 68 65 20 70 61 63 6b 61 67  ..    the packag
2530: 65 20 69 73 20 6c 69 6e 6b 65 64 20 61 67 61 69  e is linked agai
2540: 6e 73 74 20 73 75 70 70 6f 72 74 73 20 74 68 65  nst supports the
2550: 20 54 4c 53 20 68 6f 73 74 6e 61 6d 65 20 65 78   TLS hostname ex
2560: 74 65 6e 73 69 6f 6e 0a 09 20 20 20 20 66 6f 72  tension..    for
2570: 20 27 53 65 72 76 65 72 20 4e 61 6d 65 20 49 6e   'Server Name In
2580: 64 69 63 61 74 69 6f 6e 27 20 28 53 4e 49 29 2e  dication' (SNI).
2590: 20 55 73 65 20 74 6f 20 6e 61 6d 65 20 74 68 65   Use to name the
25a0: 20 6c 6f 67 69 63 61 6c 20 68 6f 73 74 0a 09 20   logical host.. 
25b0: 20 20 20 77 65 20 61 72 65 20 74 61 6c 6b 69 6e     we are talkin
25c0: 67 20 74 6f 20 61 6e 64 20 65 78 70 65 63 74 69  g to and expecti
25d0: 6e 67 20 61 20 63 65 72 74 69 66 69 63 61 74 65  ng a certificate
25e0: 20 66 6f 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 20   for.</dd>.     
25f0: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
2600: 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 72 6f  session_id</stro
2610: 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f  ng> <em>string</
2620: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
2630: 20 3c 64 64 3e 53 65 73 73 69 6f 6e 20 69 64 20   <dd>Session id 
2640: 74 6f 20 72 65 73 75 6d 65 20 73 65 73 73 69 6f  to resume sessio
2650: 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  n.</dd>.        
2660: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c  <dt><strong>-ssl
2670: 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62  2</strong> <em>b
2680: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ool</em></dt>.  
2690: 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65        <dd>Enable
26a0: 20 75 73 65 20 6f 66 20 53 53 4c 20 76 32 2e 20   use of SSL v2. 
26b0: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e  (default is <em>
26c0: 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e  false</em>)</dd>
26d0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
26e0: 72 6f 6e 67 3e 2d 73 73 6c 33 20 3c 2f 73 74 72  rong>-ssl3 </str
26f0: 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ong><em>bool</em
2700: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
2710: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66  dd>Enable use of
2720: 20 53 53 4c 20 76 33 2e 20 28 64 65 66 61 75 6c   SSL v3. (defaul
2730: 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f  t is <em>false</
2740: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20  em>)</dd>.      
2750: 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74    <dt>-<strong>t
2760: 6c 73 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ls1</strong> <em
2770: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
2780: 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62          <dd>Enab
2790: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
27a0: 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65  . (default is <e
27b0: 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64  m>true</em>)</dd
27c0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c  >.        <dt>-<
27d0: 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 31 3c 2f 73  strong>tls1.1</s
27e0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
27f0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2800: 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65    <dd>Enable use
2810: 20 6f 66 20 54 4c 53 20 76 31 2e 31 20 28 64 65   of TLS v1.1 (de
2820: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75  fault is <em>tru
2830: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20  e</em>)</dd>.   
2840: 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e       <dt>-<stron
2850: 67 3e 74 6c 73 31 2e 32 3c 2f 73 74 72 6f 6e 67  g>tls1.2</strong
2860: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c  > <em>bool</em><
2870: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
2880: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54  >Enable use of T
2890: 4c 53 20 76 31 2e 32 20 28 64 65 66 61 75 6c 74  LS v1.2 (default
28a0: 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d   is <em>true</em
28b0: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  >)</dd>.        
28c0: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73  <dt>-<strong>tls
28d0: 31 2e 33 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  1.3</strong> <em
28e0: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
28f0: 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62          <dd>Enab
2900: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
2910: 2e 33 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c  .3 (default is <
2920: 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64  em>true</em>)</d
2930: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62  d>.    </dl>.</b
2940: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 20  lockquote>..    
2950: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73  <dt><a name="tls
2960: 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e 74  ::unimport"><b>t
2970: 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 20 3c 2f 62  ls::unimport </b
2980: 3e 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c  ><i>channel</i><
2990: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
29a0: 3e 50 72 6f 76 69 64 65 64 20 66 6f 72 20 73 79  >Provided for sy
29b0: 6d 6d 65 74 72 79 20 74 6f 20 3c 73 74 72 6f 6e  mmetry to <stron
29c0: 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73  g>tls::import</s
29d0: 74 72 6f 6e 67 3e 2c 20 74 68 69 73 0a 20 20 20  trong>, this.   
29e0: 20 20 20 75 6e 73 74 61 63 6b 73 20 74 68 65 20     unstacks the 
29f0: 53 53 4c 2d 65 6e 61 62 6c 69 6e 67 20 6f 66 20  SSL-enabling of 
2a00: 61 20 72 65 67 75 6c 61 72 20 54 63 6c 20 63 68  a regular Tcl ch
2a10: 61 6e 6e 65 6c 2e 20 20 41 6e 20 65 72 72 6f 72  annel.  An error
2a20: 0a 20 20 20 20 20 20 69 73 20 74 68 72 6f 77 6e  .      is thrown
2a30: 20 69 66 20 54 4c 53 20 69 73 20 6e 6f 74 20 74   if TLS is not t
2a40: 68 65 20 74 6f 70 20 73 74 61 63 6b 65 64 20 63  he top stacked c
2a50: 68 61 6e 6e 65 6c 20 74 79 70 65 2e 3c 2f 64 64  hannel type.</dd
2a60: 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b  >.    <dt>&nbsp;
2a70: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61  </dt>.    <dt><a
2a80: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 68 61 6e 64   name="tls::hand
2a90: 73 68 61 6b 65 22 3e 3c 73 74 72 6f 6e 67 3e 74  shake"><strong>t
2aa0: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 73  ls::handshake</s
2ab0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e  trong> <em>chann
2ac0: 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e  el</em></a></dt>
2ad0: 0a 20 20 20 20 3c 64 64 3e 46 6f 72 63 65 73 20  .    <dd>Forces 
2ae0: 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 74 61 6b  handshake to tak
2af0: 65 20 70 6c 61 63 65 2c 20 61 6e 64 20 72 65 74  e place, and ret
2b00: 75 72 6e 73 20 30 20 69 66 0a 20 20 20 20 20 20  urns 0 if.      
2b10: 20 20 68 61 6e 64 73 68 61 6b 65 20 69 73 20 73    handshake is s
2b20: 74 69 6c 6c 20 69 6e 20 70 72 6f 67 72 65 73 73  till in progress
2b30: 20 28 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 29 2c   (non-blocking),
2b40: 20 6f 72 20 31 20 69 66 0a 20 20 20 20 20 20 20   or 1 if.       
2b50: 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77   the handshake w
2b60: 61 73 20 73 75 63 63 65 73 73 66 75 6c 2e 20 49  as successful. I
2b70: 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20  f the handshake 
2b80: 66 61 69 6c 65 64 0a 20 20 20 20 20 20 20 20 74  failed.        t
2b90: 68 69 73 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c  his routine will
2ba0: 20 74 68 72 6f 77 20 61 6e 20 65 72 72 6f 72 2e   throw an error.
2bb0: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e  </dd>.    <dt>&n
2bc0: 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  bsp;</dt>.    <d
2bd0: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
2be0: 73 74 61 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e  status"><strong>
2bf0: 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72  tls::status</str
2c00: 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d 3e 3f 2d 6c  ong>.    <em>?-l
2c10: 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65  ocal? channel</e
2c20: 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  m></a></dt>.    
2c30: 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20  <dd>Returns the 
2c40: 63 75 72 72 65 6e 74 20 73 74 61 74 75 73 20 6f  current status o
2c50: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
2c60: 65 20 66 6f 72 20 61 6e 20 53 53 4c 0a 09 63 68  e for an SSL..ch
2c70: 61 6e 6e 65 6c 2e 20 54 68 65 20 72 65 73 75 6c  annel. The resul
2c80: 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b  t is a list of k
2c90: 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64  ey-value pairs d
2ca0: 65 73 63 72 69 62 69 6e 67 0a 09 74 68 65 20 63  escribing..the c
2cb0: 65 72 74 69 66 69 63 61 74 65 2e 20 49 66 20 74  ertificate. If t
2cc0: 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 6e 20  he result is an 
2cd0: 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65 6e 20  empty list then 
2ce0: 74 68 65 0a 20 20 20 20 20 20 20 20 53 53 4c 20  the.        SSL 
2cf0: 68 61 6e 64 73 68 61 6b 65 20 68 61 73 20 6e 6f  handshake has no
2d00: 74 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 64 2e  t yet completed.
2d10: 20 49 66 20 3c 65 6d 3e 2d 6c 6f 63 61 6c 3c 2f   If <em>-local</
2d20: 65 6d 3e 20 69 73 0a 09 73 70 65 63 69 66 69 65  em> is..specifie
2d30: 64 2c 20 74 68 65 6e 20 74 68 65 20 6c 6f 63 61  d, then the loca
2d40: 6c 20 63 65 72 74 69 66 69 63 61 74 65 20 69 73  l certificate is
2d50: 20 75 73 65 64 2e 3c 2f 64 64 3e 0a 3c 62 6c 6f   used.</dd>.<blo
2d60: 63 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 53 53 4c  ckquote>..<b>SSL
2d70: 20 53 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20   Status</b>.    
2d80: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  <dl>.        <dt
2d90: 3e 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73  ><strong>alpn</s
2da0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f  trong> <em>proto
2db0: 63 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  col</em></dt>.  
2dc0: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 70 72        <dd>The pr
2dd0: 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64 20  otocol selected 
2de0: 61 66 74 65 72 20 41 70 70 6c 69 63 61 74 69 6f  after Applicatio
2df0: 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c  n-Layer Protocol
2e00: 0a 09 20 20 20 20 4e 65 67 6f 74 69 61 74 69 6f  ..    Negotiatio
2e10: 6e 20 28 41 4c 50 4e 29 2e 3c 2f 64 64 3e 0a 20  n (ALPN).</dd>. 
2e20: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
2e30: 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e  ng>cipher</stron
2e40: 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f 65  g> <em>cipher</e
2e50: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
2e60: 3c 64 64 3e 54 68 65 20 63 75 72 72 65 6e 74 20  <dd>The current 
2e70: 63 69 70 68 65 72 20 69 6e 20 75 73 65 20 62 65  cipher in use be
2e80: 74 77 65 65 6e 20 74 68 65 20 63 6c 69 65 6e 74  tween the client
2e90: 20 61 6e 64 0a 20 20 20 20 20 20 20 20 20 20 20   and.           
2ea0: 20 73 65 72 76 65 72 20 63 68 61 6e 6e 65 6c 73   server channels
2eb0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
2ec0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 70 65 65 72 6e  dt><strong>peern
2ed0: 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ame</strong> <em
2ee0: 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >name</em></dt>.
2ef0: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
2f00: 70 65 65 72 6e 61 6d 65 20 66 72 6f 6d 20 74 68  peername from th
2f10: 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f  e certificate.</
2f20: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
2f30: 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c  <strong>protocol
2f40: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65  </strong> <em>ve
2f50: 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  rsion</em></dt>.
2f60: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
2f70: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e  protocol version
2f80: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 6f   used for the co
2f90: 6e 6e 65 63 74 69 6f 6e 3a 0a 09 20 20 20 20 53  nnection:..    S
2fa0: 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31 2c  SL2, SSL3, TLS1,
2fb0: 20 54 4c 53 31 2e 31 2c 20 54 4c 53 31 2e 32 2c   TLS1.1, TLS1.2,
2fc0: 20 54 4c 53 31 2e 33 2c 20 6f 72 20 75 6e 6b 6e   TLS1.3, or unkn
2fd0: 6f 77 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  own.</dd>.      
2fe0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 62    <dt><strong>sb
2ff0: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  its</strong> <em
3000: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  >n</em></dt>.   
3010: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d       <dd>The num
3020: 62 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 64  ber of bits used
3030: 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f 6e   for the session
3040: 20 6b 65 79 2e 3c 2f 64 64 3e 0a 20 20 20 20 20   key.</dd>.     
3050: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73     <dt><strong>s
3060: 69 67 6e 61 74 75 72 65 48 61 73 68 41 6c 67 6f  ignatureHashAlgo
3070: 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c  rithm</strong> <
3080: 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d  em>algorithm</em
3090: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
30a0: 64 64 3e 54 68 65 20 73 69 67 6e 61 74 75 72 65  dd>The signature
30b0: 20 68 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 2e   hash algorithm.
30c0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
30d0: 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74  t><strong>signat
30e0: 75 72 65 5f 74 79 70 65 3c 2f 73 74 72 6f 6e 67  ure_type</strong
30f0: 3e 20 3c 65 6d 3e 74 79 70 65 3c 2f 65 6d 3e 3c  > <em>type</em><
3100: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
3110: 3e 54 68 65 20 73 69 67 6e 61 74 75 72 65 20 74  >The signature t
3120: 79 70 65 20 76 61 6c 75 65 2e 3c 2f 64 64 3e 0a  ype value.</dd>.
3130: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
3140: 6f 6e 67 3e 76 65 72 69 66 69 63 61 74 69 6f 6e  ong>verification
3150: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 72 65  </strong> <em>re
3160: 73 75 6c 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  sult</em></dt>. 
3170: 20 20 20 20 20 20 20 3c 64 64 3e 43 65 72 74 69         <dd>Certi
3180: 66 69 63 61 74 65 20 76 65 72 69 66 69 63 61 74  ficate verificat
3190: 69 6f 6e 20 72 65 73 75 6c 74 2e 3c 2f 64 64 3e  ion result.</dd>
31a0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
31b0: 72 6f 6e 67 3e 63 61 5f 6e 61 6d 65 73 3c 2f 73  rong>ca_names</s
31c0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c  trong> <em>list<
31d0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
31e0: 20 20 3c 64 64 3e 4c 69 73 74 20 6f 66 20 74 68    <dd>List of th
31f0: 65 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75  e Certificate Au
3200: 74 68 6f 72 69 74 69 65 73 20 75 73 65 64 20 74  thorities used t
3210: 6f 20 63 72 65 61 74 65 20 74 68 65 20 63 65 72  o create the cer
3220: 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20  tificate.</dd>. 
3230: 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b     </dl>.</block
3240: 71 75 6f 74 65 3e 0a 3c 62 6c 6f 63 6b 71 75 6f  quote>.<blockquo
3250: 74 65 3e 0a 09 3c 62 3e 43 65 72 74 69 66 69 63  te>..<b>Certific
3260: 61 74 65 20 53 74 61 74 75 73 3c 2f 62 3e 0a 20  ate Status</b>. 
3270: 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20     <dl>.        
3280: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 6c 6c 3c  <dt><strong>all<
3290: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72  /strong> <em>str
32a0: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ing</em></dt>.  
32b0: 20 20 20 20 20 20 3c 64 64 3e 44 75 6d 70 20 6f        <dd>Dump o
32c0: 66 20 61 6c 6c 20 63 65 72 74 69 66 69 63 61 74  f all certificat
32d0: 65 20 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 0a 20 20  e info.</dd>..  
32e0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
32f0: 67 3e 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e  g>version</stron
3300: 67 3e 20 3c 65 6d 3e 76 61 6c 75 65 3c 2f 65 6d  g> <em>value</em
3310: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
3320: 64 64 3e 54 68 65 20 63 65 72 74 69 66 69 63 61  dd>The certifica
3330: 74 65 20 76 65 72 73 69 6f 6e 2e 3c 2f 64 64 3e  te version.</dd>
3340: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
3350: 72 6f 6e 67 3e 73 65 72 69 61 6c 4e 75 6d 62 65  rong>serialNumbe
3360: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e  r</strong> <em>n
3370: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
3380: 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69 61     <dd>The seria
3390: 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20  l number of the 
33a0: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 68  certificate as h
33b0: 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a  ex string.</dd>.
33c0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
33d0: 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 3c 2f 73  ong>signature</s
33e0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72  trong> <em>algor
33f0: 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  ithm</em></dt>. 
3400: 20 20 20 20 20 20 20 3c 64 64 3e 43 69 70 68 65         <dd>Ciphe
3410: 72 20 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 64  r algorithm used
3420: 20 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 65   for certificate
3430: 20 73 69 67 6e 61 74 75 72 65 2e 3c 2f 64 64 3e   signature.</dd>
3440: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
3450: 72 6f 6e 67 3e 69 73 73 75 65 72 3c 2f 73 74 72  rong>issuer</str
3460: 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e  ong> <em>dn</em>
3470: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
3480: 64 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69 73  d>The distinguis
3490: 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66  hed name (DN) of
34a0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
34b0: 20 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 20 20   issuer.</dd>.  
34c0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
34d0: 67 3e 6e 6f 74 42 65 66 6f 72 65 3c 2f 73 74 72  g>notBefore</str
34e0: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65  ong> <em>date</e
34f0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
3500: 3c 64 64 3e 54 68 65 20 62 65 67 69 6e 20 64 61  <dd>The begin da
3510: 74 65 20 66 6f 72 20 74 68 65 20 76 61 6c 69 64  te for the valid
3520: 69 74 79 20 6f 66 20 74 68 65 20 63 65 72 74 69  ity of the certi
3530: 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20  ficate.</dd>.   
3540: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
3550: 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72 6f 6e  >notAfter</stron
3560: 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e  g> <em>date</em>
3570: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
3580: 64 3e 54 68 65 20 65 78 70 69 72 61 74 69 6f 6e  d>The expiration
3590: 20 64 61 74 65 20 66 6f 72 20 74 68 65 20 63 65   date for the ce
35a0: 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a  rtificate.</dd>.
35b0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
35c0: 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72  ong>subject</str
35d0: 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e  ong> <em>dn</em>
35e0: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
35f0: 64 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69 73  d>The distinguis
3600: 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66  hed name (DN) of
3610: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
3620: 20 73 75 62 6a 65 63 74 2e 0a 09 20 20 20 20 46   subject...    F
3630: 69 65 6c 64 73 20 69 6e 63 6c 75 64 65 3a 20 43  ields include: C
3640: 6f 6d 6d 6f 6e 20 4e 61 6d 65 20 28 43 4e 29 2c  ommon Name (CN),
3650: 20 4f 72 67 61 6e 69 7a 61 74 69 6f 6e 20 28 4f   Organization (O
3660: 29 2c 20 4c 6f 63 61 6c 69 74 79 0a 09 20 20 20  ), Locality..   
3670: 20 6f 72 20 43 69 74 79 20 28 4c 29 2c 20 53 74   or City (L), St
3680: 61 74 65 20 6f 72 20 50 72 6f 76 69 6e 63 65 20  ate or Province 
3690: 28 53 29 2c 20 61 6e 64 20 43 6f 75 6e 74 72 79  (S), and Country
36a0: 20 4e 61 6d 65 20 28 43 29 2e 3c 2f 64 64 3e 0a   Name (C).</dd>.
36b0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
36c0: 6f 6e 67 3e 69 73 73 75 65 72 55 6e 69 71 75 65  ong>issuerUnique
36d0: 49 44 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ID</strong> <em>
36e0: 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e  string</em></dt>
36f0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65  .        <dd>The
3700: 20 69 73 73 75 65 72 20 75 6e 69 71 75 65 20 69   issuer unique i
3710: 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  d.</dd>.        
3720: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a  <dt><strong>subj
3730: 65 63 74 55 6e 69 71 75 65 49 44 3c 2f 73 74 72  ectUniqueID</str
3740: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
3750: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
3760: 20 20 3c 64 64 3e 54 68 65 20 73 75 62 6a 65 63    <dd>The subjec
3770: 74 20 75 6e 69 71 75 65 20 69 64 2e 3c 2f 64 64  t unique id.</dd
3780: 3e 0a 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  >..        <dt><
3790: 73 74 72 6f 6e 67 3e 6e 75 6d 5f 65 78 74 65 6e  strong>num_exten
37a0: 73 69 6f 6e 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c  sions</strong> <
37b0: 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  em>n</em></dt>. 
37c0: 20 20 20 20 20 20 20 3c 64 64 3e 4e 75 6d 62 65         <dd>Numbe
37d0: 72 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 65  r of certificate
37e0: 20 65 78 74 65 6e 73 69 6f 6e 73 2e 3c 2f 64 64   extensions.</dd
37f0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
3800: 74 72 6f 6e 67 3e 65 78 74 65 6e 73 69 6f 6e 73  trong>extensions
3810: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69  </strong> <em>li
3820: 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  st</em></dt>.   
3830: 20 20 20 20 20 3c 64 64 3e 4c 69 73 74 20 6f 66       <dd>List of
3840: 20 63 65 72 74 69 66 69 63 61 74 65 20 65 78 74   certificate ext
3850: 65 6e 73 69 6f 6e 20 6e 61 6d 65 73 2e 3c 2f 64  ension names.</d
3860: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
3870: 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 4b 65  strong>subjectKe
3880: 79 49 64 65 6e 74 69 66 69 65 72 3c 2f 73 74 72  yIdentifier</str
3890: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
38a0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
38b0: 20 20 3c 64 64 3e 48 61 73 68 20 6f 66 20 74 68    <dd>Hash of th
38c0: 65 20 70 75 62 6c 69 63 20 6b 65 79 20 69 6e 73  e public key ins
38d0: 69 64 65 20 74 68 65 20 63 65 72 74 69 66 69 63  ide the certific
38e0: 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  ate.</dd>.      
38f0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75    <dt><strong>su
3900: 62 6a 65 63 74 41 6c 74 4e 61 6d 65 3c 2f 73 74  bjectAltName</st
3910: 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f  rong> <em>list</
3920: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
3930: 20 3c 64 64 3e 4c 69 73 74 20 6f 66 20 61 6c 6c   <dd>List of all
3940: 20 6f 66 20 74 68 65 20 61 6c 74 65 72 6e 61 74   of the alternat
3950: 69 76 65 20 64 6f 6d 61 69 6e 20 6e 61 6d 65 73  ive domain names
3960: 2c 20 73 75 62 20 64 6f 6d 61 69 6e 73 2c 0a 09  , sub domains,..
3970: 20 20 20 20 61 6e 64 20 49 50 20 61 64 64 72 65      and IP addre
3980: 73 73 65 73 20 74 68 61 74 20 61 72 65 20 73 65  sses that are se
3990: 63 75 72 65 64 20 62 79 20 74 68 65 20 63 65 72  cured by the cer
39a0: 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 0a  tificate.</dd>..
39b0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 65 72  .<dt><strong>cer
39c0: 74 69 66 69 63 61 74 65 3c 2f 73 74 72 6f 6e 67  tificate</strong
39d0: 3e 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 3c  > <em>cert</em><
39e0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
39f0: 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f 64 65 64  >The PEM encoded
3a00: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64   certificate.</d
3a10: 64 3e 0a 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  d>..        <dt>
3a20: 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72  <strong>signatur
3a30: 65 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72 6f  eAlgorithm</stro
3a40: 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68  ng> <em>algorith
3a50: 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  m</em></dt>.    
3a60: 20 20 20 20 3c 64 64 3e 43 69 70 68 65 72 20 61      <dd>Cipher a
3a70: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f  lgorithm used fo
3a80: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69  r certificate si
3a90: 67 6e 61 74 75 72 65 2e 3c 2f 64 64 3e 0a 20 20  gnature.</dd>.  
3aa0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
3ab0: 67 3e 73 69 67 6e 61 74 75 72 65 56 61 6c 75 65  g>signatureValue
3ac0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74  </strong> <em>st
3ad0: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  ring</em></dt>. 
3ae0: 20 20 20 20 20 20 20 3c 64 64 3e 43 65 72 74 69         <dd>Certi
3af0: 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65  ficate signature
3b00: 20 61 73 20 68 65 78 20 73 74 72 69 6e 67 2e 3c   as hex string.<
3b10: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
3b20: 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 75  ><strong>signatu
3b30: 72 65 44 69 67 65 73 74 3c 2f 73 74 72 6f 6e 67  reDigest</strong
3b40: 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65  > <em>version</e
3b50: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
3b60: 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 20  <dd>Certificate 
3b70: 73 69 67 6e 69 6e 67 20 64 69 67 65 73 74 2e 3c  signing digest.<
3b80: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
3b90: 3e 3c 73 74 72 6f 6e 67 3e 70 75 62 6c 69 63 4b  ><strong>publicK
3ba0: 65 79 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72  eyAlgorithm</str
3bb0: 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74  ong> <em>algorit
3bc0: 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  hm</em></dt>.   
3bd0: 20 20 20 20 20 3c 64 64 3e 43 65 72 74 69 66 69       <dd>Certifi
3be0: 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 70  cate signature p
3bf0: 75 62 6c 69 63 20 6b 65 79 20 61 6c 67 6f 72 69  ublic key algori
3c00: 74 68 6d 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  thm.</dd>.      
3c10: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 70 75    <dt><strong>pu
3c20: 62 6c 69 63 4b 65 79 3c 2f 73 74 72 6f 6e 67 3e  blicKey</strong>
3c30: 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e   <em>string</em>
3c40: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
3c50: 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 73 69  d>Certificate si
3c60: 67 6e 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b  gnature public k
3c70: 65 79 20 61 73 20 68 65 78 20 73 74 72 69 6e 67  ey as hex string
3c80: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
3c90: 64 74 3e 3c 73 74 72 6f 6e 67 3e 62 69 74 73 3c  dt><strong>bits<
3ca0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f  /strong> <em>n</
3cb0: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
3cc0: 20 3c 64 64 3e 4e 75 6d 62 65 72 20 6f 66 20 62   <dd>Number of b
3cd0: 69 74 73 20 75 73 65 64 20 66 6f 72 20 63 65 72  its used for cer
3ce0: 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75  tificate signatu
3cf0: 72 65 20 6b 65 79 3c 2f 64 64 3e 0a 20 20 20 20  re key</dd>.    
3d00: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
3d10: 73 65 6c 66 5f 73 69 67 6e 65 64 3c 2f 73 74 72  self_signed</str
3d20: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e  ong> <em>boolean
3d30: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
3d40: 20 20 20 3c 64 64 3e 49 73 20 63 65 72 74 69 66     <dd>Is certif
3d50: 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20  icate signature 
3d60: 73 65 6c 66 20 73 69 67 6e 65 64 2e 3c 2f 64 64  self signed.</dd
3d70: 3e 0a 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  >..        <dt><
3d80: 73 74 72 6f 6e 67 3e 73 68 61 31 5f 68 61 73 68  strong>sha1_hash
3d90: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61  </strong> <em>ha
3da0: 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  sh</em></dt>.   
3db0: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 53 48 41       <dd>The SHA
3dc0: 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 65  1 hash of the ce
3dd0: 72 74 69 66 69 63 61 74 65 20 61 73 20 68 65 78  rtificate as hex
3de0: 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 20 20   string.</dd>.  
3df0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
3e00: 67 3e 73 68 61 32 35 36 5f 68 61 73 68 3c 2f 73  g>sha256_hash</s
3e10: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61 73 68 3c  trong> <em>hash<
3e20: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
3e30: 20 20 3c 64 64 3e 54 68 65 20 53 48 41 32 35 36    <dd>The SHA256
3e40: 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 65 72   hash of the cer
3e50: 74 69 66 69 63 61 74 65 20 61 73 20 68 65 78 20  tificate as hex 
3e60: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 20 20 20  string.</dd>.   
3e70: 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75   </dl>.</blockqu
3e80: 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61  ote>..    <dt><a
3e90: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 6f 6e 6e   name="tls::conn
3ea0: 65 63 74 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e  ection"><strong>
3eb0: 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c  tls::connection<
3ec0: 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d  /strong>.    <em
3ed0: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61  >channel</em></a
3ee0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52  ></dt>.    <dd>R
3ef0: 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65  eturns the curre
3f00: 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74  nt connection st
3f10: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63  atus of an SSL c
3f20: 68 61 6e 6e 65 6c 2e 20 54 68 65 0a 20 20 20 20  hannel. The.    
3f30: 20 20 20 20 72 65 73 75 6c 74 20 69 73 20 61 20      result is a 
3f40: 6c 69 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75  list of key-valu
3f50: 65 20 70 61 69 72 73 20 64 65 73 63 72 69 62 69  e pairs describi
3f60: 6e 67 20 74 68 65 0a 20 20 20 20 20 20 20 20 63  ng the.        c
3f70: 6f 6e 6e 65 63 74 65 64 20 70 65 65 72 2e 3c 2f  onnected peer.</
3f80: 64 64 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  dd>.<blockquote>
3f90: 0a 09 3c 62 3e 53 53 4c 20 53 74 61 74 75 73 3c  ..<b>SSL Status<
3fa0: 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20  /b>.    <dl>.   
3fb0: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
3fc0: 3e 73 74 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20  >state</strong> 
3fd0: 3c 65 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f  <em>state</em></
3fe0: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
3ff0: 53 74 61 74 65 20 6f 66 20 74 68 65 20 63 6f 6e  State of the con
4000: 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20  nection.</dd>.  
4010: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
4020: 67 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74  g>servername</st
4030: 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f  rong> <em>name</
4040: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
4050: 20 3c 64 64 3e 54 68 65 20 6e 61 6d 65 20 6f 66   <dd>The name of
4060: 20 74 68 65 20 63 6f 6e 6e 65 63 74 65 64 20 74   the connected t
4070: 6f 20 73 65 72 76 65 72 2e 3c 2f 64 64 3e 0a 20  o server.</dd>. 
4080: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
4090: 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 73 74 72  ng>protocol</str
40a0: 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e  ong> <em>version
40b0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
40c0: 20 20 20 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f     <dd>The proto
40d0: 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65 64  col version used
40e0: 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63 74   for the connect
40f0: 69 6f 6e 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20  ion:..    SSL2, 
4100: 53 53 4c 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31  SSL3, TLS1, TLS1
4110: 2e 31 2c 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31  .1, TLS1.2, TLS1
4120: 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c  .3, or unknown.<
4130: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
4140: 3e 3c 73 74 72 6f 6e 67 3e 72 65 6e 65 67 6f 74  ><strong>renegot
4150: 69 61 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20  iation</strong> 
4160: 3c 65 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f  <em>state</em></
4170: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
4180: 57 68 65 74 68 65 72 20 70 72 6f 74 6f 63 6f 6c  Whether protocol
4190: 20 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e 20 69   renegotiation i
41a0: 73 20 73 75 70 70 6f 72 74 65 64 20 6f 72 20 6e  s supported or n
41b0: 6f 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ot.</dd>.       
41c0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 63   <dt><strong>sec
41d0: 75 72 69 74 79 6c 65 76 65 6c 3c 2f 73 74 72 6f  uritylevel</stro
41e0: 6e 67 3e 20 3c 65 6d 3e 6c 65 76 65 6c 3c 2f 65  ng> <em>level</e
41f0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
4200: 3c 64 64 3e 54 68 65 20 73 65 63 75 72 69 74 79  <dd>The security
4210: 20 6c 65 76 65 6c 20 75 73 65 64 20 66 6f 72 20   level used for 
4220: 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20 63 69 70  selection of cip
4230: 68 65 72 73 2c 20 6b 65 79 20 73 69 7a 65 2c 20  hers, key size, 
4240: 65 74 63 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  etc.</dd>.      
4250: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65    <dt><strong>se
4260: 73 73 69 6f 6e 5f 72 65 75 73 65 64 3c 2f 73 74  ssion_reused</st
4270: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61  rong> <em>boolea
4280: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  n</em></dt>.    
4290: 20 20 20 20 3c 64 64 3e 57 68 65 74 68 65 72 20      <dd>Whether 
42a0: 74 68 65 20 73 65 73 73 69 6f 6e 20 68 61 73 20  the session has 
42b0: 62 65 65 6e 20 72 65 75 73 65 64 20 6f 72 20 6e  been reused or n
42c0: 6f 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ot.</dd>.       
42d0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 5f   <dt><strong>is_
42e0: 73 65 72 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20  server</strong> 
42f0: 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e  <em>boolean</em>
4300: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
4310: 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 63 6f  d>Whether the co
4320: 6e 6e 65 63 74 69 6f 6e 20 63 6f 6e 66 69 67 75  nnection configu
4330: 72 65 64 20 61 73 20 61 20 73 65 72 76 65 72 20  red as a server 
4340: 6f 72 20 63 6c 69 65 6e 74 20 28 66 61 6c 73 65  or client (false
4350: 29 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  ).</dd>.        
4360: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 6f 6d 70  <dt><strong>comp
4370: 72 65 73 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e  ression</strong>
4380: 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f   <em>mode</em></
4390: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
43a0: 43 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68  Compression meth
43b0: 6f 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  od.</dd>.       
43c0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 65 78 70   <dt><strong>exp
43d0: 61 6e 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20  ansion</strong> 
43e0: 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64  <em>mode</em></d
43f0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45  t>.        <dd>E
4400: 78 70 61 6e 73 69 6f 6e 20 6d 65 74 68 6f 64 2e  xpansion method.
4410: 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a  </dd>.    </dl>.
4420: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62  </blockquote>.<b
4430: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 43  lockquote>..<b>C
4440: 69 70 68 65 72 20 49 6e 66 6f 3c 2f 62 3e 0a 20  ipher Info</b>. 
4450: 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20     <dl>.        
4460: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68  <dt><strong>ciph
4470: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  er</strong> <em>
4480: 63 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e  cipher</em></dt>
4490: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65  .        <dd>The
44a0: 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20   current cipher 
44b0: 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20 63  in use for the c
44c0: 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a  onnection.</dd>.
44d0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
44e0: 6f 6e 67 3e 73 74 61 6e 64 61 72 64 5f 6e 61 6d  ong>standard_nam
44f0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e  e</strong> <em>n
4500: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ame</em></dt>.  
4510: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 73 74        <dd>The st
4520: 61 6e 64 61 72 64 20 52 46 43 20 6e 61 6d 65 20  andard RFC name 
4530: 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e 0a  of cipher.</dd>.
4540: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
4550: 6f 6e 67 3e 62 69 74 73 3c 2f 73 74 72 6f 6e 67  ong>bits</strong
4560: 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74  > <em>n</em></dt
4570: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  >.        <dd>Th
4580: 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 72 6f 63  e number of proc
4590: 65 73 73 65 64 20 62 69 74 73 20 75 73 65 64 20  essed bits used 
45a0: 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e  for cipher.</dd>
45b0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
45c0: 72 6f 6e 67 3e 73 65 63 72 65 74 5f 62 69 74 73  rong>secret_bits
45d0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c  </strong> <em>n<
45e0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
45f0: 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d 62 65 72    <dd>The number
4600: 20 6f 66 20 73 65 63 72 65 74 20 62 69 74 73 20   of secret bits 
4610: 75 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 2e  used for cipher.
4620: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
4630: 74 3e 3c 73 74 72 6f 6e 67 3e 6d 69 6e 5f 76 65  t><strong>min_ve
4640: 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c  rsion</strong> <
4650: 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c  em>version</em><
4660: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
4670: 3e 54 68 65 20 6d 69 6e 69 6d 75 6d 20 70 72 6f  >The minimum pro
4680: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 66 6f  tocol version fo
4690: 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e 0a 20  r cipher.</dd>. 
46a0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
46b0: 6e 67 3e 69 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c  ng>id</strong> <
46c0: 65 6d 3e 69 64 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  em>id</em></dt>.
46d0: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
46e0: 4f 70 65 6e 53 53 4c 20 63 69 70 68 65 72 20 69  OpenSSL cipher i
46f0: 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  d.</dd>.        
4700: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 64 65 73 63  <dt><strong>desc
4710: 72 69 70 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e  ription</strong>
4720: 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e   <em>string</em>
4730: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
4740: 64 3e 41 20 74 65 78 74 20 64 65 73 63 72 69 70  d>A text descrip
4750: 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 69 70 68  tion of the ciph
4760: 65 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64  er.</dd>.    </d
4770: 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  l>.</blockquote>
4780: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 09 3c  .<blockquote>..<
4790: 62 3e 53 65 73 73 69 6f 6e 20 49 6e 66 6f 3c 2f  b>Session Info</
47a0: 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20  b>.    <dl>.    
47b0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
47c0: 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  alpn</strong> <e
47d0: 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c  m>protocol</em><
47e0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
47f0: 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65  >The protocol se
4800: 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 70 70  lected after App
4810: 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50  lication-Layer P
4820: 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65 67  rotocol..    Neg
4830: 6f 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e  otiation (ALPN).
4840: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
4850: 74 3e 3c 73 74 72 6f 6e 67 3e 72 65 73 75 6d 61  t><strong>resuma
4860: 62 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ble</strong> <em
4870: 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64  >boolean</em></d
4880: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 43  t>.        <dd>C
4890: 61 6e 20 74 68 65 20 73 65 73 73 69 6f 6e 20 62  an the session b
48a0: 65 20 72 65 73 75 6d 65 64 20 6f 72 20 6e 6f 74  e resumed or not
48b0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
48c0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 61 72 74  dt><strong>start
48d0: 5f 74 69 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  _time</strong> <
48e0: 65 6d 3e 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c  em>seconds</em><
48f0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
4900: 3e 54 69 6d 65 20 73 69 6e 63 65 20 73 65 73 73  >Time since sess
4910: 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e 20 73  ion started in s
4920: 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65 70 6f  econds since epo
4930: 63 68 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ch.</dd>.       
4940: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 6d   <dt><strong>tim
4950: 65 6f 75 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  eout</strong> <e
4960: 6d 3e 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f  m>seconds</em></
4970: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
4980: 4d 61 78 20 64 75 72 61 74 69 6f 6e 20 6f 66 20  Max duration of 
4990: 73 65 73 73 69 6f 6e 20 69 6e 20 73 65 63 6f 6e  session in secon
49a0: 64 73 20 62 65 66 6f 72 65 20 74 69 6d 65 2d 6f  ds before time-o
49b0: 75 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ut.</dd>.       
49c0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6c 69 66   <dt><strong>lif
49d0: 65 74 69 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  etime</strong> <
49e0: 65 6d 3e 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c  em>seconds</em><
49f0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
4a00: 3e 53 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20  >Session ticket 
4a10: 6c 69 66 65 74 69 6d 65 20 68 69 6e 74 20 69 6e  lifetime hint in
4a20: 20 73 65 63 6f 6e 64 73 2e 3c 2f 64 64 3e 0a 20   seconds.</dd>. 
4a30: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
4a40: 6e 67 3e 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73  ng>session_id</s
4a50: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e  trong> <em>strin
4a60: 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  g</em></dt>.    
4a70: 20 20 20 20 3c 64 64 3e 55 6e 69 71 75 65 20 73      <dd>Unique s
4a80: 65 73 73 69 6f 6e 20 69 64 20 66 6f 72 20 75 73  ession id for us
4a90: 65 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68  e in resuming th
4aa0: 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a  e session.</dd>.
4ab0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
4ac0: 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f 74 69 63 6b  ong>session_tick
4ad0: 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  et</strong> <em>
4ae0: 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e  string</em></dt>
4af0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 55 6e 69  .        <dd>Uni
4b00: 71 75 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b  que session tick
4b10: 65 74 20 66 6f 72 20 75 73 65 20 69 6e 20 72 65  et for use in re
4b20: 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73 73 69  suming the sessi
4b30: 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  on.</dd>.       
4b40: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 63   <dt><strong>tic
4b50: 6b 65 74 5f 61 70 70 5f 64 61 74 61 3c 2f 73 74  ket_app_data</st
4b60: 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67  rong> <em>string
4b70: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
4b80: 20 20 20 3c 64 64 3e 55 6e 69 71 75 65 20 73 65     <dd>Unique se
4b90: 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 61 70 70  ssion ticket app
4ba0: 6c 69 63 61 74 69 6f 6e 20 64 61 74 61 2e 3c 2f  lication data.</
4bb0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
4bc0: 3c 73 74 72 6f 6e 67 3e 6d 61 73 74 65 72 5f 6b  <strong>master_k
4bd0: 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ey</strong> <em>
4be0: 62 69 6e 61 72 79 5f 73 74 72 69 6e 67 3c 2f 65  binary_string</e
4bf0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
4c00: 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 69  <dd>Unique sessi
4c10: 6f 6e 20 6d 61 73 74 65 72 20 6b 65 79 2e 3c 2f  on master key.</
4c20: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
4c30: 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f  <strong>session_
4c40: 63 61 63 68 65 5f 6d 6f 64 65 3c 2f 73 74 72 6f  cache_mode</stro
4c50: 6e 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d  ng> <em>mode</em
4c60: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
4c70: 64 64 3e 53 65 72 76 65 72 20 63 61 63 68 65 20  dd>Server cache 
4c80: 6d 6f 64 65 20 28 63 6c 69 65 6e 74 2c 20 73 65  mode (client, se
4c90: 72 76 65 72 2c 20 6f 72 20 62 6f 74 68 29 2e 3c  rver, or both).<
4ca0: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c  /dd>.    </dl>.<
4cb0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20  /blockquote>..  
4cc0: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74    <dt><a name="t
4cd0: 6c 73 3a 3a 63 69 70 68 65 72 73 22 3e 3c 73 74  ls::ciphers"><st
4ce0: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72  rong>tls::cipher
4cf0: 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c  s</strong>.    <
4d00: 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72  em>protocol ?ver
4d10: 62 6f 73 65 3f 20 3f 73 75 70 70 6f 72 74 65 64  bose? ?supported
4d20: 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a  ?</em></a></dt>.
4d30: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20      <dd>Returns 
4d40: 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f 72  a list of suppor
4d50: 74 65 64 20 63 69 70 68 65 72 73 20 61 76 61 69  ted ciphers avai
4d60: 6c 61 62 6c 65 20 66 6f 72 20 3c 65 6d 3e 70 72  lable for <em>pr
4d70: 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 2c 0a 20 20 20  otocol</em>,.   
4d80: 20 20 20 20 20 77 68 65 72 65 20 70 72 6f 74 6f       where proto
4d90: 63 6f 6c 20 6d 75 73 74 20 62 65 20 6f 6e 65 20  col must be one 
4da0: 6f 66 20 3c 62 3e 73 73 6c 32 2c 20 73 73 6c 33  of <b>ssl2, ssl3
4db0: 2c 20 74 6c 73 31 2c 20 74 6c 73 31 2e 31 2c 0a  , tls1, tls1.1,.
4dc0: 09 74 6c 73 31 2e 32 2c 3c 2f 62 3e 20 6f 72 20  .tls1.2,</b> or 
4dd0: 3c 62 3e 74 6c 73 31 2e 33 3c 2f 62 3e 2e 20 49  <b>tls1.3</b>. I
4de0: 66 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f 65  f <em>verbose</e
4df0: 6d 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20  m> is specified 
4e00: 61 73 0a 09 74 72 75 65 20 74 68 65 6e 20 61 20  as..true then a 
4e10: 76 65 72 62 6f 73 65 2c 20 68 75 6d 61 6e 20 72  verbose, human r
4e20: 65 61 64 61 62 6c 65 20 6c 69 73 74 20 69 73 20  eadable list is 
4e30: 72 65 74 75 72 6e 65 64 20 77 69 74 68 0a 09 61  returned with..a
4e40: 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d  dditional inform
4e50: 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 63 69 70  ation on the cip
4e60: 68 65 72 2e 20 49 66 20 3c 65 6d 3e 73 75 70 70  her. If <em>supp
4e70: 6f 72 74 65 64 3c 2f 65 6d 3e 0a 09 69 73 20 73  orted</em>..is s
4e80: 70 65 63 69 66 69 65 64 20 61 73 20 74 72 75 65  pecified as true
4e90: 2c 20 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20  , then only the 
4ea0: 63 69 70 68 65 72 73 20 73 75 70 70 6f 72 74 65  ciphers supporte
4eb0: 64 20 66 6f 72 20 70 72 6f 74 6f 63 6f 6c 0a 09  d for protocol..
4ec0: 77 69 6c 6c 20 62 65 20 6c 69 73 74 65 64 2e 3c  will be listed.<
4ed0: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61  /dd>..    <dt><a
4ee0: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 70 72 6f 74   name="tls::prot
4ef0: 6f 63 6f 6c 73 22 3e 3c 73 74 72 6f 6e 67 3e 74  ocols"><strong>t
4f00: 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 73  ls::protocols</s
4f10: 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a  trong></a></dt>.
4f20: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20      <dd>Returns 
4f30: 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f 72  a list of suppor
4f40: 74 65 64 20 70 72 6f 74 6f 63 6f 6c 73 2e 20 56  ted protocols. V
4f50: 61 6c 69 64 20 76 61 6c 75 65 73 20 61 72 65 3a  alid values are:
4f60: 0a 09 3c 62 3e 73 73 6c 32 3c 2f 62 3e 2c 20 3c  ..<b>ssl2</b>, <
4f70: 62 3e 73 73 6c 33 3c 2f 62 3e 2c 20 3c 62 3e 74  b>ssl3</b>, <b>t
4f80: 6c 73 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31  ls1</b>, <b>tls1
4f90: 2e 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 2e  .1</b>, <b>tls1.
4fa0: 32 3c 2f 62 3e 2c 0a 09 61 6e 64 20 3c 62 3e 74  2</b>,..and <b>t
4fb0: 6c 73 31 2e 33 3c 2f 62 3e 2e 20 45 78 61 63 74  ls1.3</b>. Exact
4fc0: 20 6c 69 73 74 20 64 65 70 65 6e 64 73 20 6f 6e   list depends on
4fd0: 20 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e   OpenSSL version
4fe0: 20 61 6e 64 0a 09 63 6f 6d 70 69 6c 65 20 74 69   and..compile ti
4ff0: 6d 65 20 66 6c 61 67 73 2e 3c 2f 64 64 3e 0a 0a  me flags.</dd>..
5000: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
5010: 22 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 3e 3c  "tls::version"><
5020: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 65 72 73  strong>tls::vers
5030: 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e  ion</strong></a>
5040: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65  </dt>.    <dd>Re
5050: 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e 53 53  turns the OpenSS
5060: 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69 6e 67  L version string
5070: 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68  .</dd>.</dl>..<h
5080: 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 41 4c 4c 42  3><a name="CALLB
5090: 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c  ACK OPTIONS">CAL
50a0: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61  LBACK OPTIONS</a
50b0: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 20 69  ></h3>..<p>.As i
50c0: 6e 64 69 63 61 74 65 64 20 61 62 6f 76 65 2c 20  ndicated above, 
50d0: 69 6e 64 69 76 69 64 75 61 6c 20 63 68 61 6e 6e  individual chann
50e0: 65 6c 73 20 63 61 6e 20 62 65 20 67 69 76 65 6e  els can be given
50f0: 20 74 68 65 69 72 20 6f 77 6e 20 63 61 6c 6c 62   their own callb
5100: 61 63 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 20 69  acks.to handle i
5110: 6e 74 65 72 6d 65 64 69 61 74 65 20 70 72 6f 63  ntermediate proc
5120: 65 73 73 69 6e 67 20 62 79 20 74 68 65 20 4f 70  essing by the Op
5130: 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 75  enSSL library, u
5140: 73 69 6e 67 20 74 68 65 0a 3c 65 6d 3e 2d 63 6f  sing the.<em>-co
5150: 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 3c  mmand</em> and <
5160: 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d  em>-password</em
5170: 3e 20 6f 70 74 69 6f 6e 73 20 70 61 73 73 65 64  > options passed
5180: 20 74 6f 20 65 69 74 68 65 72 20 6f 66 0a 3c 73   to either of.<s
5190: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65  trong>tls::socke
51a0: 74 3c 2f 73 74 72 6f 6e 67 3e 20 6f 72 20 3c 73  t</strong> or <s
51b0: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72  trong>tls::impor
51c0: 74 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 3c 2f 70 3e  t</strong>..</p>
51d0: 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c  ..<blockquote>.<
51e0: 64 6c 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74  dl>..    <dt><st
51f0: 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73  rong>-command</s
5200: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62  trong> <em>callb
5210: 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ack</em></dt>.  
5220: 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20    <dd>..Invokes 
5230: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65  the specified <e
5240: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20  m>callback</em> 
5250: 73 63 72 69 70 74 20 61 74 0a 09 73 65 76 65 72  script at..sever
5260: 61 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e 67  al points during
5270: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e   the OpenSSL han
5280: 64 73 68 61 6b 65 2e 0a 09 45 78 63 65 70 74 20  dshake...Except 
5290: 61 73 20 69 6e 64 69 63 61 74 65 64 20 62 65 6c  as indicated bel
52a0: 6f 77 2c 20 76 61 6c 75 65 73 20 72 65 74 75 72  ow, values retur
52b0: 6e 65 64 20 66 72 6f 6d 20 74 68 65 0a 09 63 61  ned from the..ca
52c0: 6c 6c 62 61 63 6b 20 61 72 65 20 69 67 6e 6f 72  llback are ignor
52d0: 65 64 2e 0a 09 41 72 67 75 6d 65 6e 74 73 20 61  ed...Arguments a
52e0: 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65 20 73  ppended to the s
52f0: 63 72 69 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62  cript upon callb
5300: 61 63 6b 20 74 61 6b 65 20 6f 6e 65 20 6f 66 20  ack take one of 
5310: 74 68 65 0a 09 66 6f 6c 6c 6f 77 69 6e 67 20 66  the..following f
5320: 6f 72 6d 73 3a 0a 0a 09 3c 62 72 3e 0a 09 3c 62  orms:...<br>..<b
5330: 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 09 3c 64 74 3e  r>...<dl>...<dt>
5340: 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e  ..  <strong>alpn
5350: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72  </strong> <em>pr
5360: 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 0a 09 3c 2f 64  otocol</em>..</d
5370: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 46 6f 72 20  t>..<dd>..  For 
5380: 73 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 6f  servers, this fo
5390: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
53a0: 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74  s invoked when t
53b0: 68 65 20 63 6c 69 65 6e 74 20 41 4c 50 4e 0a 09  he client ALPN..
53c0: 20 20 68 65 61 64 65 72 20 69 73 20 72 65 63 65    header is rece
53d0: 69 76 65 64 20 61 6e 64 20 74 68 65 20 66 69 72  ived and the fir
53e0: 73 74 20 3c 62 3e 2d 61 6c 70 6e 3c 2f 62 3e 20  st <b>-alpn</b> 
53f0: 73 70 65 63 69 66 69 65 64 20 70 72 6f 74 6f 63  specified protoc
5400: 6f 6c 20 63 6f 6d 6d 6f 6e 0a 09 20 20 74 6f 20  ol common..  to 
5410: 74 68 65 20 62 6f 74 68 20 74 68 65 20 63 6c 69  the both the cli
5420: 65 6e 74 20 61 6e 64 20 73 65 72 76 65 72 20 69  ent and server i
5430: 73 20 73 65 6c 65 63 74 65 64 2e 20 49 66 20 6e  s selected. If n
5440: 6f 6e 65 2c 20 74 68 65 20 66 69 72 73 74 0a 09  one, the first..
5450: 20 20 63 6c 69 65 6e 74 20 73 70 65 63 69 66 69    client specifi
5460: 65 64 20 70 72 6f 74 6f 63 6f 6c 20 69 73 20 75  ed protocol is u
5470: 73 65 64 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62  sed...</dd>...<b
5480: 72 3e 0a 0a 3c 21 2d 2d 09 54 68 69 73 20 66 6f  r>..<!--.This fo
5490: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
54a0: 73 20 64 69 73 61 62 6c 65 64 2e 0a 0a 09 3c 64  s disabled....<d
54b0: 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 65 72  t>..  <strong>er
54c0: 72 6f 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ror</strong> <em
54d0: 3e 63 68 61 6e 6e 65 6c 20 6d 65 73 73 61 67 65  >channel message
54e0: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64  </em>..</dt>..<d
54f0: 64 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 65  d>..  The <em>me
5500: 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72 67 75 6d  ssage</em> argum
5510: 65 6e 74 20 63 6f 6e 74 61 69 6e 73 20 61 6e 20  ent contains an 
5520: 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 67 65  error message ge
5530: 6e 65 72 61 74 65 64 0a 09 20 20 62 79 20 74 68  nerated..  by th
5540: 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69  e OpenSSL functi
5550: 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 45 52 52 5f  on..  <code>ERR_
5560: 72 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72  reason_error_str
5570: 69 6e 67 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 3c  ing()</code>...<
5580: 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 2d 2d 3e 0a  /dd>...<br>.-->.
5590: 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e  ..<dt>..  <stron
55a0: 67 3e 68 65 6c 6c 6f 3c 2f 73 74 72 6f 6e 67 3e  g>hello</strong>
55b0: 20 3c 65 6d 3e 73 65 72 76 65 72 6e 61 6d 65 3c   <em>servername<
55c0: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64  /em>..</dt>..<dd
55d0: 3e 0a 09 20 20 46 6f 72 20 73 65 72 76 65 72 73  >..  For servers
55e0: 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63  , this form of c
55f0: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b  allback is invok
5600: 65 64 20 64 75 72 69 6e 67 20 63 6c 69 65 6e 74  ed during client
5610: 20 68 65 6c 6c 6f 0a 09 20 20 6d 65 73 73 61 67   hello..  messag
5620: 65 20 70 72 6f 63 65 73 73 69 6e 67 2e 0a 09 3c  e processing...<
5630: 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64  /dd>...<br>...<d
5640: 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 69 6e  t>..  <strong>in
5650: 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  fo</strong> <em>
5660: 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f 72 20 6d 69  channel major mi
5670: 6e 6f 72 20 6d 65 73 73 61 67 65 3c 2f 65 6d 3e  nor message</em>
5680: 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20  ..</dt>..<dd>.. 
5690: 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61   This form of ca
56a0: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65  llback is invoke
56b0: 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c  d by the OpenSSL
56c0: 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 6f   function..  <co
56d0: 64 65 3e 53 53 4c 5f 43 54 58 5f 73 65 74 5f 69  de>SSL_CTX_set_i
56e0: 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b 28 29 3c 2f  nfo_callback()</
56f0: 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09  code>...  <br>..
5700: 20 20 54 68 65 20 3c 65 6d 3e 6d 61 6a 6f 72 3c    The <em>major<
5710: 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e 6d 69 6e  /em> and <em>min
5720: 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74  or</em> argument
5730: 73 20 61 72 65 20 75 73 65 64 20 74 6f 0a 09 20  s are used to.. 
5740: 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 73   represent the s
5750: 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  tate information
5760: 20 62 69 74 6d 61 73 6b 2e 0a 09 20 20 3c 64 6c   bitmask...  <dl
5770: 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 69 62 6c  >..  <dt>Possibl
5780: 65 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d  e values for <em
5790: 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a  >major</em> are:
57a0: 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f  </dt>..  <dd><co
57b0: 64 65 3e 68 61 6e 64 73 68 61 6b 65 2c 20 61 6c  de>handshake, al
57c0: 65 72 74 2c 20 63 6f 6e 6e 65 63 74 2c 20 61 63  ert, connect, ac
57d0: 63 65 70 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64  cept</code>.</dd
57e0: 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 69 62 6c  >..  <dt>Possibl
57f0: 65 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d  e values for <em
5800: 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a  >minor</em> are:
5810: 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f  </dt>..  <dd><co
5820: 64 65 3e 73 74 61 72 74 2c 20 64 6f 6e 65 2c 20  de>start, done, 
5830: 72 65 61 64 2c 20 77 72 69 74 65 2c 20 6c 6f 6f  read, write, loo
5840: 70 2c 20 65 78 69 74 3c 2f 63 6f 64 65 3e 2e 3c  p, exit</code>.<
5850: 2f 64 64 3e 0a 09 20 20 3c 2f 64 6c 3e 0a 09 20  /dd>..  </dl>.. 
5860: 20 54 68 65 20 3c 65 6d 3e 6d 65 73 73 61 67 65   The <em>message
5870: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69  </em> argument i
5880: 73 20 61 20 64 65 73 63 72 69 70 74 69 76 65 20  s a descriptive 
5890: 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61 79  string which may
58a0: 0a 09 20 20 62 65 20 67 65 6e 65 72 61 74 65 64  ..  be generated
58b0: 20 65 69 74 68 65 72 20 62 79 0a 09 20 20 3c 63   either by..  <c
58c0: 6f 64 65 3e 53 53 4c 5f 73 74 61 74 65 5f 73 74  ode>SSL_state_st
58d0: 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64  ring_long()</cod
58e0: 65 3e 20 6f 72 20 62 79 0a 09 20 20 3c 63 6f 64  e> or by..  <cod
58f0: 65 3e 53 53 4c 5f 61 6c 65 72 74 5f 64 65 73 63  e>SSL_alert_desc
5900: 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f  _string_long()</
5910: 63 6f 64 65 3e 2c 0a 09 20 20 64 65 70 65 6e 64  code>,..  depend
5920: 69 6e 67 20 6f 6e 20 63 6f 6e 74 65 78 74 2e 0a  ing on context..
5930: 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09  .</dd>...<br>...
5940: 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e  <dt>..  <strong>
5950: 73 65 73 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e  session</strong>
5960: 20 3c 65 6d 3e 73 65 73 73 69 6f 6e 5f 69 64 20   <em>session_id 
5970: 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 3c  ticket lifetime<
5980: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64  /em>..</dt>..<dd
5990: 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f  >..  This form o
59a0: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e  f callback is in
59b0: 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65  voked by the Ope
59c0: 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20  nSSL function.. 
59d0: 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73   <code>SSL_CTX_s
59e0: 65 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62 28 29  ess_set_new_cb()
59f0: 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 57 68 65 72  </code>...  Wher
5a00: 65 20 3c 65 6d 3e 73 65 73 73 69 6f 6e 5f 69 64  e <em>session_id
5a10: 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 63 75 72  </em> is the cur
5a20: 72 65 6e 74 20 73 65 73 73 69 6f 6e 20 69 64 65  rent session ide
5a30: 6e 74 69 66 69 65 72 2c 0a 09 20 20 3c 65 6d 3e  ntifier,..  <em>
5a40: 74 69 63 6b 65 74 3c 2f 65 6d 3e 20 69 73 20 74  ticket</em> is t
5a50: 68 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65  he session ticke
5a60: 74 20 69 6e 66 6f 2c 20 61 6e 64 20 3c 65 6d 3e  t info, and <em>
5a70: 6c 69 66 65 74 69 6d 65 3c 2f 65 6d 3e 0a 09 20  lifetime</em>.. 
5a80: 20 69 73 20 74 68 65 20 74 68 65 20 74 69 63 6b   is the the tick
5a90: 65 74 20 6c 69 66 65 74 69 6d 65 20 69 6e 20 73  et lifetime in s
5aa0: 65 63 6f 6e 64 73 2e 0a 09 3c 2f 64 64 3e 0a 0a  econds...</dd>..
5ab0: 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20  .<br>...<dt>..  
5ac0: 3c 73 74 72 6f 6e 67 3e 73 6e 69 3c 2f 73 74 72  <strong>sni</str
5ad0: 6f 6e 67 3e 20 3c 65 6d 3e 73 65 72 76 65 72 6e  ong> <em>servern
5ae0: 61 6d 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a  ame</em>..</dt>.
5af0: 09 3c 64 64 3e 0a 09 20 20 46 6f 72 20 73 65 72  .<dd>..  For ser
5b00: 76 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20  vers, this form 
5b10: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
5b20: 6e 76 6f 6b 65 64 20 77 68 65 6e 20 74 68 65 20  nvoked when the 
5b30: 53 4e 49 20 68 65 61 64 65 72 0a 09 20 20 66 72  SNI header..  fr
5b40: 6f 6d 20 74 68 65 20 63 6c 69 65 6e 74 20 69 73  om the client is
5b50: 20 72 65 63 65 69 76 65 64 2e 20 57 68 65 72 65   received. Where
5b60: 20 3c 69 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f   <i>servername</
5b70: 69 3e 20 69 73 20 74 68 65 20 63 6c 69 65 6e 74  i> is the client
5b80: 0a 09 20 20 73 70 65 63 69 66 69 65 64 20 73 65  ..  specified se
5b90: 72 76 65 72 6e 61 6d 65 2e 20 54 68 69 73 20 69  rvername. This i
5ba0: 73 20 75 73 65 64 20 77 68 65 6e 20 61 20 73 65  s used when a se
5bb0: 72 76 65 72 20 73 75 70 70 6f 72 74 73 20 6d 75  rver supports mu
5bc0: 6c 74 69 70 6c 65 0a 09 20 20 6e 61 6d 65 73 2c  ltiple..  names,
5bd0: 20 73 6f 20 74 68 65 20 72 69 67 68 74 20 63 65   so the right ce
5be0: 72 74 69 66 69 63 61 74 65 20 63 61 6e 20 62 65  rtificate can be
5bf0: 20 75 73 65 64 2e 0a 09 3c 2f 64 64 3e 0a 0a 09   used...</dd>...
5c00: 3c 62 72 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74  <br>..<br>...<dt
5c10: 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 76 65 72  >..  <strong>ver
5c20: 69 66 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ify</strong> <em
5c30: 3e 63 68 61 6e 6e 65 6c 20 64 65 70 74 68 20 63  >channel depth c
5c40: 65 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72  ert status error
5c50: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64  </em>..</dt>..<d
5c60: 64 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20  d>..  This form 
5c70: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69  of callback is i
5c80: 6e 76 6f 6b 65 64 20 62 79 20 4f 70 65 6e 53 53  nvoked by OpenSS
5c90: 4c 20 77 68 65 6e 20 61 20 6e 65 77 20 63 65 72  L when a new cer
5ca0: 74 69 66 69 63 61 74 65 0a 09 20 20 69 73 20 72  tificate..  is r
5cb0: 65 63 65 69 76 65 64 20 66 72 6f 6d 20 74 68 65  eceived from the
5cc0: 20 70 65 65 72 2e 20 49 74 20 61 6c 6c 6f 77 73   peer. It allows
5cd0: 20 74 68 65 20 63 6c 69 65 6e 74 20 74 6f 20 63   the client to c
5ce0: 68 65 63 6b 20 74 68 65 0a 09 20 20 63 65 72 74  heck the..  cert
5cf0: 69 66 69 63 61 74 65 20 76 65 72 69 66 69 63 61  ificate verifica
5d00: 74 69 6f 6e 20 72 65 73 75 6c 74 20 61 6e 64 20  tion result and 
5d10: 63 68 6f 6f 73 65 20 77 68 65 74 68 65 72 20 74  choose whether t
5d20: 6f 20 63 6f 6e 74 69 6e 75 65 20 6f 72 20 6e 6f  o continue or no
5d30: 74 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68  t...  <br>..  Th
5d40: 65 20 3c 65 6d 3e 64 65 70 74 68 3c 2f 65 6d 3e  e <em>depth</em>
5d50: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20   argument is an 
5d60: 69 6e 74 65 67 65 72 20 72 65 70 72 65 73 65 6e  integer represen
5d70: 74 69 6e 67 20 74 68 65 0a 09 20 20 63 75 72 72  ting the..  curr
5d80: 65 6e 74 20 64 65 70 74 68 20 6f 6e 20 74 68 65  ent depth on the
5d90: 20 63 65 72 74 69 66 69 63 61 74 65 20 63 68 61   certificate cha
5da0: 69 6e 2c 20 77 69 74 68 0a 09 20 20 3c 63 6f 64  in, with..  <cod
5db0: 65 3e 30 3c 2f 63 6f 64 65 3e 20 61 73 20 74 68  e>0</code> as th
5dc0: 65 20 73 75 62 6a 65 63 74 20 63 65 72 74 69 66  e subject certif
5dd0: 69 63 61 74 65 20 61 6e 64 20 68 69 67 68 65 72  icate and higher
5de0: 20 76 61 6c 75 65 73 0a 09 20 20 64 65 6e 6f 74   values..  denot
5df0: 69 6e 67 20 70 72 6f 67 72 65 73 73 69 76 65 6c  ing progressivel
5e00: 79 20 6d 6f 72 65 20 69 6e 64 69 72 65 63 74 20  y more indirect 
5e10: 69 73 73 75 65 72 20 63 65 72 74 69 66 69 63 61  issuer certifica
5e20: 74 65 73 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20  tes...  <br>..  
5e30: 54 68 65 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d  The <em>cert</em
5e40: 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20  > argument is a 
5e50: 6c 69 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75  list of key-valu
5e60: 65 20 70 61 69 72 73 20 73 69 6d 69 6c 61 72 0a  e pairs similar.
5e70: 09 20 20 74 6f 20 74 68 6f 73 65 20 72 65 74 75  .  to those retu
5e80: 72 6e 65 64 20 62 79 0a 09 20 20 3c 61 20 68 72  rned by..  <a hr
5e90: 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61 74 75 73  ef="#tls::status
5ea0: 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73  "><strong>tls::s
5eb0: 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  tatus</strong></
5ec0: 61 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54  a>...  <br>..  T
5ed0: 68 65 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65  he <em>status</e
5ee0: 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61  m> argument is a
5ef0: 6e 20 69 6e 74 65 67 65 72 20 72 65 70 72 65 73  n integer repres
5f00: 65 6e 74 69 6e 67 20 74 68 65 0a 09 20 20 63 75  enting the..  cu
5f10: 72 72 65 6e 74 20 76 61 6c 69 64 69 74 79 20 6f  rrent validity o
5f20: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
5f30: 65 2e 0a 09 20 20 41 20 76 61 6c 75 65 20 6f 66  e...  A value of
5f40: 20 3c 63 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20   <code>0</code> 
5f50: 6d 65 61 6e 73 20 74 68 65 20 63 65 72 74 69 66  means the certif
5f60: 69 63 61 74 65 20 69 73 20 64 65 65 6d 65 64 20  icate is deemed 
5f70: 69 6e 76 61 6c 69 64 2e 0a 09 20 20 41 20 76 61  invalid...  A va
5f80: 6c 75 65 20 6f 66 20 3c 63 6f 64 65 3e 31 3c 2f  lue of <code>1</
5f90: 63 6f 64 65 3e 20 6d 65 61 6e 73 20 74 68 65 20  code> means the 
5fa0: 63 65 72 74 69 66 69 63 61 74 65 20 69 73 20 64  certificate is d
5fb0: 65 65 6d 65 64 20 76 61 6c 69 64 2e 0a 09 20 20  eemed valid...  
5fc0: 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e  <br>..  The <em>
5fd0: 65 72 72 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d  error</em> argum
5fe0: 65 6e 74 20 73 75 70 70 6c 69 65 73 20 74 68 65  ent supplies the
5ff0: 20 6d 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79   message, if any
6000: 2c 20 67 65 6e 65 72 61 74 65 64 0a 09 20 20 62  , generated..  b
6010: 79 20 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f  y <code>X509_STO
6020: 52 45 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f 72  RE_CTX_get_error
6030: 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62  ()</code>...  <b
6040: 72 3e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68  r>..  <br>..  Th
6050: 65 20 63 61 6c 6c 62 61 63 6b 20 6d 61 79 20 6f  e callback may o
6060: 76 65 72 72 69 64 65 20 6e 6f 72 6d 61 6c 20 76  verride normal v
6070: 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f 63 65 73  alidation proces
6080: 73 69 6e 67 20 62 79 20 65 78 70 6c 69 63 69 74  sing by explicit
6090: 6c 79 0a 09 20 20 72 65 74 75 72 6e 69 6e 67 20  ly..  returning 
60a0: 6f 6e 65 20 6f 66 20 74 68 65 20 61 62 6f 76 65  one of the above
60b0: 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e   <em>status</em>
60c0: 20 76 61 6c 75 65 73 2e 0a 09 3c 2f 64 64 3e 0a   values...</dd>.
60d0: 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64  ..</dl>.    </dd
60e0: 3e 0a 0a 20 20 20 20 3c 62 72 3e 0a 0a 20 20 20  >..    <br>..   
60f0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61   <dt><strong>-pa
6100: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20  ssword</strong> 
6110: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d  <em>callback</em
6120: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a  ></dt>.    <dd>.
6130: 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65  .Invokes the spe
6140: 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62  cified <em>callb
6150: 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20  ack</em> script 
6160: 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65  when OpenSSL nee
6170: 64 73 20 74 6f 0a 09 6f 62 74 61 69 6e 20 61 20  ds to..obtain a 
6180: 70 61 73 73 77 6f 72 64 2e 20 20 54 68 65 20 63  password.  The c
6190: 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72  allback should r
61a0: 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 77  eturn a string w
61b0: 68 69 63 68 0a 09 72 65 70 72 65 73 65 6e 74 73  hich..represents
61c0: 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 74 6f   the password to
61d0: 20 62 65 20 75 73 65 64 2e 0a 09 4e 6f 20 61 72   be used...No ar
61e0: 67 75 6d 65 6e 74 73 20 61 72 65 20 61 70 70 65  guments are appe
61f0: 6e 64 65 64 20 74 6f 20 74 68 65 20 73 63 72 69  nded to the scri
6200: 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62 61 63 6b  pt upon callback
6210: 2e 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c  ..    </dd>.</dl
6220: 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a  >.</blockquote>.
6230: 0a 3c 70 3e 0a 52 65 66 65 72 65 6e 63 65 20 69  .<p>.Reference i
6240: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f  mplementations o
6250: 66 20 74 68 65 73 65 20 63 61 6c 6c 62 61 63 6b  f these callback
6260: 73 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 69  s are provided i
6270: 6e 20 74 68 65 0a 64 69 73 74 72 69 62 75 74 69  n the.distributi
6280: 6f 6e 20 61 73 20 3c 73 74 72 6f 6e 67 3e 74 6c  on as <strong>tl
6290: 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72  s::callback</str
62a0: 6f 6e 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67  ong> and.<strong
62b0: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f  >tls::password</
62c0: 73 74 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 69  strong> respecti
62d0: 76 65 6c 79 2e 20 20 4e 6f 74 65 20 74 68 61 74  vely.  Note that
62e0: 20 74 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e 73   these are.<em>s
62f0: 61 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c 65  ample</em> imple
6300: 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 2e  mentations only.
6310: 20 20 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 6c    In a more real
6320: 69 73 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e 74  istic deployment
6330: 0a 79 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 69  .you would speci
6340: 66 79 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c 6c  fy your own call
6350: 62 61 63 6b 20 73 63 72 69 70 74 73 20 6f 6e 20  back scripts on 
6360: 65 61 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 6c  each TLS channel
6370: 0a 75 73 69 6e 67 20 74 68 65 20 3c 65 6d 3e 2d  .using the <em>-
6380: 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64  command</em> and
6390: 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f   <em>-password</
63a0: 65 6d 3e 20 6f 70 74 69 6f 6e 73 2e 0a 3c 2f 70  em> options..</p
63b0: 3e 0a 0a 3c 70 3e 0a 54 68 65 20 64 65 66 61 75  >..<p>.The defau
63c0: 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e  lt behavior when
63d0: 20 74 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e   the <em>-comman
63e0: 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20 69 73  d</em> option is
63f0: 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20 69   not specified i
6400: 73 20 66 6f 72 0a 54 4c 53 20 74 6f 20 70 72 6f  s for.TLS to pro
6410: 63 65 73 73 20 74 68 65 20 61 73 73 6f 63 69 61  cess the associa
6420: 74 65 64 20 6c 69 62 72 61 72 79 20 63 61 6c 6c  ted library call
6430: 62 61 63 6b 73 20 69 6e 74 65 72 6e 61 6c 6c 79  backs internally
6440: 2e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 62 65  ..The default be
6450: 68 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20  havior when the 
6460: 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65  <em>-password</e
6470: 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f 74  m> option is not
6480: 20 73 70 65 63 69 66 69 65 64 20 69 73 20 66 6f   specified is fo
6490: 72 0a 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73  r.TLS to process
64a0: 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 20   the associated 
64b0: 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b  library callback
64c0: 73 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67 20  s by attempting 
64d0: 74 6f 20 63 61 6c 6c 0a 3c 73 74 72 6f 6e 67 3e  to call.<strong>
64e0: 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73  tls::password</s
64f0: 74 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66 66  trong>..The diff
6500: 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20 74  erence between t
6510: 68 65 73 65 20 74 77 6f 20 62 65 68 61 76 69 6f  hese two behavio
6520: 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75 65  rs is a conseque
6530: 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e 69  nce of maintaini
6540: 6e 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74 79  ng.compatibility
6550: 20 77 69 74 68 20 65 61 72 6c 69 65 72 20 69 6d   with earlier im
6560: 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a 3c  plementations..<
6570: 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73 74  /p>..<p>.The <st
6580: 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c  rong>tls::debug<
6590: 2f 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 6c  /strong> variabl
65a0: 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20  e provides some 
65b0: 61 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72  additional.contr
65c0: 6f 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72 65  ol over these re
65d0: 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b  ference callback
65e0: 73 2e 20 20 49 74 73 20 76 61 6c 75 65 20 69 73  s.  Its value is
65f0: 20 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c 74   zero by default
6600: 2e 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73 20  ..Higher values 
6610: 70 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 61  produce more dia
6620: 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 20  gnostic output, 
6630: 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f  and will also fo
6640: 72 63 65 20 74 68 65 0a 76 65 72 69 66 79 20 6d  rce the.verify m
6650: 65 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e 67  ethod in <strong
6660: 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f  >tls::callback</
6670: 73 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 70  strong> to accep
6680: 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 74  t the.certificat
6690: 65 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74 20  e, even when it 
66a0: 69 73 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70 3e  is invalid..</p>
66b0: 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75  ..<p>.<em>.The u
66c0: 73 65 20 6f 66 20 74 68 65 20 72 65 66 65 72 65  se of the refere
66d0: 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c 73  nce callbacks <s
66e0: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62  trong>tls::callb
66f0: 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64  ack</strong> and
6700: 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61  .<strong>tls::pa
6710: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20  ssword</strong> 
6720: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64  is not recommend
6730: 65 64 2e 20 20 54 68 65 79 20 6d 61 79 20 62 65  ed.  They may be
6740: 20 72 65 6d 6f 76 65 64 0a 66 72 6f 6d 20 66 75   removed.from fu
6750: 74 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c  ture releases..<
6760: 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c  /em>.</p>..<p>.<
6770: 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74  em>.The use of t
6780: 68 65 20 76 61 72 69 61 62 6c 65 20 3c 73 74 72  he variable <str
6790: 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f  ong>tls::debug</
67a0: 73 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72  strong> is not r
67b0: 65 63 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 20 6d  ecommended..It m
67c0: 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72  ay be removed fr
67d0: 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 73  om future releas
67e0: 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a  es..</em>.</p>..
67f0: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 42  <h3><a name="DEB
6800: 55 47 22 3e 44 45 42 55 47 3c 2f 61 3e 3c 2f 68  UG">DEBUG</a></h
6810: 33 3e 0a 0a 54 4c 53 20 6b 65 79 20 6c 6f 67 67  3>..TLS key logg
6820: 69 6e 67 20 63 61 6e 20 62 65 20 65 6e 61 62 6c  ing can be enabl
6830: 65 64 20 62 79 20 73 65 74 74 69 6e 67 20 74 68  ed by setting th
6840: 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61  e environment va
6850: 72 69 61 62 6c 65 0a 3c 62 3e 53 53 4c 4b 45 59  riable.<b>SSLKEY
6860: 4c 4f 47 46 49 4c 45 3c 2f 62 3e 20 74 6f 20 74  LOGFILE</b> to t
6870: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 66  he name of the f
6880: 69 6c 65 20 74 6f 20 6c 6f 67 20 74 6f 2e 20 54  ile to log to. T
6890: 68 65 6e 20 77 68 65 6e 65 76 65 72 20 54 4c 53  hen whenever TLS
68a0: 0a 6b 65 79 20 6d 61 74 65 72 69 61 6c 20 69 73  .key material is
68b0: 20 67 65 6e 65 72 61 74 65 64 20 6f 72 20 72 65   generated or re
68c0: 63 65 69 76 65 64 20 69 74 20 77 69 6c 6c 20 62  ceived it will b
68d0: 65 20 6c 6f 67 67 65 64 20 74 6f 20 74 68 65 20  e logged to the 
68e0: 66 69 6c 65 2e 0a 0a 3c 68 33 3e 3c 61 20 6e 61  file...<h3><a na
68f0: 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50 4c  me="HTTPS EXAMPL
6900: 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45  E">HTTPS EXAMPLE
6910: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68  </a></h3>..<p>Th
6920: 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 73 20  is example uses 
6930: 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 72 2e  a sample server.
6940: 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 69 74  pem provided wit
6950: 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73  h the TLS releas
6960: 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74  e,.courtesy of t
6970: 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53  he <strong>OpenS
6980: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a  SL</strong> proj
6990: 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 3c  ect.</p>..<pre><
69a0: 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65  code>.package re
69b0: 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61  quire http.packa
69c0: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a  ge require tls..
69d0: 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68  http::register h
69e0: 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a  ttps 443 [list :
69f0: 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75  :tls::socket -au
6a00: 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72 75  toservername tru
6a10: 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 65 20  e -require true 
6a20: 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c 2f  -cadir /etc/ssl/
6a30: 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f 6b 20  certs]..set tok 
6a40: 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 68 74  [http::geturl ht
6a50: 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 6b  tps://www.tcl.tk
6a60: 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e  /].</code></pre>
6a70: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53  ..<h3><a name="S
6a80: 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41  PECIAL CONSIDERA
6a90: 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c 20 43  TIONS">SPECIAL C
6aa0: 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61  ONSIDERATIONS</a
6ab0: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 63  ></h3>..<p>The c
6ac0: 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74  apabilities of t
6ad0: 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20  his package can 
6ae0: 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20  vary enormously 
6af0: 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77 20 79  based.upon how y
6b00: 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72  our OpenSSL libr
6b10: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72  ary was configur
6b20: 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 74  ed and built. At
6b30: 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72 6f 2d   the.most macro-
6b40: 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73 75  level OpenSSL su
6b50: 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b 6e  pports a &quot;n
6b60: 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b 20  o patents&quot; 
6b70: 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64 69 73  build,.which dis
6b80: 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41 2c  ables RSA, IDEA,
6b90: 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20 53   RC(2,4,5) and S
6ba0: 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f 70  SL2 - if your Op
6bb0: 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69 67 75  enSSL is.configu
6bc0: 72 65 64 20 74 68 69 73 20 77 61 79 20 74 68 65  red this way the
6bd0: 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 20  n you will need 
6be0: 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77 69 74  to build TLS wit
6bf0: 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54 45 4e  h the.-DNO_PATEN
6c00: 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e 64 20  TS option - and 
6c10: 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20 6d 6f  the resultant mo
6c20: 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63 74 69  dule will functi
6c30: 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61 6e 64  on.correctly and
6c40: 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20 41 44   also support AD
6c50: 48 20 63 65 72 74 69 66 69 63 61 74 65 2d 6c 65  H certificate-le
6c60: 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c 0a 68  ss encryption,.h
6c70: 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c 6c 20  owever you will 
6c80: 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75 74 69  be unable to uti
6c90: 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73 70 65  lize this to spe
6ca0: 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57 65 62  ak to normal Web
6cb0: 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63 68 20  .Servers, which 
6cc0: 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75 69 72  typically requir
6cd0: 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e 20 50  e RSA support. P
6ce0: 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68 72 65  lease see <a.hre
6cf0: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70  f="http://www.op
6d00: 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74 74 70  enssl.org/">http
6d10: 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f  ://www.openssl.o
6d20: 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f 72 65  rg/</a> for.more
6d30: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20   information on 
6d40: 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75 65 20  the whole issue 
6d50: 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64 20 55  of patents and U
6d60: 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72 69 63  S export.restric
6d70: 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c 68 33  tions. </p>..<h3
6d80: 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20 41 4c  ><a name="SEE AL
6d90: 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e  SO">SEE ALSO</a>
6da0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f 6e  </h3>..<p><stron
6db0: 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67  g>socket</strong
6dc0: 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65  >, <strong>filee
6dd0: 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e 3c  vent, </strong><
6de0: 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77  a.href="http://w
6df0: 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22  ww.openssl.org/"
6e00: 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c  ><strong>OpenSSL
6e10: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70  </strong></a></p
6e20: 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e 0a 43  >..<hr>..<pre>.C
6e30: 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b 20  opyright &copy; 
6e40: 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e  1999 Matt Newman
6e50: 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70  ..Copyright &cop
6e60: 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 73 68  y; 2004 Starfish
6e70: 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72 65 3e   Systems..</pre>
6e80: 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c 3e  .</body>.</html>
6e90: 0a                                               .