Hex Artifact Content

Artifact 4c4e8f1d42e8e4fab05b57af7a603dc30a5cc3e4:


0000: 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 20 70  <!doctype html p
0010: 75 62 6c 69 63 20 22 2d 2f 2f 57 33 43 2f 2f 44  ublic "-//W3C//D
0020: 54 44 20 48 54 4d 4c 20 34 2e 30 20 54 72 61 6e  TD HTML 4.0 Tran
0030: 73 69 74 69 6f 6e 61 6c 2f 2f 45 4e 22 3e 20 0a  sitional//EN"> .
0040: 0a 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a  .<html>..<head>.
0050: 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76  <meta http-equiv
0060: 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a  ="Content-Type".
0070: 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74  content="text/ht
0080: 6d 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d  ml; charset=iso-
0090: 38 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e  8859-1">.<meta n
00a0: 61 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20  ame="Copyright" 
00b0: 63 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61  content="1999 Ma
00c0: 74 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34  tt Newman / 2004
00d0: 20 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d   Starfish System
00e0: 73 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28  s">.<title>TLS (
00f0: 53 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64  SSL) Tcl Command
0100: 73 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64  s</title>.</head
0110: 3e 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72  >..<body bgcolor
0120: 3d 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c  ="#FFFFFF">..<dl
0130: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65  >.    <dd><a hre
0140: 66 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f  f="#NAME">NAME</
0150: 61 3e 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20  a> <dl>.        
0160: 20 20 20 20 3c 64 64 3e 3c 73 74 72 6f 6e 67 3e      <dd><strong>
0170: 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62  tls</strong> - b
0180: 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e  inding to <stron
0190: 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e  g>OpenSSL</stron
01a0: 67 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  g>.             
01b0: 20 20 20 74 6f 6f 6c 6b 69 74 2e 3c 2f 64 64 3e     toolkit.</dd>
01c0: 0a 20 20 20 20 20 20 20 20 3c 2f 64 6c 3e 0a 20  .        </dl>. 
01d0: 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64     </dd>.    <dd
01e0: 3e 3c 61 20 68 72 65 66 3d 22 23 53 59 4e 4f 50  ><a href="#SYNOP
01f0: 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61  SIS">SYNOPSIS</a
0200: 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  > </dd>.    <dd>
0210: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 20 20 20  <dl>.           
0220: 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20   <dd><b>package 
0230: 72 65 71 75 69 72 65 20 54 63 6c 20 3c 2f 62 3e  require Tcl </b>
0240: 3c 65 6d 3e 3f 38 2e 34 3f 3c 2f 65 6d 3e 3c 2f  <em>?8.4?</em></
0250: 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  dd>.            
0260: 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72  <dd><b>package r
0270: 65 71 75 69 72 65 20 74 6c 73 20 3c 2f 62 3e 3c  equire tls </b><
0280: 65 6d 3e 3f 40 40 56 45 52 53 40 40 3f 3c 2f 65  em>?@@VERS@@?</e
0290: 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  m></dd>.        
02a0: 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f      <dt>&nbsp;</
02b0: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  dt>.            
02c0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74  <dd><b>tls::init
02d0: 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73   </b><i>?options
02e0: 3f 3c 2f 69 3e 20 3c 2f 64 64 3e 0a 20 20 20 20  ?</i> </dd>.    
02f0: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74          <dd><b>t
0300: 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c  ls::socket </b><
0310: 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73  em>?options? hos
0320: 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64 3e  t port</em></dd>
0330: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64  .            <dd
0340: 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c  ><b>tls::socket<
0350: 2f 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72  /b><em> ?-server
0360: 20 63 6f 6d 6d 61 6e 64 3f 0a 20 20 20 20 20 20   command?.      
0370: 20 20 20 20 20 20 20 20 20 20 3f 6f 70 74 69 6f            ?optio
0380: 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64  ns? port</em></d
0390: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  d>.            <
03a0: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73  dd><b>tls::hands
03b0: 68 61 6b 65 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61  hake</b><em> cha
03c0: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20  nnel</em></dd>. 
03d0: 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c             <dd><
03e0: 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c 2f  b>tls::status </
03f0: 62 3e 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63  b><em>?-local? c
0400: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e  hannel</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 0a 20 20 20 20 20 20 20 20 20 20 20 20  dd>.            
0460: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d  <dd><b>tls::unim
0470: 70 6f 72 74 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61  port</b><em> cha
0480: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20  nnel</em></dd>. 
0490: 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c             <dd><
04a0: 62 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 3c  b>tls::ciphers <
04b0: 2f 62 3e 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20  /b><em>protocol 
04c0: 3f 76 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f  ?verbose?</em></
04d0: 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  dd>.            
04e0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73  <dd><b>tls::vers
04f0: 69 6f 6e 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20  ion</b></dd>.   
0500: 20 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c       </dl>.    <
0510: 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20  /dd>.    <dd><a 
0520: 68 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22  href="#COMMANDS"
0530: 3e 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64  >COMMANDS</a></d
0540: 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72  d>.    <dd><a hr
0550: 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50  ef="#CALLBACK OP
0560: 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20  TIONS">CALLBACK 
0570: 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e  OPTIONS</a></dd>
0580: 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66  .    <dd><a href
0590: 3d 22 23 48 54 54 50 53 20 45 58 41 4d 50 4c 45  ="#HTTPS EXAMPLE
05a0: 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 3c  ">HTTPS EXAMPLE<
05b0: 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64  /a></dd>.    <dd
05c0: 3e 3c 61 20 68 72 65 66 3d 22 23 53 45 45 20 41  ><a href="#SEE A
05d0: 4c 53 4f 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e  LSO">SPECIAL CON
05e0: 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c  SIDERATIONS</a><
05f0: 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20  /dd>.    <dd><a 
0600: 68 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22  href="#SEE ALSO"
0610: 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64  >SEE ALSO</a></d
0620: 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a  d>.</dl>..<hr>..
0630: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 4e 41 4d  <h3><a name="NAM
0640: 45 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f 68 33 3e  E">NAME</a></h3>
0650: 0a 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  ..<p><strong>tls
0660: 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69 6e 64  </strong> - bind
0670: 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 4f  ing to <strong>O
0680: 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 0a  penSSL</strong>.
0690: 74 6f 6f 6c 6b 69 74 2e 3c 2f 70 3e 0a 0a 3c 68  toolkit.</p>..<h
06a0: 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 59 4e 4f 50  3><a name="SYNOP
06b0: 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61  SIS">SYNOPSIS</a
06c0: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 62 3e 70 61  ></h3>..<p><b>pa
06d0: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 63  ckage require Tc
06e0: 6c 20 38 2e 34 3c 2f 62 3e 3c 62 72 3e 0a 3c 62  l 8.4</b><br>.<b
06f0: 3e 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  >package require
0700: 20 74 6c 73 20 40 40 56 45 52 53 40 40 3c 2f 62   tls @@VERS@@</b
0710: 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72  ><br>.<br>.<a hr
0720: 65 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22 3e  ef="#tls::init">
0730: 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62  <b>tls::init </b
0740: 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69  ><i>?options?</i
0750: 3e 3c 62 72 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65  ><br>.</a><a hre
0760: 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74 22  f="#tls::socket"
0770: 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20  ><b>tls::socket 
0780: 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73  </b><em>?options
0790: 3f 20 68 6f 73 74 0a 70 6f 72 74 3c 2f 65 6d 3e  ? host.port</em>
07a0: 3c 62 72 3e 0a 3c 62 3e 74 6c 73 3a 3a 73 6f 63  <br>.<b>tls::soc
07b0: 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73 65  ket</b><em> ?-se
07c0: 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f  rver command? ?o
07d0: 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d  ptions? port</em
07e0: 3e 3c 62 72 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65  ><br>.</a><a hre
07f0: 66 3d 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22  f="#tls::status"
0800: 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73 20  ><b>tls::status 
0810: 3c 2f 62 3e 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f  </b><em>?-local?
0820: 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 62 72   channel</em><br
0830: 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23  >.</a><a href="#
0840: 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e  tls::handshake">
0850: 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b  <b>tls::handshak
0860: 65 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65  e</b><em> channe
0870: 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c  l</em></a><br>.<
0880: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
0890: 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c  s::import"><b>tl
08a0: 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69  s::import </b><i
08b0: 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e  >channel ?option
08c0: 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c  s?</i></a><br>.<
08d0: 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 75 6e  a href="#tls::un
08e0: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a  import"><b>tls::
08f0: 75 6e 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e  unimport </b><i>
0900: 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c  channel</i></a><
0910: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
0920: 73 3a 3a 63 69 70 68 65 72 73 20 70 72 6f 74 6f  s::ciphers proto
0930: 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 22 3e 3c  col ?verbose?"><
0940: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68  strong>tls::ciph
0950: 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 0a 3c 65 6d  ers</strong>.<em
0960: 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f  >protocol ?verbo
0970: 73 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 62 72 3e  se?</em></a><br>
0980: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
0990: 76 65 72 73 69 6f 6e 22 3e 3c 62 3e 74 6c 73 3a  version"><b>tls:
09a0: 3a 76 65 72 73 69 6f 6e 3c 2f 62 3e 3c 2f 61 3e  :version</b></a>
09b0: 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61  .</p>..<h3><a na
09c0: 6d 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e 22  me="DESCRIPTION"
09d0: 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e  >DESCRIPTION</a>
09e0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73 20 65  </h3>..<p>This e
09f0: 78 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64 65  xtension provide
0a00: 73 20 61 20 67 65 6e 65 72 69 63 20 62 69 6e 64  s a generic bind
0a10: 69 6e 67 20 74 6f 20 3c 61 0a 68 72 65 66 3d 22  ing to <a.href="
0a20: 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73  http://www.opens
0a30: 73 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e 53 53 4c  sl.org/">OpenSSL
0a40: 3c 2f 61 3e 2c 20 75 74 69 6c 69 7a 69 6e 67 20  </a>, utilizing 
0a50: 74 68 65 0a 3c 73 74 72 6f 6e 67 3e 54 63 6c 5f  the.<strong>Tcl_
0a60: 53 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73 74  StackChannel</st
0a70: 72 6f 6e 67 3e 0a 41 50 49 20 66 6f 72 20 54 63  rong>.API for Tc
0a80: 6c 20 38 2e 32 20 61 6e 64 20 68 69 67 68 65 72  l 8.2 and higher
0a90: 2e 20 54 68 65 20 73 6f 63 6b 65 74 73 20 62 65  . The sockets be
0aa0: 68 61 76 65 20 65 78 61 63 74 6c 79 20 74 68 65  have exactly the
0ab0: 20 73 61 6d 65 0a 61 73 20 63 68 61 6e 6e 65 6c   same.as channel
0ac0: 73 20 63 72 65 61 74 65 64 20 75 73 69 6e 67 20  s created using 
0ad0: 54 63 6c 27 73 20 62 75 69 6c 74 2d 69 6e 20 3c  Tcl's built-in <
0ae0: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
0af0: 74 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 20 77  trong>.command w
0b00: 69 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f  ith additional o
0b10: 70 74 69 6f 6e 73 20 66 6f 72 20 63 6f 6e 74 72  ptions for contr
0b20: 6f 6c 6c 69 6e 67 20 74 68 65 20 53 53 4c 20 73  olling the SSL s
0b30: 65 73 73 69 6f 6e 2e 0a 54 6f 20 75 73 65 20 54  ession..To use T
0b40: 4c 53 20 77 69 74 68 20 61 6e 20 65 61 72 6c 69  LS with an earli
0b50: 65 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63  er version of Tc
0b60: 6c 20 74 68 61 6e 20 38 2e 34 2c 20 70 6c 65 61  l than 8.4, plea
0b70: 73 65 20 6f 62 74 61 69 6e 0a 54 4c 53 20 31 2e  se obtain.TLS 1.
0b80: 33 2e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20  3..</p>..<h3><a 
0b90: 6e 61 6d 65 3d 22 43 4f 4d 4d 41 4e 44 53 22 3e  name="COMMANDS">
0ba0: 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 68 33  COMMANDS</a></h3
0bb0: 3e 0a 0a 3c 70 3e 54 79 70 69 63 61 6c 6c 79 20  >..<p>Typically 
0bc0: 6f 6e 65 20 77 6f 75 6c 64 20 75 73 65 20 74 68  one would use th
0bd0: 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73  e <strong>tls::s
0be0: 6f 63 6b 65 74 20 3c 2f 73 74 72 6f 6e 67 3e 63  ocket </strong>c
0bf0: 6f 6d 6d 61 6e 64 0a 77 68 69 63 68 20 70 72 6f  ommand.which pro
0c00: 76 69 64 65 73 20 63 6f 6d 70 61 74 69 62 69 6c  vides compatibil
0c10: 69 74 79 20 77 69 74 68 20 74 68 65 20 6e 61 74  ity with the nat
0c20: 69 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e  ive Tcl <strong>
0c30: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a  socket</strong>.
0c40: 63 6f 6d 6d 61 6e 64 2e 20 49 6e 20 73 75 63 68  command. In such
0c50: 20 63 61 73 65 73 20 3c 73 74 72 6f 6e 67 3e 74   cases <strong>t
0c60: 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f  ls::import</stro
0c70: 6e 67 3e 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62  ng> should not b
0c80: 65 0a 75 73 65 64 20 64 69 72 65 63 74 6c 79 2e  e.used directly.
0c90: 3c 2f 70 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c  </p>..<dl>.    <
0ca0: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
0cb0: 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69  :init"><b>tls::i
0cc0: 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69  nit </b><i>?opti
0cd0: 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74  ons?</i></a></dt
0ce0: 3e 0a 20 20 20 20 3c 64 64 3e 54 68 69 73 20 72  >.    <dd>This r
0cf0: 6f 75 74 69 6e 65 20 73 65 74 73 20 74 68 65 20  outine sets the 
0d00: 64 65 66 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20  default options 
0d10: 75 73 65 64 20 62 79 20 3c 73 74 72 6f 6e 67 3e  used by <strong>
0d20: 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72  tls::socket</str
0d30: 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 61 6e 64  ong>.        and
0d40: 20 69 73 20 3c 65 6d 3e 6f 70 74 69 6f 6e 61 6c   is <em>optional
0d50: 3c 2f 65 6d 3e 2e 20 49 66 20 79 6f 75 20 63 61  </em>. If you ca
0d60: 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  ll <strong>tls::
0d70: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a  import</strong>.
0d80: 20 20 20 20 20 20 20 20 64 69 72 65 63 74 6c 79          directly
0d90: 20 74 68 69 73 20 72 6f 75 74 69 6e 65 20 68 61   this routine ha
0da0: 73 20 6e 6f 20 65 66 66 65 63 74 2e 20 41 6e 79  s no effect. Any
0db0: 20 6f 66 20 74 68 65 20 6f 70 74 69 6f 6e 73 0a   of the options.
0dc0: 20 20 20 20 20 20 20 20 74 68 61 74 20 3c 73 74          that <st
0dd0: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74  rong>tls::socket
0de0: 3c 2f 73 74 72 6f 6e 67 3e 20 61 63 63 65 70 74  </strong> accept
0df0: 73 20 63 61 6e 20 62 65 20 73 65 74 0a 20 20 20  s can be set.   
0e00: 20 20 20 20 20 75 73 69 6e 67 20 74 68 69 73 20       using this 
0e10: 63 6f 6d 6d 61 6e 64 2c 20 74 68 6f 75 67 68 20  command, though 
0e20: 79 6f 75 20 73 68 6f 75 6c 64 20 6c 69 6d 69 74  you should limit
0e30: 20 79 6f 75 72 20 6f 70 74 69 6f 6e 73 0a 20 20   your options.  
0e40: 20 20 20 20 20 20 74 6f 20 6f 6e 6c 79 20 54 4c        to only TL
0e50: 53 20 72 65 6c 61 74 65 64 20 6f 6e 65 73 2e 3c  S related ones.<
0e60: 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62  /dd>.    <dt>&nb
0e70: 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74  sp;</dt>.    <dt
0e80: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73  ><a name="tls::s
0e90: 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73  ocket"><b>tls::s
0ea0: 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f  ocket </b><em>?o
0eb0: 70 74 69 6f 6e 73 3f 0a 20 20 20 20 20 20 20 20  ptions?.        
0ec0: 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f  host port</em></
0ed0: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e  a></dt>.    <dt>
0ee0: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  <b>tls::socket</
0ef0: 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20  b><em> ?-server 
0f00: 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e  command? ?option
0f10: 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74  s? port</em></dt
0f20: 3e 0a 20 20 20 20 3c 64 64 3e 54 68 69 73 20 69  >.    <dd>This i
0f30: 73 20 61 20 68 65 6c 70 65 72 20 66 75 6e 63 74  s a helper funct
0f40: 69 6f 6e 20 74 68 61 74 20 75 74 69 6c 69 7a 65  ion that utilize
0f50: 73 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67  s the underlying
0f60: 0a 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64  .        command
0f70: 73 20 28 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  s (<strong>tls::
0f80: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 29  import</strong>)
0f90: 2e 20 49 74 20 62 65 68 61 76 65 73 0a 20 20 20  . It behaves.   
0fa0: 20 20 20 20 20 65 78 61 63 74 6c 79 20 74 68 65       exactly the
0fb0: 20 73 61 6d 65 20 61 73 20 74 68 65 20 6e 61 74   same as the nat
0fc0: 69 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e  ive Tcl <strong>
0fd0: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a  socket</strong>.
0fe0: 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 20          command 
0ff0: 65 78 63 65 70 74 20 74 68 61 74 20 74 68 65 20  except that the 
1000: 6f 70 74 69 6f 6e 73 20 63 61 6e 20 69 6e 63 6c  options can incl
1010: 75 64 65 20 61 6e 79 20 6f 66 20 74 68 65 0a 20  ude any of the. 
1020: 20 20 20 20 20 20 20 61 70 70 6c 69 63 61 62 6c         applicabl
1030: 65 20 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a  e <a href="#tls:
1040: 3a 69 6d 70 6f 72 74 22 3e 3c 73 74 72 6f 6e 67  :import"><strong
1050: 3e 74 6c 73 3a 69 6d 70 6f 72 74 3c 2f 73 74 72  >tls:import</str
1060: 6f 6e 67 3e 3c 2f 61 3e 0a 20 20 20 20 20 20 20  ong></a>.       
1070: 20 6f 70 74 69 6f 6e 73 2e 3c 2f 64 64 3e 0a 20   options.</dd>. 
1080: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64     <dt>&nbsp;</d
1090: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61  t>.    <dt><a na
10a0: 6d 65 3d 22 74 6c 73 3a 3a 68 61 6e 64 73 68 61  me="tls::handsha
10b0: 6b 65 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  ke"><strong>tls:
10c0: 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 73 74 72 6f  :handshake</stro
10d0: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c  ng> <em>channel<
10e0: 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20  /em></a></dt>.  
10f0: 20 20 3c 64 64 3e 46 6f 72 63 65 73 20 68 61 6e    <dd>Forces han
1100: 64 73 68 61 6b 65 20 74 6f 20 74 61 6b 65 20 70  dshake to take p
1110: 6c 61 63 65 2c 20 61 6e 64 20 72 65 74 75 72 6e  lace, and return
1120: 73 20 30 20 69 66 0a 20 20 20 20 20 20 20 20 68  s 0 if.        h
1130: 61 6e 64 73 68 61 6b 65 20 69 73 20 73 74 69 6c  andshake is stil
1140: 6c 20 69 6e 20 70 72 6f 67 72 65 73 73 20 28 6e  l in progress (n
1150: 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72  on-blocking), or
1160: 20 31 20 69 66 0a 20 20 20 20 20 20 20 20 74 68   1 if.        th
1170: 65 20 68 61 6e 64 73 68 61 6b 65 20 77 61 73 20  e handshake was 
1180: 73 75 63 63 65 73 73 66 75 6c 2e 20 49 66 20 74  successful. If t
1190: 68 65 20 68 61 6e 64 73 68 61 6b 65 20 66 61 69  he handshake fai
11a0: 6c 65 64 0a 20 20 20 20 20 20 20 20 74 68 69 73  led.        this
11b0: 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c 20 74 68   routine will th
11c0: 72 6f 77 20 61 6e 20 65 72 72 6f 72 2e 3c 2f 64  row an error.</d
11d0: 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70  d>.    <dt>&nbsp
11e0: 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c  ;</dt>.    <dt><
11f0: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 74 61  a name="tls::sta
1200: 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  tus"><strong>tls
1210: 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67  ::status</strong
1220: 3e 0a 20 20 20 20 3c 65 6d 3e 3f 2d 6c 6f 63 61  >.    <em>?-loca
1230: 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c  l? channel</em><
1240: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
1250: 3e 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 72  >Returns the cur
1260: 72 65 6e 74 20 73 65 63 75 72 69 74 79 20 73 74  rent security st
1270: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63  atus of an SSL c
1280: 68 61 6e 6e 65 6c 2e 20 54 68 65 0a 20 20 20 20  hannel. The.    
1290: 20 20 20 20 72 65 73 75 6c 74 20 69 73 20 61 20      result is a 
12a0: 6c 69 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75  list of key-valu
12b0: 65 20 70 61 69 72 73 20 64 65 73 63 72 69 62 69  e pairs describi
12c0: 6e 67 20 74 68 65 0a 20 20 20 20 20 20 20 20 63  ng the.        c
12d0: 6f 6e 6e 65 63 74 65 64 20 70 65 65 72 2e 20 49  onnected peer. I
12e0: 66 20 74 68 65 20 72 65 73 75 6c 74 20 69 73 20  f the result is 
12f0: 61 6e 20 65 6d 70 74 79 20 6c 69 73 74 20 74 68  an empty list th
1300: 65 6e 20 74 68 65 0a 20 20 20 20 20 20 20 20 53  en the.        S
1310: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73  SL handshake has
1320: 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74   not yet complet
1330: 65 64 2e 0a 20 20 20 20 20 20 20 20 49 66 20 3c  ed..        If <
1340: 65 6d 3e 2d 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69  em>-local</em> i
1350: 73 20 67 69 76 65 6e 2c 20 74 68 65 6e 20 74 68  s given, then th
1360: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69 6e  e certificate in
1370: 66 6f 72 6d 61 74 69 6f 6e 0a 20 20 20 20 20 20  formation.      
1380: 20 20 69 73 20 74 68 65 20 6f 6e 65 20 75 73 65    is the one use
1390: 64 20 6c 6f 63 61 6c 6c 79 2e 3c 2f 64 64 3e 0a  d locally.</dd>.
13a0: 3c 2f 64 6c 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f  </dl>..<blockquo
13b0: 74 65 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20  te>.    <dl>.   
13c0: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
13d0: 3e 69 73 73 75 65 72 3c 2f 73 74 72 6f 6e 67 3e  >issuer</strong>
13e0: 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74   <em>dn</em></dt
13f0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  >.        <dd>Th
1400: 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20  e distinguished 
1410: 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65  name (DN) of the
1420: 20 63 65 72 74 69 66 69 63 61 74 65 0a 20 20 20   certificate.   
1430: 20 20 20 20 20 20 20 20 20 69 73 73 75 65 72 2e           issuer.
1440: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
1450: 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63  t><strong>subjec
1460: 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64  t</strong> <em>d
1470: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  n</em></dt>.    
1480: 20 20 20 20 3c 64 64 3e 54 68 65 20 64 69 73 74      <dd>The dist
1490: 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28  inguished name (
14a0: 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69  DN) of the certi
14b0: 66 69 63 61 74 65 0a 20 20 20 20 20 20 20 20 20  ficate.         
14c0: 20 20 20 73 75 62 6a 65 63 74 2e 3c 2f 64 64 3e     subject.</dd>
14d0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
14e0: 72 6f 6e 67 3e 6e 6f 74 42 65 66 6f 72 65 3c 2f  rong>notBefore</
14f0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65  strong> <em>date
1500: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1510: 20 20 20 3c 64 64 3e 54 68 65 20 62 65 67 69 6e     <dd>The begin
1520: 20 64 61 74 65 20 66 6f 72 20 74 68 65 20 76 61   date for the va
1530: 6c 69 64 69 74 79 20 6f 66 20 74 68 65 20 63 65  lidity of the ce
1540: 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a  rtificate.</dd>.
1550: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
1560: 6f 6e 67 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74  ong>notAfter</st
1570: 72 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f  rong> <em>date</
1580: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
1590: 20 3c 64 64 3e 54 68 65 20 65 78 70 69 72 79 20   <dd>The expiry 
15a0: 64 61 74 65 20 66 6f 72 20 74 68 65 20 63 65 72  date for the cer
15b0: 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20  tificate.</dd>. 
15c0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
15d0: 6e 67 3e 73 65 72 69 61 6c 3c 2f 73 74 72 6f 6e  ng>serial</stron
15e0: 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64  g> <em>n</em></d
15f0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54  t>.        <dd>T
1600: 68 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 65 72  he serial number
1610: 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63   of the certific
1620: 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  ate.</dd>.      
1630: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69    <dt><strong>ci
1640: 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  pher</strong> <e
1650: 6d 3e 63 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64  m>cipher</em></d
1660: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54  t>.        <dd>T
1670: 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 65  he current ciphe
1680: 72 20 69 6e 20 75 73 65 20 62 65 74 77 65 65 6e  r in use between
1690: 20 74 68 65 20 63 6c 69 65 6e 74 20 61 6e 64 0a   the client and.
16a0: 20 20 20 20 20 20 20 20 20 20 20 20 73 65 72 76              serv
16b0: 65 72 20 63 68 61 6e 6e 65 6c 73 2e 3c 2f 64 64  er channels.</dd
16c0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
16d0: 74 72 6f 6e 67 3e 73 62 69 74 73 3c 2f 73 74 72  trong>sbits</str
16e0: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c  ong> <em>n</em><
16f0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
1700: 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62  >The number of b
1710: 69 74 73 20 75 73 65 64 20 66 6f 72 20 74 68 65  its used for the
1720: 20 73 65 73 73 69 6f 6e 20 6b 65 79 2e 3c 2f 64   session key.</d
1730: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62  d>.    </dl>.</b
1740: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c 3e  lockquote>..<dl>
1750: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
1760: 3d 22 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c  ="tls::import"><
1770: 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f  b>tls::import </
1780: 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0a 20 20 20  b><i>channel.   
1790: 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f       ?options?</
17a0: 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  i></a></dt>.    
17b0: 3c 64 64 3e 53 53 4c 2d 65 6e 61 62 6c 65 20 61  <dd>SSL-enable a
17c0: 20 72 65 67 75 6c 61 72 20 54 63 6c 20 63 68 61   regular Tcl cha
17d0: 6e 6e 65 6c 20 2d 20 69 74 20 6e 65 65 64 20 6e  nnel - it need n
17e0: 6f 74 20 62 65 20 61 0a 20 20 20 20 20 20 20 20  ot be a.        
17f0: 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73 74  socket, but must
1800: 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72 65   provide bi-dire
1810: 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41 6c  ctional flow. Al
1820: 73 6f 0a 20 20 20 20 20 20 20 20 73 65 74 74 69  so.        setti
1830: 6e 67 20 73 65 73 73 69 6f 6e 20 70 61 72 61 6d  ng session param
1840: 65 74 65 72 73 20 66 6f 72 20 53 53 4c 20 68 61  eters for SSL ha
1850: 6e 64 73 68 61 6b 65 2e 3c 2f 64 64 3e 0a 3c 2f  ndshake.</dd>.</
1860: 64 6c 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65  dl>..<blockquote
1870: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20  >.    <dl>.     
1880: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
1890: 63 61 64 69 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  cadir</strong> <
18a0: 65 6d 3e 64 69 72 3c 2f 65 6d 3e 3c 2f 64 74 3e  em>dir</em></dt>
18b0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f  .        <dd>Pro
18c0: 76 69 64 65 20 74 68 65 20 64 69 72 65 63 74 6f  vide the directo
18d0: 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68  ry containing th
18e0: 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65  e CA certificate
18f0: 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  s.</dd>.        
1900: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66  <dt><strong>-caf
1910: 69 6c 65 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d  ile </strong><em
1920: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1930: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
1940: 50 72 6f 76 69 64 65 20 74 68 65 20 43 41 20 66  Provide the CA f
1950: 69 6c 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  ile.</dd>.      
1960: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63    <dt><strong>-c
1970: 65 72 74 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e  ertfile</strong>
1980: 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65   <em>filename</e
1990: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
19a0: 3c 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20  <dd>Provide the 
19b0: 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75  certificate to u
19c0: 73 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  se.</dd>.       
19d0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69   <dt><strong>-ci
19e0: 70 68 65 72 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65  pher </strong><e
19f0: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64  m>string</em></d
1a00: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50  t>.        <dd>P
1a10: 72 6f 76 69 64 65 20 74 68 65 20 63 69 70 68 65  rovide the ciphe
1a20: 72 20 73 75 69 74 65 73 20 74 6f 20 75 73 65 2e  r suites to use.
1a30: 20 53 79 6e 74 61 78 20 69 73 20 61 73 20 70 65   Syntax is as pe
1a40: 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 4f 70  r.            Op
1a50: 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0a 20 20 20 20  enSSL.</dd>.    
1a60: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
1a70: 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67  -command</strong
1a80: 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f  > <em>callback</
1a90: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
1aa0: 20 3c 64 64 3e 49 66 20 73 70 65 63 69 66 69 65   <dd>If specifie
1ab0: 64 2c 20 74 68 69 73 20 63 61 6c 6c 62 61 63 6b  d, this callback
1ac0: 20 77 69 6c 6c 20 62 65 20 69 6e 76 6f 6b 65 64   will be invoked
1ad0: 20 61 74 20 73 65 76 65 72 61 6c 20 70 6f 69 6e   at several poin
1ae0: 74 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 64  ts.            d
1af0: 75 72 69 6e 67 20 74 68 65 20 4f 70 65 6e 53 53  uring the OpenSS
1b00: 4c 20 68 61 6e 64 73 68 61 6b 65 2e 20 20 49 74  L handshake.  It
1b10: 20 63 61 6e 20 70 61 73 73 20 65 72 72 6f 72 73   can pass errors
1b20: 20 61 6e 64 20 74 72 61 63 69 6e 67 0a 20 20 20   and tracing.   
1b30: 20 20 20 20 20 20 20 20 20 69 6e 66 6f 72 6d 61           informa
1b40: 74 69 6f 6e 2c 20 61 6e 64 20 69 74 20 63 61 6e  tion, and it can
1b50: 20 61 6c 6c 6f 77 20 54 63 6c 20 73 63 72 69 70   allow Tcl scrip
1b60: 74 73 20 74 6f 20 70 65 72 66 6f 72 6d 0a 20 20  ts to perform.  
1b70: 20 20 20 20 20 20 20 20 20 20 74 68 65 69 72 20            their 
1b80: 6f 77 6e 20 76 61 6c 69 64 61 74 69 6f 6e 20 6f  own validation o
1b90: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
1ba0: 65 20 69 6e 20 70 6c 61 63 65 20 6f 66 20 74 68  e in place of th
1bb0: 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 64 65  e.            de
1bc0: 66 61 75 6c 74 20 76 61 6c 69 64 61 74 69 6f 6e  fault validation
1bd0: 20 70 72 6f 76 69 64 65 64 20 62 79 20 4f 70 65   provided by Ope
1be0: 6e 53 53 4c 2e 0a 20 20 20 20 20 20 20 20 20 20  nSSL..          
1bf0: 20 20 3c 62 72 3e 0a 20 20 20 20 20 20 20 20 20    <br>.         
1c00: 20 20 20 53 65 65 20 3c 61 20 68 72 65 66 3d 22     See <a href="
1c10: 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  #CALLBACK OPTION
1c20: 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49  S">CALLBACK OPTI
1c30: 4f 4e 53 3c 2f 61 3e 20 66 6f 72 0a 20 20 20 20  ONS</a> for.    
1c40: 20 20 20 20 20 20 20 20 66 75 72 74 68 65 72 20          further 
1c50: 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e  discussion.</dd>
1c60: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1c70: 72 6f 6e 67 3e 2d 64 68 70 61 72 61 6d 73 20 3c  rong>-dhparams <
1c80: 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65  /strong><em>file
1c90: 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  name</em></dt>. 
1ca0: 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69         <dd>Provi
1cb0: 64 65 20 61 20 44 69 66 66 69 65 2d 48 65 6c 6c  de a Diffie-Hell
1cc0: 6d 61 6e 20 70 61 72 61 6d 65 74 65 72 73 20 66  man parameters f
1cd0: 69 6c 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  ile.</dd>.      
1ce0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b    <dt><strong>-k
1cf0: 65 79 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20  eyfile</strong> 
1d00: 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d  <em>filename</em
1d10: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
1d20: 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 70  dd>Provide the p
1d30: 72 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 2e  rivate key file.
1d40: 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c   (<strong>defaul
1d50: 74 3c 2f 73 74 72 6f 6e 67 3e 3a 0a 20 20 20 20  t</strong>:.    
1d60: 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 6f 66          value of
1d70: 20 2d 63 65 72 74 66 69 6c 65 29 3c 2f 64 64 3e   -certfile)</dd>
1d80: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1d90: 72 6f 6e 67 3e 2d 6d 6f 64 65 6c 3c 2f 73 74 72  rong>-model</str
1da0: 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c  ong> <em>channel
1db0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1dc0: 20 20 20 3c 64 64 3e 54 68 69 73 20 77 69 6c 6c     <dd>This will
1dd0: 20 66 6f 72 63 65 20 74 68 69 73 20 63 68 61 6e   force this chan
1de0: 6e 65 6c 20 74 6f 20 73 68 61 72 65 20 74 68 65  nel to share the
1df0: 20 73 61 6d 65 20 3c 65 6d 3e 3c 73 74 72 6f 6e   same <em><stron
1e00: 67 3e 53 53 4c 5f 43 54 58 3c 2f 73 74 72 6f 6e  g>SSL_CTX</stron
1e10: 67 3e 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20  g></em>.        
1e20: 20 20 20 20 73 74 72 75 63 74 75 72 65 20 61 73      structure as
1e30: 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c   the specified <
1e40: 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 2c  em>channel</em>,
1e50: 20 61 6e 64 0a 20 20 20 20 20 20 20 20 20 20 20   and.           
1e60: 20 74 68 65 72 65 66 6f 72 65 20 73 68 61 72 65   therefore share
1e70: 20 63 61 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c   callbacks etc.<
1e80: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
1e90: 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f  ><strong>-passwo
1ea0: 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  rd</strong> <em>
1eb0: 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64  callback</em></d
1ec0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 49  t>.        <dd>I
1ed0: 66 20 73 75 70 70 6c 69 65 64 2c 20 74 68 69 73  f supplied, this
1ee0: 20 63 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62   callback will b
1ef0: 65 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 4f  e invoked when O
1f00: 70 65 6e 53 53 4c 20 6e 65 65 64 73 0a 20 20 20  penSSL needs.   
1f10: 20 20 20 20 20 20 20 20 20 74 6f 20 6f 62 74 61           to obta
1f20: 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2c 20 74  in a password, t
1f30: 79 70 69 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f  ypically to unlo
1f40: 63 6b 20 74 68 65 20 70 72 69 76 61 74 65 20 6b  ck the private k
1f50: 65 79 20 6f 66 0a 09 20 20 20 20 61 20 63 65 72  ey of..    a cer
1f60: 74 69 66 69 63 61 74 65 2e 0a 20 20 20 20 20 20  tificate..      
1f70: 20 20 20 20 20 20 54 68 65 20 63 61 6c 6c 62 61        The callba
1f80: 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  ck should return
1f90: 20 61 20 73 74 72 69 6e 67 20 77 68 69 63 68 20   a string which 
1fa0: 72 65 70 72 65 73 65 6e 74 73 20 74 68 65 0a 20  represents the. 
1fb0: 20 20 20 20 20 20 20 20 20 20 20 70 61 73 73 77             passw
1fc0: 6f 72 64 20 74 6f 20 62 65 20 75 73 65 64 2e 0a  ord to be used..
1fd0: 20 20 20 20 20 20 20 20 20 20 20 20 3c 62 72 3e              <br>
1fe0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 65  .            See
1ff0: 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42   <a href="#CALLB
2000: 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c  ACK OPTIONS">CAL
2010: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61  LBACK OPTIONS</a
2020: 3e 20 66 6f 72 0a 20 20 20 20 20 20 20 20 20 20  > for.          
2030: 20 20 66 75 72 74 68 65 72 20 64 69 73 63 75 73    further discus
2040: 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20  sion.</dd>.     
2050: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
2060: 72 65 71 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67  request </strong
2070: 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f  ><em>bool</em></
2080: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
2090: 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69 66  Request a certif
20a0: 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20  icate from peer 
20b0: 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73  during SSL hands
20c0: 68 61 6b 65 2e 0a 20 20 20 20 20 20 20 20 20 20  hake..          
20d0: 20 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75    (<strong>defau
20e0: 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d  lt</strong>: <em
20f0: 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e  >true</em>)</dd>
2100: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
2110: 72 6f 6e 67 3e 2d 72 65 71 75 69 72 65 3c 2f 73  rong>-require</s
2120: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
2130: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2140: 20 20 3c 64 64 3e 52 65 71 75 69 72 65 20 61 20    <dd>Require a 
2150: 76 61 6c 69 64 20 63 65 72 74 69 66 69 63 61 74  valid certificat
2160: 65 20 66 72 6f 6d 20 70 65 65 72 20 64 75 72 69  e from peer duri
2170: 6e 67 20 53 53 4c 0a 20 20 20 20 20 20 20 20 20  ng SSL.         
2180: 20 20 20 68 61 6e 64 73 68 61 6b 65 2e 20 49 66     handshake. If
2190: 20 74 68 69 73 20 69 73 20 73 65 74 20 74 6f 20   this is set to 
21a0: 74 72 75 65 20 74 68 65 6e 20 3c 73 74 72 6f 6e  true then <stron
21b0: 67 3e 2d 72 65 71 75 65 73 74 3c 2f 73 74 72 6f  g>-request</stro
21c0: 6e 67 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  ng>.            
21d0: 6d 75 73 74 20 61 6c 73 6f 20 62 65 20 73 65 74  must also be set
21e0: 20 74 6f 20 74 72 75 65 2e 20 28 3c 73 74 72 6f   to true. (<stro
21f0: 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f  ng>default</stro
2200: 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f  ng>: <em>false</
2210: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20  em>)</dd>.      
2220: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73    <dt><strong>-s
2230: 65 72 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  erver</strong> <
2240: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
2250: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 48 61  >.        <dd>Ha
2260: 6e 64 73 68 61 6b 65 20 61 73 20 73 65 72 76 65  ndshake as serve
2270: 72 20 69 66 20 74 72 75 65 2c 20 65 6c 73 65 20  r if true, else 
2280: 68 61 6e 64 73 68 61 6b 65 20 61 73 0a 20 20 20  handshake as.   
2290: 20 20 20 20 20 20 20 20 20 63 6c 69 65 6e 74 2e           client.
22a0: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
22b0: 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66  </strong>: <em>f
22c0: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a  alse</em>)</dd>.
22d0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
22e0: 6f 6e 67 3e 2d 73 65 72 76 65 72 6e 61 6d 65 3c  ong>-servername<
22f0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f 73  /strong> <em>hos
2300: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  t</em></dt>.    
2310: 20 20 20 20 3c 64 64 3e 4f 6e 6c 79 20 61 76 61      <dd>Only ava
2320: 69 6c 61 62 6c 65 20 69 66 20 74 68 65 20 4f 70  ilable if the Op
2330: 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 20 74 68  enSSL library th
2340: 65 20 70 61 63 6b 61 67 65 20 69 73 20 6c 69 6e  e package is lin
2350: 6b 65 64 0a 09 20 20 20 20 61 67 61 69 6e 73 74  ked..    against
2360: 20 73 75 70 70 6f 72 74 73 20 74 68 65 20 54 4c   supports the TL
2370: 53 20 68 6f 73 74 6e 61 6d 65 20 65 78 74 65 6e  S hostname exten
2380: 73 69 6f 6e 20 66 6f 72 20 27 53 65 72 76 65 72  sion for 'Server
2390: 20 4e 61 6d 65 0a 09 20 20 20 20 49 6e 64 69 63   Name..    Indic
23a0: 61 74 69 6f 6e 27 20 28 53 4e 49 29 2e 20 55 73  ation' (SNI). Us
23b0: 65 20 74 6f 20 6e 61 6d 65 20 74 68 65 20 6c 6f  e to name the lo
23c0: 67 69 63 61 6c 20 68 6f 73 74 20 77 65 20 61 72  gical host we ar
23d0: 65 20 74 61 6c 6b 69 6e 67 0a 09 20 20 20 20 74  e talking..    t
23e0: 6f 20 61 6e 64 20 65 78 70 65 63 74 69 6e 67 20  o and expecting 
23f0: 61 20 63 65 72 74 69 66 69 63 61 74 65 20 66 6f  a certificate fo
2400: 72 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  r</dd>.        <
2410: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 32  dt><strong>-ssl2
2420: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
2430: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  ol</em></dt>.   
2440: 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20       <dd>Enable 
2450: 75 73 65 20 6f 66 20 53 53 4c 20 76 32 2e 20 28  use of SSL v2. (
2460: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
2470: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61  /strong>: <em>fa
2480: 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20  lse</em>)</dd>. 
2490: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
24a0: 6e 67 3e 2d 73 73 6c 33 20 3c 2f 73 74 72 6f 6e  ng>-ssl3 </stron
24b0: 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c  g><em>bool</em><
24c0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
24d0: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53  >Enable use of S
24e0: 53 4c 20 76 33 2e 20 28 3c 73 74 72 6f 6e 67 3e  SL v3. (<strong>
24f0: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e  default</strong>
2500: 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e  : <em>false</em>
2510: 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  )</dd>.        <
2520: 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31  dt>-<strong>tls1
2530: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
2540: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  ol</em></dt>.   
2550: 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20       <dd>Enable 
2560: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 20 28  use of TLS v1. (
2570: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
2580: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74 72  /strong>: <em>tr
2590: 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20  ue</em>)</dd>.  
25a0: 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f        <dt>-<stro
25b0: 6e 67 3e 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e  ng>tls1.1</stron
25c0: 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e  g> <em>bool</em>
25d0: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
25e0: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20  d>Enable use of 
25f0: 54 4c 53 20 76 31 2e 31 20 28 3c 73 74 72 6f 6e  TLS v1.1 (<stron
2600: 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e  g>default</stron
2610: 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d  g>: <em>true</em
2620: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  >)</dd>.        
2630: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73  <dt>-<strong>tls
2640: 31 2e 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  1.2</strong> <em
2650: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
2660: 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62          <dd>Enab
2670: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
2680: 2e 32 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61  .2 (<strong>defa
2690: 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65  ult</strong>: <e
26a0: 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64  m>true</em>)</dd
26b0: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c  >.    </dl>.</bl
26c0: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c 3e 0a  ockquote>..<dl>.
26d0: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
26e0: 22 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e  "tls::unimport">
26f0: 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74  <b>tls::unimport
2700: 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 3c   </b><i>channel<
2710: 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20  /i></a></dt>.   
2720: 20 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 66 6f   <dd>Provided fo
2730: 72 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 3c 73  r symmetry to <s
2740: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72  trong>tls::impor
2750: 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 69 73  t</strong>, this
2760: 0a 20 20 20 20 20 20 75 6e 73 74 61 63 6b 73 20  .      unstacks 
2770: 74 68 65 20 53 53 4c 2d 65 6e 61 62 6c 69 6e 67  the SSL-enabling
2780: 20 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54 63   of a regular Tc
2790: 6c 20 63 68 61 6e 6e 65 6c 2e 20 20 41 6e 20 65  l channel.  An e
27a0: 72 72 6f 72 0a 20 20 20 20 20 20 69 73 20 74 68  rror.      is th
27b0: 72 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 20 6e  rown if TLS is n
27c0: 6f 74 20 74 68 65 20 74 6f 70 20 73 74 61 63 6b  ot the top stack
27d0: 65 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 65 2e  ed channel type.
27e0: 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 64 6c  </dd>.</dl>..<dl
27f0: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  >.    <dt><a nam
2800: 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 73 20  e="tls::ciphers 
2810: 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73  protocol ?verbos
2820: 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  e?"><strong>tls:
2830: 3a 63 69 70 68 65 72 73 3c 2f 73 74 72 6f 6e 67  :ciphers</strong
2840: 3e 0a 20 20 20 20 20 20 20 20 3c 65 6d 3e 70 72  >.        <em>pr
2850: 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f  otocol ?verbose?
2860: 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20  </em></a></dt>. 
2870: 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 6c     <dd>Returns l
2880: 69 73 74 20 6f 66 20 73 75 70 70 6f 72 74 65 64  ist of supported
2890: 20 63 69 70 68 65 72 73 20 62 61 73 65 64 20 6f   ciphers based o
28a0: 6e 20 74 68 65 20 3c 65 6d 3e 70 72 6f 74 6f 63  n the <em>protoc
28b0: 6f 6c 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20  ol</em>.        
28c0: 79 6f 75 20 73 75 70 70 6c 79 2c 20 77 68 69 63  you supply, whic
28d0: 68 20 6d 75 73 74 20 62 65 20 6f 6e 65 20 6f 66  h must be one of
28e0: 20 3c 65 6d 3e 73 73 6c 32 2c 20 73 73 6c 33 2c   <em>ssl2, ssl3,
28f0: 20 6f 72 20 74 6c 73 31 3c 2f 65 6d 3e 2e 0a 20   or tls1</em>.. 
2900: 20 20 20 20 20 20 20 49 66 20 3c 65 6d 3e 76 65         If <em>ve
2910: 72 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 20 73 70  rbose</em> is sp
2920: 65 63 69 66 69 65 64 20 61 73 20 74 72 75 65 20  ecified as true 
2930: 74 68 65 6e 20 61 20 76 65 72 62 6f 73 65 2c 0a  then a verbose,.
2940: 20 20 20 20 20 20 20 20 73 65 6d 69 2d 68 75 6d          semi-hum
2950: 61 6e 20 72 65 61 64 61 62 6c 65 20 6c 69 73 74  an readable list
2960: 20 69 73 20 72 65 74 75 72 6e 65 64 20 70 72 6f   is returned pro
2970: 76 69 64 69 6e 67 20 61 64 64 69 74 69 6f 6e 61  viding additiona
2980: 6c 0a 20 20 20 20 20 20 20 20 69 6e 66 6f 72 6d  l.        inform
2990: 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 6e 61 74  ation on the nat
29a0: 75 72 65 20 6f 66 20 74 68 65 20 63 69 70 68 65  ure of the ciphe
29b0: 72 20 73 75 70 70 6f 72 74 2e 20 49 6e 20 65 61  r support. In ea
29c0: 63 68 0a 20 20 20 20 20 20 20 20 63 61 73 65 20  ch.        case 
29d0: 74 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 20  the result is a 
29e0: 54 63 6c 20 6c 69 73 74 2e 3c 2f 64 64 3e 0a 3c  Tcl list.</dd>.<
29f0: 2f 64 6c 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c  /dl>..<dl>.    <
2a00: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
2a10: 3a 76 65 72 73 69 6f 6e 22 3e 3c 73 74 72 6f 6e  :version"><stron
2a20: 67 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f  g>tls::version</
2a30: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e  strong></a></dt>
2a40: 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73  .    <dd>Returns
2a50: 20 74 68 65 20 76 65 72 73 69 6f 6e 20 73 74 72   the version str
2a60: 69 6e 67 20 64 65 66 69 6e 65 64 20 62 79 20 4f  ing defined by O
2a70: 70 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0a 3c 2f 64  penSSL.</dd>.</d
2a80: 6c 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d  l>..<h3><a name=
2a90: 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  "CALLBACK OPTION
2aa0: 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49  S">CALLBACK OPTI
2ab0: 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70  ONS</a></h3>..<p
2ac0: 3e 0a 41 73 20 69 6e 64 69 63 61 74 65 64 20 61  >.As indicated a
2ad0: 62 6f 76 65 2c 20 69 6e 64 69 76 69 64 75 61 6c  bove, individual
2ae0: 20 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20 62 65   channels can be
2af0: 20 67 69 76 65 6e 20 74 68 65 69 72 20 6f 77 6e   given their own
2b00: 20 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20 68 61   callbacks.to ha
2b10: 6e 64 6c 65 20 69 6e 74 65 72 6d 65 64 69 61 74  ndle intermediat
2b20: 65 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20  e processing by 
2b30: 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72  the OpenSSL libr
2b40: 61 72 79 2c 20 75 73 69 6e 67 20 74 68 65 0a 3c  ary, using the.<
2b50: 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e  em>-command</em>
2b60: 20 61 6e 64 20 3c 65 6d 3e 2d 70 61 73 73 77 6f   and <em>-passwo
2b70: 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 73 20  rd</em> options 
2b80: 70 61 73 73 65 64 20 74 6f 20 65 69 74 68 65 72  passed to either
2b90: 20 6f 66 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a   of.<strong>tls:
2ba0: 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e  :socket</strong>
2bb0: 20 6f 72 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a   or <strong>tls:
2bc0: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e  :import</strong>
2bd0: 2e 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75  ..</p>..<blockqu
2be0: 6f 74 65 3e 0a 3c 64 6c 3e 0a 0a 20 20 20 20 3c  ote>.<dl>..    <
2bf0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d  dt><strong>-comm
2c00: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  and</strong> <em
2c10: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f  >callback</em></
2c20: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e  dt>.    <dd>..In
2c30: 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 66  vokes the specif
2c40: 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b  ied <em>callback
2c50: 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 61 74 0a  </em> script at.
2c60: 09 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20  .several points 
2c70: 64 75 72 69 6e 67 20 74 68 65 20 4f 70 65 6e 53  during the OpenS
2c80: 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 0a 09 45  SL handshake...E
2c90: 78 63 65 70 74 20 61 73 20 69 6e 64 69 63 61 74  xcept as indicat
2ca0: 65 64 20 62 65 6c 6f 77 2c 20 76 61 6c 75 65 73  ed below, values
2cb0: 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 74   returned from t
2cc0: 68 65 0a 09 63 61 6c 6c 62 61 63 6b 20 61 72 65  he..callback are
2cd0: 20 69 67 6e 6f 72 65 64 2e 0a 09 41 72 67 75 6d   ignored...Argum
2ce0: 65 6e 74 73 20 61 70 70 65 6e 64 65 64 20 74 6f  ents appended to
2cf0: 20 74 68 65 20 73 63 72 69 70 74 20 75 70 6f 6e   the script upon
2d00: 20 63 61 6c 6c 62 61 63 6b 20 74 61 6b 65 20 6f   callback take o
2d10: 6e 65 20 6f 66 20 74 68 65 0a 09 66 6f 6c 6c 6f  ne of the..follo
2d20: 77 69 6e 67 20 66 6f 72 6d 73 3a 0a 0a 09 3c 62  wing forms:...<b
2d30: 72 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a  r>..<br>...<dl>.
2d40: 0a 3c 21 2d 2d 09 54 68 69 73 20 66 6f 72 6d 20  .<!--.This form 
2d50: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 64  of callback is d
2d60: 69 73 61 62 6c 65 64 2e 0a 0a 09 3c 64 74 3e 0a  isabled....<dt>.
2d70: 09 20 20 3c 73 74 72 6f 6e 67 3e 65 72 72 6f 72  .  <strong>error
2d80: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68  </strong> <em>ch
2d90: 61 6e 6e 65 6c 20 6d 65 73 73 61 67 65 3c 2f 65  annel message</e
2da0: 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a  m>..</dt>..<dd>.
2db0: 09 20 20 54 68 65 20 3c 65 6d 3e 6d 65 73 73 61  .  The <em>messa
2dc0: 67 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74  ge</em> argument
2dd0: 20 63 6f 6e 74 61 69 6e 73 20 61 6e 20 65 72 72   contains an err
2de0: 6f 72 20 6d 65 73 73 61 67 65 20 67 65 6e 65 72  or message gener
2df0: 61 74 65 64 0a 09 20 20 62 79 20 74 68 65 20 4f  ated..  by the O
2e00: 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a  penSSL function.
2e10: 09 20 20 3c 63 6f 64 65 3e 45 52 52 5f 72 65 61  .  <code>ERR_rea
2e20: 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 69 6e 67  son_error_string
2e30: 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 3c 2f 64 64  ()</code>...</dd
2e40: 3e 0a 0a 09 3c 62 72 3e 0a 2d 2d 3e 0a 0a 09 3c  >...<br>.-->...<
2e50: 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 69  dt>..  <strong>i
2e60: 6e 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  nfo</strong> <em
2e70: 3e 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f 72 20 6d  >channel major m
2e80: 69 6e 6f 72 20 6d 65 73 73 61 67 65 3c 2f 65 6d  inor message</em
2e90: 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09  >..</dt>..<dd>..
2ea0: 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63    This form of c
2eb0: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b  allback is invok
2ec0: 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53  ed by the OpenSS
2ed0: 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c 63  L function..  <c
2ee0: 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73 65 74 5f  ode>SSL_CTX_set_
2ef0: 69 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b 28 29 3c  info_callback()<
2f00: 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a  /code>...  <br>.
2f10: 09 20 20 54 68 65 20 3c 65 6d 3e 6d 61 6a 6f 72  .  The <em>major
2f20: 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e 6d 69  </em> and <em>mi
2f30: 6e 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e  nor</em> argumen
2f40: 74 73 20 61 72 65 20 75 73 65 64 20 74 6f 0a 09  ts are used to..
2f50: 20 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20    represent the 
2f60: 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f  state informatio
2f70: 6e 20 62 69 74 6d 61 73 6b 2e 0a 09 20 20 3c 64  n bitmask...  <d
2f80: 6c 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 69 62  l>..  <dt>Possib
2f90: 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65  le values for <e
2fa0: 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65  m>major</em> are
2fb0: 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e 3c 63  :</dt>..  <dd><c
2fc0: 6f 64 65 3e 68 61 6e 64 73 68 61 6b 65 2c 20 61  ode>handshake, a
2fd0: 6c 65 72 74 2c 20 63 6f 6e 6e 65 63 74 2c 20 61  lert, connect, a
2fe0: 63 63 65 70 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64  ccept</code>.</d
2ff0: 64 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 69 62  d>..  <dt>Possib
3000: 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65  le values for <e
3010: 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 72 65  m>minor</em> are
3020: 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e 3c 63  :</dt>..  <dd><c
3030: 6f 64 65 3e 73 74 61 72 74 2c 20 64 6f 6e 65 2c  ode>start, done,
3040: 20 72 65 61 64 2c 20 77 72 69 74 65 2c 20 6c 6f   read, write, lo
3050: 6f 70 2c 20 65 78 69 74 3c 2f 63 6f 64 65 3e 2e  op, exit</code>.
3060: 3c 2f 64 64 3e 0a 09 20 20 3c 2f 64 6c 3e 0a 09  </dd>..  </dl>..
3070: 20 20 54 68 65 20 3c 65 6d 3e 6d 65 73 73 61 67    The <em>messag
3080: 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20  e</em> argument 
3090: 69 73 20 61 20 64 65 73 63 72 69 70 74 69 76 65  is a descriptive
30a0: 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61   string which ma
30b0: 79 0a 09 20 20 62 65 20 67 65 6e 65 72 61 74 65  y..  be generate
30c0: 64 20 65 69 74 68 65 72 20 62 79 0a 09 20 20 3c  d either by..  <
30d0: 63 6f 64 65 3e 53 53 4c 5f 73 74 61 74 65 5f 73  code>SSL_state_s
30e0: 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f  tring_long()</co
30f0: 64 65 3e 20 6f 72 20 62 79 0a 09 20 20 3c 63 6f  de> or by..  <co
3100: 64 65 3e 53 53 4c 5f 61 6c 65 72 74 5f 64 65 73  de>SSL_alert_des
3110: 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c  c_string_long()<
3120: 2f 63 6f 64 65 3e 2c 0a 09 20 20 64 65 70 65 6e  /code>,..  depen
3130: 64 69 6e 67 20 6f 6e 20 63 6f 6e 74 65 78 74 2e  ding on context.
3140: 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a  ..</dd>...<br>..
3150: 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67  .<dt>..  <strong
3160: 3e 76 65 72 69 66 79 3c 2f 73 74 72 6f 6e 67 3e  >verify</strong>
3170: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 64 65 70   <em>channel dep
3180: 74 68 20 63 65 72 74 20 73 74 61 74 75 73 20 65  th cert status e
3190: 72 72 6f 72 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e  rror</em>..</dt>
31a0: 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 73 20 66  ..<dd>..  This f
31b0: 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20  orm of callback 
31c0: 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68  is invoked by th
31d0: 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69  e OpenSSL functi
31e0: 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f  on..  <code>SSL_
31f0: 73 65 74 5f 76 65 72 69 66 79 28 29 3c 2f 63 6f  set_verify()</co
3200: 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20  de>...  <br>..  
3210: 54 68 65 20 3c 65 6d 3e 64 65 70 74 68 3c 2f 65  The <em>depth</e
3220: 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61  m> argument is a
3230: 6e 20 69 6e 74 65 67 65 72 20 72 65 70 72 65 73  n integer repres
3240: 65 6e 74 69 6e 67 20 74 68 65 0a 09 20 20 63 75  enting the..  cu
3250: 72 72 65 6e 74 20 64 65 70 74 68 20 6f 6e 20 74  rrent depth on t
3260: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 63  he certificate c
3270: 68 61 69 6e 2c 20 77 69 74 68 0a 09 20 20 3c 63  hain, with..  <c
3280: 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 61 73 20  ode>0</code> as 
3290: 74 68 65 20 73 75 62 6a 65 63 74 20 63 65 72 74  the subject cert
32a0: 69 66 69 63 61 74 65 20 61 6e 64 20 68 69 67 68  ificate and high
32b0: 65 72 20 76 61 6c 75 65 73 0a 09 20 20 64 65 6e  er values..  den
32c0: 6f 74 69 6e 67 20 70 72 6f 67 72 65 73 73 69 76  oting progressiv
32d0: 65 6c 79 20 6d 6f 72 65 20 69 6e 64 69 72 65 63  ely more indirec
32e0: 74 20 69 73 73 75 65 72 20 63 65 72 74 69 66 69  t issuer certifi
32f0: 63 61 74 65 73 2e 0a 09 20 20 3c 62 72 3e 0a 09  cates...  <br>..
3300: 20 20 54 68 65 20 3c 65 6d 3e 63 65 72 74 3c 2f    The <em>cert</
3310: 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20  em> argument is 
3320: 61 20 6c 69 73 74 20 6f 66 20 6b 65 79 2d 76 61  a list of key-va
3330: 6c 75 65 20 70 61 69 72 73 20 73 69 6d 69 6c 61  lue pairs simila
3340: 72 0a 09 20 20 74 6f 20 74 68 6f 73 65 20 72 65  r..  to those re
3350: 74 75 72 6e 65 64 20 62 79 0a 09 20 20 3c 61 20  turned by..  <a 
3360: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61 74  href="#tls::stat
3370: 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  us"><strong>tls:
3380: 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e  :status</strong>
3390: 3c 2f 61 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20  </a>...  <br>.. 
33a0: 20 54 68 65 20 3c 65 6d 3e 73 74 61 74 75 73 3c   The <em>status<
33b0: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73  /em> argument is
33c0: 20 61 6e 20 69 6e 74 65 67 65 72 20 72 65 70 72   an integer repr
33d0: 65 73 65 6e 74 69 6e 67 20 74 68 65 0a 09 20 20  esenting the..  
33e0: 63 75 72 72 65 6e 74 20 76 61 6c 69 64 69 74 79  current validity
33f0: 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63   of the certific
3400: 61 74 65 2e 0a 09 20 20 41 20 76 61 6c 75 65 20  ate...  A value 
3410: 6f 66 20 3c 63 6f 64 65 3e 30 3c 2f 63 6f 64 65  of <code>0</code
3420: 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65 72 74  > means the cert
3430: 69 66 69 63 61 74 65 20 69 73 20 64 65 65 6d 65  ificate is deeme
3440: 64 20 69 6e 76 61 6c 69 64 2e 0a 09 20 20 41 20  d invalid...  A 
3450: 76 61 6c 75 65 20 6f 66 20 3c 63 6f 64 65 3e 31  value of <code>1
3460: 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e 73 20 74 68  </code> means th
3470: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69 73  e certificate is
3480: 20 64 65 65 6d 65 64 20 76 61 6c 69 64 2e 0a 09   deemed valid...
3490: 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65    <br>..  The <e
34a0: 6d 3e 65 72 72 6f 72 3c 2f 65 6d 3e 20 61 72 67  m>error</em> arg
34b0: 75 6d 65 6e 74 20 73 75 70 70 6c 69 65 73 20 74  ument supplies t
34c0: 68 65 20 6d 65 73 73 61 67 65 2c 20 69 66 20 61  he message, if a
34d0: 6e 79 2c 20 67 65 6e 65 72 61 74 65 64 0a 09 20  ny, generated.. 
34e0: 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e 58 35 30   by..  <code>X50
34f0: 39 5f 53 54 4f 52 45 5f 43 54 58 5f 67 65 74 5f  9_STORE_CTX_get_
3500: 65 72 72 6f 72 28 29 3c 2f 63 6f 64 65 3e 2e 0a  error()</code>..
3510: 09 20 20 3c 62 72 3e 0a 09 20 20 3c 62 72 3e 0a  .  <br>..  <br>.
3520: 09 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20  .  The callback 
3530: 6d 61 79 20 6f 76 65 72 72 69 64 65 20 6e 6f 72  may override nor
3540: 6d 61 6c 20 76 61 6c 69 64 61 74 69 6f 6e 20 70  mal validation p
3550: 72 6f 63 65 73 73 69 6e 67 20 62 79 20 65 78 70  rocessing by exp
3560: 6c 69 63 69 74 6c 79 0a 09 20 20 72 65 74 75 72  licitly..  retur
3570: 6e 69 6e 67 20 6f 6e 65 20 6f 66 20 74 68 65 20  ning one of the 
3580: 61 62 6f 76 65 20 3c 65 6d 3e 73 74 61 74 75 73  above <em>status
3590: 3c 2f 65 6d 3e 20 76 61 6c 75 65 73 2e 0a 09 3c  </em> values...<
35a0: 2f 64 64 3e 0a 0a 09 3c 2f 64 6c 3e 0a 20 20 20  /dd>...</dl>.   
35b0: 20 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 62 72 3e   </dd>..    <br>
35c0: 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e  ..    <dt><stron
35d0: 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72  g>-password</str
35e0: 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63  ong> <em>callbac
35f0: 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  k</em></dt>.    
3600: 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68  <dd>..Invokes th
3610: 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e  e specified <em>
3620: 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63  callback</em> sc
3630: 72 69 70 74 20 77 68 65 6e 20 4f 70 65 6e 53 53  ript when OpenSS
3640: 4c 20 6e 65 65 64 73 20 74 6f 0a 09 6f 62 74 61  L needs to..obta
3650: 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2e 20 20  in a password.  
3660: 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f  The callback sho
3670: 75 6c 64 20 72 65 74 75 72 6e 20 61 20 73 74 72  uld return a str
3680: 69 6e 67 20 77 68 69 63 68 0a 09 72 65 70 72 65  ing which..repre
3690: 73 65 6e 74 73 20 74 68 65 20 70 61 73 73 77 6f  sents the passwo
36a0: 72 64 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 09  rd to be used...
36b0: 4e 6f 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65  No arguments are
36c0: 20 61 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65   appended to the
36d0: 20 73 63 72 69 70 74 20 75 70 6f 6e 20 63 61 6c   script upon cal
36e0: 6c 62 61 63 6b 2e 0a 20 20 20 20 3c 2f 64 64 3e  lback..    </dd>
36f0: 0a 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75  .</dl>.</blockqu
3700: 6f 74 65 3e 0a 0a 3c 70 3e 0a 52 65 66 65 72 65  ote>..<p>.Refere
3710: 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69  nce implementati
3720: 6f 6e 73 20 6f 66 20 74 68 65 73 65 20 63 61 6c  ons of these cal
3730: 6c 62 61 63 6b 73 20 61 72 65 20 70 72 6f 76 69  lbacks are provi
3740: 64 65 64 20 69 6e 20 74 68 65 0a 64 69 73 74 72  ded in the.distr
3750: 69 62 75 74 69 6f 6e 20 61 73 20 3c 73 74 72 6f  ibution as <stro
3760: 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b  ng>tls::callback
3770: 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 0a 3c 73  </strong> and.<s
3780: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77  trong>tls::passw
3790: 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 72 65 73  ord</strong> res
37a0: 70 65 63 74 69 76 65 6c 79 2e 20 20 4e 6f 74 65  pectively.  Note
37b0: 20 74 68 61 74 20 74 68 65 73 65 20 61 72 65 0a   that these are.
37c0: 3c 65 6d 3e 73 61 6d 70 6c 65 3c 2f 65 6d 3e 20  <em>sample</em> 
37d0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20  implementations 
37e0: 6f 6e 6c 79 2e 20 20 49 6e 20 61 20 6d 6f 72 65  only.  In a more
37f0: 20 72 65 61 6c 69 73 74 69 63 20 64 65 70 6c 6f   realistic deplo
3800: 79 6d 65 6e 74 0a 79 6f 75 20 77 6f 75 6c 64 20  yment.you would 
3810: 73 70 65 63 69 66 79 20 79 6f 75 72 20 6f 77 6e  specify your own
3820: 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74   callback script
3830: 73 20 6f 6e 20 65 61 63 68 20 54 4c 53 20 63 68  s on each TLS ch
3840: 61 6e 6e 65 6c 0a 75 73 69 6e 67 20 74 68 65 20  annel.using the 
3850: 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d  <em>-command</em
3860: 3e 20 61 6e 64 20 3c 65 6d 3e 2d 70 61 73 73 77  > and <em>-passw
3870: 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 73  ord</em> options
3880: 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20  ..</p>..<p>.The 
3890: 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72  default behavior
38a0: 20 77 68 65 6e 20 74 68 65 20 3c 65 6d 3e 2d 63   when the <em>-c
38b0: 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 6f 70 74 69  ommand</em> opti
38c0: 6f 6e 20 69 73 20 6e 6f 74 20 73 70 65 63 69 66  on is not specif
38d0: 69 65 64 20 69 73 20 66 6f 72 0a 54 4c 53 20 74  ied is for.TLS t
38e0: 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 61 73  o process the as
38f0: 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 72 79  sociated library
3900: 20 63 61 6c 6c 62 61 63 6b 73 20 69 6e 74 65 72   callbacks inter
3910: 6e 61 6c 6c 79 2e 0a 54 68 65 20 64 65 66 61 75  nally..The defau
3920: 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e  lt behavior when
3930: 20 74 68 65 20 3c 65 6d 3e 2d 70 61 73 73 77 6f   the <em>-passwo
3940: 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20 69  rd</em> option i
3950: 73 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20  s not specified 
3960: 69 73 20 66 6f 72 0a 54 4c 53 20 74 6f 20 70 72  is for.TLS to pr
3970: 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f 63 69  ocess the associ
3980: 61 74 65 64 20 6c 69 62 72 61 72 79 20 63 61 6c  ated library cal
3990: 6c 62 61 63 6b 73 20 62 79 20 61 74 74 65 6d 70  lbacks by attemp
39a0: 74 69 6e 67 20 74 6f 20 63 61 6c 6c 0a 3c 73 74  ting to call.<st
39b0: 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f  rong>tls::passwo
39c0: 72 64 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 54 68 65  rd</strong>..The
39d0: 20 64 69 66 66 65 72 65 6e 63 65 20 62 65 74 77   difference betw
39e0: 65 65 6e 20 74 68 65 73 65 20 74 77 6f 20 62 65  een these two be
39f0: 68 61 76 69 6f 72 73 20 69 73 20 61 20 63 6f 6e  haviors is a con
3a00: 73 65 71 75 65 6e 63 65 20 6f 66 20 6d 61 69 6e  sequence of main
3a10: 74 61 69 6e 69 6e 67 0a 63 6f 6d 70 61 74 69 62  taining.compatib
3a20: 69 6c 69 74 79 20 77 69 74 68 20 65 61 72 6c 69  ility with earli
3a30: 65 72 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  er implementatio
3a40: 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68  ns..</p>..<p>.Th
3a50: 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64  e <strong>tls::d
3a60: 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20 76 61  ebug</strong> va
3a70: 72 69 61 62 6c 65 20 70 72 6f 76 69 64 65 73 20  riable provides 
3a80: 73 6f 6d 65 20 61 64 64 69 74 69 6f 6e 61 6c 0a  some additional.
3a90: 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20 74 68 65  control over the
3aa0: 73 65 20 72 65 66 65 72 65 6e 63 65 20 63 61 6c  se reference cal
3ab0: 6c 62 61 63 6b 73 2e 20 20 49 74 73 20 76 61 6c  lbacks.  Its val
3ac0: 75 65 20 69 73 20 7a 65 72 6f 20 62 79 20 64 65  ue is zero by de
3ad0: 66 61 75 6c 74 2e 0a 48 69 67 68 65 72 20 76 61  fault..Higher va
3ae0: 6c 75 65 73 20 70 72 6f 64 75 63 65 20 6d 6f 72  lues produce mor
3af0: 65 20 64 69 61 67 6e 6f 73 74 69 63 20 6f 75 74  e diagnostic out
3b00: 70 75 74 2c 20 61 6e 64 20 77 69 6c 6c 20 61 6c  put, and will al
3b10: 73 6f 20 66 6f 72 63 65 20 74 68 65 0a 76 65 72  so force the.ver
3b20: 69 66 79 20 6d 65 74 68 6f 64 20 69 6e 20 3c 73  ify method in <s
3b30: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62  trong>tls::callb
3b40: 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 74 6f 20  ack</strong> to 
3b50: 61 63 63 65 70 74 20 74 68 65 0a 63 65 72 74 69  accept the.certi
3b60: 66 69 63 61 74 65 2c 20 65 76 65 6e 20 77 68 65  ficate, even whe
3b70: 6e 20 69 74 20 69 73 20 69 6e 76 61 6c 69 64 2e  n it is invalid.
3b80: 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a  .</p>..<p>.<em>.
3b90: 54 68 65 20 75 73 65 20 6f 66 20 74 68 65 20 72  The use of the r
3ba0: 65 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63  eference callbac
3bb0: 6b 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  ks <strong>tls::
3bc0: 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67  callback</strong
3bd0: 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e 74 6c  > and.<strong>tl
3be0: 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 72  s::password</str
3bf0: 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72 65 63 6f  ong> is not reco
3c00: 6d 6d 65 6e 64 65 64 2e 20 20 54 68 65 79 20 6d  mmended.  They m
3c10: 61 79 20 62 65 20 72 65 6d 6f 76 65 64 0a 66 72  ay be removed.fr
3c20: 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 73  om future releas
3c30: 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a  es..</em>.</p>..
3c40: 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 65  <p>.<em>.The use
3c50: 20 6f 66 20 74 68 65 20 76 61 72 69 61 62 6c 65   of the variable
3c60: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65   <strong>tls::de
3c70: 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20 69 73 20  bug</strong> is 
3c80: 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e  not recommended.
3c90: 0a 49 74 20 6d 61 79 20 62 65 20 72 65 6d 6f 76  .It may be remov
3ca0: 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 20 72  ed from future r
3cb0: 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c  eleases..</em>.<
3cc0: 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65  /p>..<h3><a name
3cd0: 3d 22 48 54 54 50 53 20 45 58 41 4d 50 4c 45 22  ="HTTPS EXAMPLE"
3ce0: 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f  >HTTPS EXAMPLE</
3cf0: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73  a></h3>..<p>This
3d00: 20 65 78 61 6d 70 6c 65 20 75 73 65 73 20 61 20   example uses a 
3d10: 73 61 6d 70 6c 65 20 73 65 72 76 65 72 2e 70 65  sample server.pe
3d20: 6d 20 70 72 6f 76 69 64 65 64 20 77 69 74 68 20  m provided with 
3d30: 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73 65 2c  the TLS release,
3d40: 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74 68 65  .courtesy of the
3d50: 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c   <strong>OpenSSL
3d60: 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a 65 63  </strong> projec
3d70: 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 3c 63 6f  t.</p>..<pre><co
3d80: 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71 75  de>.package requ
3d90: 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67 65  ire http.package
3da0: 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 68 74   require tls..ht
3db0: 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 74 74  tp::register htt
3dc0: 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74  ps 443 [list ::t
3dd0: 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 72 65 71 75  ls::socket -requ
3de0: 69 72 65 20 31 20 2d 63 61 66 69 6c 65 20 2e 2f  ire 1 -cafile ./
3df0: 73 65 72 76 65 72 2e 70 65 6d 5d 0a 0a 73 65 74  server.pem]..set
3e00: 20 74 6f 6b 20 5b 68 74 74 70 3a 3a 67 65 74 75   tok [http::getu
3e10: 72 6c 20 68 74 74 70 73 3a 2f 2f 64 65 76 65 6c  rl https://devel
3e20: 6f 70 65 72 2e 6e 65 74 73 63 61 70 65 2e 63 6f  oper.netscape.co
3e30: 6d 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65  m/].</code></pre
3e40: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  >..<h3><a name="
3e50: 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52  SPECIAL CONSIDER
3e60: 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c 20  ATIONS">SPECIAL 
3e70: 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f  CONSIDERATIONS</
3e80: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 20  a></h3>..<p>The 
3e90: 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20  capabilities of 
3ea0: 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e  this package can
3eb0: 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79   vary enormously
3ec0: 20 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77 20   based.upon how 
3ed0: 79 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62  your OpenSSL lib
3ee0: 72 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75  rary was configu
3ef0: 72 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41  red and built. A
3f00: 74 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72 6f  t the.most macro
3f10: 2d 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73  -level OpenSSL s
3f20: 75 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b  upports a &quot;
3f30: 6e 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b  no patents&quot;
3f40: 20 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64 69   build,.which di
3f50: 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41  sables RSA, IDEA
3f60: 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20  , RC(2,4,5) and 
3f70: 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f  SSL2 - if your O
3f80: 70 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69 67  penSSL is.config
3f90: 75 72 65 64 20 74 68 69 73 20 77 61 79 20 74 68  ured this way th
3fa0: 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64  en you will need
3fb0: 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77 69   to build TLS wi
3fc0: 74 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54 45  th the.-DNO_PATE
3fd0: 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e 64  NTS option - and
3fe0: 20 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20 6d   the resultant m
3ff0: 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63 74  odule will funct
4000: 69 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61 6e  ion.correctly an
4010: 64 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20 41  d also support A
4020: 44 48 20 63 65 72 74 69 66 69 63 61 74 65 2d 6c  DH certificate-l
4030: 65 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c 0a  ess encryption,.
4040: 68 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c 6c  however you will
4050: 20 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75 74   be unable to ut
4060: 69 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73 70  ilize this to sp
4070: 65 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57 65  eak to normal We
4080: 62 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63 68  b.Servers, which
4090: 20 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75 69   typically requi
40a0: 72 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e 20  re RSA support. 
40b0: 50 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68 72  Please see <a.hr
40c0: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f  ef="http://www.o
40d0: 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74 74  penssl.org/">htt
40e0: 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e  p://www.openssl.
40f0: 6f 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f 72  org/</a> for.mor
4100: 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e  e information on
4110: 20 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75 65   the whole issue
4120: 20 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64 20   of patents and 
4130: 55 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72 69  US export.restri
4140: 63 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c 68  ctions. </p>..<h
4150: 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20 41  3><a name="SEE A
4160: 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61  LSO">SEE ALSO</a
4170: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f  ></h3>..<p><stro
4180: 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e  ng>socket</stron
4190: 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65  g>, <strong>file
41a0: 65 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e  event, </strong>
41b0: 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f  <a.href="http://
41c0: 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f  www.openssl.org/
41d0: 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53  "><strong>OpenSS
41e0: 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f  L</strong></a></
41f0: 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e 0a  p>..<hr>..<pre>.
4200: 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b  Copyright &copy;
4210: 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61   1999 Matt Newma
4220: 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f  n..Copyright &co
4230: 70 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 73  py; 2004 Starfis
4240: 68 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72 65  h Systems..</pre
4250: 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c  >.</body>.</html
4260: 3e 0a                                            >.