Hex Artifact Content

Artifact 7d8a6ea6dea6bf3a9925098c23686466782de0ae:


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 20 0a  sitional//EN"> .
0040: 0a 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a  .<html>..<head>.
0050: 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76  <meta http-equiv
0060: 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a  ="Content-Type".
0070: 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74  content="text/ht
0080: 6d 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d  ml; charset=iso-
0090: 38 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e  8859-1">.<meta n
00a0: 61 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20  ame="Copyright" 
00b0: 63 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61  content="1999 Ma
00c0: 74 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34  tt Newman / 2004
00d0: 20 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d   Starfish System
00e0: 73 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28  s">.<title>TLS (
00f0: 53 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64  SSL) Tcl Command
0100: 73 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64  s</title>.</head
0110: 3e 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72  >..<body bgcolor
0120: 3d 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c  ="#FFFFFF">..<dl
0130: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65  >.    <dd><a hre
0140: 66 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f  f="#NAME">NAME</
0150: 61 3e 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20  a> <dl>.        
0160: 20 20 20 20 3c 64 64 3e 3c 73 74 72 6f 6e 67 3e      <dd><strong>
0170: 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62  tls</strong> - b
0180: 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e  inding to <stron
0190: 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e  g>OpenSSL</stron
01a0: 67 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  g>.             
01b0: 20 20 20 74 6f 6f 6c 6b 69 74 2e 3c 2f 64 64 3e     toolkit.</dd>
01c0: 0a 20 20 20 20 20 20 20 20 3c 2f 64 6c 3e 0a 20  .        </dl>. 
01d0: 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64     </dd>.    <dd
01e0: 3e 3c 61 20 68 72 65 66 3d 22 23 53 59 4e 4f 50  ><a href="#SYNOP
01f0: 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61  SIS">SYNOPSIS</a
0200: 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  > </dd>.    <dd>
0210: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 20 20 20  <dl>.           
0220: 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20   <dd><b>package 
0230: 72 65 71 75 69 72 65 20 54 63 6c 20 3c 2f 62 3e  require Tcl </b>
0240: 3c 65 6d 3e 3f 38 2e 32 3f 3c 2f 65 6d 3e 3c 2f  <em>?8.2?</em></
0250: 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  dd>.            
0260: 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72  <dd><b>package r
0270: 65 71 75 69 72 65 20 74 6c 73 20 3c 2f 62 3e 3c  equire tls </b><
0280: 65 6d 3e 3f 31 2e 35 3f 3c 2f 65 6d 3e 3c 2f 64  em>?1.5?</em></d
0290: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  d>.            <
02a0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20  dt>&nbsp;</dt>. 
02b0: 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c             <dd><
02c0: 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e  b>tls::init </b>
02d0: 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e  <i>?options?</i>
02e0: 20 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20   </dd>.         
02f0: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73     <dd><b>tls::s
0300: 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f  ocket </b><em>?o
0310: 70 74 69 6f 6e 73 3f 20 68 6f 73 74 20 70 6f 72  ptions? host por
0320: 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20  t</em></dd>.    
0330: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74          <dd><b>t
0340: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65  ls::socket</b><e
0350: 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d  m> ?-server comm
0360: 61 6e 64 3f 0a 20 20 20 20 20 20 20 20 20 20 20  and?.           
0370: 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73 3f 20 70       ?options? p
0380: 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20  ort</em></dd>.  
0390: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62            <dd><b
03a0: 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c  >tls::handshake<
03b0: 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c  /b><em> channel<
03c0: 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  /em></dd>.      
03d0: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73        <dd><b>tls
03e0: 3a 3a 73 74 61 74 75 73 20 3c 2f 62 3e 3c 65 6d  ::status </b><em
03f0: 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65  >?-local? channe
0400: 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20  l</em></dd>.    
0410: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74          <dd><b>t
0420: 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 3c 65  ls::import</b><e
0430: 6d 3e 20 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69  m> channel ?opti
0440: 6f 6e 73 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20  ons?</em></dd>. 
0450: 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c             <dd><
0460: 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 3c  b>tls::unimport<
0470: 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c  /b><em> channel<
0480: 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  /em></dd>.      
0490: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73        <dd><b>tls
04a0: 3a 3a 63 69 70 68 65 72 73 20 3c 2f 62 3e 3c 65  ::ciphers </b><e
04b0: 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62  m>protocol ?verb
04c0: 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20  ose?</em></dd>. 
04d0: 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c             <dd><
04e0: 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f  b>tls::version</
04f0: 62 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  b></dd>.        
0500: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a  </dl>.    </dd>.
0510: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
0520: 22 23 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d  "#COMMANDS">COMM
0530: 41 4e 44 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20  ANDS</a></dd>.  
0540: 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23    <dd><a href="#
0550: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53  CALLBACK OPTIONS
0560: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f  ">CALLBACK OPTIO
0570: 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20  NS</a></dd>.    
0580: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 48 54  <dd><a href="#HT
0590: 54 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54 54  TPS EXAMPLE">HTT
05a0: 50 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f  PS EXAMPLE</a></
05b0: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  dd>.    <dd><a h
05c0: 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e  ref="#SEE ALSO">
05d0: 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52  SPECIAL CONSIDER
05e0: 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a  ATIONS</a></dd>.
05f0: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
0600: 22 23 53 45 45 20 41 4c 53 4f 22 3e 53 45 45 20  "#SEE ALSO">SEE 
0610: 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 3e 0a 3c 2f  ALSO</a></dd>.</
0620: 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c  dl>..<hr>..<h3><
0630: 61 20 6e 61 6d 65 3d 22 4e 41 4d 45 22 3e 4e 41  a name="NAME">NA
0640: 4d 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e  ME</a></h3>..<p>
0650: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3c 2f 73 74 72  <strong>tls</str
0660: 6f 6e 67 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74  ong> - binding t
0670: 6f 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53  o <strong>OpenSS
0680: 4c 3c 2f 73 74 72 6f 6e 67 3e 0a 74 6f 6f 6c 6b  L</strong>.toolk
0690: 69 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20  it.</p>..<h3><a 
06a0: 6e 61 6d 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e  name="SYNOPSIS">
06b0: 53 59 4e 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33  SYNOPSIS</a></h3
06c0: 3e 0a 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65  >..<p><b>package
06d0: 20 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 32   require Tcl 8.2
06e0: 3c 2f 62 3e 3c 62 72 3e 0a 3c 62 3e 70 61 63 6b  </b><br>.<b>pack
06f0: 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 20  age require tls 
0700: 31 2e 36 3c 2f 62 3e 3c 62 72 3e 0a 3c 62 72 3e  1.6</b><br>.<br>
0710: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
0720: 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e  init"><b>tls::in
0730: 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f  it </b><i>?optio
0740: 6e 73 3f 3c 2f 69 3e 3c 62 72 3e 0a 3c 2f 61 3e  ns?</i><br>.</a>
0750: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73  <a href="#tls::s
0760: 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73  ocket"><b>tls::s
0770: 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f  ocket </b><em>?o
0780: 70 74 69 6f 6e 73 3f 20 68 6f 73 74 0a 70 6f 72  ptions? host.por
0790: 74 3c 2f 65 6d 3e 3c 62 72 3e 0a 3c 62 3e 74 6c  t</em><br>.<b>tl
07a0: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d  s::socket</b><em
07b0: 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61  > ?-server comma
07c0: 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f  nd? ?options? po
07d0: 72 74 3c 2f 65 6d 3e 3c 62 72 3e 0a 3c 2f 61 3e  rt</em><br>.</a>
07e0: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73  <a href="#tls::s
07f0: 74 61 74 75 73 22 3e 3c 62 3e 74 6c 73 3a 3a 73  tatus"><b>tls::s
0800: 74 61 74 75 73 20 3c 2f 62 3e 3c 65 6d 3e 3f 2d  tatus </b><em>?-
0810: 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f  local? channel</
0820: 65 6d 3e 3c 62 72 3e 0a 3c 2f 61 3e 3c 61 20 68  em><br>.</a><a h
0830: 72 65 66 3d 22 23 74 6c 73 3a 3a 68 61 6e 64 73  ref="#tls::hands
0840: 68 61 6b 65 22 3e 3c 62 3e 74 6c 73 3a 3a 68 61  hake"><b>tls::ha
0850: 6e 64 73 68 61 6b 65 3c 2f 62 3e 3c 65 6d 3e 20  ndshake</b><em> 
0860: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e  channel</em></a>
0870: 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65  <br>.<br>.<a hre
0880: 66 3d 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22  f="#tls::import"
0890: 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20  ><b>tls::import 
08a0: 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 20 3f  </b><i>channel ?
08b0: 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e  options?</i></a>
08c0: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74  <br>.<a href="#t
08d0: 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c 62  ls::unimport"><b
08e0: 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 20 3c  >tls::unimport <
08f0: 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69  /b><i>channel</i
0900: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65  ></a><br>.<a hre
0910: 66 3d 22 23 74 6c 73 3a 3a 63 69 70 68 65 72 73  f="#tls::ciphers
0920: 20 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f   protocol ?verbo
0930: 73 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  se?"><strong>tls
0940: 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74 72 6f 6e  ::ciphers</stron
0950: 67 3e 0a 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20  g>.<em>protocol 
0960: 3f 76 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f  ?verbose?</em></
0970: 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22  a><br>.<a href="
0980: 23 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 3e 3c  #tls::version"><
0990: 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f  b>tls::version</
09a0: 62 3e 3c 2f 61 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33  b></a>.</p>..<h3
09b0: 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 53 43 52 49  ><a name="DESCRI
09c0: 50 54 49 4f 4e 22 3e 44 45 53 43 52 49 50 54 49  PTION">DESCRIPTI
09d0: 4f 4e 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e  ON</a></h3>..<p>
09e0: 54 68 69 73 20 65 78 74 65 6e 73 69 6f 6e 20 70  This extension p
09f0: 72 6f 76 69 64 65 73 20 61 20 67 65 6e 65 72 69  rovides a generi
0a00: 63 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 61 0a  c binding to <a.
0a10: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
0a20: 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 4f  .openssl.org/">O
0a30: 70 65 6e 53 53 4c 3c 2f 61 3e 2c 20 75 74 69 6c  penSSL</a>, util
0a40: 69 7a 69 6e 67 20 74 68 65 0a 3c 73 74 72 6f 6e  izing the.<stron
0a50: 67 3e 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e 6e  g>Tcl_StackChann
0a60: 65 6c 3c 2f 73 74 72 6f 6e 67 3e 0a 41 50 49 20  el</strong>.API 
0a70: 66 6f 72 20 54 63 6c 20 38 2e 32 20 61 6e 64 20  for Tcl 8.2 and 
0a80: 68 69 67 68 65 72 2e 20 54 68 65 20 73 6f 63 6b  higher. The sock
0a90: 65 74 73 20 62 65 68 61 76 65 20 65 78 61 63 74  ets behave exact
0aa0: 6c 79 20 74 68 65 20 73 61 6d 65 0a 61 73 20 63  ly the same.as c
0ab0: 68 61 6e 6e 65 6c 73 20 63 72 65 61 74 65 64 20  hannels created 
0ac0: 75 73 69 6e 67 20 54 63 6c 27 73 20 62 75 69 6c  using Tcl's buil
0ad0: 74 2d 69 6e 20 3c 73 74 72 6f 6e 67 3e 73 6f 63  t-in <strong>soc
0ae0: 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63 6f 6d  ket</strong>.com
0af0: 6d 61 6e 64 20 77 69 74 68 20 61 64 64 69 74 69  mand with additi
0b00: 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 66 6f 72  onal options for
0b10: 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 74 68 65   controlling the
0b20: 20 53 53 4c 20 73 65 73 73 69 6f 6e 2e 0a 54 6f   SSL session..To
0b30: 20 75 73 65 20 54 4c 53 20 77 69 74 68 20 61 6e   use TLS with an
0b40: 20 65 61 72 6c 69 65 72 20 76 65 72 73 69 6f 6e   earlier version
0b50: 20 6f 66 20 54 63 6c 20 74 68 61 6e 20 38 2e 32   of Tcl than 8.2
0b60: 2c 20 70 6c 65 61 73 65 20 6f 62 74 61 69 6e 0a  , please obtain.
0b70: 54 4c 53 20 31 2e 33 2e 20 20 50 6c 65 61 73 65  TLS 1.3.  Please
0b80: 20 6e 6f 74 65 20 74 68 61 74 20 74 68 65 72 65   note that there
0b90: 20 61 72 65 20 6b 6e 6f 77 6e 20 6c 69 6d 69 74   are known limit
0ba0: 61 74 69 6f 6e 73 20 77 69 74 68 20 74 68 65 0a  ations with the.
0bb0: 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20  stacked channel 
0bc0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 70  implementation p
0bd0: 72 69 6f 72 20 74 6f 20 38 2e 33 2e 32 2c 20 73  rior to 8.3.2, s
0be0: 6f 20 69 74 20 69 73 20 72 65 63 6f 6d 6d 65 6e  o it is recommen
0bf0: 64 65 64 0a 74 68 61 74 20 54 4c 53 20 69 73 20  ded.that TLS is 
0c00: 75 73 65 64 20 77 69 74 68 20 61 6e 20 38 2e 33  used with an 8.3
0c10: 2e 32 2b 20 69 6e 74 65 72 70 72 65 74 65 72 2e  .2+ interpreter.
0c20: 20 20 54 68 65 20 63 75 72 72 65 6e 74 20 76 65    The current ve
0c30: 72 73 69 6f 6e 0a 6f 66 20 54 4c 53 20 77 69 6c  rsion.of TLS wil
0c40: 6c 20 77 6f 72 6b 20 77 69 74 68 20 54 63 6c 20  l work with Tcl 
0c50: 38 2e 32 2b 2c 20 69 74 20 69 73 20 6a 75 73 74  8.2+, it is just
0c60: 20 6d 6f 72 65 20 73 74 61 62 6c 65 20 77 69 74   more stable wit
0c70: 68 20 38 2e 33 2e 32 2b 2e 0a 3c 2f 70 3e 0a 0a  h 8.3.2+..</p>..
0c80: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 4f 4d  <h3><a name="COM
0c90: 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 3c  MANDS">COMMANDS<
0ca0: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 79 70  /a></h3>..<p>Typ
0cb0: 69 63 61 6c 6c 79 20 6f 6e 65 20 77 6f 75 6c 64  ically one would
0cc0: 20 75 73 65 20 74 68 65 20 3c 73 74 72 6f 6e 67   use the <strong
0cd0: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 73  >tls::socket </s
0ce0: 74 72 6f 6e 67 3e 63 6f 6d 6d 61 6e 64 0a 77 68  trong>command.wh
0cf0: 69 63 68 20 70 72 6f 76 69 64 65 73 20 63 6f 6d  ich provides com
0d00: 70 61 74 69 62 69 6c 69 74 79 20 77 69 74 68 20  patibility with 
0d10: 74 68 65 20 6e 61 74 69 76 65 20 54 63 6c 20 3c  the native Tcl <
0d20: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
0d30: 74 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 2e 20  trong>.command. 
0d40: 49 6e 20 73 75 63 68 20 63 61 73 65 73 20 3c 73  In such cases <s
0d50: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72  trong>tls::impor
0d60: 74 3c 2f 73 74 72 6f 6e 67 3e 20 73 68 6f 75 6c  t</strong> shoul
0d70: 64 20 6e 6f 74 20 62 65 0a 75 73 65 64 20 64 69  d not be.used di
0d80: 72 65 63 74 6c 79 2e 3c 2f 70 3e 0a 0a 3c 64 6c  rectly.</p>..<dl
0d90: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  >.    <dt><a nam
0da0: 65 3d 22 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62  e="tls::init"><b
0db0: 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c  >tls::init </b><
0dc0: 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c  i>?options?</i><
0dd0: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
0de0: 3e 54 68 69 73 20 72 6f 75 74 69 6e 65 20 73 65  >This routine se
0df0: 74 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 6f  ts the default o
0e00: 70 74 69 6f 6e 73 20 75 73 65 64 20 62 79 20 3c  ptions used by <
0e10: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b  strong>tls::sock
0e20: 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20  et</strong>.    
0e30: 20 20 20 20 61 6e 64 20 69 73 20 3c 65 6d 3e 6f      and is <em>o
0e40: 70 74 69 6f 6e 61 6c 3c 2f 65 6d 3e 2e 20 49 66  ptional</em>. If
0e50: 20 79 6f 75 20 63 61 6c 6c 20 3c 73 74 72 6f 6e   you call <stron
0e60: 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73  g>tls::import</s
0e70: 74 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 64  trong>.        d
0e80: 69 72 65 63 74 6c 79 20 74 68 69 73 20 72 6f 75  irectly this rou
0e90: 74 69 6e 65 20 68 61 73 20 6e 6f 20 65 66 66 65  tine has no effe
0ea0: 63 74 2e 20 41 6e 79 20 6f 66 20 74 68 65 20 6f  ct. Any of the o
0eb0: 70 74 69 6f 6e 73 0a 20 20 20 20 20 20 20 20 74  ptions.        t
0ec0: 68 61 74 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  hat <strong>tls:
0ed0: 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e  :socket</strong>
0ee0: 20 61 63 63 65 70 74 73 20 63 61 6e 20 62 65 20   accepts can be 
0ef0: 73 65 74 0a 20 20 20 20 20 20 20 20 75 73 69 6e  set.        usin
0f00: 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c 20  g this command, 
0f10: 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75 6c  though you shoul
0f20: 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70 74  d limit your opt
0f30: 69 6f 6e 73 0a 20 20 20 20 20 20 20 20 74 6f 20  ions.        to 
0f40: 6f 6e 6c 79 20 54 4c 53 20 72 65 6c 61 74 65 64  only TLS related
0f50: 20 6f 6e 65 73 2e 3c 2f 64 64 3e 0a 20 20 20 20   ones.</dd>.    
0f60: 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a  <dt>&nbsp;</dt>.
0f70: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
0f80: 22 74 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62  "tls::socket"><b
0f90: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62  >tls::socket </b
0fa0: 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 0a 20  ><em>?options?. 
0fb0: 20 20 20 20 20 20 20 68 6f 73 74 20 70 6f 72 74         host port
0fc0: 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20  </em></a></dt>. 
0fd0: 20 20 20 3c 64 74 3e 3c 62 3e 74 6c 73 3a 3a 73     <dt><b>tls::s
0fe0: 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d  ocket</b><em> ?-
0ff0: 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20  server command? 
1000: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f  ?options? port</
1010: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  em></dt>.    <dd
1020: 3e 54 68 69 73 20 69 73 20 61 20 68 65 6c 70 65  >This is a helpe
1030: 72 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20  r function that 
1040: 75 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e 64  utilizes the und
1050: 65 72 6c 79 69 6e 67 0a 20 20 20 20 20 20 20 20  erlying.        
1060: 63 6f 6d 6d 61 6e 64 73 20 28 3c 73 74 72 6f 6e  commands (<stron
1070: 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73  g>tls::import</s
1080: 74 72 6f 6e 67 3e 29 2e 20 49 74 20 62 65 68 61  trong>). It beha
1090: 76 65 73 0a 20 20 20 20 20 20 20 20 65 78 61 63  ves.        exac
10a0: 74 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 20  tly the same as 
10b0: 74 68 65 20 6e 61 74 69 76 65 20 54 63 6c 20 3c  the native Tcl <
10c0: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
10d0: 74 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 63  trong>.        c
10e0: 6f 6d 6d 61 6e 64 20 65 78 63 65 70 74 20 74 68  ommand except th
10f0: 61 74 20 74 68 65 20 6f 70 74 69 6f 6e 73 20 63  at the options c
1100: 61 6e 20 69 6e 63 6c 75 64 65 20 61 6e 79 20 6f  an include any o
1110: 66 20 74 68 65 0a 20 20 20 20 20 20 20 20 61 70  f the.        ap
1120: 70 6c 69 63 61 62 6c 65 20 3c 61 20 68 72 65 66  plicable <a href
1130: 3d 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e  ="#tls::import">
1140: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 69 6d 70 6f  <strong>tls:impo
1150: 72 74 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 0a  rt</strong></a>.
1160: 20 20 20 20 20 20 20 20 6f 70 74 69 6f 6e 73 2e          options.
1170: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e  </dd>.    <dt>&n
1180: 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  bsp;</dt>.    <d
1190: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
11a0: 68 61 6e 64 73 68 61 6b 65 22 3e 3c 73 74 72 6f  handshake"><stro
11b0: 6e 67 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b  ng>tls::handshak
11c0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63  e</strong> <em>c
11d0: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c  hannel</em></a><
11e0: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 46 6f 72  /dt>.    <dd>For
11f0: 63 65 73 20 68 61 6e 64 73 68 61 6b 65 20 74 6f  ces handshake to
1200: 20 74 61 6b 65 20 70 6c 61 63 65 2c 20 61 6e 64   take place, and
1210: 20 72 65 74 75 72 6e 73 20 30 20 69 66 0a 20 20   returns 0 if.  
1220: 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b 65 20        handshake 
1230: 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f 67  is still in prog
1240: 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63 6b 69  ress (non-blocki
1250: 6e 67 29 2c 20 6f 72 20 31 20 69 66 0a 20 20 20  ng), or 1 if.   
1260: 20 20 20 20 20 74 68 65 20 68 61 6e 64 73 68 61       the handsha
1270: 6b 65 20 77 61 73 20 73 75 63 63 65 73 73 66 75  ke was successfu
1280: 6c 2e 20 49 66 20 74 68 65 20 68 61 6e 64 73 68  l. If the handsh
1290: 61 6b 65 20 66 61 69 6c 65 64 0a 20 20 20 20 20  ake failed.     
12a0: 20 20 20 74 68 69 73 20 72 6f 75 74 69 6e 65 20     this routine 
12b0: 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20 65 72  will throw an er
12c0: 72 6f 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64  ror.</dd>.    <d
12d0: 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20  t>&nbsp;</dt>.  
12e0: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74    <dt><a name="t
12f0: 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74 72  ls::status"><str
1300: 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73 3c  ong>tls::status<
1310: 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d  /strong>.    <em
1320: 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65  >?-local? channe
1330: 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a  l</em></a></dt>.
1340: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20      <dd>Returns 
1350: 74 68 65 20 63 75 72 72 65 6e 74 20 73 65 63 75  the current secu
1360: 72 69 74 79 20 73 74 61 74 75 73 20 6f 66 20 61  rity status of a
1370: 6e 20 53 53 4c 20 63 68 61 6e 6e 65 6c 2e 20 54  n SSL channel. T
1380: 68 65 0a 20 20 20 20 20 20 20 20 72 65 73 75 6c  he.        resul
1390: 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b  t is a list of k
13a0: 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64  ey-value pairs d
13b0: 65 73 63 72 69 62 69 6e 67 20 74 68 65 0a 20 20  escribing the.  
13c0: 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 65 64 20        connected 
13d0: 70 65 65 72 2e 20 49 66 20 74 68 65 20 72 65 73  peer. If the res
13e0: 75 6c 74 20 69 73 20 61 6e 20 65 6d 70 74 79 20  ult is an empty 
13f0: 6c 69 73 74 20 74 68 65 6e 20 74 68 65 0a 20 20  list then the.  
1400: 20 20 20 20 20 20 53 53 4c 20 68 61 6e 64 73 68        SSL handsh
1410: 61 6b 65 20 68 61 73 20 6e 6f 74 20 79 65 74 20  ake has not yet 
1420: 63 6f 6d 70 6c 65 74 65 64 2e 0a 20 20 20 20 20  completed..     
1430: 20 20 20 49 66 20 3c 65 6d 3e 2d 6c 6f 63 61 6c     If <em>-local
1440: 3c 2f 65 6d 3e 20 69 73 20 67 69 76 65 6e 2c 20  </em> is given, 
1450: 74 68 65 6e 20 74 68 65 20 63 65 72 74 69 66 69  then the certifi
1460: 63 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  cate information
1470: 0a 20 20 20 20 20 20 20 20 69 73 20 74 68 65 20  .        is the 
1480: 6f 6e 65 20 75 73 65 64 20 6c 6f 63 61 6c 6c 79  one used locally
1490: 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 62  .</dd>.</dl>..<b
14a0: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c  lockquote>.    <
14b0: 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dl>.        <dt>
14c0: 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 3c 2f  <strong>issuer</
14d0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f  strong> <em>dn</
14e0: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
14f0: 20 3c 64 64 3e 54 68 65 20 64 69 73 74 69 6e 67   <dd>The disting
1500: 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 4e 29  uished name (DN)
1510: 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63   of the certific
1520: 61 74 65 0a 20 20 20 20 20 20 20 20 20 20 20 20  ate.            
1530: 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 20 20 20  issuer.</dd>.   
1540: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
1550: 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72 6f 6e 67  >subject</strong
1560: 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64  > <em>dn</em></d
1570: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54  t>.        <dd>T
1580: 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 64  he distinguished
1590: 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68   name (DN) of th
15a0: 65 20 63 65 72 74 69 66 69 63 61 74 65 0a 20 20  e certificate.  
15b0: 20 20 20 20 20 20 20 20 20 20 73 75 62 6a 65 63            subjec
15c0: 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  t.</dd>.        
15d0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 42  <dt><strong>notB
15e0: 65 66 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  efore</strong> <
15f0: 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74  em>date</em></dt
1600: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  >.        <dd>Th
1610: 65 20 62 65 67 69 6e 20 64 61 74 65 20 66 6f 72  e begin date for
1620: 20 74 68 65 20 76 61 6c 69 64 69 74 79 20 6f 66   the validity of
1630: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
1640: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
1650: 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 41 66  dt><strong>notAf
1660: 74 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ter</strong> <em
1670: 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >date</em></dt>.
1680: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
1690: 65 78 70 69 72 79 20 64 61 74 65 20 66 6f 72 20  expiry date for 
16a0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e  the certificate.
16b0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
16c0: 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69 61 6c  t><strong>serial
16d0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c  </strong> <em>n<
16e0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
16f0: 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69 61 6c    <dd>The serial
1700: 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63   number of the c
1710: 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e  ertificate.</dd>
1720: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1730: 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72  rong>cipher</str
1740: 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c  ong> <em>cipher<
1750: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
1760: 20 20 3c 64 64 3e 54 68 65 20 63 75 72 72 65 6e    <dd>The curren
1770: 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 65 20  t cipher in use 
1780: 62 65 74 77 65 65 6e 20 74 68 65 20 63 6c 69 65  between the clie
1790: 6e 74 20 61 6e 64 0a 20 20 20 20 20 20 20 20 20  nt and.         
17a0: 20 20 20 73 65 72 76 65 72 20 63 68 61 6e 6e 65     server channe
17b0: 6c 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  ls.</dd>.       
17c0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 62 69   <dt><strong>sbi
17d0: 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ts</strong> <em>
17e0: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  n</em></dt>.    
17f0: 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d 62      <dd>The numb
1800: 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 64 20  er of bits used 
1810: 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f 6e 20  for the session 
1820: 6b 65 79 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f  key.</dd>.    </
1830: 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  dl>.</blockquote
1840: 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e  >..<dl>.    <dt>
1850: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 69 6d  <a name="tls::im
1860: 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6d  port"><b>tls::im
1870: 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e  port </b><i>chan
1880: 6e 65 6c 0a 20 20 20 20 20 20 20 20 3f 6f 70 74  nel.        ?opt
1890: 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64  ions?</i></a></d
18a0: 74 3e 0a 20 20 20 20 3c 64 64 3e 53 53 4c 2d 65  t>.    <dd>SSL-e
18b0: 6e 61 62 6c 65 20 61 20 72 65 67 75 6c 61 72 20  nable a regular 
18c0: 54 63 6c 20 63 68 61 6e 6e 65 6c 20 2d 20 69 74  Tcl channel - it
18d0: 20 6e 65 65 64 20 6e 6f 74 20 62 65 20 61 0a 20   need not be a. 
18e0: 20 20 20 20 20 20 20 73 6f 63 6b 65 74 2c 20 62         socket, b
18f0: 75 74 20 6d 75 73 74 20 70 72 6f 76 69 64 65 20  ut must provide 
1900: 62 69 2d 64 69 72 65 63 74 69 6f 6e 61 6c 20 66  bi-directional f
1910: 6c 6f 77 2e 20 41 6c 73 6f 0a 20 20 20 20 20 20  low. Also.      
1920: 20 20 73 65 74 74 69 6e 67 20 73 65 73 73 69 6f    setting sessio
1930: 6e 20 70 61 72 61 6d 65 74 65 72 73 20 66 6f 72  n parameters for
1940: 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 3c   SSL handshake.<
1950: 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 62 6c 6f  /dd>.</dl>..<blo
1960: 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c  ckquote>.    <dl
1970: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
1980: 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f 73 74  trong>-cadir</st
1990: 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c 2f 65  rong> <em>dir</e
19a0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
19b0: 3c 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20  <dd>Provide the 
19c0: 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69  directory contai
19d0: 6e 69 6e 67 20 74 68 65 20 43 41 20 63 65 72 74  ning the CA cert
19e0: 69 66 69 63 61 74 65 73 2e 3c 2f 64 64 3e 0a 20  ificates.</dd>. 
19f0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
1a00: 6e 67 3e 2d 63 61 66 69 6c 65 20 3c 2f 73 74 72  ng>-cafile </str
1a10: 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65  ong><em>filename
1a20: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1a30: 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 74     <dd>Provide t
1a40: 68 65 20 43 41 20 66 69 6c 65 2e 3c 2f 64 64 3e  he CA file.</dd>
1a50: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1a60: 72 6f 6e 67 3e 2d 63 65 72 74 66 69 6c 65 3c 2f  rong>-certfile</
1a70: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65  strong> <em>file
1a80: 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  name</em></dt>. 
1a90: 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69         <dd>Provi
1aa0: 64 65 20 74 68 65 20 63 65 72 74 69 66 69 63 61  de the certifica
1ab0: 74 65 20 74 6f 20 75 73 65 2e 3c 2f 64 64 3e 0a  te to use.</dd>.
1ac0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
1ad0: 6f 6e 67 3e 2d 63 69 70 68 65 72 20 3c 2f 73 74  ong>-cipher </st
1ae0: 72 6f 6e 67 3e 3c 65 6d 3e 73 74 72 69 6e 67 3c  rong><em>string<
1af0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
1b00: 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 74 68    <dd>Provide th
1b10: 65 20 63 69 70 68 65 72 20 73 75 69 74 65 73 20  e cipher suites 
1b20: 74 6f 20 75 73 65 2e 20 53 79 6e 74 61 78 20 69  to use. Syntax i
1b30: 73 20 61 73 20 70 65 72 0a 20 20 20 20 20 20 20  s as per.       
1b40: 20 20 20 20 20 4f 70 65 6e 53 53 4c 2e 3c 2f 64       OpenSSL.</d
1b50: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1b60: 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c  strong>-command<
1b70: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c  /strong> <em>cal
1b80: 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  lback</em></dt>.
1b90: 20 20 20 20 20 20 20 20 3c 64 64 3e 49 66 20 73          <dd>If s
1ba0: 70 65 63 69 66 69 65 64 2c 20 74 68 69 73 20 63  pecified, this c
1bb0: 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62 65 20  allback will be 
1bc0: 69 6e 76 6f 6b 65 64 20 61 74 20 73 65 76 65 72  invoked at sever
1bd0: 61 6c 20 70 6f 69 6e 74 73 0a 20 20 20 20 20 20  al points.      
1be0: 20 20 20 20 20 20 64 75 72 69 6e 67 20 74 68 65        during the
1bf0: 20 4f 70 65 6e 53 53 4c 20 68 61 6e 64 73 68 61   OpenSSL handsha
1c00: 6b 65 2e 20 20 49 74 20 63 61 6e 20 70 61 73 73  ke.  It can pass
1c10: 20 65 72 72 6f 72 73 20 61 6e 64 20 74 72 61 63   errors and trac
1c20: 69 6e 67 0a 20 20 20 20 20 20 20 20 20 20 20 20  ing.            
1c30: 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e 64  information, and
1c40: 20 69 74 20 63 61 6e 20 61 6c 6c 6f 77 20 54 63   it can allow Tc
1c50: 6c 20 73 63 72 69 70 74 73 20 74 6f 20 70 65 72  l scripts to per
1c60: 66 6f 72 6d 0a 20 20 20 20 20 20 20 20 20 20 20  form.           
1c70: 20 74 68 65 69 72 20 6f 77 6e 20 76 61 6c 69 64   their own valid
1c80: 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 65 72  ation of the cer
1c90: 74 69 66 69 63 61 74 65 20 69 6e 20 70 6c 61 63  tificate in plac
1ca0: 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 20 20  e of the.       
1cb0: 20 20 20 20 20 64 65 66 61 75 6c 74 20 76 61 6c       default val
1cc0: 69 64 61 74 69 6f 6e 20 70 72 6f 76 69 64 65 64  idation provided
1cd0: 20 62 79 20 4f 70 65 6e 53 53 4c 2e 0a 20 20 20   by OpenSSL..   
1ce0: 20 20 20 20 20 20 20 20 20 3c 62 72 3e 0a 20 20           <br>.  
1cf0: 20 20 20 20 20 20 20 20 20 20 53 65 65 20 3c 61            See <a
1d00: 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b   href="#CALLBACK
1d10: 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41   OPTIONS">CALLBA
1d20: 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 20 66  CK OPTIONS</a> f
1d30: 6f 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  or.            f
1d40: 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69 6f  urther discussio
1d50: 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  n.</dd>.        
1d60: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79  <dt><strong>-key
1d70: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  file</strong> <e
1d80: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c  m>filename</em><
1d90: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
1da0: 3e 50 72 6f 76 69 64 65 20 74 68 65 20 70 72 69  >Provide the pri
1db0: 76 61 74 65 20 6b 65 79 20 66 69 6c 65 2e 20 28  vate key file. (
1dc0: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
1dd0: 2f 73 74 72 6f 6e 67 3e 3a 0a 20 20 20 20 20 20  /strong>:.      
1de0: 20 20 20 20 20 20 76 61 6c 75 65 20 6f 66 20 2d        value of -
1df0: 63 65 72 74 66 69 6c 65 29 3c 2f 64 64 3e 0a 20  certfile)</dd>. 
1e00: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
1e10: 6e 67 3e 2d 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e  ng>-model</stron
1e20: 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f  g> <em>channel</
1e30: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
1e40: 20 3c 64 64 3e 54 68 69 73 20 77 69 6c 6c 20 66   <dd>This will f
1e50: 6f 72 63 65 20 74 68 69 73 20 63 68 61 6e 6e 65  orce this channe
1e60: 6c 20 74 6f 20 73 68 61 72 65 20 74 68 65 20 73  l to share the s
1e70: 61 6d 65 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e  ame <em><strong>
1e80: 53 53 4c 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e  SSL_CTX</strong>
1e90: 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20 20 20  </em>.          
1ea0: 20 20 73 74 72 75 63 74 75 72 65 20 61 73 20 74    structure as t
1eb0: 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d  he specified <em
1ec0: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 2c 20 61  >channel</em>, a
1ed0: 6e 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 74  nd.            t
1ee0: 68 65 72 65 66 6f 72 65 20 73 68 61 72 65 20 63  herefore share c
1ef0: 61 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64  allbacks etc.</d
1f00: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1f10: 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64  strong>-password
1f20: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61  </strong> <em>ca
1f30: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e  llback</em></dt>
1f40: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 49 66 20  .        <dd>If 
1f50: 73 75 70 70 6c 69 65 64 2c 20 74 68 69 73 20 63  supplied, this c
1f60: 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62 65 20  allback will be 
1f70: 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 4f 70 65  invoked when Ope
1f80: 6e 53 53 4c 20 6e 65 65 64 73 0a 20 20 20 20 20  nSSL needs.     
1f90: 20 20 20 20 20 20 20 74 6f 20 6f 62 74 61 69 6e         to obtain
1fa0: 20 61 20 70 61 73 73 77 6f 72 64 2c 20 74 79 70   a password, typ
1fb0: 69 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63 6b  ically to unlock
1fc0: 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79   the private key
1fd0: 20 6f 66 0a 09 20 20 20 20 61 20 63 65 72 74 69   of..    a certi
1fe0: 66 69 63 61 74 65 2e 0a 20 20 20 20 20 20 20 20  ficate..        
1ff0: 20 20 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b      The callback
2000: 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 61   should return a
2010: 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 72 65   string which re
2020: 70 72 65 73 65 6e 74 73 20 74 68 65 0a 20 20 20  presents the.   
2030: 20 20 20 20 20 20 20 20 20 70 61 73 73 77 6f 72           passwor
2040: 64 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 20 20  d to be used..  
2050: 20 20 20 20 20 20 20 20 20 20 3c 62 72 3e 0a 20            <br>. 
2060: 20 20 20 20 20 20 20 20 20 20 20 53 65 65 20 3c             See <
2070: 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43  a href="#CALLBAC
2080: 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42  K OPTIONS">CALLB
2090: 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 20  ACK OPTIONS</a> 
20a0: 66 6f 72 0a 20 20 20 20 20 20 20 20 20 20 20 20  for.            
20b0: 66 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69  further discussi
20c0: 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  on.</dd>.       
20d0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65   <dt><strong>-re
20e0: 71 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67 3e 3c  quest </strong><
20f0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
2100: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 52 65  >.        <dd>Re
2110: 71 75 65 73 74 20 61 20 63 65 72 74 69 66 69 63  quest a certific
2120: 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64 75  ate from peer du
2130: 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73 68 61  ring SSL handsha
2140: 6b 65 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20  ke..            
2150: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
2160: 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74  </strong>: <em>t
2170: 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20  rue</em>)</dd>. 
2180: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
2190: 6e 67 3e 2d 72 65 71 75 69 72 65 3c 2f 73 74 72  ng>-require</str
21a0: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65  ong> <em>bool</e
21b0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
21c0: 3c 64 64 3e 52 65 71 75 69 72 65 20 61 20 76 61  <dd>Require a va
21d0: 6c 69 64 20 63 65 72 74 69 66 69 63 61 74 65 20  lid certificate 
21e0: 66 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67  from peer during
21f0: 20 53 53 4c 0a 20 20 20 20 20 20 20 20 20 20 20   SSL.           
2200: 20 68 61 6e 64 73 68 61 6b 65 2e 20 49 66 20 74   handshake. If t
2210: 68 69 73 20 69 73 20 73 65 74 20 74 6f 20 74 72  his is set to tr
2220: 75 65 20 74 68 65 6e 20 3c 73 74 72 6f 6e 67 3e  ue then <strong>
2230: 2d 72 65 71 75 65 73 74 3c 2f 73 74 72 6f 6e 67  -request</strong
2240: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 75  >.            mu
2250: 73 74 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74  st also be set t
2260: 6f 20 74 72 75 65 2e 20 28 3c 73 74 72 6f 6e 67  o true. (<strong
2270: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67  >default</strong
2280: 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d  >: <em>false</em
2290: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  >)</dd>.        
22a0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72  <dt><strong>-ser
22b0: 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ver</strong> <em
22c0: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
22d0: 20 20 20 20 20 20 20 20 3c 64 64 3e 48 61 6e 64          <dd>Hand
22e0: 73 68 61 6b 65 20 61 73 20 73 65 72 76 65 72 20  shake as server 
22f0: 69 66 20 74 72 75 65 2c 20 65 6c 73 65 20 68 61  if true, else ha
2300: 6e 64 73 68 61 6b 65 20 61 73 0a 20 20 20 20 20  ndshake as.     
2310: 20 20 20 20 20 20 20 63 6c 69 65 6e 74 2e 28 3c         client.(<
2320: 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f  strong>default</
2330: 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c  strong>: <em>fal
2340: 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20  se</em>)</dd>.  
2350: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
2360: 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e  g>-ssl2</strong>
2370: 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f   <em>bool</em></
2380: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
2390: 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53  Enable use of SS
23a0: 4c 20 76 32 2e 20 28 3c 73 74 72 6f 6e 67 3e 64  L v2. (<strong>d
23b0: 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a  efault</strong>:
23c0: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 0a 20   <em>true</em>. 
23d0: 20 20 20 20 20 20 20 20 20 20 20 75 6e 6c 65 73             unles
23e0: 73 20 2d 44 4e 4f 5f 50 41 54 45 4e 54 53 20 77  s -DNO_PATENTS w
23f0: 61 73 20 73 70 65 63 69 66 69 65 64 20 69 6e 20  as specified in 
2400: 62 75 69 6c 64 29 3c 2f 64 64 3e 0a 20 20 20 20  build)</dd>.    
2410: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
2420: 2d 73 73 6c 33 20 3c 2f 73 74 72 6f 6e 67 3e 3c  -ssl3 </strong><
2430: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
2440: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e  >.        <dd>En
2450: 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20  able use of SSL 
2460: 76 33 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66  v3. (<strong>def
2470: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
2480: 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64  em>true</em>)</d
2490: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d  d>.        <dt>-
24a0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74  <strong>tls1</st
24b0: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f  rong> <em>bool</
24c0: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
24d0: 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20   <dd>Enable use 
24e0: 6f 66 20 54 4c 53 20 76 31 2e 20 28 3c 73 74 72  of TLS v1. (<str
24f0: 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72  ong>default</str
2500: 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c  ong>: <em>false<
2510: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 3c  /em>)</dd>.    <
2520: 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74  /dl>.</blockquot
2530: 65 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74  e>..<dl>.    <dt
2540: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 75  ><a name="tls::u
2550: 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a  nimport"><b>tls:
2560: 3a 75 6e 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69  :unimport </b><i
2570: 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e  >channel</i></a>
2580: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 50 72  </dt>.    <dd>Pr
2590: 6f 76 69 64 65 64 20 66 6f 72 20 73 79 6d 6d 65  ovided for symme
25a0: 74 72 79 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 74  try to <strong>t
25b0: 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f  ls::import</stro
25c0: 6e 67 3e 2c 20 74 68 69 73 0a 20 20 20 20 20 20  ng>, this.      
25d0: 75 6e 73 74 61 63 6b 73 20 74 68 65 20 53 53 4c  unstacks the SSL
25e0: 2d 65 6e 61 62 6c 69 6e 67 20 6f 66 20 61 20 72  -enabling of a r
25f0: 65 67 75 6c 61 72 20 54 63 6c 20 63 68 61 6e 6e  egular Tcl chann
2600: 65 6c 2e 20 20 41 6e 20 65 72 72 6f 72 0a 20 20  el.  An error.  
2610: 20 20 20 20 69 73 20 74 68 72 6f 77 6e 20 69 66      is thrown if
2620: 20 54 4c 53 20 69 73 20 6e 6f 74 20 74 68 65 20   TLS is not the 
2630: 74 6f 70 20 73 74 61 63 6b 65 64 20 63 68 61 6e  top stacked chan
2640: 6e 65 6c 20 74 79 70 65 2e 3c 2f 64 64 3e 0a 3c  nel type.</dd>.<
2650: 2f 64 6c 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c  /dl>..<dl>.    <
2660: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
2670: 3a 63 69 70 68 65 72 73 20 70 72 6f 74 6f 63 6f  :ciphers protoco
2680: 6c 20 3f 76 65 72 62 6f 73 65 3f 22 3e 3c 73 74  l ?verbose?"><st
2690: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72  rong>tls::cipher
26a0: 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 20  s</strong>.     
26b0: 20 20 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20     <em>protocol 
26c0: 3f 76 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f  ?verbose?</em></
26d0: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  a></dt>.    <dd>
26e0: 52 65 74 75 72 6e 73 20 6c 69 73 74 20 6f 66 20  Returns list of 
26f0: 73 75 70 70 6f 72 74 65 64 20 63 69 70 68 65 72  supported cipher
2700: 73 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c  s based on the <
2710: 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e  em>protocol</em>
2720: 0a 20 20 20 20 20 20 20 20 79 6f 75 20 73 75 70  .        you sup
2730: 70 6c 79 2c 20 77 68 69 63 68 20 6d 75 73 74 20  ply, which must 
2740: 62 65 20 6f 6e 65 20 6f 66 20 3c 65 6d 3e 73 73  be one of <em>ss
2750: 6c 32 2c 20 73 73 6c 33 2c 20 6f 72 20 74 6c 73  l2, ssl3, or tls
2760: 31 3c 2f 65 6d 3e 2e 0a 20 20 20 20 20 20 20 20  1</em>..        
2770: 49 66 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f  If <em>verbose</
2780: 65 6d 3e 20 69 73 20 73 70 65 63 69 66 69 65 64  em> is specified
2790: 20 61 73 20 74 72 75 65 20 74 68 65 6e 20 61 20   as true then a 
27a0: 76 65 72 62 6f 73 65 2c 0a 20 20 20 20 20 20 20  verbose,.       
27b0: 20 73 65 6d 69 2d 68 75 6d 61 6e 20 72 65 61 64   semi-human read
27c0: 61 62 6c 65 20 6c 69 73 74 20 69 73 20 72 65 74  able list is ret
27d0: 75 72 6e 65 64 20 70 72 6f 76 69 64 69 6e 67 20  urned providing 
27e0: 61 64 64 69 74 69 6f 6e 61 6c 0a 20 20 20 20 20  additional.     
27f0: 20 20 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f     information o
2800: 6e 20 74 68 65 20 6e 61 74 75 72 65 20 6f 66 20  n the nature of 
2810: 74 68 65 20 63 69 70 68 65 72 20 73 75 70 70 6f  the cipher suppo
2820: 72 74 2e 20 49 6e 20 65 61 63 68 0a 20 20 20 20  rt. In each.    
2830: 20 20 20 20 63 61 73 65 20 74 68 65 20 72 65 73      case the res
2840: 75 6c 74 20 69 73 20 61 20 54 63 6c 20 6c 69 73  ult is a Tcl lis
2850: 74 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c  t.</dd>.</dl>..<
2860: 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e  dl>.    <dt><a n
2870: 61 6d 65 3d 22 74 6c 73 3a 3a 76 65 72 73 69 6f  ame="tls::versio
2880: 6e 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  n"><strong>tls::
2890: 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e  version</strong>
28a0: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  </a></dt>.    <d
28b0: 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20 76 65  d>Returns the ve
28c0: 72 73 69 6f 6e 20 73 74 72 69 6e 67 20 64 65 66  rsion string def
28d0: 69 6e 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 2e  ined by OpenSSL.
28e0: 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 33  </dd>.</dl>..<h3
28f0: 3e 3c 61 20 6e 61 6d 65 3d 22 43 41 4c 4c 42 41  ><a name="CALLBA
2900: 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c  CK OPTIONS">CALL
2910: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e  BACK OPTIONS</a>
2920: 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 20 69 6e  </h3>..<p>.As in
2930: 64 69 63 61 74 65 64 20 61 62 6f 76 65 2c 20 69  dicated above, i
2940: 6e 64 69 76 69 64 75 61 6c 20 63 68 61 6e 6e 65  ndividual channe
2950: 6c 73 20 63 61 6e 20 62 65 20 67 69 76 65 6e 20  ls can be given 
2960: 74 68 65 69 72 20 6f 77 6e 20 63 61 6c 6c 62 61  their own callba
2970: 63 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 20 69 6e  cks.to handle in
2980: 74 65 72 6d 65 64 69 61 74 65 20 70 72 6f 63 65  termediate proce
2990: 73 73 69 6e 67 20 62 79 20 74 68 65 20 4f 70 65  ssing by the Ope
29a0: 6e 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 75 73  nSSL library, us
29b0: 69 6e 67 20 74 68 65 0a 3c 65 6d 3e 2d 63 6f 6d  ing the.<em>-com
29c0: 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65  mand</em> and <e
29d0: 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d 3e  m>-password</em>
29e0: 20 6f 70 74 69 6f 6e 73 20 70 61 73 73 65 64 20   options passed 
29f0: 74 6f 20 65 69 74 68 65 72 20 6f 66 0a 3c 73 74  to either of.<st
2a00: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74  rong>tls::socket
2a10: 3c 2f 73 74 72 6f 6e 67 3e 20 6f 72 20 3c 73 74  </strong> or <st
2a20: 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74  rong>tls::import
2a30: 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 3c 2f 70 3e 0a  </strong>..</p>.
2a40: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 64  .<blockquote>.<d
2a50: 6c 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72  l>..    <dt><str
2a60: 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74  ong>-command</st
2a70: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61  rong> <em>callba
2a80: 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  ck</em></dt>.   
2a90: 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74   <dd>..Invokes t
2aa0: 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d  he specified <em
2ab0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73  >callback</em> s
2ac0: 63 72 69 70 74 20 61 74 0a 09 73 65 76 65 72 61  cript at..severa
2ad0: 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20  l points during 
2ae0: 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e 64  the OpenSSL hand
2af0: 73 68 61 6b 65 2e 0a 09 45 78 63 65 70 74 20 61  shake...Except a
2b00: 73 20 69 6e 64 69 63 61 74 65 64 20 62 65 6c 6f  s indicated belo
2b10: 77 2c 20 76 61 6c 75 65 73 20 72 65 74 75 72 6e  w, values return
2b20: 65 64 20 66 72 6f 6d 20 74 68 65 0a 09 63 61 6c  ed from the..cal
2b30: 6c 62 61 63 6b 20 61 72 65 20 69 67 6e 6f 72 65  lback are ignore
2b40: 64 2e 0a 09 41 72 67 75 6d 65 6e 74 73 20 61 70  d...Arguments ap
2b50: 70 65 6e 64 65 64 20 74 6f 20 74 68 65 20 73 63  pended to the sc
2b60: 72 69 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62 61  ript upon callba
2b70: 63 6b 20 74 61 6b 65 20 6f 6e 65 20 6f 66 20 74  ck take one of t
2b80: 68 65 0a 09 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f  he..following fo
2b90: 72 6d 73 3a 0a 0a 09 3c 62 72 3e 0a 09 3c 62 72  rms:...<br>..<br
2ba0: 3e 0a 0a 09 3c 64 6c 3e 0a 0a 3c 21 2d 2d 09 54  >...<dl>..<!--.T
2bb0: 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c  his form of call
2bc0: 62 61 63 6b 20 69 73 20 64 69 73 61 62 6c 65 64  back is disabled
2bd0: 2e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72  ....<dt>..  <str
2be0: 6f 6e 67 3e 65 72 72 6f 72 3c 2f 73 74 72 6f 6e  ong>error</stron
2bf0: 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d  g> <em>channel m
2c00: 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64  essage</em>..</d
2c10: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 65 20  t>..<dd>..  The 
2c20: 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e  <em>message</em>
2c30: 20 61 72 67 75 6d 65 6e 74 20 63 6f 6e 74 61 69   argument contai
2c40: 6e 73 20 61 6e 20 65 72 72 6f 72 20 6d 65 73 73  ns an error mess
2c50: 61 67 65 20 67 65 6e 65 72 61 74 65 64 0a 09 20  age generated.. 
2c60: 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20   by the OpenSSL 
2c70: 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64  function..  <cod
2c80: 65 3e 45 52 52 5f 72 65 61 73 6f 6e 5f 65 72 72  e>ERR_reason_err
2c90: 6f 72 5f 73 74 72 69 6e 67 28 29 3c 2f 63 6f 64  or_string()</cod
2ca0: 65 3e 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72  e>...</dd>...<br
2cb0: 3e 0a 2d 2d 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20  >.-->...<dt>..  
2cc0: 3c 73 74 72 6f 6e 67 3e 69 6e 66 6f 3c 2f 73 74  <strong>info</st
2cd0: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65  rong> <em>channe
2ce0: 6c 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 6d 65  l major minor me
2cf0: 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74  ssage</em>..</dt
2d00: 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 73 20  >..<dd>..  This 
2d10: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b  form of callback
2d20: 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74   is invoked by t
2d30: 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74  he OpenSSL funct
2d40: 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c  ion..  <code>SSL
2d50: 5f 43 54 58 5f 73 65 74 5f 69 6e 66 6f 5f 63 61  _CTX_set_info_ca
2d60: 6c 6c 62 61 63 6b 28 29 3c 2f 63 6f 64 65 3e 2e  llback()</code>.
2d70: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20  ..  <br>..  The 
2d80: 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61  <em>major</em> a
2d90: 6e 64 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d  nd <em>minor</em
2da0: 3e 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 20  > arguments are 
2db0: 75 73 65 64 20 74 6f 0a 09 20 20 72 65 70 72 65  used to..  repre
2dc0: 73 65 6e 74 20 74 68 65 20 73 74 61 74 65 20 69  sent the state i
2dd0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 62 69 74 6d 61  nformation bitma
2de0: 73 6b 2e 0a 09 20 20 3c 64 6c 3e 0a 09 20 20 3c  sk...  <dl>..  <
2df0: 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75  dt>Possible valu
2e00: 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 61 6a 6f 72  es for <em>major
2e10: 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 3e 0a  </em> are:</dt>.
2e20: 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e 68 61 6e  .  <dd><code>han
2e30: 64 73 68 61 6b 65 2c 20 61 6c 65 72 74 2c 20 63  dshake, alert, c
2e40: 6f 6e 6e 65 63 74 2c 20 61 63 63 65 70 74 3c 2f  onnect, accept</
2e50: 63 6f 64 65 3e 2e 3c 2f 64 64 3e 0a 09 20 20 3c  code>.</dd>..  <
2e60: 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75  dt>Possible valu
2e70: 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 69 6e 6f 72  es for <em>minor
2e80: 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 3e 0a  </em> are:</dt>.
2e90: 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e 73 74 61  .  <dd><code>sta
2ea0: 72 74 2c 20 64 6f 6e 65 2c 20 72 65 61 64 2c 20  rt, done, read, 
2eb0: 77 72 69 74 65 2c 20 6c 6f 6f 70 2c 20 65 78 69  write, loop, exi
2ec0: 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64 3e 0a 09  t</code>.</dd>..
2ed0: 20 20 3c 2f 64 6c 3e 0a 09 20 20 54 68 65 20 3c    </dl>..  The <
2ee0: 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20  em>message</em> 
2ef0: 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20 64 65  argument is a de
2f00: 73 63 72 69 70 74 69 76 65 20 73 74 72 69 6e 67  scriptive string
2f10: 20 77 68 69 63 68 20 6d 61 79 0a 09 20 20 62 65   which may..  be
2f20: 20 67 65 6e 65 72 61 74 65 64 20 65 69 74 68 65   generated eithe
2f30: 72 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e 53 53  r by..  <code>SS
2f40: 4c 5f 73 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c  L_state_string_l
2f50: 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 20 6f 72 20  ong()</code> or 
2f60: 62 79 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f  by..  <code>SSL_
2f70: 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 72 69 6e  alert_desc_strin
2f80: 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 2c  g_long()</code>,
2f90: 0a 09 20 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e  ..  depending on
2fa0: 20 63 6f 6e 74 65 78 74 2e 0a 09 3c 2f 64 64 3e   context...</dd>
2fb0: 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09  ...<br>...<dt>..
2fc0: 20 20 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 79    <strong>verify
2fd0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68  </strong> <em>ch
2fe0: 61 6e 6e 65 6c 20 64 65 70 74 68 20 63 65 72 74  annel depth cert
2ff0: 20 73 74 61 74 75 73 20 65 72 72 6f 72 3c 2f 65   status error</e
3000: 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a  m>..</dt>..<dd>.
3010: 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20  .  This form of 
3020: 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f  callback is invo
3030: 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53  ked by the OpenS
3040: 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c  SL function..  <
3050: 63 6f 64 65 3e 53 53 4c 5f 73 65 74 5f 76 65 72  code>SSL_set_ver
3060: 69 66 79 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20  ify()</code>... 
3070: 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d   <br>..  The <em
3080: 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 72 67 75  >depth</em> argu
3090: 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74 65 67  ment is an integ
30a0: 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20  er representing 
30b0: 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74 20 64  the..  current d
30c0: 65 70 74 68 20 6f 6e 20 74 68 65 20 63 65 72 74  epth on the cert
30d0: 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c 20 77  ificate chain, w
30e0: 69 74 68 0a 09 20 20 3c 63 6f 64 65 3e 30 3c 2f  ith..  <code>0</
30f0: 63 6f 64 65 3e 20 61 73 20 74 68 65 20 73 75 62  code> as the sub
3100: 6a 65 63 74 20 63 65 72 74 69 66 69 63 61 74 65  ject certificate
3110: 20 61 6e 64 20 68 69 67 68 65 72 20 76 61 6c 75   and higher valu
3120: 65 73 0a 09 20 20 64 65 6e 6f 74 69 6e 67 20 70  es..  denoting p
3130: 72 6f 67 72 65 73 73 69 76 65 6c 79 20 6d 6f 72  rogressively mor
3140: 65 20 69 6e 64 69 72 65 63 74 20 69 73 73 75 65  e indirect issue
3150: 72 20 63 65 72 74 69 66 69 63 61 74 65 73 2e 0a  r certificates..
3160: 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c  .  <br>..  The <
3170: 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 61 72 67  em>cert</em> arg
3180: 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 73 74 20  ument is a list 
3190: 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69  of key-value pai
31a0: 72 73 20 73 69 6d 69 6c 61 72 0a 09 20 20 74 6f  rs similar..  to
31b0: 20 74 68 6f 73 65 20 72 65 74 75 72 6e 65 64 20   those returned 
31c0: 62 79 0a 09 20 20 3c 61 20 68 72 65 66 3d 22 23  by..  <a href="#
31d0: 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74  tls::status"><st
31e0: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73  rong>tls::status
31f0: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e 0a 09  </strong></a>...
3200: 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65    <br>..  The <e
3210: 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 61 72  m>status</em> ar
3220: 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74  gument is an int
3230: 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e  eger representin
3240: 67 20 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74  g the..  current
3250: 20 76 61 6c 69 64 69 74 79 20 6f 66 20 74 68 65   validity of the
3260: 20 63 65 72 74 69 66 69 63 61 74 65 2e 0a 09 20   certificate... 
3270: 20 41 20 76 61 6c 75 65 20 6f 66 20 3c 63 6f 64   A value of <cod
3280: 65 3e 30 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e 73  e>0</code> means
3290: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
32a0: 20 69 73 20 64 65 65 6d 65 64 20 69 6e 76 61 6c   is deemed inval
32b0: 69 64 2e 0a 09 20 20 41 20 76 61 6c 75 65 20 6f  id...  A value o
32c0: 66 20 3c 63 6f 64 65 3e 31 3c 2f 63 6f 64 65 3e  f <code>1</code>
32d0: 20 6d 65 61 6e 73 20 74 68 65 20 63 65 72 74 69   means the certi
32e0: 66 69 63 61 74 65 20 69 73 20 64 65 65 6d 65 64  ficate is deemed
32f0: 20 76 61 6c 69 64 2e 0a 09 20 20 3c 62 72 3e 0a   valid...  <br>.
3300: 09 20 20 54 68 65 20 3c 65 6d 3e 65 72 72 6f 72  .  The <em>error
3310: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 73  </em> argument s
3320: 75 70 70 6c 69 65 73 20 74 68 65 20 6d 65 73 73  upplies the mess
3330: 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 65 6e  age, if any, gen
3340: 65 72 61 74 65 64 0a 09 20 20 62 79 0a 09 20 20  erated..  by..  
3350: 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f 52 45  <code>X509_STORE
3360: 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f 72 28 29  _CTX_get_error()
3370: 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e  </code>...  <br>
3380: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20  ..  <br>..  The 
3390: 63 61 6c 6c 62 61 63 6b 20 6d 61 79 20 6f 76 65  callback may ove
33a0: 72 72 69 64 65 20 6e 6f 72 6d 61 6c 20 76 61 6c  rride normal val
33b0: 69 64 61 74 69 6f 6e 20 70 72 6f 63 65 73 73 69  idation processi
33c0: 6e 67 20 62 79 20 65 78 70 6c 69 63 69 74 6c 79  ng by explicitly
33d0: 0a 09 20 20 72 65 74 75 72 6e 69 6e 67 20 6f 6e  ..  returning on
33e0: 65 20 6f 66 20 74 68 65 20 61 62 6f 76 65 20 3c  e of the above <
33f0: 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 76  em>status</em> v
3400: 61 6c 75 65 73 2e 0a 09 3c 2f 64 64 3e 0a 0a 09  alues...</dd>...
3410: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a  </dl>.    </dd>.
3420: 0a 20 20 20 20 3c 62 72 3e 0a 0a 20 20 20 20 3c  .    <br>..    <
3430: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73  dt><strong>-pass
3440: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  word</strong> <e
3450: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c  m>callback</em><
3460: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49  /dt>.    <dd>..I
3470: 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69  nvokes the speci
3480: 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63  fied <em>callbac
3490: 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 77 68  k</em> script wh
34a0: 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73  en OpenSSL needs
34b0: 20 74 6f 0a 09 6f 62 74 61 69 6e 20 61 20 70 61   to..obtain a pa
34c0: 73 73 77 6f 72 64 2e 20 20 54 68 65 20 63 61 6c  ssword.  The cal
34d0: 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 65 74  lback should ret
34e0: 75 72 6e 20 61 20 73 74 72 69 6e 67 20 77 68 69  urn a string whi
34f0: 63 68 0a 09 72 65 70 72 65 73 65 6e 74 73 20 74  ch..represents t
3500: 68 65 20 70 61 73 73 77 6f 72 64 20 74 6f 20 62  he password to b
3510: 65 20 75 73 65 64 2e 0a 09 4e 6f 20 61 72 67 75  e used...No argu
3520: 6d 65 6e 74 73 20 61 72 65 20 61 70 70 65 6e 64  ments are append
3530: 65 64 20 74 6f 20 74 68 65 20 73 63 72 69 70 74  ed to the script
3540: 20 75 70 6f 6e 20 63 61 6c 6c 62 61 63 6b 2e 0a   upon callback..
3550: 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a      </dd>.</dl>.
3560: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c  </blockquote>..<
3570: 70 3e 0a 52 65 66 65 72 65 6e 63 65 20 69 6d 70  p>.Reference imp
3580: 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20  lementations of 
3590: 74 68 65 73 65 20 63 61 6c 6c 62 61 63 6b 73 20  these callbacks 
35a0: 61 72 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20  are provided in 
35b0: 74 68 65 0a 64 69 73 74 72 69 62 75 74 69 6f 6e  the.distribution
35c0: 20 61 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a   as <strong>tls:
35d0: 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e  :callback</stron
35e0: 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e 74  g> and.<strong>t
35f0: 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74  ls::password</st
3600: 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 69 76 65  rong> respective
3610: 6c 79 2e 20 20 4e 6f 74 65 20 74 68 61 74 20 74  ly.  Note that t
3620: 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e 73 61 6d  hese are.<em>sam
3630: 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c 65 6d 65  ple</em> impleme
3640: 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 2e 20 20  ntations only.  
3650: 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 6c 69 73  In a more realis
3660: 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e 74 0a 79  tic deployment.y
3670: 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 69 66 79  ou would specify
3680: 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c 6c 62 61   your own callba
3690: 63 6b 20 73 63 72 69 70 74 73 20 6f 6e 20 65 61  ck scripts on ea
36a0: 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 6c 0a 75  ch TLS channel.u
36b0: 73 69 6e 67 20 74 68 65 20 3c 65 6d 3e 2d 63 6f  sing the <em>-co
36c0: 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 3c  mmand</em> and <
36d0: 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d  em>-password</em
36e0: 3e 20 6f 70 74 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a  > options..</p>.
36f0: 0a 3c 70 3e 0a 54 68 65 20 64 65 66 61 75 6c 74  .<p>.The default
3700: 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74   behavior when t
3710: 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c  he <em>-command<
3720: 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e  /em> option is n
3730: 6f 74 20 73 70 65 63 69 66 69 65 64 20 69 73 20  ot specified is 
3740: 66 6f 72 0a 54 4c 53 20 74 6f 20 70 72 6f 63 65  for.TLS to proce
3750: 73 73 20 74 68 65 20 61 73 73 6f 63 69 61 74 65  ss the associate
3760: 64 20 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61  d library callba
3770: 63 6b 73 20 69 6e 74 65 72 6e 61 6c 6c 79 2e 0a  cks internally..
3780: 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61  The default beha
3790: 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 65  vior when the <e
37a0: 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d 3e  m>-password</em>
37b0: 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f 74 20 73   option is not s
37c0: 70 65 63 69 66 69 65 64 20 69 73 20 66 6f 72 0a  pecified is for.
37d0: 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74  TLS to process t
37e0: 68 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69  he associated li
37f0: 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 20  brary callbacks 
3800: 62 79 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f  by attempting to
3810: 20 63 61 6c 6c 0a 3c 73 74 72 6f 6e 67 3e 74 6c   call.<strong>tl
3820: 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 72  s::password</str
3830: 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66 66 65 72  ong>..The differ
3840: 65 6e 63 65 20 62 65 74 77 65 65 6e 20 74 68 65  ence between the
3850: 73 65 20 74 77 6f 20 62 65 68 61 76 69 6f 72 73  se two behaviors
3860: 20 69 73 20 61 20 63 6f 6e 73 65 71 75 65 6e 63   is a consequenc
3870: 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e 69 6e 67  e of maintaining
3880: 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 77  .compatibility w
3890: 69 74 68 20 65 61 72 6c 69 65 72 20 69 6d 70 6c  ith earlier impl
38a0: 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a 3c 2f 70  ementations..</p
38b0: 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73 74 72 6f  >..<p>.The <stro
38c0: 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73  ng>tls::debug</s
38d0: 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 6c 65 20  trong> variable 
38e0: 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 61 64  provides some ad
38f0: 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72 6f 6c  ditional.control
3900: 20 6f 76 65 72 20 74 68 65 73 65 20 72 65 66 65   over these refe
3910: 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 2e  rence callbacks.
3920: 20 20 49 74 73 20 76 61 6c 75 65 20 69 73 20 7a    Its value is z
3930: 65 72 6f 20 62 79 20 64 65 66 61 75 6c 74 2e 0a  ero by default..
3940: 48 69 67 68 65 72 20 76 61 6c 75 65 73 20 70 72  Higher values pr
3950: 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 61 67 6e  oduce more diagn
3960: 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 20 61 6e  ostic output, an
3970: 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 63  d will also forc
3980: 65 20 74 68 65 0a 76 65 72 69 66 79 20 6d 65 74  e the.verify met
3990: 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e 67 3e 74  hod in <strong>t
39a0: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74  ls::callback</st
39b0: 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 70 74 20  rong> to accept 
39c0: 74 68 65 0a 63 65 72 74 69 66 69 63 61 74 65 2c  the.certificate,
39d0: 20 65 76 65 6e 20 77 68 65 6e 20 69 74 20 69 73   even when it is
39e0: 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70 3e 0a 0a   invalid..</p>..
39f0: 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 65  <p>.<em>.The use
3a00: 20 6f 66 20 74 68 65 20 72 65 66 65 72 65 6e 63   of the referenc
3a10: 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c 73 74 72  e callbacks <str
3a20: 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63  ong>tls::callbac
3a30: 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 0a 3c  k</strong> and.<
3a40: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73  strong>tls::pass
3a50: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 69 73  word</strong> is
3a60: 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64   not recommended
3a70: 2e 20 20 54 68 65 79 20 6d 61 79 20 62 65 20 72  .  They may be r
3a80: 65 6d 6f 76 65 64 0a 66 72 6f 6d 20 66 75 74 75  emoved.from futu
3a90: 72 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65  re releases..</e
3aa0: 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65 6d  m>.</p>..<p>.<em
3ab0: 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 68 65  >.The use of the
3ac0: 20 76 61 72 69 61 62 6c 65 20 3c 73 74 72 6f 6e   variable <stron
3ad0: 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73 74  g>tls::debug</st
3ae0: 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72 65 63  rong> is not rec
3af0: 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 20 6d 61 79  ommended..It may
3b00: 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d   be removed from
3b10: 20 66 75 74 75 72 65 20 72 65 6c 65 61 73 65 73   future releases
3b20: 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 68  ..</em>.</p>..<h
3b30: 33 3e 3c 61 20 6e 61 6d 65 3d 22 48 54 54 50 53  3><a name="HTTPS
3b40: 20 45 58 41 4d 50 4c 45 22 3e 48 54 54 50 53 20   EXAMPLE">HTTPS 
3b50: 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 68 33 3e  EXAMPLE</a></h3>
3b60: 0a 0a 3c 70 3e 54 68 69 73 20 65 78 61 6d 70 6c  ..<p>This exampl
3b70: 65 20 72 65 71 75 69 72 65 73 20 61 20 70 61 74  e requires a pat
3b80: 63 68 20 74 6f 20 74 68 65 20 3c 73 74 72 6f 6e  ch to the <stron
3b90: 67 3e 68 74 74 70 3c 2f 73 74 72 6f 6e 67 3e 0a  g>http</strong>.
3ba0: 6d 6f 64 75 6c 65 20 74 68 61 74 20 73 68 69 70  module that ship
3bb0: 73 20 77 69 74 68 20 54 63 6c 20 2d 20 74 68 69  s with Tcl - thi
3bc0: 73 20 70 61 74 63 68 20 68 61 73 20 62 65 65 6e  s patch has been
3bd0: 20 73 75 62 6d 69 74 74 65 64 20 66 6f 72 0a 69   submitted for.i
3be0: 6e 63 6c 75 73 69 6f 6e 20 69 6e 20 54 63 6c 20  nclusion in Tcl 
3bf0: 38 2e 32 2e 31 2c 20 62 75 74 20 69 73 20 61 6c  8.2.1, but is al
3c00: 73 6f 20 70 72 6f 76 69 64 65 64 20 69 6e 20 74  so provided in t
3c10: 68 65 20 74 6c 73 20 64 69 72 65 63 74 6f 72 79  he tls directory
3c20: 0a 69 66 20 6e 65 65 64 65 64 2e 20 41 20 73 61  .if needed. A sa
3c30: 6d 70 6c 65 20 73 65 72 76 65 72 2e 70 65 6d 20  mple server.pem 
3c40: 69 73 20 70 72 6f 76 69 64 65 64 20 77 69 74 68  is provided with
3c50: 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73 65   the TLS release
3c60: 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74 68  ,.courtesy of th
3c70: 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53  e <strong>OpenSS
3c80: 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a 65  L</strong> proje
3c90: 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 3c 63  ct.</p>..<pre><c
3ca0: 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71  ode>.package req
3cb0: 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67  uire http.packag
3cc0: 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 68  e require tls..h
3cd0: 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 74  ttp::register ht
3ce0: 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a  tps 443 [list ::
3cf0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 72 65 71  tls::socket -req
3d00: 75 69 72 65 20 31 20 2d 63 61 66 69 6c 65 20 2e  uire 1 -cafile .
3d10: 2f 73 65 72 76 65 72 2e 70 65 6d 5d 0a 0a 73 65  /server.pem]..se
3d20: 74 20 74 6f 6b 20 5b 68 74 74 70 3a 3a 67 65 74  t tok [http::get
3d30: 75 72 6c 20 68 74 74 70 73 3a 2f 2f 64 65 76 65  url https://deve
3d40: 6c 6f 70 65 72 2e 6e 65 74 73 63 61 70 65 2e 63  loper.netscape.c
3d50: 6f 6d 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72  om/].</code></pr
3d60: 65 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d  e>..<h3><a name=
3d70: 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45  "SPECIAL CONSIDE
3d80: 52 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c  RATIONS">SPECIAL
3d90: 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c   CONSIDERATIONS<
3da0: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65  /a></h3>..<p>The
3db0: 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66   capabilities of
3dc0: 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 61   this package ca
3dd0: 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c  n vary enormousl
3de0: 79 20 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77  y based.upon how
3df0: 20 79 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69   your OpenSSL li
3e00: 62 72 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67  brary was config
3e10: 75 72 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20  ured and built. 
3e20: 41 74 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72  At the.most macr
3e30: 6f 2d 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20  o-level OpenSSL 
3e40: 73 75 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74  supports a &quot
3e50: 3b 6e 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74  ;no patents&quot
3e60: 3b 20 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64  ; build,.which d
3e70: 69 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45  isables RSA, IDE
3e80: 41 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64  A, RC(2,4,5) and
3e90: 20 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20   SSL2 - if your 
3ea0: 4f 70 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69  OpenSSL is.confi
3eb0: 67 75 72 65 64 20 74 68 69 73 20 77 61 79 20 74  gured this way t
3ec0: 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65  hen you will nee
3ed0: 64 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77  d to build TLS w
3ee0: 69 74 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54  ith the.-DNO_PAT
3ef0: 45 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e  ENTS option - an
3f00: 64 20 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20  d the resultant 
3f10: 6d 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63  module will func
3f20: 74 69 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61  tion.correctly a
3f30: 6e 64 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20  nd also support 
3f40: 41 44 48 20 63 65 72 74 69 66 69 63 61 74 65 2d  ADH certificate-
3f50: 6c 65 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c  less encryption,
3f60: 0a 68 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c  .however you wil
3f70: 6c 20 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75  l be unable to u
3f80: 74 69 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73  tilize this to s
3f90: 70 65 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57  peak to normal W
3fa0: 65 62 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63  eb.Servers, whic
3fb0: 68 20 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75  h typically requ
3fc0: 69 72 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e  ire RSA support.
3fd0: 20 50 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68   Please see <a.h
3fe0: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e  ref="http://www.
3ff0: 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74  openssl.org/">ht
4000: 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c  tp://www.openssl
4010: 2e 6f 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f  .org/</a> for.mo
4020: 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f  re information o
4030: 6e 20 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75  n the whole issu
4040: 65 20 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64  e of patents and
4050: 20 55 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72   US export.restr
4060: 69 63 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c  ictions. </p>..<
4070: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20  h3><a name="SEE 
4080: 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f  ALSO">SEE ALSO</
4090: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72  a></h3>..<p><str
40a0: 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f  ong>socket</stro
40b0: 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c  ng>, <strong>fil
40c0: 65 65 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67  eevent, </strong
40d0: 3e 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f  ><a.href="http:/
40e0: 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67  /www.openssl.org
40f0: 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53  /"><strong>OpenS
4100: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c  SL</strong></a><
4110: 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e  /p>..<hr>..<pre>
4120: 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79  .Copyright &copy
4130: 3b 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d  ; 1999 Matt Newm
4140: 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63  an..Copyright &c
4150: 6f 70 79 3b 20 32 30 30 34 20 53 74 61 72 66 69  opy; 2004 Starfi
4160: 73 68 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72  sh Systems..</pr
4170: 65 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d  e>.</body>.</htm
4180: 6c 3e 0a                                         l>.