Hex Artifact Content

Artifact 2335b9e31579828677e7de3998c3e357e77e347c21f78d609c7ee4f25b0b87ff:


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 20 77 69 74 68 20 6f 6e   options with on
1080: 65 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74  e additional opt
1090: 69 6f 6e 3a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65  ion:.<blockquote
10a0: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20  >.    <dl>.     
10b0: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d     <dt><strong>-
10c0: 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 3c 2f  autoservername</
10d0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c  strong> <em>bool
10e0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
10f0: 20 20 20 3c 64 64 3e 41 75 74 6f 6d 61 74 69 63     <dd>Automatic
1100: 61 6c 6c 79 20 73 65 6e 64 20 74 68 65 20 2d 73  ally send the -s
1110: 65 72 76 65 72 6e 61 6d 65 20 61 73 20 74 68 65  ervername as the
1120: 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 20 61   <em>host</em> a
1130: 72 67 75 6d 65 6e 74 0a 20 20 20 20 20 20 20 20  rgument.        
1140: 20 20 20 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66      (<strong>def
1150: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
1160: 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f  em>false</em>)</
1170: 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f  dd>.    </dl>.</
1180: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20  blockquote>.    
1190: 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a  <dt>&nbsp;</dt>.
11a0: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
11b0: 22 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22  "tls::handshake"
11c0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61  ><strong>tls::ha
11d0: 6e 64 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e  ndshake</strong>
11e0: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d   <em>channel</em
11f0: 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c  ></a></dt>.    <
1200: 64 64 3e 46 6f 72 63 65 73 20 68 61 6e 64 73 68  dd>Forces handsh
1210: 61 6b 65 20 74 6f 20 74 61 6b 65 20 70 6c 61 63  ake to take plac
1220: 65 2c 20 61 6e 64 20 72 65 74 75 72 6e 73 20 30  e, and returns 0
1230: 20 69 66 0a 20 20 20 20 20 20 20 20 68 61 6e 64   if.        hand
1240: 73 68 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69  shake is still i
1250: 6e 20 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d  n progress (non-
1260: 62 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20  blocking), or 1 
1270: 69 66 0a 20 20 20 20 20 20 20 20 74 68 65 20 68  if.        the h
1280: 61 6e 64 73 68 61 6b 65 20 77 61 73 20 73 75 63  andshake was suc
1290: 63 65 73 73 66 75 6c 2e 20 49 66 20 74 68 65 20  cessful. If the 
12a0: 68 61 6e 64 73 68 61 6b 65 20 66 61 69 6c 65 64  handshake failed
12b0: 0a 20 20 20 20 20 20 20 20 74 68 69 73 20 72 6f  .        this ro
12c0: 75 74 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f 77  utine will throw
12d0: 20 61 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a   an error.</dd>.
12e0: 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f      <dt>&nbsp;</
12f0: 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e  dt>.    <dt><a n
1300: 61 6d 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73  ame="tls::status
1310: 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73  "><strong>tls::s
1320: 74 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20  tatus</strong>. 
1330: 20 20 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20     <em>?-local? 
1340: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e  channel</em></a>
1350: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65  </dt>.    <dd>Re
1360: 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e  turns the curren
1370: 74 20 73 65 63 75 72 69 74 79 20 73 74 61 74 75  t security statu
1380: 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e  s of an SSL chan
1390: 6e 65 6c 2e 20 54 68 65 0a 20 20 20 20 20 20 20  nel. The.       
13a0: 20 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69 73   result is a lis
13b0: 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70  t of key-value p
13c0: 61 69 72 73 20 64 65 73 63 72 69 62 69 6e 67 20  airs describing 
13d0: 74 68 65 0a 20 20 20 20 20 20 20 20 63 6f 6e 6e  the.        conn
13e0: 65 63 74 65 64 20 70 65 65 72 2e 20 49 66 20 74  ected peer. If t
13f0: 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 6e 20  he result is an 
1400: 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65 6e 20  empty list then 
1410: 74 68 65 0a 20 20 20 20 20 20 20 20 53 53 4c 20  the.        SSL 
1420: 68 61 6e 64 73 68 61 6b 65 20 68 61 73 20 6e 6f  handshake has no
1430: 74 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 64 2e  t yet completed.
1440: 0a 20 20 20 20 20 20 20 20 49 66 20 3c 65 6d 3e  .        If <em>
1450: 2d 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 20 67  -local</em> is g
1460: 69 76 65 6e 2c 20 74 68 65 6e 20 74 68 65 20 63  iven, then the c
1470: 65 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f 72  ertificate infor
1480: 6d 61 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 69  mation.        i
1490: 73 20 74 68 65 20 6f 6e 65 20 75 73 65 64 20 6c  s the one used l
14a0: 6f 63 61 6c 6c 79 2e 3c 2f 64 64 3e 0a 3c 2f 64  ocally.</dd>.</d
14b0: 6c 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  l>..<blockquote>
14c0: 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20  .    <dl>.      
14d0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73    <dt><strong>is
14e0: 73 75 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  suer</strong> <e
14f0: 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  m>dn</em></dt>. 
1500: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 64         <dd>The d
1510: 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d  istinguished nam
1520: 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65  e (DN) of the ce
1530: 72 74 69 66 69 63 61 74 65 0a 20 20 20 20 20 20  rtificate.      
1540: 20 20 20 20 20 20 69 73 73 75 65 72 2e 3c 2f 64        issuer.</d
1550: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1560: 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f  strong>subject</
1570: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f  strong> <em>dn</
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 64 69 73 74 69 6e 67   <dd>The disting
15a0: 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 4e 29  uished name (DN)
15b0: 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63   of the certific
15c0: 61 74 65 0a 20 20 20 20 20 20 20 20 20 20 20 20  ate.            
15d0: 73 75 62 6a 65 63 74 2e 3c 2f 64 64 3e 0a 20 20  subject.</dd>.  
15e0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
15f0: 67 3e 6e 6f 74 42 65 66 6f 72 65 3c 2f 73 74 72  g>notBefore</str
1600: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65  ong> <em>date</e
1610: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
1620: 3c 64 64 3e 54 68 65 20 62 65 67 69 6e 20 64 61  <dd>The begin da
1630: 74 65 20 66 6f 72 20 74 68 65 20 76 61 6c 69 64  te for the valid
1640: 69 74 79 20 6f 66 20 74 68 65 20 63 65 72 74 69  ity of the certi
1650: 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20  ficate.</dd>.   
1660: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
1670: 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72 6f 6e  >notAfter</stron
1680: 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e  g> <em>date</em>
1690: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
16a0: 64 3e 54 68 65 20 65 78 70 69 72 79 20 64 61 74  d>The expiry dat
16b0: 65 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 66  e for the certif
16c0: 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20  icate.</dd>.    
16d0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
16e0: 73 65 72 69 61 6c 3c 2f 73 74 72 6f 6e 67 3e 20  serial</strong> 
16f0: 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  <em>n</em></dt>.
1700: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
1710: 73 65 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66  serial number of
1720: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
1730: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
1740: 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65  dt><strong>ciphe
1750: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63  r</strong> <em>c
1760: 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  ipher</em></dt>.
1770: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20          <dd>The 
1780: 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69  current cipher i
1790: 6e 20 75 73 65 20 62 65 74 77 65 65 6e 20 74 68  n use between th
17a0: 65 20 63 6c 69 65 6e 74 20 61 6e 64 0a 20 20 20  e client and.   
17b0: 20 20 20 20 20 20 20 20 20 73 65 72 76 65 72 20           server 
17c0: 63 68 61 6e 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 20  channels.</dd>. 
17d0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
17e0: 6e 67 3e 73 62 69 74 73 3c 2f 73 74 72 6f 6e 67  ng>sbits</strong
17f0: 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74  > <em>n</em></dt
1800: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  >.        <dd>Th
1810: 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 69 74 73  e number of bits
1820: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 73 65   used for the se
1830: 73 73 69 6f 6e 20 6b 65 79 2e 3c 2f 64 64 3e 0a  ssion key.</dd>.
1840: 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63      </dl>.</bloc
1850: 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c 3e 0a 20 20  kquote>..<dl>.  
1860: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74    <dt><a name="t
1870: 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74  ls::import"><b>t
1880: 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c  ls::import </b><
1890: 69 3e 63 68 61 6e 6e 65 6c 0a 20 20 20 20 20 20  i>channel.      
18a0: 20 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c    ?options?</i><
18b0: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
18c0: 3e 53 53 4c 2d 65 6e 61 62 6c 65 20 61 20 72 65  >SSL-enable a re
18d0: 67 75 6c 61 72 20 54 63 6c 20 63 68 61 6e 6e 65  gular Tcl channe
18e0: 6c 20 2d 20 69 74 20 6e 65 65 64 20 6e 6f 74 20  l - it need not 
18f0: 62 65 20 61 0a 20 20 20 20 20 20 20 20 73 6f 63  be a.        soc
1900: 6b 65 74 2c 20 62 75 74 20 6d 75 73 74 20 70 72  ket, but must pr
1910: 6f 76 69 64 65 20 62 69 2d 64 69 72 65 63 74 69  ovide bi-directi
1920: 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41 6c 73 6f 0a  onal flow. Also.
1930: 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 20          setting 
1940: 73 65 73 73 69 6f 6e 20 70 61 72 61 6d 65 74 65  session paramete
1950: 72 73 20 66 6f 72 20 53 53 4c 20 68 61 6e 64 73  rs for SSL hands
1960: 68 61 6b 65 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e  hake.</dd>.</dl>
1970: 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20  ..<blockquote>. 
1980: 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20     <dl>.        
1990: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 64  <dt><strong>-cad
19a0: 69 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ir</strong> <em>
19b0: 64 69 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  dir</em></dt>.  
19c0: 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64        <dd>Provid
19d0: 65 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20  e the directory 
19e0: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 43  containing the C
19f0: 41 20 63 65 72 74 69 66 69 63 61 74 65 73 2e 3c  A certificates.<
1a00: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
1a10: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65  ><strong>-cafile
1a20: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69   </strong><em>fi
1a30: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e  lename</em></dt>
1a40: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f  .        <dd>Pro
1a50: 76 69 64 65 20 74 68 65 20 43 41 20 66 69 6c 65  vide the CA file
1a60: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
1a70: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74  dt><strong>-cert
1a80: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  file</strong> <e
1a90: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c  m>filename</em><
1aa0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
1ab0: 3e 50 72 6f 76 69 64 65 20 74 68 65 20 63 65 72  >Provide the cer
1ac0: 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 2e  tificate to use.
1ad0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
1ae0: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65  t><strong>-ciphe
1af0: 72 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 73  r </strong><em>s
1b00: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  tring</em></dt>.
1b10: 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76          <dd>Prov
1b20: 69 64 65 20 74 68 65 20 63 69 70 68 65 72 20 73  ide the cipher s
1b30: 75 69 74 65 73 20 74 6f 20 75 73 65 2e 20 53 79  uites to use. Sy
1b40: 6e 74 61 78 20 69 73 20 61 73 20 70 65 72 0a 20  ntax is as per. 
1b50: 20 20 20 20 20 20 20 20 20 20 20 4f 70 65 6e 53             OpenS
1b60: 53 4c 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  SL.</dd>.       
1b70: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f   <dt><strong>-co
1b80: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c  mmand</strong> <
1b90: 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e  em>callback</em>
1ba0: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dt>.        <d
1bb0: 64 3e 49 66 20 73 70 65 63 69 66 69 65 64 2c 20  d>If specified, 
1bc0: 74 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 77 69  this callback wi
1bd0: 6c 6c 20 62 65 20 69 6e 76 6f 6b 65 64 20 61 74  ll be invoked at
1be0: 20 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 0a   several points.
1bf0: 20 20 20 20 20 20 20 20 20 20 20 20 64 75 72 69              duri
1c00: 6e 67 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68  ng the OpenSSL h
1c10: 61 6e 64 73 68 61 6b 65 2e 20 20 49 74 20 63 61  andshake.  It ca
1c20: 6e 20 70 61 73 73 20 65 72 72 6f 72 73 20 61 6e  n pass errors an
1c30: 64 20 74 72 61 63 69 6e 67 0a 20 20 20 20 20 20  d tracing.      
1c40: 20 20 20 20 20 20 69 6e 66 6f 72 6d 61 74 69 6f        informatio
1c50: 6e 2c 20 61 6e 64 20 69 74 20 63 61 6e 20 61 6c  n, and it can al
1c60: 6c 6f 77 20 54 63 6c 20 73 63 72 69 70 74 73 20  low Tcl scripts 
1c70: 74 6f 20 70 65 72 66 6f 72 6d 0a 20 20 20 20 20  to perform.     
1c80: 20 20 20 20 20 20 20 74 68 65 69 72 20 6f 77 6e         their own
1c90: 20 76 61 6c 69 64 61 74 69 6f 6e 20 6f 66 20 74   validation of t
1ca0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69  he certificate i
1cb0: 6e 20 70 6c 61 63 65 20 6f 66 20 74 68 65 0a 20  n place of the. 
1cc0: 20 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75             defau
1cd0: 6c 74 20 76 61 6c 69 64 61 74 69 6f 6e 20 70 72  lt validation pr
1ce0: 6f 76 69 64 65 64 20 62 79 20 4f 70 65 6e 53 53  ovided by OpenSS
1cf0: 4c 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  L..            <
1d00: 62 72 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  br>.            
1d10: 53 65 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41  See <a href="#CA
1d20: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e  LLBACK OPTIONS">
1d30: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53  CALLBACK OPTIONS
1d40: 3c 2f 61 3e 20 66 6f 72 0a 20 20 20 20 20 20 20  </a> for.       
1d50: 20 20 20 20 20 66 75 72 74 68 65 72 20 64 69 73       further dis
1d60: 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20  cussion.</dd>.  
1d70: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
1d80: 67 3e 2d 64 68 70 61 72 61 6d 73 20 3c 2f 73 74  g>-dhparams </st
1d90: 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d  rong><em>filenam
1da0: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  e</em></dt>.    
1db0: 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20      <dd>Provide 
1dc0: 61 20 44 69 66 66 69 65 2d 48 65 6c 6c 6d 61 6e  a Diffie-Hellman
1dd0: 20 70 61 72 61 6d 65 74 65 72 73 20 66 69 6c 65   parameters file
1de0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  .</dd>.        <
1df0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79 66  dt><strong>-keyf
1e00: 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ile</strong> <em
1e10: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f  >filename</em></
1e20: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
1e30: 50 72 6f 76 69 64 65 20 74 68 65 20 70 72 69 76  Provide the priv
1e40: 61 74 65 20 6b 65 79 20 66 69 6c 65 2e 20 28 3c  ate key file. (<
1e50: 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f  strong>default</
1e60: 73 74 72 6f 6e 67 3e 3a 0a 20 20 20 20 20 20 20  strong>:.       
1e70: 20 20 20 20 20 76 61 6c 75 65 20 6f 66 20 2d 63       value of -c
1e80: 65 72 74 66 69 6c 65 29 3c 2f 64 64 3e 0a 20 20  ertfile)</dd>.  
1e90: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
1ea0: 67 3e 2d 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e 67  g>-model</strong
1eb0: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65  > <em>channel</e
1ec0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
1ed0: 3c 64 64 3e 54 68 69 73 20 77 69 6c 6c 20 66 6f  <dd>This will fo
1ee0: 72 63 65 20 74 68 69 73 20 63 68 61 6e 6e 65 6c  rce this channel
1ef0: 20 74 6f 20 73 68 61 72 65 20 74 68 65 20 73 61   to share the sa
1f00: 6d 65 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53  me <em><strong>S
1f10: 53 4c 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c  SL_CTX</strong><
1f20: 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20 20 20 20  /em>.           
1f30: 20 73 74 72 75 63 74 75 72 65 20 61 73 20 74 68   structure as th
1f40: 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e  e specified <em>
1f50: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 2c 20 61 6e  channel</em>, an
1f60: 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68  d.            th
1f70: 65 72 65 66 6f 72 65 20 73 68 61 72 65 20 63 61  erefore share ca
1f80: 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64  llbacks etc.</dd
1f90: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
1fa0: 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c  trong>-password<
1fb0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c  /strong> <em>cal
1fc0: 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  lback</em></dt>.
1fd0: 20 20 20 20 20 20 20 20 3c 64 64 3e 49 66 20 73          <dd>If s
1fe0: 75 70 70 6c 69 65 64 2c 20 74 68 69 73 20 63 61  upplied, this ca
1ff0: 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62 65 20 69  llback will be i
2000: 6e 76 6f 6b 65 64 20 77 68 65 6e 20 4f 70 65 6e  nvoked when Open
2010: 53 53 4c 20 6e 65 65 64 73 0a 20 20 20 20 20 20  SSL needs.      
2020: 20 20 20 20 20 20 74 6f 20 6f 62 74 61 69 6e 20        to obtain 
2030: 61 20 70 61 73 73 77 6f 72 64 2c 20 74 79 70 69  a password, typi
2040: 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63 6b 20  cally to unlock 
2050: 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 20  the private key 
2060: 6f 66 0a 09 20 20 20 20 61 20 63 65 72 74 69 66  of..    a certif
2070: 69 63 61 74 65 2e 0a 20 20 20 20 20 20 20 20 20  icate..         
2080: 20 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20     The callback 
2090: 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 61 20  should return a 
20a0: 73 74 72 69 6e 67 20 77 68 69 63 68 20 72 65 70  string which rep
20b0: 72 65 73 65 6e 74 73 20 74 68 65 0a 20 20 20 20  resents the.    
20c0: 20 20 20 20 20 20 20 20 70 61 73 73 77 6f 72 64          password
20d0: 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 20 20 20   to be used..   
20e0: 20 20 20 20 20 20 20 20 20 3c 62 72 3e 0a 20 20           <br>.  
20f0: 20 20 20 20 20 20 20 20 20 20 53 65 65 20 3c 61            See <a
2100: 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b   href="#CALLBACK
2110: 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41   OPTIONS">CALLBA
2120: 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 20 66  CK OPTIONS</a> f
2130: 6f 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  or.            f
2140: 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69 6f  urther discussio
2150: 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  n.</dd>.        
2160: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71  <dt><strong>-req
2170: 75 65 73 74 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65  uest </strong><e
2180: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e  m>bool</em></dt>
2190: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 52 65 71  .        <dd>Req
21a0: 75 65 73 74 20 61 20 63 65 72 74 69 66 69 63 61  uest a certifica
21b0: 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64 75 72  te from peer dur
21c0: 69 6e 67 20 53 53 4c 20 68 61 6e 64 73 68 61 6b  ing SSL handshak
21d0: 65 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 28  e..            (
21e0: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
21f0: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74 72  /strong>: <em>tr
2200: 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20  ue</em>)</dd>.  
2210: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e        <dt><stron
2220: 67 3e 2d 72 65 71 75 69 72 65 3c 2f 73 74 72 6f  g>-require</stro
2230: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
2240: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
2250: 64 64 3e 52 65 71 75 69 72 65 20 61 20 76 61 6c  dd>Require a val
2260: 69 64 20 63 65 72 74 69 66 69 63 61 74 65 20 66  id certificate f
2270: 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67 20  rom peer during 
2280: 53 53 4c 0a 20 20 20 20 20 20 20 20 20 20 20 20  SSL.            
2290: 68 61 6e 64 73 68 61 6b 65 2e 20 49 66 20 74 68  handshake. If th
22a0: 69 73 20 69 73 20 73 65 74 20 74 6f 20 74 72 75  is is set to tru
22b0: 65 20 74 68 65 6e 20 3c 73 74 72 6f 6e 67 3e 2d  e then <strong>-
22c0: 72 65 71 75 65 73 74 3c 2f 73 74 72 6f 6e 67 3e  request</strong>
22d0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 75 73  .            mus
22e0: 74 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 6f  t also be set to
22f0: 20 74 72 75 65 2e 20 28 3c 73 74 72 6f 6e 67 3e   true. (<strong>
2300: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e  default</strong>
2310: 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e  : <em>false</em>
2320: 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  )</dd>.        <
2330: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76  dt><strong>-serv
2340: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  er</strong> <em>
2350: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  bool</em></dt>. 
2360: 20 20 20 20 20 20 20 3c 64 64 3e 48 61 6e 64 73         <dd>Hands
2370: 68 61 6b 65 20 61 73 20 73 65 72 76 65 72 20 69  hake as server i
2380: 66 20 74 72 75 65 2c 20 65 6c 73 65 20 68 61 6e  f true, else han
2390: 64 73 68 61 6b 65 20 61 73 0a 20 20 20 20 20 20  dshake as.      
23a0: 20 20 20 20 20 20 63 6c 69 65 6e 74 2e 28 3c 73        client.(<s
23b0: 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73  trong>default</s
23c0: 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73  trong>: <em>fals
23d0: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20  e</em>)</dd>.   
23e0: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
23f0: 3e 2d 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74  >-servername</st
2400: 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f 73 74 3c 2f  rong> <em>host</
2410: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
2420: 20 3c 64 64 3e 4f 6e 6c 79 20 61 76 61 69 6c 61   <dd>Only availa
2430: 62 6c 65 20 69 66 20 74 68 65 20 4f 70 65 6e 53  ble if the OpenS
2440: 53 4c 20 6c 69 62 72 61 72 79 20 74 68 65 20 70  SL library the p
2450: 61 63 6b 61 67 65 20 69 73 20 6c 69 6e 6b 65 64  ackage is linked
2460: 0a 09 20 20 20 20 61 67 61 69 6e 73 74 20 73 75  ..    against su
2470: 70 70 6f 72 74 73 20 74 68 65 20 54 4c 53 20 68  pports the TLS h
2480: 6f 73 74 6e 61 6d 65 20 65 78 74 65 6e 73 69 6f  ostname extensio
2490: 6e 20 66 6f 72 20 27 53 65 72 76 65 72 20 4e 61  n for 'Server Na
24a0: 6d 65 0a 09 20 20 20 20 49 6e 64 69 63 61 74 69  me..    Indicati
24b0: 6f 6e 27 20 28 53 4e 49 29 2e 20 55 73 65 20 74  on' (SNI). Use t
24c0: 6f 20 6e 61 6d 65 20 74 68 65 20 6c 6f 67 69 63  o name the logic
24d0: 61 6c 20 68 6f 73 74 20 77 65 20 61 72 65 20 74  al host we are t
24e0: 61 6c 6b 69 6e 67 0a 09 20 20 20 20 74 6f 20 61  alking..    to a
24f0: 6e 64 20 65 78 70 65 63 74 69 6e 67 20 61 20 63  nd expecting a c
2500: 65 72 74 69 66 69 63 61 74 65 20 66 6f 72 3c 2f  ertificate for</
2510: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
2520: 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 32 3c 2f 73  <strong>-ssl2</s
2530: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
2540: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2550: 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65    <dd>Enable use
2560: 20 6f 66 20 53 53 4c 20 76 32 2e 20 28 3c 73 74   of SSL v2. (<st
2570: 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74  rong>default</st
2580: 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65  rong>: <em>false
2590: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20  </em>)</dd>.    
25a0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
25b0: 2d 73 73 6c 33 20 3c 2f 73 74 72 6f 6e 67 3e 3c  -ssl3 </strong><
25c0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
25d0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e  >.        <dd>En
25e0: 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20  able use of SSL 
25f0: 76 33 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66  v3. (<strong>def
2600: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
2610: 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f  em>false</em>)</
2620: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
2630: 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73  -<strong>tls1</s
2640: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c  trong> <em>bool<
2650: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2660: 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65    <dd>Enable use
2670: 20 6f 66 20 54 4c 53 20 76 31 2e 20 28 3c 73 74   of TLS v1. (<st
2680: 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74  rong>default</st
2690: 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c  rong>: <em>true<
26a0: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20  /em>)</dd>.     
26b0: 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e     <dt>-<strong>
26c0: 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e 20  tls1.1</strong> 
26d0: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64  <em>bool</em></d
26e0: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45  t>.        <dd>E
26f0: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53  nable use of TLS
2700: 20 76 31 2e 31 20 28 3c 73 74 72 6f 6e 67 3e 64   v1.1 (<strong>d
2710: 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a  efault</strong>:
2720: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c   <em>true</em>)<
2730: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
2740: 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 32  >-<strong>tls1.2
2750: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
2760: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  ol</em></dt>.   
2770: 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20       <dd>Enable 
2780: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 32 20  use of TLS v1.2 
2790: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
27a0: 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74  </strong>: <em>t
27b0: 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20  rue</em>)</dd>. 
27c0: 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72         <dt>-<str
27d0: 6f 6e 67 3e 74 6c 73 31 2e 33 3c 2f 73 74 72 6f  ong>tls1.3</stro
27e0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
27f0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
2800: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66  dd>Enable use of
2810: 20 54 4c 53 20 76 31 2e 33 20 28 3c 73 74 72 6f   TLS v1.3 (<stro
2820: 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f  ng>default</stro
2830: 6e 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65  ng>: <em>true</e
2840: 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64  m>)</dd>.    </d
2850: 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  l>.</blockquote>
2860: 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c  ..<dl>.    <dt><
2870: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 75 6e 69  a name="tls::uni
2880: 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75  mport"><b>tls::u
2890: 6e 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63  nimport </b><i>c
28a0: 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f  hannel</i></a></
28b0: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 50 72 6f 76  dt>.    <dd>Prov
28c0: 69 64 65 64 20 66 6f 72 20 73 79 6d 6d 65 74 72  ided for symmetr
28d0: 79 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 74 6c 73  y to <strong>tls
28e0: 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67  ::import</strong
28f0: 3e 2c 20 74 68 69 73 0a 20 20 20 20 20 20 75 6e  >, this.      un
2900: 73 74 61 63 6b 73 20 74 68 65 20 53 53 4c 2d 65  stacks the SSL-e
2910: 6e 61 62 6c 69 6e 67 20 6f 66 20 61 20 72 65 67  nabling of a reg
2920: 75 6c 61 72 20 54 63 6c 20 63 68 61 6e 6e 65 6c  ular Tcl channel
2930: 2e 20 20 41 6e 20 65 72 72 6f 72 0a 20 20 20 20  .  An error.    
2940: 20 20 69 73 20 74 68 72 6f 77 6e 20 69 66 20 54    is thrown if T
2950: 4c 53 20 69 73 20 6e 6f 74 20 74 68 65 20 74 6f  LS is not the to
2960: 70 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65  p stacked channe
2970: 6c 20 74 79 70 65 2e 3c 2f 64 64 3e 0a 3c 2f 64  l type.</dd>.</d
2980: 6c 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74  l>..<dl>.    <dt
2990: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63  ><a name="tls::c
29a0: 69 70 68 65 72 73 20 70 72 6f 74 6f 63 6f 6c 20  iphers protocol 
29b0: 3f 76 65 72 62 6f 73 65 3f 22 3e 3c 73 74 72 6f  ?verbose?"><stro
29c0: 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c  ng>tls::ciphers<
29d0: 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20  /strong>.       
29e0: 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76   <em>protocol ?v
29f0: 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e  erbose?</em></a>
2a00: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65  </dt>.    <dd>Re
2a10: 74 75 72 6e 73 20 6c 69 73 74 20 6f 66 20 73 75  turns list of su
2a20: 70 70 6f 72 74 65 64 20 63 69 70 68 65 72 73 20  pported ciphers 
2a30: 62 61 73 65 64 20 6f 6e 20 74 68 65 20 3c 65 6d  based on the <em
2a40: 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 0a 20  >protocol</em>. 
2a50: 20 20 20 20 20 20 20 79 6f 75 20 73 75 70 70 6c         you suppl
2a60: 79 2c 20 77 68 69 63 68 20 6d 75 73 74 20 62 65  y, which must be
2a70: 20 6f 6e 65 20 6f 66 20 3c 65 6d 3e 73 73 6c 32   one of <em>ssl2
2a80: 2c 20 73 73 6c 33 2c 20 6f 72 20 74 6c 73 31 3c  , ssl3, or tls1<
2a90: 2f 65 6d 3e 2e 0a 20 20 20 20 20 20 20 20 49 66  /em>..        If
2aa0: 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f 65 6d   <em>verbose</em
2ab0: 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20 61  > is specified a
2ac0: 73 20 74 72 75 65 20 74 68 65 6e 20 61 20 76 65  s true then a ve
2ad0: 72 62 6f 73 65 2c 0a 20 20 20 20 20 20 20 20 73  rbose,.        s
2ae0: 65 6d 69 2d 68 75 6d 61 6e 20 72 65 61 64 61 62  emi-human readab
2af0: 6c 65 20 6c 69 73 74 20 69 73 20 72 65 74 75 72  le list is retur
2b00: 6e 65 64 20 70 72 6f 76 69 64 69 6e 67 20 61 64  ned providing ad
2b10: 64 69 74 69 6f 6e 61 6c 0a 20 20 20 20 20 20 20  ditional.       
2b20: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20   information on 
2b30: 74 68 65 20 6e 61 74 75 72 65 20 6f 66 20 74 68  the nature of th
2b40: 65 20 63 69 70 68 65 72 20 73 75 70 70 6f 72 74  e cipher support
2b50: 2e 20 49 6e 20 65 61 63 68 0a 20 20 20 20 20 20  . In each.      
2b60: 20 20 63 61 73 65 20 74 68 65 20 72 65 73 75 6c    case the resul
2b70: 74 20 69 73 20 61 20 54 63 6c 20 6c 69 73 74 2e  t is a Tcl list.
2b80: 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 64 6c  </dd>.</dl>..<dl
2b90: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d  >.    <dt><a nam
2ba0: 65 3d 22 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22  e="tls::version"
2bb0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 65  ><strong>tls::ve
2bc0: 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  rsion</strong></
2bd0: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  a></dt>.    <dd>
2be0: 52 65 74 75 72 6e 73 20 74 68 65 20 76 65 72 73  Returns the vers
2bf0: 69 6f 6e 20 73 74 72 69 6e 67 20 64 65 66 69 6e  ion string defin
2c00: 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 2e 3c 2f  ed by OpenSSL.</
2c10: 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 33 3e 3c  dd>.</dl>..<h3><
2c20: 61 20 6e 61 6d 65 3d 22 43 41 4c 4c 42 41 43 4b  a name="CALLBACK
2c30: 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41   OPTIONS">CALLBA
2c40: 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f  CK OPTIONS</a></
2c50: 68 33 3e 0a 0a 3c 70 3e 0a 41 73 20 69 6e 64 69  h3>..<p>.As indi
2c60: 63 61 74 65 64 20 61 62 6f 76 65 2c 20 69 6e 64  cated above, ind
2c70: 69 76 69 64 75 61 6c 20 63 68 61 6e 6e 65 6c 73  ividual channels
2c80: 20 63 61 6e 20 62 65 20 67 69 76 65 6e 20 74 68   can be given th
2c90: 65 69 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b  eir own callback
2ca0: 73 0a 74 6f 20 68 61 6e 64 6c 65 20 69 6e 74 65  s.to handle inte
2cb0: 72 6d 65 64 69 61 74 65 20 70 72 6f 63 65 73 73  rmediate process
2cc0: 69 6e 67 20 62 79 20 74 68 65 20 4f 70 65 6e 53  ing by the OpenS
2cd0: 53 4c 20 6c 69 62 72 61 72 79 2c 20 75 73 69 6e  SL library, usin
2ce0: 67 20 74 68 65 0a 3c 65 6d 3e 2d 63 6f 6d 6d 61  g the.<em>-comma
2cf0: 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e  nd</em> and <em>
2d00: 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d 3e 20 6f  -password</em> o
2d10: 70 74 69 6f 6e 73 20 70 61 73 73 65 64 20 74 6f  ptions passed to
2d20: 20 65 69 74 68 65 72 20 6f 66 0a 3c 73 74 72 6f   either of.<stro
2d30: 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  ng>tls::socket</
2d40: 73 74 72 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f  strong> or <stro
2d50: 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f  ng>tls::import</
2d60: 73 74 72 6f 6e 67 3e 2e 0a 3c 2f 70 3e 0a 0a 3c  strong>..</p>..<
2d70: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 64 6c 3e  blockquote>.<dl>
2d80: 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e  ..    <dt><stron
2d90: 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f  g>-command</stro
2da0: 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b  ng> <em>callback
2db0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c  </em></dt>.    <
2dc0: 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65  dd>..Invokes the
2dd0: 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63   specified <em>c
2de0: 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72  allback</em> scr
2df0: 69 70 74 20 61 74 0a 09 73 65 76 65 72 61 6c 20  ipt at..several 
2e00: 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20 74 68  points during th
2e10: 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e 64 73 68  e OpenSSL handsh
2e20: 61 6b 65 2e 0a 09 45 78 63 65 70 74 20 61 73 20  ake...Except as 
2e30: 69 6e 64 69 63 61 74 65 64 20 62 65 6c 6f 77 2c  indicated below,
2e40: 20 76 61 6c 75 65 73 20 72 65 74 75 72 6e 65 64   values returned
2e50: 20 66 72 6f 6d 20 74 68 65 0a 09 63 61 6c 6c 62   from the..callb
2e60: 61 63 6b 20 61 72 65 20 69 67 6e 6f 72 65 64 2e  ack are ignored.
2e70: 0a 09 41 72 67 75 6d 65 6e 74 73 20 61 70 70 65  ..Arguments appe
2e80: 6e 64 65 64 20 74 6f 20 74 68 65 20 73 63 72 69  nded to the scri
2e90: 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62 61 63 6b  pt upon callback
2ea0: 20 74 61 6b 65 20 6f 6e 65 20 6f 66 20 74 68 65   take one of the
2eb0: 0a 09 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f 72 6d  ..following form
2ec0: 73 3a 0a 0a 09 3c 62 72 3e 0a 09 3c 62 72 3e 0a  s:...<br>..<br>.
2ed0: 0a 09 3c 64 6c 3e 0a 0a 3c 21 2d 2d 09 54 68 69  ..<dl>..<!--.Thi
2ee0: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
2ef0: 63 6b 20 69 73 20 64 69 73 61 62 6c 65 64 2e 0a  ck is disabled..
2f00: 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e  ..<dt>..  <stron
2f10: 67 3e 65 72 72 6f 72 3c 2f 73 74 72 6f 6e 67 3e  g>error</strong>
2f20: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d 65 73   <em>channel mes
2f30: 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e  sage</em>..</dt>
2f40: 0a 09 3c 64 64 3e 0a 09 20 20 54 68 65 20 3c 65  ..<dd>..  The <e
2f50: 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61  m>message</em> a
2f60: 72 67 75 6d 65 6e 74 20 63 6f 6e 74 61 69 6e 73  rgument contains
2f70: 20 61 6e 20 65 72 72 6f 72 20 6d 65 73 73 61 67   an error messag
2f80: 65 20 67 65 6e 65 72 61 74 65 64 0a 09 20 20 62  e generated..  b
2f90: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75  y the OpenSSL fu
2fa0: 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e  nction..  <code>
2fb0: 45 52 52 5f 72 65 61 73 6f 6e 5f 65 72 72 6f 72  ERR_reason_error
2fc0: 5f 73 74 72 69 6e 67 28 29 3c 2f 63 6f 64 65 3e  _string()</code>
2fd0: 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a  ...</dd>...<br>.
2fe0: 2d 2d 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73  -->...<dt>..  <s
2ff0: 74 72 6f 6e 67 3e 69 6e 66 6f 3c 2f 73 74 72 6f  trong>info</stro
3000: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20  ng> <em>channel 
3010: 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 6d 65 73 73  major minor mess
3020: 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a  age</em>..</dt>.
3030: 09 3c 64 64 3e 0a 09 20 20 54 68 69 73 20 66 6f  .<dd>..  This fo
3040: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69  rm of callback i
3050: 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65  s invoked by the
3060: 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f   OpenSSL functio
3070: 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 43  n..  <code>SSL_C
3080: 54 58 5f 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c  TX_set_info_call
3090: 62 61 63 6b 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09  back()</code>...
30a0: 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65    <br>..  The <e
30b0: 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 6e 64  m>major</em> and
30c0: 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20   <em>minor</em> 
30d0: 61 72 67 75 6d 65 6e 74 73 20 61 72 65 20 75 73  arguments are us
30e0: 65 64 20 74 6f 0a 09 20 20 72 65 70 72 65 73 65  ed to..  represe
30f0: 6e 74 20 74 68 65 20 73 74 61 74 65 20 69 6e 66  nt the state inf
3100: 6f 72 6d 61 74 69 6f 6e 20 62 69 74 6d 61 73 6b  ormation bitmask
3110: 2e 0a 09 20 20 3c 64 6c 3e 0a 09 20 20 3c 64 74  ...  <dl>..  <dt
3120: 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 73  >Possible values
3130: 20 66 6f 72 20 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f   for <em>major</
3140: 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 3e 0a 09 20  em> are:</dt>.. 
3150: 20 3c 64 64 3e 3c 63 6f 64 65 3e 68 61 6e 64 73   <dd><code>hands
3160: 68 61 6b 65 2c 20 61 6c 65 72 74 2c 20 63 6f 6e  hake, alert, con
3170: 6e 65 63 74 2c 20 61 63 63 65 70 74 3c 2f 63 6f  nect, accept</co
3180: 64 65 3e 2e 3c 2f 64 64 3e 0a 09 20 20 3c 64 74  de>.</dd>..  <dt
3190: 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 73  >Possible values
31a0: 20 66 6f 72 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f   for <em>minor</
31b0: 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 3e 0a 09 20  em> are:</dt>.. 
31c0: 20 3c 64 64 3e 3c 63 6f 64 65 3e 73 74 61 72 74   <dd><code>start
31d0: 2c 20 64 6f 6e 65 2c 20 72 65 61 64 2c 20 77 72  , done, read, wr
31e0: 69 74 65 2c 20 6c 6f 6f 70 2c 20 65 78 69 74 3c  ite, loop, exit<
31f0: 2f 63 6f 64 65 3e 2e 3c 2f 64 64 3e 0a 09 20 20  /code>.</dd>..  
3200: 3c 2f 64 6c 3e 0a 09 20 20 54 68 65 20 3c 65 6d  </dl>..  The <em
3210: 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72  >message</em> ar
3220: 67 75 6d 65 6e 74 20 69 73 20 61 20 64 65 73 63  gument is a desc
3230: 72 69 70 74 69 76 65 20 73 74 72 69 6e 67 20 77  riptive string w
3240: 68 69 63 68 20 6d 61 79 0a 09 20 20 62 65 20 67  hich may..  be g
3250: 65 6e 65 72 61 74 65 64 20 65 69 74 68 65 72 20  enerated either 
3260: 62 79 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f  by..  <code>SSL_
3270: 73 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e  state_string_lon
3280: 67 28 29 3c 2f 63 6f 64 65 3e 20 6f 72 20 62 79  g()</code> or by
3290: 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 61 6c  ..  <code>SSL_al
32a0: 65 72 74 5f 64 65 73 63 5f 73 74 72 69 6e 67 5f  ert_desc_string_
32b0: 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 2c 0a 09  long()</code>,..
32c0: 20 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 63    depending on c
32d0: 6f 6e 74 65 78 74 2e 0a 09 3c 2f 64 64 3e 0a 0a  ontext...</dd>..
32e0: 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20  .<br>...<dt>..  
32f0: 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 79 3c 2f  <strong>verify</
3300: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e  strong> <em>chan
3310: 6e 65 6c 20 64 65 70 74 68 20 63 65 72 74 20 73  nel depth cert s
3320: 74 61 74 75 73 20 65 72 72 6f 72 3c 2f 65 6d 3e  tatus error</em>
3330: 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20  ..</dt>..<dd>.. 
3340: 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61   This form of ca
3350: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65  llback is invoke
3360: 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c  d by the OpenSSL
3370: 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 6f   function..  <co
3380: 64 65 3e 53 53 4c 5f 73 65 74 5f 76 65 72 69 66  de>SSL_set_verif
3390: 79 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c  y()</code>...  <
33a0: 62 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 64  br>..  The <em>d
33b0: 65 70 74 68 3c 2f 65 6d 3e 20 61 72 67 75 6d 65  epth</em> argume
33c0: 6e 74 20 69 73 20 61 6e 20 69 6e 74 65 67 65 72  nt is an integer
33d0: 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20 74 68   representing th
33e0: 65 0a 09 20 20 63 75 72 72 65 6e 74 20 64 65 70  e..  current dep
33f0: 74 68 20 6f 6e 20 74 68 65 20 63 65 72 74 69 66  th on the certif
3400: 69 63 61 74 65 20 63 68 61 69 6e 2c 20 77 69 74  icate chain, wit
3410: 68 0a 09 20 20 3c 63 6f 64 65 3e 30 3c 2f 63 6f  h..  <code>0</co
3420: 64 65 3e 20 61 73 20 74 68 65 20 73 75 62 6a 65  de> as the subje
3430: 63 74 20 63 65 72 74 69 66 69 63 61 74 65 20 61  ct certificate a
3440: 6e 64 20 68 69 67 68 65 72 20 76 61 6c 75 65 73  nd higher values
3450: 0a 09 20 20 64 65 6e 6f 74 69 6e 67 20 70 72 6f  ..  denoting pro
3460: 67 72 65 73 73 69 76 65 6c 79 20 6d 6f 72 65 20  gressively more 
3470: 69 6e 64 69 72 65 63 74 20 69 73 73 75 65 72 20  indirect issuer 
3480: 63 65 72 74 69 66 69 63 61 74 65 73 2e 0a 09 20  certificates... 
3490: 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d   <br>..  The <em
34a0: 3e 63 65 72 74 3c 2f 65 6d 3e 20 61 72 67 75 6d  >cert</em> argum
34b0: 65 6e 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66  ent is a list of
34c0: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73   key-value pairs
34d0: 20 73 69 6d 69 6c 61 72 0a 09 20 20 74 6f 20 74   similar..  to t
34e0: 68 6f 73 65 20 72 65 74 75 72 6e 65 64 20 62 79  hose returned by
34f0: 0a 09 20 20 3c 61 20 68 72 65 66 3d 22 23 74 6c  ..  <a href="#tl
3500: 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74 72 6f  s::status"><stro
3510: 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f  ng>tls::status</
3520: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e 0a 09 20 20  strong></a>...  
3530: 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e  <br>..  The <em>
3540: 73 74 61 74 75 73 3c 2f 65 6d 3e 20 61 72 67 75  status</em> argu
3550: 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74 65 67  ment is an integ
3560: 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20  er representing 
3570: 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74 20 76  the..  current v
3580: 61 6c 69 64 69 74 79 20 6f 66 20 74 68 65 20 63  alidity of the c
3590: 65 72 74 69 66 69 63 61 74 65 2e 0a 09 20 20 41  ertificate...  A
35a0: 20 76 61 6c 75 65 20 6f 66 20 3c 63 6f 64 65 3e   value of <code>
35b0: 30 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e 73 20 74  0</code> means t
35c0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 69  he certificate i
35d0: 73 20 64 65 65 6d 65 64 20 69 6e 76 61 6c 69 64  s deemed invalid
35e0: 2e 0a 09 20 20 41 20 76 61 6c 75 65 20 6f 66 20  ...  A value of 
35f0: 3c 63 6f 64 65 3e 31 3c 2f 63 6f 64 65 3e 20 6d  <code>1</code> m
3600: 65 61 6e 73 20 74 68 65 20 63 65 72 74 69 66 69  eans the certifi
3610: 63 61 74 65 20 69 73 20 64 65 65 6d 65 64 20 76  cate is deemed v
3620: 61 6c 69 64 2e 0a 09 20 20 3c 62 72 3e 0a 09 20  alid...  <br>.. 
3630: 20 54 68 65 20 3c 65 6d 3e 65 72 72 6f 72 3c 2f   The <em>error</
3640: 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 73 75 70  em> argument sup
3650: 70 6c 69 65 73 20 74 68 65 20 6d 65 73 73 61 67  plies the messag
3660: 65 2c 20 69 66 20 61 6e 79 2c 20 67 65 6e 65 72  e, if any, gener
3670: 61 74 65 64 0a 09 20 20 62 79 0a 09 20 20 3c 63  ated..  by..  <c
3680: 6f 64 65 3e 58 35 30 39 5f 53 54 4f 52 45 5f 43  ode>X509_STORE_C
3690: 54 58 5f 67 65 74 5f 65 72 72 6f 72 28 29 3c 2f  TX_get_error()</
36a0: 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09  code>...  <br>..
36b0: 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 63 61    <br>..  The ca
36c0: 6c 6c 62 61 63 6b 20 6d 61 79 20 6f 76 65 72 72  llback may overr
36d0: 69 64 65 20 6e 6f 72 6d 61 6c 20 76 61 6c 69 64  ide normal valid
36e0: 61 74 69 6f 6e 20 70 72 6f 63 65 73 73 69 6e 67  ation processing
36f0: 20 62 79 20 65 78 70 6c 69 63 69 74 6c 79 0a 09   by explicitly..
3700: 20 20 72 65 74 75 72 6e 69 6e 67 20 6f 6e 65 20    returning one 
3710: 6f 66 20 74 68 65 20 61 62 6f 76 65 20 3c 65 6d  of the above <em
3720: 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 76 61 6c  >status</em> val
3730: 75 65 73 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 2f  ues...</dd>...</
3740: 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 0a 20  dl>.    </dd>.. 
3750: 20 20 20 3c 62 72 3e 0a 0a 20 20 20 20 3c 64 74     <br>..    <dt
3760: 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f  ><strong>-passwo
3770: 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  rd</strong> <em>
3780: 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64  callback</em></d
3790: 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76  t>.    <dd>..Inv
37a0: 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 66 69  okes the specifi
37b0: 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c  ed <em>callback<
37c0: 2f 65 6d 3e 20 73 63 72 69 70 74 20 77 68 65 6e  /em> script when
37d0: 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 20 74   OpenSSL needs t
37e0: 6f 0a 09 6f 62 74 61 69 6e 20 61 20 70 61 73 73  o..obtain a pass
37f0: 77 6f 72 64 2e 20 20 54 68 65 20 63 61 6c 6c 62  word.  The callb
3800: 61 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 72  ack should retur
3810: 6e 20 61 20 73 74 72 69 6e 67 20 77 68 69 63 68  n a string which
3820: 0a 09 72 65 70 72 65 73 65 6e 74 73 20 74 68 65  ..represents the
3830: 20 70 61 73 73 77 6f 72 64 20 74 6f 20 62 65 20   password to be 
3840: 75 73 65 64 2e 0a 09 4e 6f 20 61 72 67 75 6d 65  used...No argume
3850: 6e 74 73 20 61 72 65 20 61 70 70 65 6e 64 65 64  nts are appended
3860: 20 74 6f 20 74 68 65 20 73 63 72 69 70 74 20 75   to the script u
3870: 70 6f 6e 20 63 61 6c 6c 62 61 63 6b 2e 0a 20 20  pon callback..  
3880: 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c 2f    </dd>.</dl>.</
3890: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e  blockquote>..<p>
38a0: 0a 52 65 66 65 72 65 6e 63 65 20 69 6d 70 6c 65  .Reference imple
38b0: 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20 74 68  mentations of th
38c0: 65 73 65 20 63 61 6c 6c 62 61 63 6b 73 20 61 72  ese callbacks ar
38d0: 65 20 70 72 6f 76 69 64 65 64 20 69 6e 20 74 68  e provided in th
38e0: 65 0a 64 69 73 74 72 69 62 75 74 69 6f 6e 20 61  e.distribution a
38f0: 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63  s <strong>tls::c
3900: 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e  allback</strong>
3910: 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73   and.<strong>tls
3920: 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f  ::password</stro
3930: 6e 67 3e 20 72 65 73 70 65 63 74 69 76 65 6c 79  ng> respectively
3940: 2e 20 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65  .  Note that the
3950: 73 65 20 61 72 65 0a 3c 65 6d 3e 73 61 6d 70 6c  se are.<em>sampl
3960: 65 3c 2f 65 6d 3e 20 69 6d 70 6c 65 6d 65 6e 74  e</em> implement
3970: 61 74 69 6f 6e 73 20 6f 6e 6c 79 2e 20 20 49 6e  ations only.  In
3980: 20 61 20 6d 6f 72 65 20 72 65 61 6c 69 73 74 69   a more realisti
3990: 63 20 64 65 70 6c 6f 79 6d 65 6e 74 0a 79 6f 75  c deployment.you
39a0: 20 77 6f 75 6c 64 20 73 70 65 63 69 66 79 20 79   would specify y
39b0: 6f 75 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b  our own callback
39c0: 20 73 63 72 69 70 74 73 20 6f 6e 20 65 61 63 68   scripts on each
39d0: 20 54 4c 53 20 63 68 61 6e 6e 65 6c 0a 75 73 69   TLS channel.usi
39e0: 6e 67 20 74 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d  ng the <em>-comm
39f0: 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d  and</em> and <em
3a00: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d 3e 20  >-password</em> 
3a10: 6f 70 74 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c  options..</p>..<
3a20: 70 3e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 62  p>.The default b
3a30: 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65  ehavior when the
3a40: 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65   <em>-command</e
3a50: 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f 74  m> option is not
3a60: 20 73 70 65 63 69 66 69 65 64 20 69 73 20 66 6f   specified is fo
3a70: 72 0a 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73  r.TLS to process
3a80: 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 20   the associated 
3a90: 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b  library callback
3aa0: 73 20 69 6e 74 65 72 6e 61 6c 6c 79 2e 0a 54 68  s internally..Th
3ab0: 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69  e default behavi
3ac0: 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 65 6d 3e  or when the <em>
3ad0: 2d 70 61 73 73 77 6f 72 64 3c 2f 65 6d 3e 20 6f  -password</em> o
3ae0: 70 74 69 6f 6e 20 69 73 20 6e 6f 74 20 73 70 65  ption is not spe
3af0: 63 69 66 69 65 64 20 69 73 20 66 6f 72 0a 54 4c  cified is for.TL
3b00: 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65  S to process the
3b10: 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72   associated libr
3b20: 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 20 62 79  ary callbacks by
3b30: 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 63   attempting to c
3b40: 61 6c 6c 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  all.<strong>tls:
3b50: 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e  :password</stron
3b60: 67 3e 2e 0a 54 68 65 20 64 69 66 66 65 72 65 6e  g>..The differen
3b70: 63 65 20 62 65 74 77 65 65 6e 20 74 68 65 73 65  ce between these
3b80: 20 74 77 6f 20 62 65 68 61 76 69 6f 72 73 20 69   two behaviors i
3b90: 73 20 61 20 63 6f 6e 73 65 71 75 65 6e 63 65 20  s a consequence 
3ba0: 6f 66 20 6d 61 69 6e 74 61 69 6e 69 6e 67 0a 63  of maintaining.c
3bb0: 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 77 69 74  ompatibility wit
3bc0: 68 20 65 61 72 6c 69 65 72 20 69 6d 70 6c 65 6d  h earlier implem
3bd0: 65 6e 74 61 74 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a  entations..</p>.
3be0: 0a 3c 70 3e 0a 54 68 65 20 3c 73 74 72 6f 6e 67  .<p>.The <strong
3bf0: 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73 74 72  >tls::debug</str
3c00: 6f 6e 67 3e 20 76 61 72 69 61 62 6c 65 20 70 72  ong> variable pr
3c10: 6f 76 69 64 65 73 20 73 6f 6d 65 20 61 64 64 69  ovides some addi
3c20: 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72 6f 6c 20 6f  tional.control o
3c30: 76 65 72 20 74 68 65 73 65 20 72 65 66 65 72 65  ver these refere
3c40: 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 2e 20 20  nce callbacks.  
3c50: 49 74 73 20 76 61 6c 75 65 20 69 73 20 7a 65 72  Its value is zer
3c60: 6f 20 62 79 20 64 65 66 61 75 6c 74 2e 0a 48 69  o by default..Hi
3c70: 67 68 65 72 20 76 61 6c 75 65 73 20 70 72 6f 64  gher values prod
3c80: 75 63 65 20 6d 6f 72 65 20 64 69 61 67 6e 6f 73  uce more diagnos
3c90: 74 69 63 20 6f 75 74 70 75 74 2c 20 61 6e 64 20  tic output, and 
3ca0: 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 63 65 20  will also force 
3cb0: 74 68 65 0a 76 65 72 69 66 79 20 6d 65 74 68 6f  the.verify metho
3cc0: 64 20 69 6e 20 3c 73 74 72 6f 6e 67 3e 74 6c 73  d in <strong>tls
3cd0: 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f  ::callback</stro
3ce0: 6e 67 3e 20 74 6f 20 61 63 63 65 70 74 20 74 68  ng> to accept th
3cf0: 65 0a 63 65 72 74 69 66 69 63 61 74 65 2c 20 65  e.certificate, e
3d00: 76 65 6e 20 77 68 65 6e 20 69 74 20 69 73 20 69  ven when it is i
3d10: 6e 76 61 6c 69 64 2e 0a 3c 2f 70 3e 0a 0a 3c 70  nvalid..</p>..<p
3d20: 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f  >.<em>.The use o
3d30: 66 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 20  f the reference 
3d40: 63 61 6c 6c 62 61 63 6b 73 20 3c 73 74 72 6f 6e  callbacks <stron
3d50: 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c  g>tls::callback<
3d60: 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 0a 3c 73 74  /strong> and.<st
3d70: 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f  rong>tls::passwo
3d80: 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 69 73 20 6e  rd</strong> is n
3d90: 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20  ot recommended. 
3da0: 20 54 68 65 79 20 6d 61 79 20 62 65 20 72 65 6d   They may be rem
3db0: 6f 76 65 64 0a 66 72 6f 6d 20 66 75 74 75 72 65  oved.from future
3dc0: 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e   releases..</em>
3dd0: 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a  .</p>..<p>.<em>.
3de0: 54 68 65 20 75 73 65 20 6f 66 20 74 68 65 20 76  The use of the v
3df0: 61 72 69 61 62 6c 65 20 3c 73 74 72 6f 6e 67 3e  ariable <strong>
3e00: 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73 74 72 6f  tls::debug</stro
3e10: 6e 67 3e 20 69 73 20 6e 6f 74 20 72 65 63 6f 6d  ng> is not recom
3e20: 6d 65 6e 64 65 64 2e 0a 49 74 20 6d 61 79 20 62  mended..It may b
3e30: 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 66  e removed from f
3e40: 75 74 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a  uture releases..
3e50: 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e  </em>.</p>..<h3>
3e60: 3c 61 20 6e 61 6d 65 3d 22 48 54 54 50 53 20 45  <a name="HTTPS E
3e70: 58 41 4d 50 4c 45 22 3e 48 54 54 50 53 20 45 58  XAMPLE">HTTPS EX
3e80: 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a  AMPLE</a></h3>..
3e90: 3c 70 3e 54 68 69 73 20 65 78 61 6d 70 6c 65 20  <p>This example 
3ea0: 75 73 65 73 20 61 20 73 61 6d 70 6c 65 20 73 65  uses a sample se
3eb0: 72 76 65 72 2e 70 65 6d 20 70 72 6f 76 69 64 65  rver.pem provide
3ec0: 64 20 77 69 74 68 20 74 68 65 20 54 4c 53 20 72  d with the TLS r
3ed0: 65 6c 65 61 73 65 2c 0a 63 6f 75 72 74 65 73 79  elease,.courtesy
3ee0: 20 6f 66 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e   of the <strong>
3ef0: 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e  OpenSSL</strong>
3f00: 20 70 72 6f 6a 65 63 74 2e 3c 2f 70 3e 0a 0a 3c   project.</p>..<
3f10: 70 72 65 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61  pre><code>.packa
3f20: 67 65 20 72 65 71 75 69 72 65 20 68 74 74 70 0a  ge require http.
3f30: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
3f40: 74 6c 73 0a 0a 68 74 74 70 3a 3a 72 65 67 69 73  tls..http::regis
3f50: 74 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c  ter https 443 [l
3f60: 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65  ist ::tls::socke
3f70: 74 20 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d  t -autoservernam
3f80: 65 20 74 72 75 65 20 2d 72 65 71 75 69 72 65 20  e true -require 
3f90: 74 72 75 65 20 2d 63 61 64 69 72 20 2f 65 74 63  true -cadir /etc
3fa0: 2f 73 73 6c 2f 63 65 72 74 73 5d 0a 0a 73 65 74  /ssl/certs]..set
3fb0: 20 74 6f 6b 20 5b 68 74 74 70 3a 3a 67 65 74 75   tok [http::getu
3fc0: 72 6c 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74  rl https://www.t
3fd0: 63 6c 2e 74 6b 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c  cl.tk/].</code><
3fe0: 2f 70 72 65 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61  /pre>..<h3><a na
3ff0: 6d 65 3d 22 53 50 45 43 49 41 4c 20 43 4f 4e 53  me="SPECIAL CONS
4000: 49 44 45 52 41 54 49 4f 4e 53 22 3e 53 50 45 43  IDERATIONS">SPEC
4010: 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f  IAL CONSIDERATIO
4020: 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e  NS</a></h3>..<p>
4030: 54 68 65 20 63 61 70 61 62 69 6c 69 74 69 65 73  The capabilities
4040: 20 6f 66 20 74 68 69 73 20 70 61 63 6b 61 67 65   of this package
4050: 20 63 61 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f   can vary enormo
4060: 75 73 6c 79 20 62 61 73 65 64 0a 75 70 6f 6e 20  usly based.upon 
4070: 68 6f 77 20 79 6f 75 72 20 4f 70 65 6e 53 53 4c  how your OpenSSL
4080: 20 6c 69 62 72 61 72 79 20 77 61 73 20 63 6f 6e   library was con
4090: 66 69 67 75 72 65 64 20 61 6e 64 20 62 75 69 6c  figured and buil
40a0: 74 2e 20 41 74 20 74 68 65 0a 6d 6f 73 74 20 6d  t. At the.most m
40b0: 61 63 72 6f 2d 6c 65 76 65 6c 20 4f 70 65 6e 53  acro-level OpenS
40c0: 53 4c 20 73 75 70 70 6f 72 74 73 20 61 20 26 71  SL supports a &q
40d0: 75 6f 74 3b 6e 6f 20 70 61 74 65 6e 74 73 26 71  uot;no patents&q
40e0: 75 6f 74 3b 20 62 75 69 6c 64 2c 0a 77 68 69 63  uot; build,.whic
40f0: 68 20 64 69 73 61 62 6c 65 73 20 52 53 41 2c 20  h disables RSA, 
4100: 49 44 45 41 2c 20 52 43 28 32 2c 34 2c 35 29 20  IDEA, RC(2,4,5) 
4110: 61 6e 64 20 53 53 4c 32 20 2d 20 69 66 20 79 6f  and SSL2 - if yo
4120: 75 72 20 4f 70 65 6e 53 53 4c 20 69 73 0a 63 6f  ur OpenSSL is.co
4130: 6e 66 69 67 75 72 65 64 20 74 68 69 73 20 77 61  nfigured this wa
4140: 79 20 74 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20  y then you will 
4150: 6e 65 65 64 20 74 6f 20 62 75 69 6c 64 20 54 4c  need to build TL
4160: 53 20 77 69 74 68 20 74 68 65 0a 2d 44 4e 4f 5f  S with the.-DNO_
4170: 50 41 54 45 4e 54 53 20 6f 70 74 69 6f 6e 20 2d  PATENTS option -
4180: 20 61 6e 64 20 74 68 65 20 72 65 73 75 6c 74 61   and the resulta
4190: 6e 74 20 6d 6f 64 75 6c 65 20 77 69 6c 6c 20 66  nt module will f
41a0: 75 6e 63 74 69 6f 6e 0a 63 6f 72 72 65 63 74 6c  unction.correctl
41b0: 79 20 61 6e 64 20 61 6c 73 6f 20 73 75 70 70 6f  y and also suppo
41c0: 72 74 20 41 44 48 20 63 65 72 74 69 66 69 63 61  rt ADH certifica
41d0: 74 65 2d 6c 65 73 73 20 65 6e 63 72 79 70 74 69  te-less encrypti
41e0: 6f 6e 2c 0a 68 6f 77 65 76 65 72 20 79 6f 75 20  on,.however you 
41f0: 77 69 6c 6c 20 62 65 20 75 6e 61 62 6c 65 20 74  will be unable t
4200: 6f 20 75 74 69 6c 69 7a 65 20 74 68 69 73 20 74  o utilize this t
4210: 6f 20 73 70 65 61 6b 20 74 6f 20 6e 6f 72 6d 61  o speak to norma
4220: 6c 20 57 65 62 0a 53 65 72 76 65 72 73 2c 20 77  l Web.Servers, w
4230: 68 69 63 68 20 74 79 70 69 63 61 6c 6c 79 20 72  hich typically r
4240: 65 71 75 69 72 65 20 52 53 41 20 73 75 70 70 6f  equire RSA suppo
4250: 72 74 2e 20 50 6c 65 61 73 65 20 73 65 65 20 3c  rt. Please see <
4260: 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77  a.href="http://w
4270: 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22  ww.openssl.org/"
4280: 3e 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e  >http://www.open
4290: 73 73 6c 2e 6f 72 67 2f 3c 2f 61 3e 20 66 6f 72  ssl.org/</a> for
42a0: 0a 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f  .more informatio
42b0: 6e 20 6f 6e 20 74 68 65 20 77 68 6f 6c 65 20 69  n on the whole i
42c0: 73 73 75 65 20 6f 66 20 70 61 74 65 6e 74 73 20  ssue of patents 
42d0: 61 6e 64 20 55 53 20 65 78 70 6f 72 74 0a 72 65  and US export.re
42e0: 73 74 72 69 63 74 69 6f 6e 73 2e 20 3c 2f 70 3e  strictions. </p>
42f0: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53  ..<h3><a name="S
4300: 45 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53  EE ALSO">SEE ALS
4310: 4f 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c  O</a></h3>..<p><
4320: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
4330: 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e  trong>, <strong>
4340: 66 69 6c 65 65 76 65 6e 74 2c 20 3c 2f 73 74 72  fileevent, </str
4350: 6f 6e 67 3e 3c 61 0a 68 72 65 66 3d 22 68 74 74  ong><a.href="htt
4360: 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e  p://www.openssl.
4370: 6f 72 67 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70  org/"><strong>Op
4380: 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  enSSL</strong></
4390: 61 3e 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70  a></p>..<hr>..<p
43a0: 72 65 3e 0a 43 6f 70 79 72 69 67 68 74 20 26 63  re>.Copyright &c
43b0: 6f 70 79 3b 20 31 39 39 39 20 4d 61 74 74 20 4e  opy; 1999 Matt N
43c0: 65 77 6d 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74  ewman..Copyright
43d0: 20 26 63 6f 70 79 3b 20 32 30 30 34 20 53 74 61   &copy; 2004 Sta
43e0: 72 66 69 73 68 20 53 79 73 74 65 6d 73 2e 0a 3c  rfish Systems..<
43f0: 2f 70 72 65 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f  /pre>.</body>.</
4400: 68 74 6d 6c 3e 0a                                html>.