Hex Artifact Content

Artifact 4a8c5d43b62f12e456f8fc97c60622bec70c3c03:


0000: 3c 68 74 6d 6c 3e 0d 0a 0d 0a 3c 68 65 61 64 3e  <html>....<head>
0010: 0d 0a 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 75  ..<meta http-equ
0020: 69 76 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65  iv="Content-Type
0030: 22 0d 0a 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74  "..content="text
0040: 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 3d 69  /html; charset=i
0050: 73 6f 2d 38 38 35 39 2d 31 22 3e 0d 0a 3c 6d 65  so-8859-1">..<me
0060: 74 61 20 6e 61 6d 65 3d 22 41 75 74 68 6f 72 22  ta name="Author"
0070: 0d 0a 63 6f 6e 74 65 6e 74 3d 22 4d 61 74 74 20  ..content="Matt 
0080: 4e 65 77 6d 61 6e 20 26 6c 74 3b 6d 61 74 74 40  Newman &lt;matt@
0090: 6e 6f 76 61 64 69 67 6d 2e 63 6f 6d 26 67 74 3b  novadigm.com&gt;
00a0: 22 3e 0d 0a 3c 6d 65 74 61 20 6e 61 6d 65 3d 22  ">..<meta name="
00b0: 43 6f 70 79 72 69 67 68 74 22 20 63 6f 6e 74 65  Copyright" conte
00c0: 6e 74 3d 22 31 39 39 39 20 4d 61 74 74 20 4e 65  nt="1999 Matt Ne
00d0: 77 6d 61 6e 2e 22 3e 0d 0a 3c 6d 65 74 61 20 6e  wman.">..<meta n
00e0: 61 6d 65 3d 22 47 45 4e 45 52 41 54 4f 52 22 20  ame="GENERATOR" 
00f0: 63 6f 6e 74 65 6e 74 3d 22 4d 69 63 72 6f 73 6f  content="Microso
0100: 66 74 20 46 72 6f 6e 74 50 61 67 65 20 45 78 70  ft FrontPage Exp
0110: 72 65 73 73 20 32 2e 30 22 3e 0d 0a 3c 74 69 74  ress 2.0">..<tit
0120: 6c 65 3e 54 4c 53 20 28 53 53 4c 29 20 54 63 6c  le>TLS (SSL) Tcl
0130: 20 43 6f 6d 6d 61 6e 64 73 3c 2f 74 69 74 6c 65   Commands</title
0140: 3e 0d 0a 3c 2f 68 65 61 64 3e 0d 0a 0d 0a 3c 62  >..</head>....<b
0150: 6f 64 79 20 62 67 63 6f 6c 6f 72 3d 22 23 46 46  ody bgcolor="#FF
0160: 46 46 46 46 22 3e 0d 0a 0d 0a 3c 64 6c 3e 0d 0a  FFFF">....<dl>..
0170: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
0180: 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 3e  "#NAME">NAME</a>
0190: 20 3c 64 6c 3e 0d 0a 20 20 20 20 20 20 20 20 20   <dl>..         
01a0: 20 20 20 3c 64 64 3e 3c 73 74 72 6f 6e 67 3e 74     <dd><strong>t
01b0: 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69  ls</strong> - bi
01c0: 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67  nding to <strong
01d0: 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67  >OpenSSL</strong
01e0: 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  >..             
01f0: 20 20 20 74 6f 6f 6c 6b 69 74 2e 3c 2f 64 64 3e     toolkit.</dd>
0200: 0d 0a 20 20 20 20 20 20 20 20 3c 2f 64 6c 3e 0d  ..        </dl>.
0210: 0a 20 20 20 20 3c 2f 64 64 3e 0d 0a 20 20 20 20  .    </dd>..    
0220: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 59  <dd><a href="#SY
0230: 4e 4f 50 53 49 53 22 3e 53 59 4e 4f 50 53 49 53  NOPSIS">SYNOPSIS
0240: 3c 2f 61 3e 20 3c 2f 64 64 3e 0d 0a 20 20 20 20  </a> </dd>..    
0250: 3c 64 64 3e 3c 64 6c 3e 0d 0a 20 20 20 20 20 20  <dd><dl>..      
0260: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 70 61 63        <dd><b>pac
0270: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73  kage require tls
0280: 20 3c 2f 62 3e 3c 65 6d 3e 3f 31 2e 33 3f 3c 2f   </b><em>?1.3?</
0290: 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20  em></dd>..      
02a0: 20 20 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b        <dt>&nbsp;
02b0: 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 20  </dt>..         
02c0: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69     <dd><b>tls::i
02d0: 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69  nit </b><i>?opti
02e0: 6f 6e 73 3f 3c 2f 69 3e 20 3c 2f 64 64 3e 0d 0a  ons?</i> </dd>..
02f0: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e              <dd>
0300: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c  <b>tls::socket <
0310: 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f  /b><em>?options?
0320: 20 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c   host port</em><
0330: 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20 20  /dd>..          
0340: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f    <dd><b>tls::so
0350: 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73  cket</b><em> ?-s
0360: 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 0d 0a  erver command?..
0370: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0380: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f  ?options? port</
0390: 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20  em></dd>..      
03a0: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73        <dd><b>tls
03b0: 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e 3c  ::handshake</b><
03c0: 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e  em> channel</em>
03d0: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20  </dd>..         
03e0: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73     <dd><b>tls::s
03f0: 74 61 74 75 73 20 3c 2f 62 3e 3c 65 6d 3e 63 68  tatus </b><em>ch
0400: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0d  annel</em></dd>.
0410: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64  .            <dd
0420: 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c  ><b>tls::import<
0430: 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 20  /b><em> channel 
0440: 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 65 6d 3e 3c 2f  ?options?</em></
0450: 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20  dd>..           
0460: 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70   <dd><b>tls::cip
0470: 68 65 72 73 20 3c 2f 62 3e 3c 65 6d 3e 70 72 6f  hers </b><em>pro
0480: 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 3c  tocol ?verbose?<
0490: 2f 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20  /em></dd>..     
04a0: 20 20 20 3c 2f 64 6c 3e 0d 0a 20 20 20 20 3c 2f     </dl>..    </
04b0: 64 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20  dd>..    <dd><a 
04c0: 68 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22  href="#COMMANDS"
04d0: 3e 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64  >COMMANDS</a></d
04e0: 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  d>..    <dd><a h
04f0: 72 65 66 3d 22 23 43 4f 4e 46 49 47 55 52 41 54  ref="#CONFIGURAT
0500: 49 4f 4e 20 4f 50 54 49 4f 4e 53 22 3e 43 4f 4e  ION OPTIONS">CON
0510: 46 49 47 55 52 41 54 49 4f 4e 20 4f 50 54 49 4f  FIGURATION OPTIO
0520: 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0d 0a 20 20 20  NS</a></dd>..   
0530: 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 48   <dd><a href="#H
0540: 54 54 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54  TTPS EXAMPLE">HT
0550: 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c  TPS EXAMPLE</a><
0560: 2f 64 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61  /dd>..    <dd><a
0570: 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f   href="#SEE ALSO
0580: 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44  ">SPECIAL CONSID
0590: 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64  ERATIONS</a></dd
05a0: 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72  >..    <dd><a hr
05b0: 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e 53  ef="#SEE ALSO">S
05c0: 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 3e  EE ALSO</a></dd>
05d0: 0d 0a 3c 2f 64 6c 3e 0d 0a 0d 0a 3c 68 72 3e 0d  ..</dl>....<hr>.
05e0: 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  ...<h3><a name="
05f0: 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f  NAME">NAME</a></
0600: 68 33 3e 0d 0a 0d 0a 3c 70 3e 3c 73 74 72 6f 6e  h3>....<p><stron
0610: 67 3e 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d  g>tls</strong> -
0620: 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72   binding to <str
0630: 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72  ong>OpenSSL</str
0640: 6f 6e 67 3e 0d 0a 74 6f 6f 6c 6b 69 74 2e 3c 2f  ong>..toolkit.</
0650: 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d  p>....<h3><a nam
0660: 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53 59 4e  e="SYNOPSIS">SYN
0670: 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a  OPSIS</a></h3>..
0680: 0d 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20  ..<p><b>package 
0690: 72 65 71 75 69 72 65 20 74 6c 73 20 3c 2f 62 3e  require tls </b>
06a0: 3c 65 6d 3e 3f 31 2e 33 3f 3c 2f 65 6d 3e 3c 62  <em>?1.3?</em><b
06b0: 72 3e 0d 0a 3c 62 72 3e 0d 0a 3c 61 20 68 72 65  r>..<br>..<a hre
06c0: 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c  f="#tls::init"><
06d0: 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e  b>tls::init </b>
06e0: 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e  <i>?options?</i>
06f0: 3c 62 72 3e 0d 0a 3c 2f 61 3e 3c 61 20 68 72 65  <br>..</a><a hre
0700: 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74 22  f="#tls::socket"
0710: 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  ><b>tls::socket 
0720: 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73  </b><em>?options
0730: 3f 20 68 6f 73 74 0d 0a 70 6f 72 74 3c 2f 65 6d  ? host..port</em
0740: 3e 3c 62 72 3e 0d 0a 3c 62 3e 74 6c 73 3a 3a 73  ><br>..<b>tls::s
0750: 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d  ocket</b><em> ?-
0760: 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20  server command? 
0770: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f  ?options? port</
0780: 65 6d 3e 3c 62 72 3e 0d 0a 3c 2f 61 3e 3c 61 20  em><br>..</a><a 
0790: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61 74  href="#tls::stat
07a0: 75 73 22 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74  us"><b>tls::stat
07b0: 75 73 20 3c 2f 62 3e 3c 65 6d 3e 63 68 61 6e 6e  us </b><em>chann
07c0: 65 6c 3c 2f 65 6d 3e 3c 62 72 3e 0d 0a 3c 2f 61  el</em><br>..</a
07d0: 3e 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  ><a href="#tls::
07e0: 68 61 6e 64 73 68 61 6b 65 22 3e 3c 62 3e 74 6c  handshake"><b>tl
07f0: 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e  s::handshake</b>
0800: 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d  <em> channel</em
0810: 3e 3c 2f 61 3e 3c 62 72 3e 0d 0a 3c 62 72 3e 0d  ></a><br>..<br>.
0820: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
0830: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a  import"><b>tls::
0840: 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68  import </b><i>ch
0850: 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c  annel ?options?<
0860: 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0d 0a 3c 61 20  /i></a><br>..<a 
0870: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 63 69 70 68  href="#tls::ciph
0880: 65 72 73 20 70 72 6f 74 6f 63 6f 6c 20 3f 76 65  ers protocol ?ve
0890: 72 62 6f 73 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e  rbose?"><strong>
08a0: 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74  tls::ciphers</st
08b0: 72 6f 6e 67 3e 0d 0a 3c 65 6d 3e 70 72 6f 74 6f  rong>..<em>proto
08c0: 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 3c 2f 65  col ?verbose?</e
08d0: 6d 3e 3c 2f 61 3e 3c 2f 70 3e 0d 0a 0d 0a 3c 68  m></a></p>....<h
08e0: 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 53 43 52  3><a name="DESCR
08f0: 49 50 54 49 4f 4e 22 3e 44 45 53 43 52 49 50 54  IPTION">DESCRIPT
0900: 49 4f 4e 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a 0d 0a  ION</a></h3>....
0910: 3c 70 3e 54 68 69 73 20 65 78 74 65 6e 73 69 6f  <p>This extensio
0920: 6e 20 70 72 6f 76 69 64 65 73 20 61 20 67 65 6e  n provides a gen
0930: 65 72 69 63 20 62 69 6e 64 69 6e 67 20 74 6f 20  eric binding to 
0940: 3c 61 0d 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f  <a..href="http:/
0950: 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67  /www.openssl.org
0960: 2f 22 3e 4f 70 65 6e 53 53 4c 3c 2f 61 3e 2c 20  /">OpenSSL</a>, 
0970: 75 74 69 6c 69 7a 69 6e 67 20 74 68 65 20 3c 61  utilizing the <a
0980: 0d 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77  ..href="http://w
0990: 77 77 2e 6f 63 68 65 2e 64 65 2f 7e 61 6b 75 70  ww.oche.de/~akup
09a0: 72 69 65 73 2f 73 6f 66 74 2f 74 72 66 2f 69 6e  ries/soft/trf/in
09b0: 64 65 78 2e 68 74 6d 6c 22 3e 54 72 66 3c 2f 61  dex.html">Trf</a
09c0: 3e 0d 0a 43 68 61 6e 6e 65 6c 20 53 74 61 63 6b  >..Channel Stack
09d0: 69 6e 67 20 70 61 74 63 68 20 66 6f 72 20 54 63  ing patch for Tc
09e0: 6c 20 38 2e 5b 30 31 5d 20 61 6e 64 20 74 68 65  l 8.[01] and the
09f0: 20 6e 65 77 20 3c 73 74 72 6f 6e 67 3e 54 63 6c   new <strong>Tcl
0a00: 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73  _StackChannel</s
0a10: 74 72 6f 6e 67 3e 0d 0a 41 50 49 20 66 6f 72 20  trong>..API for 
0a20: 54 63 6c 20 38 2e 32 20 61 6e 64 20 68 69 67 68  Tcl 8.2 and high
0a30: 65 72 2e 20 54 68 65 20 73 6f 63 6b 65 74 73 20  er. The sockets 
0a40: 62 65 68 61 76 65 20 65 78 61 63 74 6c 79 20 74  behave exactly t
0a50: 68 65 20 73 61 6d 65 0d 0a 61 73 20 63 68 61 6e  he same..as chan
0a60: 6e 65 6c 73 20 63 72 65 61 74 65 64 20 75 73 69  nels created usi
0a70: 6e 67 20 54 63 6c 27 73 20 62 75 69 6c 74 2d 69  ng Tcl's built-i
0a80: 6e 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74  n <strong>socket
0a90: 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 63 6f 6d 6d 61  </strong>..comma
0aa0: 6e 64 20 77 69 74 68 20 61 64 64 69 74 69 6f 6e  nd with addition
0ab0: 61 6c 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20 63  al options for c
0ac0: 6f 6e 74 72 6f 6c 6c 69 6e 67 20 74 68 65 20 53  ontrolling the S
0ad0: 53 4c 20 73 65 73 73 69 6f 6e 2e 3c 2f 70 3e 0d  SL session.</p>.
0ae0: 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  ...<h3><a name="
0af0: 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e  COMMANDS">COMMAN
0b00: 44 53 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a 0d 0a 3c  DS</a></h3>....<
0b10: 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f 6e 65 20  p>Typically one 
0b20: 77 6f 75 6c 64 20 75 73 65 20 74 68 65 20 3c 73  would use the <s
0b30: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65  trong>tls::socke
0b40: 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f 6d 6d 61  t </strong>comma
0b50: 6e 64 0d 0a 77 68 69 63 68 20 70 72 6f 76 69 64  nd..which provid
0b60: 65 73 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79  es compatibility
0b70: 20 77 69 74 68 20 74 68 65 20 6e 61 74 69 76 65   with the native
0b80: 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63   Tcl <strong>soc
0b90: 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 63 6f  ket</strong>..co
0ba0: 6d 6d 61 6e 64 2e 20 49 6e 20 73 75 63 68 20 63  mmand. In such c
0bb0: 61 73 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73  ases <strong>tls
0bc0: 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67  ::import</strong
0bd0: 3e 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 0d  > should not be.
0be0: 0a 75 73 65 64 20 64 69 72 65 63 74 6c 79 2e 3c  .used directly.<
0bf0: 2f 70 3e 0d 0a 0d 0a 3c 64 6c 3e 0d 0a 20 20 20  /p>....<dl>..   
0c00: 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c   <dt><a name="tl
0c10: 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a  s::init"><b>tls:
0c20: 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70  :init </b><i>?op
0c30: 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f  tions?</i></a></
0c40: 64 74 3e 0d 0a 20 20 20 20 3c 64 64 3e 54 68 69  dt>..    <dd>Thi
0c50: 73 20 72 6f 75 74 69 6e 65 20 73 65 74 73 20 74  s routine sets t
0c60: 68 65 20 64 65 66 61 75 6c 74 20 6f 70 74 69 6f  he default optio
0c70: 6e 73 20 75 73 65 64 20 62 79 20 3c 73 74 72 6f  ns used by <stro
0c80: 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  ng>tls::socket</
0c90: 73 74 72 6f 6e 67 3e 0d 0a 20 20 20 20 20 20 20  strong>..       
0ca0: 20 61 6e 64 20 69 73 20 3c 65 6d 3e 6f 70 74 69   and is <em>opti
0cb0: 6f 6e 61 6c 3c 2f 65 6d 3e 2e 20 49 66 20 79 6f  onal</em>. If yo
0cc0: 75 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74  u call <strong>t
0cd0: 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f  ls::import</stro
0ce0: 6e 67 3e 0d 0a 20 20 20 20 20 20 20 20 64 69 72  ng>..        dir
0cf0: 65 63 74 6c 79 20 74 68 69 73 20 72 6f 75 74 69  ectly this routi
0d00: 6e 65 20 68 61 73 20 6e 6f 20 65 66 66 65 63 74  ne has no effect
0d10: 2e 20 41 6e 79 20 6f 66 20 74 68 65 20 6f 70 74  . Any of the opt
0d20: 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 74 68  ions..        th
0d30: 61 74 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  at <strong>tls::
0d40: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20  socket</strong> 
0d50: 61 63 63 65 70 74 73 20 63 61 6e 20 62 65 20 73  accepts can be s
0d60: 65 74 0d 0a 20 20 20 20 20 20 20 20 75 73 69 6e  et..        usin
0d70: 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c 20  g this command, 
0d80: 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75 6c  though you shoul
0d90: 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70 74  d limit your opt
0da0: 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 74 6f  ions..        to
0db0: 20 6f 6e 6c 79 20 54 4c 53 20 72 65 6c 61 74 65   only TLS relate
0dc0: 64 20 6f 6e 65 73 2e 3c 2f 64 64 3e 0d 0a 20 20  d ones.</dd>..  
0dd0: 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74    <dt>&nbsp;</dt
0de0: 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61  >..    <dt><a na
0df0: 6d 65 3d 22 74 6c 73 3a 3a 73 6f 63 6b 65 74 22  me="tls::socket"
0e00: 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  ><b>tls::socket 
0e10: 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73  </b><em>?options
0e20: 3f 0d 0a 20 20 20 20 20 20 20 20 68 6f 73 74 20  ?..        host 
0e30: 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64  port</em></a></d
0e40: 74 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 62 3e 74  t>..    <dt><b>t
0e50: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65  ls::socket</b><e
0e60: 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d  m> ?-server comm
0e70: 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70  and? ?options? p
0e80: 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20  ort</em></dt>.. 
0e90: 20 20 20 3c 64 64 3e 54 68 69 73 20 69 73 20 61     <dd>This is a
0ea0: 20 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e   helper function
0eb0: 20 74 68 61 74 20 75 74 69 6c 69 7a 65 73 20 74   that utilizes t
0ec0: 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 0d 0a 20  he underlying.. 
0ed0: 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 73 20         commands 
0ee0: 28 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d  (<strong>tls::im
0ef0: 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 29 2e 20  port</strong>). 
0f00: 49 74 20 62 65 68 61 76 65 73 0d 0a 20 20 20 20  It behaves..    
0f10: 20 20 20 20 65 78 61 63 74 6c 79 20 74 68 65 20      exactly the 
0f20: 73 61 6d 65 20 61 73 20 74 68 65 20 6e 61 74 69  same as the nati
0f30: 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73  ve Tcl <strong>s
0f40: 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0d 0a  ocket</strong>..
0f50: 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 20          command 
0f60: 65 78 63 65 70 74 20 74 68 61 74 20 74 68 65 20  except that the 
0f70: 6f 70 74 69 6f 6e 73 20 63 61 6e 20 69 6e 63 6c  options can incl
0f80: 75 64 65 20 61 6e 79 20 6f 66 20 74 68 65 0d 0a  ude any of the..
0f90: 20 20 20 20 20 20 20 20 61 70 70 6c 69 63 61 62          applicab
0fa0: 6c 65 20 3c 61 20 68 72 65 66 3d 22 23 74 6c 73  le <a href="#tls
0fb0: 3a 3a 69 6d 70 6f 72 74 22 3e 3c 73 74 72 6f 6e  ::import"><stron
0fc0: 67 3e 74 6c 73 3a 69 6d 70 6f 72 74 3c 2f 73 74  g>tls:import</st
0fd0: 72 6f 6e 67 3e 3c 2f 61 3e 0d 0a 20 20 20 20 20  rong></a>..     
0fe0: 20 20 20 6f 70 74 69 6f 6e 73 2e 3c 2f 64 64 3e     options.</dd>
0ff0: 0d 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b  ..    <dt>&nbsp;
1000: 3c 2f 64 74 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c  </dt>..    <dt><
1010: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 68 61 6e  a name="tls::han
1020: 64 73 68 61 6b 65 22 3e 3c 73 74 72 6f 6e 67 3e  dshake"><strong>
1030: 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f  tls::handshake</
1040: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e  strong> <em>chan
1050: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74  nel</em></a></dt
1060: 3e 0d 0a 20 20 20 20 3c 64 64 3e 46 6f 72 63 65  >..    <dd>Force
1070: 73 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 74  s handshake to t
1080: 61 6b 65 20 70 6c 61 63 65 2c 20 61 6e 64 20 72  ake place, and r
1090: 65 74 75 72 6e 73 20 30 20 69 66 0d 0a 20 20 20  eturns 0 if..   
10a0: 20 20 20 20 20 68 61 6e 64 73 68 61 6b 65 20 69       handshake i
10b0: 73 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f 67 72  s still in progr
10c0: 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e  ess (non-blockin
10d0: 67 29 2c 20 6f 72 20 31 20 69 66 0d 0a 20 20 20  g), or 1 if..   
10e0: 20 20 20 20 20 74 68 65 20 68 61 6e 64 73 68 61       the handsha
10f0: 6b 65 20 77 61 73 20 73 75 63 63 65 73 73 66 75  ke was successfu
1100: 6c 2e 20 49 66 20 74 68 65 20 68 61 6e 64 73 68  l. If the handsh
1110: 61 6b 65 20 66 61 69 6c 65 64 0d 0a 20 20 20 20  ake failed..    
1120: 20 20 20 20 74 68 69 73 20 72 6f 75 74 69 6e 65      this routine
1130: 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20 65   will throw an e
1140: 72 72 6f 72 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20  rror.</dd>..    
1150: 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0d  <dt>&nbsp;</dt>.
1160: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
1170: 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c  ="tls::status"><
1180: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74  strong>tls::stat
1190: 75 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  us</strong> <em>
11a0: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e  channel</em></a>
11b0: 3c 2f 64 74 3e 0d 0a 20 20 20 20 3c 64 64 3e 52  </dt>..    <dd>R
11c0: 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65  eturns the curre
11d0: 6e 74 20 73 65 63 75 72 69 74 79 20 73 74 61 74  nt security stat
11e0: 75 73 20 6f 66 20 61 20 53 53 4c 20 63 68 61 6e  us of a SSL chan
11f0: 6e 65 6c 2e 20 54 68 65 0d 0a 20 20 20 20 20 20  nel. The..      
1200: 20 20 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69    result is a li
1210: 73 74 20 6f 66 20 6b 65 79 20 76 61 6c 75 65 20  st of key value 
1220: 70 61 69 72 73 20 64 65 73 63 72 69 62 69 6e 67  pairs describing
1230: 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 63 6f   the..        co
1240: 6e 6e 65 63 74 65 64 20 70 65 65 72 2e 20 49 66  nnected peer. If
1250: 20 74 68 65 20 72 65 73 75 6c 74 20 69 73 20 61   the result is a
1260: 6e 20 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65  n empty list the
1270: 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 53  n the..        S
1280: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73  SL handshake has
1290: 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74   not yet complet
12a0: 65 64 2e 3c 2f 64 64 3e 0d 0a 3c 2f 64 6c 3e 0d  ed.</dd>..</dl>.
12b0: 0a 0d 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0d  ...<blockquote>.
12c0: 0a 20 20 20 20 3c 64 6c 3e 0d 0a 20 20 20 20 20  .    <dl>..     
12d0: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69     <dt><strong>i
12e0: 73 73 75 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  ssuer</strong> <
12f0: 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d  em>dn</em></dt>.
1300: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65  .        <dd>The
1310: 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e   distinguished n
1320: 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20  ame (DN) of the 
1330: 63 65 72 74 69 66 69 63 61 74 65 0d 0a 20 20 20  certificate..   
1340: 20 20 20 20 20 20 20 20 20 69 73 73 75 65 72 2e           issuer.
1350: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dd>..        <
1360: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65  dt><strong>subje
1370: 63 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ct</strong> <em>
1380: 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20  dn</em></dt>..  
1390: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 64 69        <dd>The di
13a0: 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65  stinguished name
13b0: 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72   (DN) of the cer
13c0: 74 69 66 69 63 61 74 65 0d 0a 20 20 20 20 20 20  tificate..      
13d0: 20 20 20 20 20 20 73 75 62 6a 65 63 74 2e 3c 2f        subject.</
13e0: 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74  dd>..        <dt
13f0: 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 42 65 66 6f  ><strong>notBefo
1400: 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  re</strong> <em>
1410: 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a  date</em></dt>..
1420: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
1430: 62 65 67 69 6e 20 64 61 74 65 20 66 6f 72 20 74  begin date for t
1440: 68 65 20 76 61 6c 69 64 69 74 79 20 6f 66 20 74  he validity of t
1450: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c  he certificate.<
1460: 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dd>..        <d
1470: 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 41 66 74  t><strong>notAft
1480: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  er</strong> <em>
1490: 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a  date</em></dt>..
14a0: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
14b0: 65 78 70 69 72 79 20 64 61 74 65 20 66 6f 72 20  expiry date for 
14c0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e  the certificate.
14d0: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dd>..        <
14e0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69 61  dt><strong>seria
14f0: 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e  l</strong> <em>n
1500: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20 20  </em></dt>..    
1510: 20 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69      <dd>The seri
1520: 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65  al number of the
1530: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64   certificate.</d
1540: 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  d>..        <dt>
1550: 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f  <strong>cipher</
1560: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68  strong> <em>ciph
1570: 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20  er</em></dt>..  
1580: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 63 75        <dd>The cu
1590: 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e 20  rrent cipher in 
15a0: 75 73 65 20 62 65 74 77 65 65 6e 20 74 68 65 20  use between the 
15b0: 63 6c 69 65 6e 74 20 61 6e 64 0d 0a 20 20 20 20  client and..    
15c0: 20 20 20 20 20 20 20 20 73 65 72 76 65 72 20 63          server c
15d0: 68 61 6e 6e 65 6c 73 2e 3c 2f 64 64 3e 0d 0a 20  hannels.</dd>.. 
15e0: 20 20 20 3c 2f 64 6c 3e 0d 0a 3c 2f 62 6c 6f 63     </dl>..</bloc
15f0: 6b 71 75 6f 74 65 3e 0d 0a 0d 0a 3c 64 6c 3e 0d  kquote>....<dl>.
1600: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
1610: 3d 22 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c  ="tls::import"><
1620: 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f  b>tls::import </
1630: 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0d 0a 20 20  b><i>channel..  
1640: 20 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73 3f 3c        ?options?<
1650: 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0d 0a 20 20  /i></a></dt>..  
1660: 20 20 3c 64 64 3e 53 53 4c 2d 65 6e 61 62 6c 65    <dd>SSL-enable
1670: 20 61 20 72 65 67 75 6c 61 72 20 54 63 6c 20 63   a regular Tcl c
1680: 68 61 6e 6e 65 6c 20 2d 20 69 74 20 6e 65 65 64  hannel - it need
1690: 20 6e 6f 74 20 62 65 20 61 0d 0a 20 20 20 20 20   not be a..     
16a0: 20 20 20 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d     socket, but m
16b0: 75 73 74 20 70 72 6f 76 69 64 65 20 62 69 2d 64  ust provide bi-d
16c0: 69 72 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e  irectional flow.
16d0: 20 41 6c 73 6f 0d 0a 20 20 20 20 20 20 20 20 73   Also..        s
16e0: 65 74 74 69 6e 67 20 73 65 73 73 69 6f 6e 20 70  etting session p
16f0: 61 72 61 6d 65 74 65 72 73 20 66 6f 72 20 53 53  arameters for SS
1700: 4c 20 68 61 6e 64 73 68 61 6b 65 2e 3c 2f 64 64  L handshake.</dd
1710: 3e 0d 0a 3c 2f 64 6c 3e 0d 0a 0d 0a 3c 62 6c 6f  >..</dl>....<blo
1720: 63 6b 71 75 6f 74 65 3e 0d 0a 20 20 20 20 3c 64  ckquote>..    <d
1730: 6c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  l>..        <dt>
1740: 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65 20  <strong>-cafile 
1750: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c  </strong><em>fil
1760: 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d  ename</em></dt>.
1770: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f  .        <dd>Pro
1780: 76 69 64 65 20 74 68 65 20 43 41 20 66 69 6c 65  vide the CA file
1790: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
17a0: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 63 61 64  <dt>-<strong>cad
17b0: 69 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ir</strong> <em>
17c0: 64 69 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20  dir</em></dt>.. 
17d0: 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69         <dd>Provi
17e0: 64 65 20 74 68 65 20 64 69 72 65 63 74 6f 72 79  de the directory
17f0: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20   containing the 
1800: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73 2e  CA certificates.
1810: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dd>..        <
1820: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74  dt><strong>-cert
1830: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  file</strong> <e
1840: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c  m>filename</em><
1850: 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dt>..        <d
1860: 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 63 65  d>Provide the ce
1870: 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65  rtificate to use
1880: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
1890: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69 70  <dt><strong>-cip
18a0: 68 65 72 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d  her </strong><em
18b0: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  >string</em></dt
18c0: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50  >..        <dd>P
18d0: 72 6f 76 69 64 65 20 74 68 65 20 63 69 70 68 65  rovide the ciphe
18e0: 72 20 73 75 69 74 65 73 20 74 6f 20 75 73 65 2e  r suites to use.
18f0: 20 53 79 6e 74 61 78 20 69 73 20 61 73 20 70 65   Syntax is as pe
1900: 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4f  r..            O
1910: 70 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0d 0a 20 20  penSSL.</dd>..  
1920: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
1930: 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f  g>-command</stro
1940: 6e 67 3e 3c 65 6d 3e 20 63 61 6c 6c 62 61 63 6b  ng><em> callback
1950: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20 20  </em></dt>..    
1960: 20 20 20 20 3c 64 64 3e 54 68 69 73 20 63 61 6c      <dd>This cal
1970: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64  lback is invoked
1980: 20 74 6f 20 70 61 73 73 20 65 72 72 6f 72 73 2c   to pass errors,
1990: 20 74 72 61 63 69 6e 67 0d 0a 20 20 20 20 20 20   tracing..      
19a0: 20 20 20 20 20 20 69 6e 66 6f 72 6d 61 74 69 6f        informatio
19b0: 6e 20 61 6e 64 20 74 6f 20 61 6c 6c 6f 77 20 54  n and to allow T
19c0: 63 6c 20 73 63 72 69 70 74 73 20 74 6f 20 70 65  cl scripts to pe
19d0: 72 66 6f 72 6d 0d 0a 20 20 20 20 20 20 20 20 20  rform..         
19e0: 20 20 20 61 64 64 69 74 69 6f 6e 61 6c 20 76 65     additional ve
19f0: 72 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 74 68  rification of th
1a00: 65 20 63 65 72 74 69 66 69 63 61 74 65 2c 20 77  e certificate, w
1a10: 68 69 63 68 20 63 61 6e 0d 0a 20 20 20 20 20 20  hich can..      
1a20: 20 20 20 20 20 20 6f 76 65 72 72 69 64 65 20 74        override t
1a30: 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64  he default valid
1a40: 61 74 69 6f 6e 20 69 6e 20 4f 70 65 6e 53 53 4c  ation in OpenSSL
1a50: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
1a60: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79  <dt><strong>-key
1a70: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  file</strong> <e
1a80: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c  m>filename</em><
1a90: 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dt>..        <d
1aa0: 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 70 72  d>Provide the pr
1ab0: 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 2e 20  ivate key file. 
1ac0: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
1ad0: 3c 2f 73 74 72 6f 6e 67 3e 3a 0d 0a 20 20 20 20  </strong>:..    
1ae0: 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 6f 66          value of
1af0: 20 2d 63 65 72 74 66 69 6c 65 29 3c 2f 64 64 3e   -certfile)</dd>
1b00: 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  ..        <dt><s
1b10: 74 72 6f 6e 67 3e 2d 6d 6f 64 65 6c 3c 2f 73 74  trong>-model</st
1b20: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65  rong> <em>channe
1b30: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20  l</em></dt>..   
1b40: 20 20 20 20 20 3c 64 64 3e 54 68 69 73 20 77 69       <dd>This wi
1b50: 6c 6c 20 66 6f 72 63 65 20 74 68 69 73 20 63 68  ll force this ch
1b60: 61 6e 6e 65 6c 20 74 6f 20 73 68 61 72 65 20 74  annel to share t
1b70: 68 65 20 73 61 6d 65 20 3c 65 6d 3e 3c 73 74 72  he same <em><str
1b80: 6f 6e 67 3e 53 53 4c 5f 43 54 58 3c 2f 73 74 72  ong>SSL_CTX</str
1b90: 6f 6e 67 3e 3c 2f 65 6d 3e 0d 0a 20 20 20 20 20  ong></em>..     
1ba0: 20 20 20 20 20 20 20 73 74 72 75 63 74 75 72 65         structure
1bb0: 20 61 73 20 74 68 65 20 73 70 65 63 69 66 69 65   as the specifie
1bc0: 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65  d <em>channel</e
1bd0: 6d 3e 2c 20 61 6e 64 0d 0a 20 20 20 20 20 20 20  m>, and..       
1be0: 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 20 73       therefore s
1bf0: 68 61 72 65 20 63 61 6c 6c 62 61 63 6b 73 20 65  hare callbacks e
1c00: 74 63 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20  tc.</dd>..      
1c10: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72    <dt><strong>-r
1c20: 65 71 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67 3e  equest </strong>
1c30: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64  <em>bool</em></d
1c40: 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  t>..        <dd>
1c50: 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69 66  Request a certif
1c60: 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20  icate from peer 
1c70: 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73  during SSL hands
1c80: 68 61 6b 65 2e 0d 0a 20 20 20 20 20 20 20 20 20  hake...         
1c90: 20 20 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61     (<strong>defa
1ca0: 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65  ult</strong>: <e
1cb0: 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64  m>true</em>)</dd
1cc0: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  >..        <dt><
1cd0: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 65 3c  strong>-require<
1ce0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f  /strong> <em>boo
1cf0: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20  l</em></dt>..   
1d00: 20 20 20 20 20 3c 64 64 3e 52 65 71 75 69 72 65       <dd>Require
1d10: 20 61 20 76 61 6c 69 64 20 63 65 72 74 69 66 69   a valid certifi
1d20: 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64  cate from peer d
1d30: 75 72 69 6e 67 20 53 53 4c 0d 0a 20 20 20 20 20  uring SSL..     
1d40: 20 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b 65         handshake
1d50: 2e 20 49 66 20 74 68 69 73 20 69 73 20 73 65 74  . If this is set
1d60: 20 74 6f 20 74 72 75 65 20 74 68 65 6e 20 3c 73   to true then <s
1d70: 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 3c 2f  trong>-request</
1d80: 73 74 72 6f 6e 67 3e 0d 0a 20 20 20 20 20 20 20  strong>..       
1d90: 20 20 20 20 20 6d 75 73 74 20 61 6c 73 6f 20 62       must also b
1da0: 65 20 73 65 74 20 74 6f 20 74 72 75 65 2e 20 28  e set to true. (
1db0: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
1dc0: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61  /strong>: <em>fa
1dd0: 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0d 0a  lse</em>)</dd>..
1de0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
1df0: 6f 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73 74 72  ong>-server</str
1e00: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65  ong> <em>bool</e
1e10: 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20  m></dt>..       
1e20: 20 3c 64 64 3e 48 61 6e 64 73 68 61 6b 65 20 61   <dd>Handshake a
1e30: 73 20 73 65 72 76 65 72 20 69 66 20 74 72 75 65  s server if true
1e40: 2c 20 65 6c 73 65 20 68 61 6e 64 73 68 61 6b 65  , else handshake
1e50: 20 61 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20   as..           
1e60: 20 63 6c 69 65 6e 74 2e 28 3c 73 74 72 6f 6e 67   client.(<strong
1e70: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67  >default</strong
1e80: 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d  >: <em>false</em
1e90: 3e 29 20 3c 65 6d 3e 5b 4e 6f 74 0d 0a 20 20 20  >) <em>[Not..   
1ea0: 20 20 20 20 20 20 20 20 20 61 76 61 69 6c 61 62           availab
1eb0: 6c 65 20 74 6f 20 74 6c 73 3a 3a 73 6f 63 6b 65  le to tls::socke
1ec0: 74 5d 3c 2f 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20  t]</em></dd>..  
1ed0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
1ee0: 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e  g>-ssl2</strong>
1ef0: 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f   <em>bool</em></
1f00: 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 64  dt>..        <dd
1f10: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53  >Enable use of S
1f20: 53 4c 20 76 32 2e 20 28 3c 73 74 72 6f 6e 67 3e  SL v2. (<strong>
1f30: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e  default</strong>
1f40: 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 0d  : <em>true</em>.
1f50: 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 6e 6c  .            unl
1f60: 65 73 73 20 2d 44 4e 4f 5f 50 41 54 45 4e 54 53  ess -DNO_PATENTS
1f70: 20 77 61 73 20 73 70 65 63 69 66 69 65 64 20 69   was specified i
1f80: 6e 20 62 75 69 6c 64 29 3c 2f 64 64 3e 0d 0a 20  n build)</dd>.. 
1f90: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
1fa0: 6e 67 3e 2d 73 73 6c 33 20 3c 2f 73 74 72 6f 6e  ng>-ssl3 </stron
1fb0: 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c  g><em>bool</em><
1fc0: 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dt>..        <d
1fd0: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20  d>Enable use of 
1fe0: 53 53 4c 20 76 33 2e 20 28 3c 73 74 72 6f 6e 67  SSL v3. (<strong
1ff0: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67  >default</strong
2000: 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e  >: <em>true</em>
2010: 29 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  )</dd>..        
2020: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73  <dt>-<strong>tls
2030: 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62  1</strong> <em>b
2040: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20  ool</em></dt>.. 
2050: 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c         <dd>Enabl
2060: 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e  e use of TLS v1.
2070: 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c   (<strong>defaul
2080: 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e  t</strong>: <em>
2090: 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e  false</em>)</dd>
20a0: 0d 0a 20 20 20 20 3c 2f 64 6c 3e 0d 0a 3c 2f 62  ..    </dl>..</b
20b0: 6c 6f 63 6b 71 75 6f 74 65 3e 0d 0a 0d 0a 3c 64  lockquote>....<d
20c0: 6c 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e  l>..    <dt><a n
20d0: 61 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72  ame="tls::cipher
20e0: 73 20 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62  s protocol ?verb
20f0: 6f 73 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c  ose?"><strong>tl
2100: 73 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74 72 6f  s::ciphers</stro
2110: 6e 67 3e 0d 0a 20 20 20 20 20 20 20 20 3c 65 6d  ng>..        <em
2120: 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f  >protocol ?verbo
2130: 73 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74  se?</em></a></dt
2140: 3e 0d 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72  >..    <dd>Retur
2150: 6e 73 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f  ns list of suppo
2160: 72 74 65 64 20 63 69 70 68 65 72 73 20 62 61 73  rted ciphers bas
2170: 65 64 20 6f 6e 20 74 68 65 20 3c 65 6d 3e 70 72  ed on the <em>pr
2180: 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 0d 0a 20 20 20  otocol</em>..   
2190: 20 20 20 20 20 79 6f 75 20 73 75 70 70 6c 79 2c       you supply,
21a0: 20 77 68 69 63 68 20 6d 75 73 74 20 62 65 20 6f   which must be o
21b0: 6e 65 20 6f 66 20 3c 65 6d 3e 73 73 6c 32 2c 20  ne of <em>ssl2, 
21c0: 73 73 6c 33 2c 20 6f 72 20 74 6c 73 31 3c 2f 65  ssl3, or tls1</e
21d0: 6d 3e 2e 0d 0a 20 20 20 20 20 20 20 20 49 66 20  m>...        If 
21e0: 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f 65 6d 3e  <em>verbose</em>
21f0: 20 69 73 20 73 70 65 63 69 66 69 65 64 20 61 73   is specified as
2200: 20 74 72 75 65 20 74 68 65 6e 20 61 20 76 65 72   true then a ver
2210: 62 6f 73 65 2c 0d 0a 20 20 20 20 20 20 20 20 73  bose,..        s
2220: 65 6d 69 2d 68 75 6d 61 6e 20 72 65 61 64 61 62  emi-human readab
2230: 6c 65 20 6c 69 73 74 20 69 73 20 72 65 74 75 72  le list is retur
2240: 6e 65 64 20 70 72 6f 76 69 64 69 6e 67 20 61 64  ned providing ad
2250: 64 69 74 69 6f 6e 61 6c 0d 0a 20 20 20 20 20 20  ditional..      
2260: 20 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e    information on
2270: 20 74 68 65 20 6e 61 74 75 72 65 20 6f 66 20 74   the nature of t
2280: 68 65 20 63 69 70 68 65 72 20 73 75 70 70 6f 72  he cipher suppor
2290: 74 2e 20 49 6e 20 65 61 63 68 0d 0a 20 20 20 20  t. In each..    
22a0: 20 20 20 20 63 61 73 65 20 74 68 65 20 72 65 73      case the res
22b0: 75 6c 74 20 69 73 20 61 20 54 63 6c 20 6c 69 73  ult is a Tcl lis
22c0: 74 2e 3c 2f 64 64 3e 0d 0a 3c 2f 64 6c 3e 0d 0a  t.</dd>..</dl>..
22d0: 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43  ..<h3><a name="C
22e0: 4f 4e 46 49 47 55 52 41 54 49 4f 4e 20 4f 50 54  ONFIGURATION OPT
22f0: 49 4f 4e 53 22 3e 43 4f 4e 46 49 47 55 52 41 54  IONS">CONFIGURAT
2300: 49 4f 4e 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c  ION OPTIONS</a><
2310: 2f 68 33 3e 0d 0a 0d 0a 3c 70 3e 49 6e 20 61 64  /h3>....<p>In ad
2320: 64 69 74 69 6f 6e 20 74 6f 20 74 68 65 20 6f 70  dition to the op
2330: 74 69 6f 6e 73 20 6c 69 73 74 65 64 20 61 62 6f  tions listed abo
2340: 76 65 20 79 6f 75 20 63 61 6e 20 73 65 74 20 74  ve you can set t
2350: 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  he <strong>tls::
2360: 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 0d 0a  debug</strong>..
2370: 66 6c 61 67 20 74 6f 20 61 20 6e 6f 6e 2d 7a 65  flag to a non-ze
2380: 72 6f 20 76 61 6c 75 65 20 74 6f 20 73 65 65 20  ro value to see 
2390: 74 68 65 20 6f 75 74 70 75 74 20 66 72 6f 6d 20  the output from 
23a0: 74 68 65 20 64 65 66 61 75 6c 74 0d 0a 63 6f 6d  the default..com
23b0: 6d 61 6e 64 20 63 61 6c 6c 62 61 63 6b 20 28 3c  mand callback (<
23c0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c  strong>tls::call
23d0: 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 29 20 77  back</strong>) w
23e0: 68 69 63 68 20 73 68 6f 77 73 20 74 68 65 0d 0a  hich shows the..
23f0: 70 72 6f 67 72 65 73 73 69 6f 6e 20 6f 66 20 74  progression of t
2400: 68 65 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65  he SSL handshake
2410: 2e 20 53 65 74 74 69 6e 67 20 74 68 69 73 20 76  . Setting this v
2420: 61 6c 75 65 20 74 6f 20 67 72 65 61 74 65 64 0d  alue to greated.
2430: 0a 74 68 61 6e 20 31 20 77 69 6c 6c 20 63 61 75  .than 1 will cau
2440: 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 20 76  se the default v
2450: 65 72 69 66 79 20 6d 65 74 68 6f 64 20 69 6e 20  erify method in 
2460: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c  <strong>tls::cal
2470: 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 0d 0a  lback</strong>..
2480: 74 6f 20 61 6c 77 61 79 73 20 61 63 63 65 70 74  to always accept
2490: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
24a0: 2c 20 65 76 65 6e 20 69 66 20 69 74 20 69 73 20  , even if it is 
24b0: 69 6e 76 61 6c 69 64 2e 3c 2f 70 3e 0d 0a 0d 0a  invalid.</p>....
24c0: 3c 70 3e 49 6e 20 61 20 72 65 61 6c 2d 77 6f 72  <p>In a real-wor
24d0: 6c 64 20 64 65 70 6c 6f 79 6d 65 6e 74 20 79 6f  ld deployment yo
24e0: 75 20 73 68 6f 75 6c 64 20 73 75 62 73 74 69 74  u should substit
24f0: 75 74 65 20 79 6f 75 72 20 6f 77 6e 0d 0a 63 61  ute your own..ca
2500: 6c 6c 62 61 63 6b 20 69 6e 20 70 6c 61 63 65 20  llback in place 
2510: 6f 66 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  of <strong>tls::
2520: 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67  callback</strong
2530: 3e 2c 20 76 69 61 20 74 68 65 20 3c 65 6d 3e 2d  >, via the <em>-
2540: 63 6f 6d 6d 61 6e 64 0d 0a 3c 2f 65 6d 3e 6f 70  command..</em>op
2550: 74 69 6f 6e 20 74 6f 20 3c 73 74 72 6f 6e 67 3e  tion to <strong>
2560: 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72  tls::socket</str
2570: 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f 6e 67 3e  ong> or <strong>
2580: 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72  tls::import</str
2590: 6f 6e 67 3e 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 70 3e  ong>.</p>....<p>
25a0: 57 68 65 6e 20 74 68 65 20 54 4c 53 20 6c 61 79  When the TLS lay
25b0: 65 72 20 6e 65 65 64 73 20 74 6f 20 6f 62 74 61  er needs to obta
25c0: 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2c 20 74  in a password, t
25d0: 79 70 69 63 61 6c 6c 79 20 66 6f 72 20 61 0d 0a  ypically for a..
25e0: 63 65 72 74 69 66 69 63 61 74 65 2c 20 74 68 65  certificate, the
25f0: 20 73 6f 66 74 77 61 72 65 20 77 69 6c 6c 20 69   software will i
2600: 6e 76 6f 6b 65 20 61 20 54 63 6c 20 63 6f 6d 6d  nvoke a Tcl comm
2610: 61 6e 64 20 63 61 6c 6c 65 64 20 3c 73 74 72 6f  and called <stro
2620: 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64  ng>tls::password
2630: 3c 2f 73 74 72 6f 6e 67 3e 2c 0d 0a 77 68 69 63  </strong>,..whic
2640: 68 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20  h should return 
2650: 61 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 72  a string which r
2660: 65 70 72 65 73 65 6e 74 73 20 74 68 65 20 70 61  epresents the pa
2670: 73 73 77 6f 72 64 20 74 6f 20 62 65 0d 0a 75 73  ssword to be..us
2680: 65 64 2e 20 41 20 64 65 66 61 75 6c 74 20 69 6d  ed. A default im
2690: 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 69 73 20  plementation is 
26a0: 70 72 6f 76 69 64 65 64 2c 20 77 68 69 63 68 20  provided, which 
26b0: 73 69 6d 70 6c 79 20 72 65 74 75 72 6e 73 3c 65  simply returns<e
26c0: 6d 3e 0d 0a 26 71 75 6f 74 3b 73 65 63 72 65 74  m>..&quot;secret
26d0: 26 71 75 6f 74 3b 3c 2f 65 6d 3e 20 2d 20 79 6f  &quot;</em> - yo
26e0: 75 20 73 68 6f 75 6c 64 20 72 65 64 65 66 69 6e  u should redefin
26f0: 65 20 74 68 69 73 20 70 72 6f 63 65 64 75 72 65  e this procedure
2700: 0d 0a 61 66 74 65 72 20 69 73 73 75 69 6e 67 20  ..after issuing 
2710: 74 68 65 20 3c 65 6d 3e 70 61 63 6b 61 67 65 20  the <em>package 
2720: 72 65 71 75 69 72 65 20 74 6c 73 3c 2f 65 6d 3e  require tls</em>
2730: 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20  .</p>....<h3><a 
2740: 6e 61 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d  name="HTTPS EXAM
2750: 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50  PLE">HTTPS EXAMP
2760: 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a 0d 0a 3c  LE</a></h3>....<
2770: 70 3e 54 68 69 73 20 65 78 61 6d 70 6c 65 20 72  p>This example r
2780: 65 71 75 69 72 65 73 20 61 20 70 61 74 63 68 20  equires a patch 
2790: 74 6f 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 68  to the <strong>h
27a0: 74 74 70 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 6d 6f  ttp</strong>..mo
27b0: 64 75 6c 65 20 74 68 61 74 20 73 68 69 70 73 20  dule that ships 
27c0: 77 69 74 68 20 54 63 6c 20 2d 20 74 68 69 73 20  with Tcl - this 
27d0: 70 61 74 63 68 20 68 61 73 20 62 65 65 6e 20 73  patch has been s
27e0: 75 62 6d 69 74 74 65 64 20 66 6f 72 0d 0a 69 6e  ubmitted for..in
27f0: 63 6c 75 73 69 6f 6e 20 69 6e 20 54 63 6c 20 38  clusion in Tcl 8
2800: 2e 32 2e 31 2c 20 62 75 74 20 69 73 20 61 6c 73  .2.1, but is als
2810: 6f 20 70 72 6f 76 69 64 65 64 20 69 6e 20 74 68  o provided in th
2820: 65 20 74 6c 73 20 64 69 72 65 63 74 6f 72 79 0d  e tls directory.
2830: 0a 69 66 20 6e 65 65 64 65 64 2e 20 41 20 73 61  .if needed. A sa
2840: 6d 70 6c 65 20 73 65 72 76 65 72 2e 70 65 6d 20  mple server.pem 
2850: 69 73 20 70 72 6f 76 69 64 65 64 20 77 69 74 68  is provided with
2860: 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73 65   the TLS release
2870: 2c 0d 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74  ,..courtesy of t
2880: 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53  he <strong>OpenS
2890: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a  SL</strong> proj
28a0: 65 63 74 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 70 72 65  ect.</p>....<pre
28b0: 3e 3c 63 6f 64 65 3e 70 61 63 6b 61 67 65 20 72  ><code>package r
28c0: 65 71 75 69 72 65 20 68 74 74 70 0d 0a 70 61 63  equire http..pac
28d0: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73  kage require tls
28e0: 0d 0a 0d 0a 68 74 74 70 3a 3a 72 65 67 69 73 74  ....http::regist
28f0: 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69  er https 443 [li
2900: 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74  st ::tls::socket
2910: 20 2d 72 65 71 75 69 72 65 20 31 20 2d 63 61 66   -require 1 -caf
2920: 69 6c 65 20 2e 2f 73 65 72 76 65 72 2e 70 65 6d  ile ./server.pem
2930: 5d 0d 0a 0d 0a 73 65 74 20 74 6f 6b 20 5b 68 74  ]....set tok [ht
2940: 74 70 3a 3a 67 65 74 75 72 6c 20 68 74 74 70 73  tp::geturl https
2950: 3a 2f 2f 64 65 76 65 6c 6f 70 65 72 2e 6e 65 74  ://developer.net
2960: 73 63 61 70 65 2e 63 6f 6d 2f 5d 0d 0a 3c 2f 63  scape.com/]..</c
2970: 6f 64 65 3e 3c 2f 70 72 65 3e 0d 0a 0d 0a 3c 68  ode></pre>....<h
2980: 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 50 45 43 49  3><a name="SPECI
2990: 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e  AL CONSIDERATION
29a0: 53 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53 49  S">SPECIAL CONSI
29b0: 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 68  DERATIONS</a></h
29c0: 33 3e 0d 0a 0d 0a 3c 70 3e 54 68 65 20 63 61 70  3>....<p>The cap
29d0: 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74 68 69  abilities of thi
29e0: 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20 76 61  s package can va
29f0: 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 62 61  ry enormously ba
2a00: 73 65 64 0d 0a 75 70 6f 6e 20 68 6f 77 20 79 6f  sed..upon how yo
2a10: 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61  ur OpenSSL libra
2a20: 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72 65  ry was configure
2a30: 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 74 20  d and built. At 
2a40: 74 68 65 0d 0a 6d 6f 73 74 20 6d 61 63 72 6f 2d  the..most macro-
2a50: 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73 75  level OpenSSL su
2a60: 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b 6e  pports a &quot;n
2a70: 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b 20  o patents&quot; 
2a80: 62 75 69 6c 64 2c 0d 0a 77 68 69 63 68 20 64 69  build,..which di
2a90: 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41  sables RSA, IDEA
2aa0: 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20  , RC(2,4,5) and 
2ab0: 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f  SSL2 - if your O
2ac0: 70 65 6e 53 53 4c 20 69 73 0d 0a 63 6f 6e 66 69  penSSL is..confi
2ad0: 67 75 72 65 64 20 74 68 69 73 20 77 61 79 20 74  gured this way t
2ae0: 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65  hen you will nee
2af0: 64 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77  d to build TLS w
2b00: 69 74 68 20 74 68 65 0d 0a 2d 44 4e 4f 5f 50 41  ith the..-DNO_PA
2b10: 54 45 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61  TENTS option - a
2b20: 6e 64 20 74 68 65 20 72 65 73 75 6c 74 61 6e 74  nd the resultant
2b30: 20 6d 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e   module will fun
2b40: 63 74 69 6f 6e 0d 0a 63 6f 72 72 65 63 74 6c 79  ction..correctly
2b50: 20 61 6e 64 20 61 6c 73 6f 20 73 75 70 70 6f 72   and also suppor
2b60: 74 20 41 44 48 20 63 65 72 74 69 66 69 63 61 74  t ADH certificat
2b70: 65 2d 6c 65 73 73 20 65 6e 63 72 79 70 74 69 6f  e-less encryptio
2b80: 6e 2c 0d 0a 68 6f 77 65 76 65 72 20 79 6f 75 20  n,..however you 
2b90: 77 69 6c 6c 20 62 65 20 75 6e 61 62 6c 65 20 74  will be unable t
2ba0: 6f 20 75 74 69 6c 69 7a 65 20 74 68 69 73 20 74  o utilize this t
2bb0: 6f 20 73 70 65 61 6b 20 74 6f 20 6e 6f 72 6d 61  o speak to norma
2bc0: 6c 20 57 65 62 0d 0a 53 65 72 76 65 72 73 2c 20  l Web..Servers, 
2bd0: 77 68 69 63 68 20 74 79 70 69 63 61 6c 6c 79 20  which typically 
2be0: 72 65 71 75 69 72 65 20 52 53 41 20 73 75 70 70  require RSA supp
2bf0: 6f 72 74 2e 20 50 6c 65 61 73 65 20 73 65 65 20  ort. Please see 
2c00: 3c 61 0d 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f  <a..href="http:/
2c10: 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67  /www.openssl.org
2c20: 2f 22 3e 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70  /">http://www.op
2c30: 65 6e 73 73 6c 2e 6f 72 67 2f 3c 2f 61 3e 20 66  enssl.org/</a> f
2c40: 6f 72 0d 0a 6d 6f 72 65 20 69 6e 66 6f 72 6d 61  or..more informa
2c50: 74 69 6f 6e 20 6f 6e 20 74 68 65 20 77 68 6f 6c  tion on the whol
2c60: 65 20 69 73 73 75 65 20 6f 66 20 70 61 74 65 6e  e issue of paten
2c70: 74 73 20 61 6e 64 20 55 53 20 65 78 70 6f 72 74  ts and US export
2c80: 0d 0a 72 65 73 74 72 69 63 74 69 6f 6e 73 2e 20  ..restrictions. 
2c90: 3c 2f 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20 6e  </p>....<h3><a n
2ca0: 61 6d 65 3d 22 53 45 45 20 41 4c 53 4f 22 3e 53  ame="SEE ALSO">S
2cb0: 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 68 33 3e  EE ALSO</a></h3>
2cc0: 0d 0a 0d 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 73  ....<p><strong>s
2cd0: 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20  ocket</strong>, 
2ce0: 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65 76 65 6e  <strong>fileeven
2cf0: 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e 3c 61 0d 0a  t, </strong><a..
2d00: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
2d10: 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 3c  .openssl.org/"><
2d20: 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f  strong>OpenSSL</
2d30: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70 3e 0d  strong></a></p>.
2d40: 0a 0d 0a 3c 68 72 3e 0d 0a 0d 0a 3c 70 72 65 3e  ...<hr>....<pre>
2d50: 0d 0a 43 6f 70 79 72 69 67 68 74 20 a9 20 31 39  ..Copyright © 19
2d60: 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 2e 3c  99 Matt Newman.<
2d70: 2f 70 72 65 3e 0d 0a 3c 2f 62 6f 64 79 3e 0d 0a  /pre>..</body>..
2d80: 3c 2f 68 74 6d 6c 3e 0d 0a                       </html>..