Hex Artifact Content

Artifact 2c238dd9734dabc9f7bedf93ce4ac1422633d425:


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 54 63 6c  kage require Tcl
0280: 20 3c 2f 62 3e 3c 65 6d 3e 3f 38 2e 32 3f 3c 2f   </b><em>?8.2?</
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 64 3e 3c 62 3e 70 61 63        <dd><b>pac
02b0: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73  kage require tls
02c0: 20 3c 2f 62 3e 3c 65 6d 3e 3f 31 2e 34 3f 3c 2f   </b><em>?1.4?</
02d0: 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20  em></dd>..      
02e0: 20 20 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b        <dt>&nbsp;
02f0: 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 20  </dt>..         
0300: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69     <dd><b>tls::i
0310: 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69  nit </b><i>?opti
0320: 6f 6e 73 3f 3c 2f 69 3e 20 3c 2f 64 64 3e 0d 0a  ons?</i> </dd>..
0330: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e              <dd>
0340: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c  <b>tls::socket <
0350: 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f  /b><em>?options?
0360: 20 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c   host port</em><
0370: 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20 20  /dd>..          
0380: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f    <dd><b>tls::so
0390: 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73  cket</b><em> ?-s
03a0: 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 0d 0a  erver command?..
03b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
03c0: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f  ?options? port</
03d0: 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20  em></dd>..      
03e0: 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73        <dd><b>tls
03f0: 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e 3c  ::handshake</b><
0400: 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e  em> channel</em>
0410: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20  </dd>..         
0420: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73     <dd><b>tls::s
0430: 74 61 74 75 73 20 3c 2f 62 3e 3c 65 6d 3e 63 68  tatus </b><em>ch
0440: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0d  annel</em></dd>.
0450: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64  .            <dd
0460: 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c  ><b>tls::import<
0470: 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 20  /b><em> channel 
0480: 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 65 6d 3e 3c 2f  ?options?</em></
0490: 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20  dd>..           
04a0: 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70   <dd><b>tls::cip
04b0: 68 65 72 73 20 3c 2f 62 3e 3c 65 6d 3e 70 72 6f  hers </b><em>pro
04c0: 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 3c  tocol ?verbose?<
04d0: 2f 65 6d 3e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20  /em></dd>..     
04e0: 20 20 20 3c 2f 64 6c 3e 0d 0a 20 20 20 20 3c 2f     </dl>..    </
04f0: 64 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20  dd>..    <dd><a 
0500: 68 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22  href="#COMMANDS"
0510: 3e 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64  >COMMANDS</a></d
0520: 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  d>..    <dd><a h
0530: 72 65 66 3d 22 23 43 4f 4e 46 49 47 55 52 41 54  ref="#CONFIGURAT
0540: 49 4f 4e 20 4f 50 54 49 4f 4e 53 22 3e 43 4f 4e  ION OPTIONS">CON
0550: 46 49 47 55 52 41 54 49 4f 4e 20 4f 50 54 49 4f  FIGURATION OPTIO
0560: 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0d 0a 20 20 20  NS</a></dd>..   
0570: 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 48   <dd><a href="#H
0580: 54 54 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54  TTPS EXAMPLE">HT
0590: 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c  TPS EXAMPLE</a><
05a0: 2f 64 64 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61  /dd>..    <dd><a
05b0: 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f   href="#SEE ALSO
05c0: 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44  ">SPECIAL CONSID
05d0: 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64  ERATIONS</a></dd
05e0: 3e 0d 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72  >..    <dd><a hr
05f0: 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e 53  ef="#SEE ALSO">S
0600: 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 3e  EE ALSO</a></dd>
0610: 0d 0a 3c 2f 64 6c 3e 0d 0a 0d 0a 3c 68 72 3e 0d  ..</dl>....<hr>.
0620: 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  ...<h3><a name="
0630: 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f  NAME">NAME</a></
0640: 68 33 3e 0d 0a 0d 0a 3c 70 3e 3c 73 74 72 6f 6e  h3>....<p><stron
0650: 67 3e 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d  g>tls</strong> -
0660: 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72   binding to <str
0670: 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72  ong>OpenSSL</str
0680: 6f 6e 67 3e 0d 0a 74 6f 6f 6c 6b 69 74 2e 3c 2f  ong>..toolkit.</
0690: 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d  p>....<h3><a nam
06a0: 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53 59 4e  e="SYNOPSIS">SYN
06b0: 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a  OPSIS</a></h3>..
06c0: 0d 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20  ..<p><b>package 
06d0: 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 32 3c  require Tcl 8.2<
06e0: 2f 62 3e 3c 62 72 3e 0d 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 34 3c 2f 62 3e 3c 62 72 3e 0d 0a 3c 62 72  1.4</b><br>..<br
0710: 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73  >..<a href="#tls
0720: 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a 3a  ::init"><b>tls::
0730: 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74  init </b><i>?opt
0740: 69 6f 6e 73 3f 3c 2f 69 3e 3c 62 72 3e 0d 0a 3c  ions?</i><br>..<
0750: 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23 74 6c 73  /a><a href="#tls
0760: 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73  ::socket"><b>tls
0770: 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d  ::socket </b><em
0780: 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73 74 0d  >?options? host.
0790: 0a 70 6f 72 74 3c 2f 65 6d 3e 3c 62 72 3e 0d 0a  .port</em><br>..
07a0: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  <b>tls::socket</
07b0: 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20  b><em> ?-server 
07c0: 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e  command? ?option
07d0: 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 62 72 3e  s? port</em><br>
07e0: 0d 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23  ..</a><a href="#
07f0: 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 62 3e  tls::status"><b>
0800: 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c 2f 62 3e  tls::status </b>
0810: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e  <em>channel</em>
0820: 3c 62 72 3e 0d 0a 3c 2f 61 3e 3c 61 20 68 72 65  <br>..</a><a hre
0830: 66 3d 22 23 74 6c 73 3a 3a 68 61 6e 64 73 68 61  f="#tls::handsha
0840: 6b 65 22 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64  ke"><b>tls::hand
0850: 73 68 61 6b 65 3c 2f 62 3e 3c 65 6d 3e 20 63 68  shake</b><em> ch
0860: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 62  annel</em></a><b
0870: 72 3e 0d 0a 3c 62 72 3e 0d 0a 3c 61 20 68 72 65  r>..<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 0d 0a 3c 61 20 68 72 65 66 3d 22 23  <br>..<a href="#
08d0: 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 70 72 6f  tls::ciphers pro
08e0: 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 22  tocol ?verbose?"
08f0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69  ><strong>tls::ci
0900: 70 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 0d 0a  phers</strong>..
0910: 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65  <em>protocol ?ve
0920: 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c  rbose?</em></a><
0930: 2f 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61  /p>....<h3><a na
0940: 6d 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e 22  me="DESCRIPTION"
0950: 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e  >DESCRIPTION</a>
0960: 3c 2f 68 33 3e 0d 0a 0d 0a 3c 70 3e 54 68 69 73  </h3>....<p>This
0970: 20 65 78 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69   extension provi
0980: 64 65 73 20 61 20 67 65 6e 65 72 69 63 20 62 69  des a generic bi
0990: 6e 64 69 6e 67 20 74 6f 20 3c 61 0d 0a 68 72 65  nding to <a..hre
09a0: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70  f="http://www.op
09b0: 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e  enssl.org/">Open
09c0: 53 53 4c 3c 2f 61 3e 2c 20 75 74 69 6c 69 7a 69  SSL</a>, utilizi
09d0: 6e 67 20 74 68 65 0d 0a 3c 73 74 72 6f 6e 67 3e  ng the..<strong>
09e0: 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c  Tcl_StackChannel
09f0: 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 41 50 49 20 66  </strong>..API f
0a00: 6f 72 20 54 63 6c 20 38 2e 32 20 61 6e 64 20 68  or Tcl 8.2 and h
0a10: 69 67 68 65 72 2e 20 54 68 65 20 73 6f 63 6b 65  igher. The socke
0a20: 74 73 20 62 65 68 61 76 65 20 65 78 61 63 74 6c  ts behave exactl
0a30: 79 20 74 68 65 20 73 61 6d 65 0d 0a 61 73 20 63  y the same..as c
0a40: 68 61 6e 6e 65 6c 73 20 63 72 65 61 74 65 64 20  hannels created 
0a50: 75 73 69 6e 67 20 54 63 6c 27 73 20 62 75 69 6c  using Tcl's buil
0a60: 74 2d 69 6e 20 3c 73 74 72 6f 6e 67 3e 73 6f 63  t-in <strong>soc
0a70: 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 63 6f  ket</strong>..co
0a80: 6d 6d 61 6e 64 20 77 69 74 68 20 61 64 64 69 74  mmand with addit
0a90: 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 66 6f  ional options fo
0aa0: 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 74 68  r controlling th
0ab0: 65 20 53 53 4c 20 73 65 73 73 69 6f 6e 2e 0d 0a  e SSL session...
0ac0: 54 6f 20 75 73 65 20 54 4c 53 20 77 69 74 68 20  To use TLS with 
0ad0: 61 6e 20 65 61 72 6c 69 65 72 20 76 65 72 73 69  an earlier versi
0ae0: 6f 6e 20 6f 66 20 54 63 6c 20 74 68 61 6e 20 38  on of Tcl than 8
0af0: 2e 32 2c 20 70 6c 65 61 73 65 20 6f 62 74 61 69  .2, please obtai
0b00: 6e 0d 0a 54 4c 53 20 76 31 2e 33 2e 20 20 50 6c  n..TLS v1.3.  Pl
0b10: 65 61 73 65 20 6e 6f 74 65 20 74 68 61 74 20 74  ease note that t
0b20: 68 65 72 65 20 61 72 65 20 6b 6e 6f 77 6e 20 6c  here are known l
0b30: 69 6d 69 74 61 74 69 6f 6e 73 20 77 69 74 68 20  imitations with 
0b40: 74 68 65 0d 0a 73 74 61 63 6b 65 64 20 63 68 61  the..stacked cha
0b50: 6e 6e 65 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74  nnel implementat
0b60: 69 6f 6e 20 70 72 69 6f 72 20 74 6f 20 38 2e 33  ion prior to 8.3
0b70: 2e 32 2c 20 73 6f 20 69 74 20 69 73 20 72 65 63  .2, so it is rec
0b80: 6f 6d 6d 65 6e 64 65 64 0d 0a 74 68 61 74 20 54  ommended..that T
0b90: 4c 53 20 69 73 20 75 73 65 64 20 77 69 74 68 20  LS is used with 
0ba0: 61 6e 20 38 2e 33 2e 32 2b 20 69 6e 74 65 72 70  an 8.3.2+ interp
0bb0: 72 65 74 65 72 2e 20 20 54 4c 53 20 76 31 2e 34  reter.  TLS v1.4
0bc0: 20 77 69 6c 6c 20 77 6f 72 6b 0d 0a 77 69 74 68   will work..with
0bd0: 20 38 2e 32 2b 2c 20 69 74 20 69 73 20 6a 75 73   8.2+, it is jus
0be0: 74 20 6d 6f 72 65 20 73 74 61 62 6c 65 20 77 69  t more stable wi
0bf0: 74 68 20 38 2e 33 2e 32 2b 2e 0d 0a 3c 2f 70 3e  th 8.3.2+...</p>
0c00: 0d 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d  ....<h3><a name=
0c10: 22 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41  "COMMANDS">COMMA
0c20: 4e 44 53 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a 0d 0a  NDS</a></h3>....
0c30: 3c 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f 6e 65  <p>Typically one
0c40: 20 77 6f 75 6c 64 20 75 73 65 20 74 68 65 20 3c   would use the <
0c50: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b  strong>tls::sock
0c60: 65 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f 6d 6d  et </strong>comm
0c70: 61 6e 64 0d 0a 77 68 69 63 68 20 70 72 6f 76 69  and..which provi
0c80: 64 65 73 20 63 6f 6d 70 61 74 69 62 69 6c 69 74  des compatibilit
0c90: 79 20 77 69 74 68 20 74 68 65 20 6e 61 74 69 76  y with the nativ
0ca0: 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f  e Tcl <strong>so
0cb0: 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 63  cket</strong>..c
0cc0: 6f 6d 6d 61 6e 64 2e 20 49 6e 20 73 75 63 68 20  ommand. In such 
0cd0: 63 61 73 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c  cases <strong>tl
0ce0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e  s::import</stron
0cf0: 67 3e 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65  g> should not be
0d00: 0d 0a 75 73 65 64 20 64 69 72 65 63 74 6c 79 2e  ..used directly.
0d10: 3c 2f 70 3e 0d 0a 0d 0a 3c 64 6c 3e 0d 0a 20 20  </p>....<dl>..  
0d20: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74    <dt><a name="t
0d30: 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73  ls::init"><b>tls
0d40: 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f  ::init </b><i>?o
0d50: 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c  ptions?</i></a><
0d60: 2f 64 74 3e 0d 0a 20 20 20 20 3c 64 64 3e 54 68  /dt>..    <dd>Th
0d70: 69 73 20 72 6f 75 74 69 6e 65 20 73 65 74 73 20  is routine sets 
0d80: 74 68 65 20 64 65 66 61 75 6c 74 20 6f 70 74 69  the default opti
0d90: 6f 6e 73 20 75 73 65 64 20 62 79 20 3c 73 74 72  ons used by <str
0da0: 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c  ong>tls::socket<
0db0: 2f 73 74 72 6f 6e 67 3e 0d 0a 20 20 20 20 20 20  /strong>..      
0dc0: 20 20 61 6e 64 20 69 73 20 3c 65 6d 3e 6f 70 74    and is <em>opt
0dd0: 69 6f 6e 61 6c 3c 2f 65 6d 3e 2e 20 49 66 20 79  ional</em>. If y
0de0: 6f 75 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67 3e  ou call <strong>
0df0: 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72  tls::import</str
0e00: 6f 6e 67 3e 0d 0a 20 20 20 20 20 20 20 20 64 69  ong>..        di
0e10: 72 65 63 74 6c 79 20 74 68 69 73 20 72 6f 75 74  rectly this rout
0e20: 69 6e 65 20 68 61 73 20 6e 6f 20 65 66 66 65 63  ine has no effec
0e30: 74 2e 20 41 6e 79 20 6f 66 20 74 68 65 20 6f 70  t. Any of the op
0e40: 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 74  tions..        t
0e50: 68 61 74 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  hat <strong>tls:
0e60: 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e  :socket</strong>
0e70: 20 61 63 63 65 70 74 73 20 63 61 6e 20 62 65 20   accepts can be 
0e80: 73 65 74 0d 0a 20 20 20 20 20 20 20 20 75 73 69  set..        usi
0e90: 6e 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c  ng this command,
0ea0: 20 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75   though you shou
0eb0: 6c 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70  ld limit your op
0ec0: 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 74  tions..        t
0ed0: 6f 20 6f 6e 6c 79 20 54 4c 53 20 72 65 6c 61 74  o only TLS relat
0ee0: 65 64 20 6f 6e 65 73 2e 3c 2f 64 64 3e 0d 0a 20  ed ones.</dd>.. 
0ef0: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64     <dt>&nbsp;</d
0f00: 74 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e  t>..    <dt><a n
0f10: 61 6d 65 3d 22 74 6c 73 3a 3a 73 6f 63 6b 65 74  ame="tls::socket
0f20: 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74  "><b>tls::socket
0f30: 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e   </b><em>?option
0f40: 73 3f 0d 0a 20 20 20 20 20 20 20 20 68 6f 73 74  s?..        host
0f50: 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f   port</em></a></
0f60: 64 74 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 62 3e  dt>..    <dt><b>
0f70: 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c  tls::socket</b><
0f80: 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d  em> ?-server com
0f90: 6d 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20  mand? ?options? 
0fa0: 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a  port</em></dt>..
0fb0: 20 20 20 20 3c 64 64 3e 54 68 69 73 20 69 73 20      <dd>This is 
0fc0: 61 20 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f  a helper functio
0fd0: 6e 20 74 68 61 74 20 75 74 69 6c 69 7a 65 73 20  n that utilizes 
0fe0: 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 0d 0a  the underlying..
0ff0: 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 73          commands
1000: 20 28 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69   (<strong>tls::i
1010: 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 29 2e  mport</strong>).
1020: 20 49 74 20 62 65 68 61 76 65 73 0d 0a 20 20 20   It behaves..   
1030: 20 20 20 20 20 65 78 61 63 74 6c 79 20 74 68 65       exactly the
1040: 20 73 61 6d 65 20 61 73 20 74 68 65 20 6e 61 74   same as the nat
1050: 69 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e  ive Tcl <strong>
1060: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0d  socket</strong>.
1070: 0a 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64  .        command
1080: 20 65 78 63 65 70 74 20 74 68 61 74 20 74 68 65   except that the
1090: 20 6f 70 74 69 6f 6e 73 20 63 61 6e 20 69 6e 63   options can inc
10a0: 6c 75 64 65 20 61 6e 79 20 6f 66 20 74 68 65 0d  lude any of the.
10b0: 0a 20 20 20 20 20 20 20 20 61 70 70 6c 69 63 61  .        applica
10c0: 62 6c 65 20 3c 61 20 68 72 65 66 3d 22 23 74 6c  ble <a href="#tl
10d0: 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 73 74 72 6f  s::import"><stro
10e0: 6e 67 3e 74 6c 73 3a 69 6d 70 6f 72 74 3c 2f 73  ng>tls:import</s
10f0: 74 72 6f 6e 67 3e 3c 2f 61 3e 0d 0a 20 20 20 20  trong></a>..    
1100: 20 20 20 20 6f 70 74 69 6f 6e 73 2e 3c 2f 64 64      options.</dd
1110: 3e 0d 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70  >..    <dt>&nbsp
1120: 3b 3c 2f 64 74 3e 0d 0a 20 20 20 20 3c 64 74 3e  ;</dt>..    <dt>
1130: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 68 61  <a name="tls::ha
1140: 6e 64 73 68 61 6b 65 22 3e 3c 73 74 72 6f 6e 67  ndshake"><strong
1150: 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c  >tls::handshake<
1160: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61  /strong> <em>cha
1170: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64  nnel</em></a></d
1180: 74 3e 0d 0a 20 20 20 20 3c 64 64 3e 46 6f 72 63  t>..    <dd>Forc
1190: 65 73 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20  es handshake to 
11a0: 74 61 6b 65 20 70 6c 61 63 65 2c 20 61 6e 64 20  take place, and 
11b0: 72 65 74 75 72 6e 73 20 30 20 69 66 0d 0a 20 20  returns 0 if..  
11c0: 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b 65 20        handshake 
11d0: 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f 67  is still in prog
11e0: 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63 6b 69  ress (non-blocki
11f0: 6e 67 29 2c 20 6f 72 20 31 20 69 66 0d 0a 20 20  ng), or 1 if..  
1200: 20 20 20 20 20 20 74 68 65 20 68 61 6e 64 73 68        the handsh
1210: 61 6b 65 20 77 61 73 20 73 75 63 63 65 73 73 66  ake was successf
1220: 75 6c 2e 20 49 66 20 74 68 65 20 68 61 6e 64 73  ul. If the hands
1230: 68 61 6b 65 20 66 61 69 6c 65 64 0d 0a 20 20 20  hake failed..   
1240: 20 20 20 20 20 74 68 69 73 20 72 6f 75 74 69 6e       this routin
1250: 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20  e will throw an 
1260: 65 72 72 6f 72 2e 3c 2f 64 64 3e 0d 0a 20 20 20  error.</dd>..   
1270: 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e   <dt>&nbsp;</dt>
1280: 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  ..    <dt><a nam
1290: 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e  e="tls::status">
12a0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61  <strong>tls::sta
12b0: 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  tus</strong> <em
12c0: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61  >channel</em></a
12d0: 3e 3c 2f 64 74 3e 0d 0a 20 20 20 20 3c 64 64 3e  ></dt>..    <dd>
12e0: 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72  Returns the curr
12f0: 65 6e 74 20 73 65 63 75 72 69 74 79 20 73 74 61  ent security sta
1300: 74 75 73 20 6f 66 20 61 20 53 53 4c 20 63 68 61  tus of a SSL cha
1310: 6e 6e 65 6c 2e 20 54 68 65 0d 0a 20 20 20 20 20  nnel. The..     
1320: 20 20 20 72 65 73 75 6c 74 20 69 73 20 61 20 6c     result is a l
1330: 69 73 74 20 6f 66 20 6b 65 79 20 76 61 6c 75 65  ist of key value
1340: 20 70 61 69 72 73 20 64 65 73 63 72 69 62 69 6e   pairs describin
1350: 67 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 63  g the..        c
1360: 6f 6e 6e 65 63 74 65 64 20 70 65 65 72 2e 20 49  onnected peer. I
1370: 66 20 74 68 65 20 72 65 73 75 6c 74 20 69 73 20  f the result is 
1380: 61 6e 20 65 6d 70 74 79 20 6c 69 73 74 20 74 68  an empty list th
1390: 65 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20  en the..        
13a0: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61  SSL handshake ha
13b0: 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65  s not yet comple
13c0: 74 65 64 2e 3c 2f 64 64 3e 0d 0a 3c 2f 64 6c 3e  ted.</dd>..</dl>
13d0: 0d 0a 0d 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  ....<blockquote>
13e0: 0d 0a 20 20 20 20 3c 64 6c 3e 0d 0a 20 20 20 20  ..    <dl>..    
13f0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
1400: 69 73 73 75 65 72 3c 2f 73 74 72 6f 6e 67 3e 20  issuer</strong> 
1410: 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e  <em>dn</em></dt>
1420: 0d 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  ..        <dd>Th
1430: 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20  e distinguished 
1440: 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65  name (DN) of the
1450: 20 63 65 72 74 69 66 69 63 61 74 65 0d 0a 20 20   certificate..  
1460: 20 20 20 20 20 20 20 20 20 20 69 73 73 75 65 72            issuer
1470: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
1480: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a  <dt><strong>subj
1490: 65 63 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ect</strong> <em
14a0: 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20  >dn</em></dt>.. 
14b0: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 64         <dd>The d
14c0: 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d  istinguished nam
14d0: 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65  e (DN) of the ce
14e0: 72 74 69 66 69 63 61 74 65 0d 0a 20 20 20 20 20  rtificate..     
14f0: 20 20 20 20 20 20 20 73 75 62 6a 65 63 74 2e 3c         subject.<
1500: 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dd>..        <d
1510: 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 42 65 66  t><strong>notBef
1520: 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ore</strong> <em
1530: 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d  >date</em></dt>.
1540: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65  .        <dd>The
1550: 20 62 65 67 69 6e 20 64 61 74 65 20 66 6f 72 20   begin date for 
1560: 74 68 65 20 76 61 6c 69 64 69 74 79 20 6f 66 20  the validity of 
1570: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e  the certificate.
1580: 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dd>..        <
1590: 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 41 66  dt><strong>notAf
15a0: 74 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ter</strong> <em
15b0: 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d  >date</em></dt>.
15c0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65  .        <dd>The
15d0: 20 65 78 70 69 72 79 20 64 61 74 65 20 66 6f 72   expiry date for
15e0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
15f0: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
1600: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69  <dt><strong>seri
1610: 61 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  al</strong> <em>
1620: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20  n</em></dt>..   
1630: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72       <dd>The ser
1640: 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68  ial number of th
1650: 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f  e certificate.</
1660: 64 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74  dd>..        <dt
1670: 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c  ><strong>cipher<
1680: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70  /strong> <em>cip
1690: 68 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20  her</em></dt>.. 
16a0: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 63         <dd>The c
16b0: 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e  urrent cipher in
16c0: 20 75 73 65 20 62 65 74 77 65 65 6e 20 74 68 65   use between the
16d0: 20 63 6c 69 65 6e 74 20 61 6e 64 0d 0a 20 20 20   client and..   
16e0: 20 20 20 20 20 20 20 20 20 73 65 72 76 65 72 20           server 
16f0: 63 68 61 6e 6e 65 6c 73 2e 3c 2f 64 64 3e 0d 0a  channels.</dd>..
1700: 20 20 20 20 3c 2f 64 6c 3e 0d 0a 3c 2f 62 6c 6f      </dl>..</blo
1710: 63 6b 71 75 6f 74 65 3e 0d 0a 0d 0a 3c 64 6c 3e  ckquote>....<dl>
1720: 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  ..    <dt><a nam
1730: 65 3d 22 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e  e="tls::import">
1740: 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c  <b>tls::import <
1750: 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0d 0a 20  /b><i>channel.. 
1760: 20 20 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73 3f         ?options?
1770: 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0d 0a 20  </i></a></dt>.. 
1780: 20 20 20 3c 64 64 3e 53 53 4c 2d 65 6e 61 62 6c     <dd>SSL-enabl
1790: 65 20 61 20 72 65 67 75 6c 61 72 20 54 63 6c 20  e a regular Tcl 
17a0: 63 68 61 6e 6e 65 6c 20 2d 20 69 74 20 6e 65 65  channel - it nee
17b0: 64 20 6e 6f 74 20 62 65 20 61 0d 0a 20 20 20 20  d not be a..    
17c0: 20 20 20 20 73 6f 63 6b 65 74 2c 20 62 75 74 20      socket, but 
17d0: 6d 75 73 74 20 70 72 6f 76 69 64 65 20 62 69 2d  must provide bi-
17e0: 64 69 72 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77  directional flow
17f0: 2e 20 41 6c 73 6f 0d 0a 20 20 20 20 20 20 20 20  . Also..        
1800: 73 65 74 74 69 6e 67 20 73 65 73 73 69 6f 6e 20  setting session 
1810: 70 61 72 61 6d 65 74 65 72 73 20 66 6f 72 20 53  parameters for S
1820: 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 3c 2f 64  SL handshake.</d
1830: 64 3e 0d 0a 3c 2f 64 6c 3e 0d 0a 0d 0a 3c 62 6c  d>..</dl>....<bl
1840: 6f 63 6b 71 75 6f 74 65 3e 0d 0a 20 20 20 20 3c  ockquote>..    <
1850: 64 6c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74  dl>..        <dt
1860: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65  ><strong>-cafile
1870: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69   </strong><em>fi
1880: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e  lename</em></dt>
1890: 0d 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72  ..        <dd>Pr
18a0: 6f 76 69 64 65 20 74 68 65 20 43 41 20 66 69 6c  ovide the CA fil
18b0: 65 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20  e.</dd>..       
18c0: 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 63 61   <dt>-<strong>ca
18d0: 64 69 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  dir</strong> <em
18e0: 3e 64 69 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a  >dir</em></dt>..
18f0: 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76          <dd>Prov
1900: 69 64 65 20 74 68 65 20 64 69 72 65 63 74 6f 72  ide the director
1910: 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65  y containing the
1920: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 73   CA certificates
1930: 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20 20  .</dd>..        
1940: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72  <dt><strong>-cer
1950: 74 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  tfile</strong> <
1960: 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e  em>filename</em>
1970: 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dt>..        <
1980: 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 63  dd>Provide the c
1990: 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73  ertificate to us
19a0: 65 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20  e.</dd>..       
19b0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69   <dt><strong>-ci
19c0: 70 68 65 72 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65  pher </strong><e
19d0: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64  m>string</em></d
19e0: 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  t>..        <dd>
19f0: 50 72 6f 76 69 64 65 20 74 68 65 20 63 69 70 68  Provide the ciph
1a00: 65 72 20 73 75 69 74 65 73 20 74 6f 20 75 73 65  er suites to use
1a10: 2e 20 53 79 6e 74 61 78 20 69 73 20 61 73 20 70  . Syntax is as p
1a20: 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20  er..            
1a30: 4f 70 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0d 0a 20  OpenSSL.</dd>.. 
1a40: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
1a50: 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72  ng>-command</str
1a60: 6f 6e 67 3e 3c 65 6d 3e 20 63 61 6c 6c 62 61 63  ong><em> callbac
1a70: 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20  k</em></dt>..   
1a80: 20 20 20 20 20 3c 64 64 3e 54 68 69 73 20 63 61       <dd>This ca
1a90: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65  llback is invoke
1aa0: 64 20 74 6f 20 70 61 73 73 20 65 72 72 6f 72 73  d to pass errors
1ab0: 2c 20 74 72 61 63 69 6e 67 0d 0a 20 20 20 20 20  , tracing..     
1ac0: 20 20 20 20 20 20 20 69 6e 66 6f 72 6d 61 74 69         informati
1ad0: 6f 6e 20 61 6e 64 20 74 6f 20 61 6c 6c 6f 77 20  on and to allow 
1ae0: 54 63 6c 20 73 63 72 69 70 74 73 20 74 6f 20 70  Tcl scripts to p
1af0: 65 72 66 6f 72 6d 0d 0a 20 20 20 20 20 20 20 20  erform..        
1b00: 20 20 20 20 61 64 64 69 74 69 6f 6e 61 6c 20 76      additional v
1b10: 65 72 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 74  erification of t
1b20: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2c 20  he certificate, 
1b30: 77 68 69 63 68 20 63 61 6e 0d 0a 20 20 20 20 20  which can..     
1b40: 20 20 20 20 20 20 20 6f 76 65 72 72 69 64 65 20         override 
1b50: 74 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 69  the default vali
1b60: 64 61 74 69 6f 6e 20 69 6e 20 4f 70 65 6e 53 53  dation in OpenSS
1b70: 4c 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20  L.</dd>..       
1b80: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65   <dt><strong>-ke
1b90: 79 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c  yfile</strong> <
1ba0: 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e  em>filename</em>
1bb0: 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dt>..        <
1bc0: 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 70  dd>Provide the p
1bd0: 72 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 2e  rivate key file.
1be0: 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c   (<strong>defaul
1bf0: 74 3c 2f 73 74 72 6f 6e 67 3e 3a 0d 0a 20 20 20  t</strong>:..   
1c00: 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 6f           value o
1c10: 66 20 2d 63 65 72 74 66 69 6c 65 29 3c 2f 64 64  f -certfile)</dd
1c20: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  >..        <dt><
1c30: 73 74 72 6f 6e 67 3e 2d 6d 6f 64 65 6c 3c 2f 73  strong>-model</s
1c40: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e  trong> <em>chann
1c50: 65 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20  el</em></dt>..  
1c60: 20 20 20 20 20 20 3c 64 64 3e 54 68 69 73 20 77        <dd>This w
1c70: 69 6c 6c 20 66 6f 72 63 65 20 74 68 69 73 20 63  ill force this c
1c80: 68 61 6e 6e 65 6c 20 74 6f 20 73 68 61 72 65 20  hannel to share 
1c90: 74 68 65 20 73 61 6d 65 20 3c 65 6d 3e 3c 73 74  the same <em><st
1ca0: 72 6f 6e 67 3e 53 53 4c 5f 43 54 58 3c 2f 73 74  rong>SSL_CTX</st
1cb0: 72 6f 6e 67 3e 3c 2f 65 6d 3e 0d 0a 20 20 20 20  rong></em>..    
1cc0: 20 20 20 20 20 20 20 20 73 74 72 75 63 74 75 72          structur
1cd0: 65 20 61 73 20 74 68 65 20 73 70 65 63 69 66 69  e as the specifi
1ce0: 65 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f  ed <em>channel</
1cf0: 65 6d 3e 2c 20 61 6e 64 0d 0a 20 20 20 20 20 20  em>, and..      
1d00: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 20        therefore 
1d10: 73 68 61 72 65 20 63 61 6c 6c 62 61 63 6b 73 20  share callbacks 
1d20: 65 74 63 2e 3c 2f 64 64 3e 0d 0a 20 20 20 20 20  etc.</dd>..     
1d30: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
1d40: 72 65 71 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67  request </strong
1d50: 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f  ><em>bool</em></
1d60: 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 64  dt>..        <dd
1d70: 3e 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69  >Request a certi
1d80: 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72  ficate from peer
1d90: 20 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64   during SSL hand
1da0: 73 68 61 6b 65 2e 0d 0a 20 20 20 20 20 20 20 20  shake...        
1db0: 20 20 20 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66      (<strong>def
1dc0: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
1dd0: 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64  em>true</em>)</d
1de0: 64 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  d>..        <dt>
1df0: 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 65  <strong>-require
1e00: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
1e10: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20  ol</em></dt>..  
1e20: 20 20 20 20 20 20 3c 64 64 3e 52 65 71 75 69 72        <dd>Requir
1e30: 65 20 61 20 76 61 6c 69 64 20 63 65 72 74 69 66  e a valid certif
1e40: 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20  icate from peer 
1e50: 64 75 72 69 6e 67 20 53 53 4c 0d 0a 20 20 20 20  during SSL..    
1e60: 20 20 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b          handshak
1e70: 65 2e 20 49 66 20 74 68 69 73 20 69 73 20 73 65  e. If this is se
1e80: 74 20 74 6f 20 74 72 75 65 20 74 68 65 6e 20 3c  t to true then <
1e90: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 3c  strong>-request<
1ea0: 2f 73 74 72 6f 6e 67 3e 0d 0a 20 20 20 20 20 20  /strong>..      
1eb0: 20 20 20 20 20 20 6d 75 73 74 20 61 6c 73 6f 20        must also 
1ec0: 62 65 20 73 65 74 20 74 6f 20 74 72 75 65 2e 20  be set to true. 
1ed0: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
1ee0: 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66  </strong>: <em>f
1ef0: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0d  alse</em>)</dd>.
1f00: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1f10: 72 6f 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73 74  rong>-server</st
1f20: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f  rong> <em>bool</
1f30: 65 6d 3e 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20  em></dt>..      
1f40: 20 20 3c 64 64 3e 48 61 6e 64 73 68 61 6b 65 20    <dd>Handshake 
1f50: 61 73 20 73 65 72 76 65 72 20 69 66 20 74 72 75  as server if tru
1f60: 65 2c 20 65 6c 73 65 20 68 61 6e 64 73 68 61 6b  e, else handshak
1f70: 65 20 61 73 0d 0a 20 20 20 20 20 20 20 20 20 20  e as..          
1f80: 20 20 63 6c 69 65 6e 74 2e 28 3c 73 74 72 6f 6e    client.(<stron
1f90: 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e  g>default</stron
1fa0: 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65  g>: <em>false</e
1fb0: 6d 3e 29 20 3c 65 6d 3e 5b 4e 6f 74 0d 0a 20 20  m>) <em>[Not..  
1fc0: 20 20 20 20 20 20 20 20 20 20 61 76 61 69 6c 61            availa
1fd0: 62 6c 65 20 74 6f 20 74 6c 73 3a 3a 73 6f 63 6b  ble to tls::sock
1fe0: 65 74 5d 3c 2f 65 6d 3e 3c 2f 64 64 3e 0d 0a 20  et]</em></dd>.. 
1ff0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
2000: 6e 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67  ng>-ssl2</strong
2010: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c  > <em>bool</em><
2020: 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c 64  /dt>..        <d
2030: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20  d>Enable use of 
2040: 53 53 4c 20 76 32 2e 20 28 3c 73 74 72 6f 6e 67  SSL v2. (<strong
2050: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67  >default</strong
2060: 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e  >: <em>true</em>
2070: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 6e  ..            un
2080: 6c 65 73 73 20 2d 44 4e 4f 5f 50 41 54 45 4e 54  less -DNO_PATENT
2090: 53 20 77 61 73 20 73 70 65 63 69 66 69 65 64 20  S was specified 
20a0: 69 6e 20 62 75 69 6c 64 29 3c 2f 64 64 3e 0d 0a  in build)</dd>..
20b0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
20c0: 6f 6e 67 3e 2d 73 73 6c 33 20 3c 2f 73 74 72 6f  ong>-ssl3 </stro
20d0: 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e  ng><em>bool</em>
20e0: 3c 2f 64 74 3e 0d 0a 20 20 20 20 20 20 20 20 3c  </dt>..        <
20f0: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66  dd>Enable use of
2100: 20 53 53 4c 20 76 33 2e 20 28 3c 73 74 72 6f 6e   SSL v3. (<stron
2110: 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e  g>default</stron
2120: 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d  g>: <em>true</em
2130: 3e 29 3c 2f 64 64 3e 0d 0a 20 20 20 20 20 20 20  >)</dd>..       
2140: 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c   <dt>-<strong>tl
2150: 73 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  s1</strong> <em>
2160: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0d 0a  bool</em></dt>..
2170: 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62          <dd>Enab
2180: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
2190: 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75  . (<strong>defau
21a0: 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d  lt</strong>: <em
21b0: 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64  >false</em>)</dd
21c0: 3e 0d 0a 20 20 20 20 3c 2f 64 6c 3e 0d 0a 3c 2f  >..    </dl>..</
21d0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0d 0a 0d 0a 3c  blockquote>....<
21e0: 64 6c 3e 0d 0a 20 20 20 20 3c 64 74 3e 3c 61 20  dl>..    <dt><a 
21f0: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65  name="tls::ciphe
2200: 72 73 20 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72  rs protocol ?ver
2210: 62 6f 73 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74  bose?"><strong>t
2220: 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74 72  ls::ciphers</str
2230: 6f 6e 67 3e 0d 0a 20 20 20 20 20 20 20 20 3c 65  ong>..        <e
2240: 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62  m>protocol ?verb
2250: 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64  ose?</em></a></d
2260: 74 3e 0d 0a 20 20 20 20 3c 64 64 3e 52 65 74 75  t>..    <dd>Retu
2270: 72 6e 73 20 6c 69 73 74 20 6f 66 20 73 75 70 70  rns list of supp
2280: 6f 72 74 65 64 20 63 69 70 68 65 72 73 20 62 61  orted ciphers ba
2290: 73 65 64 20 6f 6e 20 74 68 65 20 3c 65 6d 3e 70  sed on the <em>p
22a0: 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 0d 0a 20 20  rotocol</em>..  
22b0: 20 20 20 20 20 20 79 6f 75 20 73 75 70 70 6c 79        you supply
22c0: 2c 20 77 68 69 63 68 20 6d 75 73 74 20 62 65 20  , which must be 
22d0: 6f 6e 65 20 6f 66 20 3c 65 6d 3e 73 73 6c 32 2c  one of <em>ssl2,
22e0: 20 73 73 6c 33 2c 20 6f 72 20 74 6c 73 31 3c 2f   ssl3, or tls1</
22f0: 65 6d 3e 2e 0d 0a 20 20 20 20 20 20 20 20 49 66  em>...        If
2300: 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f 65 6d   <em>verbose</em
2310: 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20 61  > is specified a
2320: 73 20 74 72 75 65 20 74 68 65 6e 20 61 20 76 65  s true then a ve
2330: 72 62 6f 73 65 2c 0d 0a 20 20 20 20 20 20 20 20  rbose,..        
2340: 73 65 6d 69 2d 68 75 6d 61 6e 20 72 65 61 64 61  semi-human reada
2350: 62 6c 65 20 6c 69 73 74 20 69 73 20 72 65 74 75  ble list is retu
2360: 72 6e 65 64 20 70 72 6f 76 69 64 69 6e 67 20 61  rned providing a
2370: 64 64 69 74 69 6f 6e 61 6c 0d 0a 20 20 20 20 20  dditional..     
2380: 20 20 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f     information o
2390: 6e 20 74 68 65 20 6e 61 74 75 72 65 20 6f 66 20  n the nature of 
23a0: 74 68 65 20 63 69 70 68 65 72 20 73 75 70 70 6f  the cipher suppo
23b0: 72 74 2e 20 49 6e 20 65 61 63 68 0d 0a 20 20 20  rt. In each..   
23c0: 20 20 20 20 20 63 61 73 65 20 74 68 65 20 72 65       case the re
23d0: 73 75 6c 74 20 69 73 20 61 20 54 63 6c 20 6c 69  sult is a Tcl li
23e0: 73 74 2e 3c 2f 64 64 3e 0d 0a 3c 2f 64 6c 3e 0d  st.</dd>..</dl>.
23f0: 0a 0d 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  ...<h3><a name="
2400: 43 4f 4e 46 49 47 55 52 41 54 49 4f 4e 20 4f 50  CONFIGURATION OP
2410: 54 49 4f 4e 53 22 3e 43 4f 4e 46 49 47 55 52 41  TIONS">CONFIGURA
2420: 54 49 4f 4e 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e  TION OPTIONS</a>
2430: 3c 2f 68 33 3e 0d 0a 0d 0a 3c 70 3e 49 6e 20 61  </h3>....<p>In a
2440: 64 64 69 74 69 6f 6e 20 74 6f 20 74 68 65 20 6f  ddition to the o
2450: 70 74 69 6f 6e 73 20 6c 69 73 74 65 64 20 61 62  ptions listed ab
2460: 6f 76 65 20 79 6f 75 20 63 61 6e 20 73 65 74 20  ove you can set 
2470: 74 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  the <strong>tls:
2480: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 0d  :debug</strong>.
2490: 0a 66 6c 61 67 20 74 6f 20 61 20 6e 6f 6e 2d 7a  .flag to a non-z
24a0: 65 72 6f 20 76 61 6c 75 65 20 74 6f 20 73 65 65  ero value to see
24b0: 20 74 68 65 20 6f 75 74 70 75 74 20 66 72 6f 6d   the output from
24c0: 20 74 68 65 20 64 65 66 61 75 6c 74 0d 0a 63 6f   the default..co
24d0: 6d 6d 61 6e 64 20 63 61 6c 6c 62 61 63 6b 20 28  mmand callback (
24e0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c  <strong>tls::cal
24f0: 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 29 20  lback</strong>) 
2500: 77 68 69 63 68 20 73 68 6f 77 73 20 74 68 65 0d  which shows the.
2510: 0a 70 72 6f 67 72 65 73 73 69 6f 6e 20 6f 66 20  .progression of 
2520: 74 68 65 20 53 53 4c 20 68 61 6e 64 73 68 61 6b  the SSL handshak
2530: 65 2e 20 53 65 74 74 69 6e 67 20 74 68 69 73 20  e. Setting this 
2540: 76 61 6c 75 65 20 74 6f 20 67 72 65 61 74 65 64  value to greated
2550: 0d 0a 74 68 61 6e 20 31 20 77 69 6c 6c 20 63 61  ..than 1 will ca
2560: 75 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 20  use the default 
2570: 76 65 72 69 66 79 20 6d 65 74 68 6f 64 20 69 6e  verify method in
2580: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61   <strong>tls::ca
2590: 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 0d  llback</strong>.
25a0: 0a 74 6f 20 61 6c 77 61 79 73 20 61 63 63 65 70  .to always accep
25b0: 74 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  t the certificat
25c0: 65 2c 20 65 76 65 6e 20 69 66 20 69 74 20 69 73  e, even if it is
25d0: 20 69 6e 76 61 6c 69 64 2e 3c 2f 70 3e 0d 0a 0d   invalid.</p>...
25e0: 0a 3c 70 3e 49 6e 20 61 20 72 65 61 6c 2d 77 6f  .<p>In a real-wo
25f0: 72 6c 64 20 64 65 70 6c 6f 79 6d 65 6e 74 20 79  rld deployment y
2600: 6f 75 20 73 68 6f 75 6c 64 20 73 75 62 73 74 69  ou should substi
2610: 74 75 74 65 20 79 6f 75 72 20 6f 77 6e 0d 0a 63  tute your own..c
2620: 61 6c 6c 62 61 63 6b 20 69 6e 20 70 6c 61 63 65  allback in place
2630: 20 6f 66 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a   of <strong>tls:
2640: 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e  :callback</stron
2650: 67 3e 2c 20 76 69 61 20 74 68 65 20 3c 65 6d 3e  g>, via the <em>
2660: 2d 63 6f 6d 6d 61 6e 64 0d 0a 3c 2f 65 6d 3e 6f  -command..</em>o
2670: 70 74 69 6f 6e 20 74 6f 20 3c 73 74 72 6f 6e 67  ption to <strong
2680: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74  >tls::socket</st
2690: 72 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f 6e 67  rong> or <strong
26a0: 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74  >tls::import</st
26b0: 72 6f 6e 67 3e 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 70  rong>.</p>....<p
26c0: 3e 57 68 65 6e 20 74 68 65 20 54 4c 53 20 6c 61  >When the TLS la
26d0: 79 65 72 20 6e 65 65 64 73 20 74 6f 20 6f 62 74  yer needs to obt
26e0: 61 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2c 20  ain a password, 
26f0: 74 79 70 69 63 61 6c 6c 79 20 66 6f 72 20 61 0d  typically for a.
2700: 0a 63 65 72 74 69 66 69 63 61 74 65 2c 20 74 68  .certificate, th
2710: 65 20 73 6f 66 74 77 61 72 65 20 77 69 6c 6c 20  e software will 
2720: 69 6e 76 6f 6b 65 20 61 20 54 63 6c 20 63 6f 6d  invoke a Tcl com
2730: 6d 61 6e 64 20 63 61 6c 6c 65 64 20 3c 73 74 72  mand called <str
2740: 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72  ong>tls::passwor
2750: 64 3c 2f 73 74 72 6f 6e 67 3e 2c 0d 0a 77 68 69  d</strong>,..whi
2760: 63 68 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  ch should return
2770: 20 61 20 73 74 72 69 6e 67 20 77 68 69 63 68 20   a string which 
2780: 72 65 70 72 65 73 65 6e 74 73 20 74 68 65 20 70  represents the p
2790: 61 73 73 77 6f 72 64 20 74 6f 20 62 65 0d 0a 75  assword to be..u
27a0: 73 65 64 2e 20 41 20 64 65 66 61 75 6c 74 20 69  sed. A default i
27b0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 69 73  mplementation is
27c0: 20 70 72 6f 76 69 64 65 64 2c 20 77 68 69 63 68   provided, which
27d0: 20 73 69 6d 70 6c 79 20 72 65 74 75 72 6e 73 3c   simply returns<
27e0: 65 6d 3e 0d 0a 26 71 75 6f 74 3b 73 65 63 72 65  em>..&quot;secre
27f0: 74 26 71 75 6f 74 3b 3c 2f 65 6d 3e 20 2d 20 79  t&quot;</em> - y
2800: 6f 75 20 73 68 6f 75 6c 64 20 72 65 64 65 66 69  ou should redefi
2810: 6e 65 20 74 68 69 73 20 70 72 6f 63 65 64 75 72  ne this procedur
2820: 65 0d 0a 61 66 74 65 72 20 69 73 73 75 69 6e 67  e..after issuing
2830: 20 74 68 65 20 3c 65 6d 3e 70 61 63 6b 61 67 65   the <em>package
2840: 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f 65 6d   require tls</em
2850: 3e 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61  >.</p>....<h3><a
2860: 20 6e 61 6d 65 3d 22 48 54 54 50 53 20 45 58 41   name="HTTPS EXA
2870: 4d 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d  MPLE">HTTPS EXAM
2880: 50 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0d 0a 0d 0a  PLE</a></h3>....
2890: 3c 70 3e 54 68 69 73 20 65 78 61 6d 70 6c 65 20  <p>This example 
28a0: 72 65 71 75 69 72 65 73 20 61 20 70 61 74 63 68  requires a patch
28b0: 20 74 6f 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e   to the <strong>
28c0: 68 74 74 70 3c 2f 73 74 72 6f 6e 67 3e 0d 0a 6d  http</strong>..m
28d0: 6f 64 75 6c 65 20 74 68 61 74 20 73 68 69 70 73  odule that ships
28e0: 20 77 69 74 68 20 54 63 6c 20 2d 20 74 68 69 73   with Tcl - this
28f0: 20 70 61 74 63 68 20 68 61 73 20 62 65 65 6e 20   patch has been 
2900: 73 75 62 6d 69 74 74 65 64 20 66 6f 72 0d 0a 69  submitted for..i
2910: 6e 63 6c 75 73 69 6f 6e 20 69 6e 20 54 63 6c 20  nclusion in Tcl 
2920: 38 2e 32 2e 31 2c 20 62 75 74 20 69 73 20 61 6c  8.2.1, but is al
2930: 73 6f 20 70 72 6f 76 69 64 65 64 20 69 6e 20 74  so provided in t
2940: 68 65 20 74 6c 73 20 64 69 72 65 63 74 6f 72 79  he tls directory
2950: 0d 0a 69 66 20 6e 65 65 64 65 64 2e 20 41 20 73  ..if needed. A s
2960: 61 6d 70 6c 65 20 73 65 72 76 65 72 2e 70 65 6d  ample server.pem
2970: 20 69 73 20 70 72 6f 76 69 64 65 64 20 77 69 74   is provided wit
2980: 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73  h the TLS releas
2990: 65 2c 0d 0a 63 6f 75 72 74 65 73 79 20 6f 66 20  e,..courtesy of 
29a0: 74 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e  the <strong>Open
29b0: 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f  SSL</strong> pro
29c0: 6a 65 63 74 2e 3c 2f 70 3e 0d 0a 0d 0a 3c 70 72  ject.</p>....<pr
29d0: 65 3e 3c 63 6f 64 65 3e 70 61 63 6b 61 67 65 20  e><code>package 
29e0: 72 65 71 75 69 72 65 20 68 74 74 70 0d 0a 70 61  require http..pa
29f0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c  ckage require tl
2a00: 73 0d 0a 0d 0a 68 74 74 70 3a 3a 72 65 67 69 73  s....http::regis
2a10: 74 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c  ter https 443 [l
2a20: 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65  ist ::tls::socke
2a30: 74 20 2d 72 65 71 75 69 72 65 20 31 20 2d 63 61  t -require 1 -ca
2a40: 66 69 6c 65 20 2e 2f 73 65 72 76 65 72 2e 70 65  file ./server.pe
2a50: 6d 5d 0d 0a 0d 0a 73 65 74 20 74 6f 6b 20 5b 68  m]....set tok [h
2a60: 74 74 70 3a 3a 67 65 74 75 72 6c 20 68 74 74 70  ttp::geturl http
2a70: 73 3a 2f 2f 64 65 76 65 6c 6f 70 65 72 2e 6e 65  s://developer.ne
2a80: 74 73 63 61 70 65 2e 63 6f 6d 2f 5d 0d 0a 3c 2f  tscape.com/]..</
2a90: 63 6f 64 65 3e 3c 2f 70 72 65 3e 0d 0a 0d 0a 3c  code></pre>....<
2aa0: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 50 45 43  h3><a name="SPEC
2ab0: 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f  IAL CONSIDERATIO
2ac0: 4e 53 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53  NS">SPECIAL CONS
2ad0: 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f  IDERATIONS</a></
2ae0: 68 33 3e 0d 0a 0d 0a 3c 70 3e 54 68 65 20 63 61  h3>....<p>The ca
2af0: 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74 68  pabilities of th
2b00: 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20 76  is package can v
2b10: 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 62  ary enormously b
2b20: 61 73 65 64 0d 0a 75 70 6f 6e 20 68 6f 77 20 79  ased..upon how y
2b30: 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72  our OpenSSL libr
2b40: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72  ary was configur
2b50: 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 74  ed and built. At
2b60: 20 74 68 65 0d 0a 6d 6f 73 74 20 6d 61 63 72 6f   the..most macro
2b70: 2d 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73  -level OpenSSL s
2b80: 75 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b  upports a &quot;
2b90: 6e 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b  no patents&quot;
2ba0: 20 62 75 69 6c 64 2c 0d 0a 77 68 69 63 68 20 64   build,..which d
2bb0: 69 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45  isables RSA, IDE
2bc0: 41 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64  A, RC(2,4,5) and
2bd0: 20 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20   SSL2 - if your 
2be0: 4f 70 65 6e 53 53 4c 20 69 73 0d 0a 63 6f 6e 66  OpenSSL is..conf
2bf0: 69 67 75 72 65 64 20 74 68 69 73 20 77 61 79 20  igured this way 
2c00: 74 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65  then you will ne
2c10: 65 64 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20  ed to build TLS 
2c20: 77 69 74 68 20 74 68 65 0d 0a 2d 44 4e 4f 5f 50  with the..-DNO_P
2c30: 41 54 45 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20  ATENTS option - 
2c40: 61 6e 64 20 74 68 65 20 72 65 73 75 6c 74 61 6e  and the resultan
2c50: 74 20 6d 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75  t module will fu
2c60: 6e 63 74 69 6f 6e 0d 0a 63 6f 72 72 65 63 74 6c  nction..correctl
2c70: 79 20 61 6e 64 20 61 6c 73 6f 20 73 75 70 70 6f  y and also suppo
2c80: 72 74 20 41 44 48 20 63 65 72 74 69 66 69 63 61  rt ADH certifica
2c90: 74 65 2d 6c 65 73 73 20 65 6e 63 72 79 70 74 69  te-less encrypti
2ca0: 6f 6e 2c 0d 0a 68 6f 77 65 76 65 72 20 79 6f 75  on,..however you
2cb0: 20 77 69 6c 6c 20 62 65 20 75 6e 61 62 6c 65 20   will be unable 
2cc0: 74 6f 20 75 74 69 6c 69 7a 65 20 74 68 69 73 20  to utilize this 
2cd0: 74 6f 20 73 70 65 61 6b 20 74 6f 20 6e 6f 72 6d  to speak to norm
2ce0: 61 6c 20 57 65 62 0d 0a 53 65 72 76 65 72 73 2c  al Web..Servers,
2cf0: 20 77 68 69 63 68 20 74 79 70 69 63 61 6c 6c 79   which typically
2d00: 20 72 65 71 75 69 72 65 20 52 53 41 20 73 75 70   require RSA sup
2d10: 70 6f 72 74 2e 20 50 6c 65 61 73 65 20 73 65 65  port. Please see
2d20: 20 3c 61 0d 0a 68 72 65 66 3d 22 68 74 74 70 3a   <a..href="http:
2d30: 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72  //www.openssl.or
2d40: 67 2f 22 3e 68 74 74 70 3a 2f 2f 77 77 77 2e 6f  g/">http://www.o
2d50: 70 65 6e 73 73 6c 2e 6f 72 67 2f 3c 2f 61 3e 20  penssl.org/</a> 
2d60: 66 6f 72 0d 0a 6d 6f 72 65 20 69 6e 66 6f 72 6d  for..more inform
2d70: 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 77 68 6f  ation on the who
2d80: 6c 65 20 69 73 73 75 65 20 6f 66 20 70 61 74 65  le issue of pate
2d90: 6e 74 73 20 61 6e 64 20 55 53 20 65 78 70 6f 72  nts and US expor
2da0: 74 0d 0a 72 65 73 74 72 69 63 74 69 6f 6e 73 2e  t..restrictions.
2db0: 20 3c 2f 70 3e 0d 0a 0d 0a 3c 68 33 3e 3c 61 20   </p>....<h3><a 
2dc0: 6e 61 6d 65 3d 22 53 45 45 20 41 4c 53 4f 22 3e  name="SEE ALSO">
2dd0: 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 68 33  SEE ALSO</a></h3
2de0: 3e 0d 0a 0d 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e  >....<p><strong>
2df0: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 2c  socket</strong>,
2e00: 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65 76 65   <strong>fileeve
2e10: 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e 3c 61 0d  nt, </strong><a.
2e20: 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77  .href="http://ww
2e30: 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e  w.openssl.org/">
2e40: 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c  <strong>OpenSSL<
2e50: 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70 3e  /strong></a></p>
2e60: 0d 0a 0d 0a 3c 68 72 3e 0d 0a 0d 0a 3c 70 72 65  ....<hr>....<pre
2e70: 3e 0d 0a 43 6f 70 79 72 69 67 68 74 20 a9 20 31  >..Copyright © 1
2e80: 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 2e  999 Matt Newman.
2e90: 3c 2f 70 72 65 3e 0d 0a 3c 2f 62 6f 64 79 3e 0d  </pre>..</body>.
2ea0: 0a 3c 2f 68 74 6d 6c 3e 0d 0a                    .</html>..