Hex Artifact Content

Artifact 6088730c6106e0333c6ae86c8c60cd2bf759b20e71ebac6a8a8cbe77e9b8c39f:

Wiki page [Documentation] by rkeene on 2020-10-12 20:37:52.
0000: 44 20 32 30 32 30 2d 31 30 2d 31 32 54 32 30 3a  D 2020-10-12T20:
0010: 33 37 3a 35 32 2e 32 31 34 0a 4c 20 44 6f 63 75  37:52.214.L Docu
0020: 6d 65 6e 74 61 74 69 6f 6e 0a 50 20 34 62 65 33  mentation.P 4be3
0030: 63 35 31 30 33 37 62 32 66 35 35 31 35 61 66 33  c51037b2f5515af3
0040: 34 62 34 36 32 66 31 61 38 61 64 32 62 37 33 64  4b462f1a8ad2b73d
0050: 39 30 66 31 34 37 39 62 32 38 35 61 61 62 35 63  90f1479b285aab5c
0060: 38 66 37 32 37 35 34 30 32 63 66 34 0a 55 20 72  8f7275402cf4.U r
0070: 6b 65 65 6e 65 0a 57 20 31 37 34 36 32 0a 0a 3c  keene.W 17462..<
0080: 64 6c 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  dl>.    <dd><a h
0090: 72 65 66 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45  ref="#NAME">NAME
00a0: 3c 2f 61 3e 20 3c 64 6c 3e 0a 20 20 20 20 20 20  </a> <dl>.      
00b0: 20 20 20 20 20 20 3c 64 64 3e 3c 73 74 72 6f 6e        <dd><stron
00c0: 67 3e 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d  g>tls</strong> -
00d0: 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72   binding to <str
00e0: 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72  ong>OpenSSL</str
00f0: 6f 6e 67 3e 0a 20 20 20 20 20 20 20 20 20 20 20  ong>.           
0100: 20 20 20 20 20 74 6f 6f 6c 6b 69 74 2e 3c 2f 64       toolkit.</d
0110: 64 3e 0a 20 20 20 20 20 20 20 20 3c 2f 64 6c 3e  d>.        </dl>
0120: 0a 20 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c  .    </dd>.    <
0130: 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 59 4e  dd><a href="#SYN
0140: 4f 50 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c  OPSIS">SYNOPSIS<
0150: 2f 61 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64  /a> </dd>.    <d
0160: 64 3e 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 20  d><dl>.         
0170: 20 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67     <dd><b>packag
0180: 65 20 72 65 71 75 69 72 65 20 54 63 6c 20 3c 2f  e require Tcl </
0190: 62 3e 3c 65 6d 3e 3f 38 2e 34 3f 3c 2f 65 6d 3e  b><em>?8.4?</em>
01a0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20  </dd>.          
01b0: 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65    <dd><b>package
01c0: 20 72 65 71 75 69 72 65 20 74 6c 73 20 3c 2f 62   require tls </b
01d0: 3e 3c 65 6d 3e 3f 31 2e 38 2e 30 3f 3c 2f 65 6d  ><em>?1.8.0?</em
01e0: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20  ></dd>.         
01f0: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64     <dt>&nbsp;</d
0200: 74 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  t>.            <
0210: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20  dd><b>tls::init 
0220: 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f  </b><i>?options?
0230: 3c 2f 69 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 20  </i> </dd>.     
0240: 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c         <dd><b>tl
0250: 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65  s::socket </b><e
0260: 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73 74  m>?options? host
0270: 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a   port</em></dd>.
0280: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e              <dd>
0290: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  <b>tls::socket</
02a0: 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20  b><em> ?-server 
02b0: 63 6f 6d 6d 61 6e 64 3f 0a 20 20 20 20 20 20 20  command?.       
02c0: 20 20 20 20 20 20 20 20 20 3f 6f 70 74 69 6f 6e           ?option
02d0: 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64  s? port</em></dd
02e0: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64  >.            <d
02f0: 64 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68  d><b>tls::handsh
0300: 61 6b 65 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e  ake</b><em> chan
0310: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20  nel</em></dd>.  
0320: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62            <dd><b
0330: 3e 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c 2f 62  >tls::status </b
0340: 3e 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68  ><em>?-local? ch
0350: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a  annel</em></dd>.
0360: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e              <dd>
0370: 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f  <b>tls::import</
0380: 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 20 3f  b><em> channel ?
0390: 6f 70 74 69 6f 6e 73 3f 3c 2f 65 6d 3e 3c 2f 64  options?</em></d
03a0: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  d>.            <
03b0: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70  dd><b>tls::unimp
03c0: 6f 72 74 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e  ort</b><em> chan
03d0: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20  nel</em></dd>.  
03e0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62            <dd><b
03f0: 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 3c 2f  >tls::ciphers </
0400: 62 3e 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f  b><em>protocol ?
0410: 76 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 64  verbose?</em></d
0420: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c  d>.            <
0430: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69  dd><b>tls::versi
0440: 6f 6e 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20 20  on</b></dd>.    
0450: 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f      </dl>.    </
0460: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  dd>.    <dd><a h
0470: 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22 3e  ref="#COMMANDS">
0480: 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64 64  COMMANDS</a></dd
0490: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65  >.    <dd><a hre
04a0: 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54  f="#CALLBACK OPT
04b0: 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f  IONS">CALLBACK O
04c0: 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a  PTIONS</a></dd>.
04d0: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d      <dd><a href=
04e0: 22 23 48 54 54 50 53 20 45 58 41 4d 50 4c 45 22  "#HTTPS EXAMPLE"
04f0: 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f  >HTTPS EXAMPLE</
0500: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  a></dd>.    <dd>
0510: 3c 61 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c  <a href="#SEE AL
0520: 53 4f 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53  SO">SPECIAL CONS
0530: 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f  IDERATIONS</a></
0540: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  dd>.    <dd><a h
0550: 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e  ref="#SEE ALSO">
0560: 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64  SEE ALSO</a></dd
0570: 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c  >.</dl>..<hr>..<
0580: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 4e 41 4d 45  h3><a name="NAME
0590: 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f 68 33 3e 0a  ">NAME</a></h3>.
05a0: 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3c  .<p><strong>tls<
05b0: 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69 6e 64 69  /strong> - bindi
05c0: 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 4f 70  ng to <strong>Op
05d0: 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 0a 74  enSSL</strong>.t
05e0: 6f 6f 6c 6b 69 74 2e 3c 2f 70 3e 0a 0a 3c 68 33  oolkit.</p>..<h3
05f0: 3e 3c 61 20 6e 61 6d 65 3d 22 53 59 4e 4f 50 53  ><a name="SYNOPS
0600: 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 3e  IS">SYNOPSIS</a>
0610: 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 62 3e 70 61 63  </h3>..<p><b>pac
0620: 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 63 6c  kage require Tcl
0630: 20 38 2e 34 3c 2f 62 3e 3c 62 72 3e 0a 3c 62 3e   8.4</b><br>.<b>
0640: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0650: 74 6c 73 20 31 2e 38 2e 30 3c 2f 62 3e 3c 62 72  tls 1.8.0</b><br
0660: 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22  >.<br>.<a href="
0670: 23 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74  #tls::init"><b>t
0680: 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e  ls::init </b><i>
0690: 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 62 72  ?options?</i><br
06a0: 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23  >.</a><a href="#
06b0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e  tls::socket"><b>
06c0: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e  tls::socket </b>
06d0: 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f  <em>?options? ho
06e0: 73 74 0a 70 6f 72 74 3c 2f 65 6d 3e 3c 62 72 3e  st.port</em><br>
06f0: 0a 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c  .<b>tls::socket<
0700: 2f 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72  /b><em> ?-server
0710: 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 69 6f   command? ?optio
0720: 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 62 72  ns? port</em><br
0730: 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23  >.</a><a href="#
0740: 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 62 3e  tls::status"><b>
0750: 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c 2f 62 3e  tls::status </b>
0760: 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61  <em>?-local? cha
0770: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 62 72 3e 0a 3c 2f  nnel</em><br>.</
0780: 61 3e 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a  a><a href="#tls:
0790: 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c 62 3e 74  :handshake"><b>t
07a0: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62  ls::handshake</b
07b0: 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 3c 2f 65  ><em> channel</e
07c0: 6d 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 62 72 3e 0a  m></a><br>.<br>.
07d0: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 69  <a href="#tls::i
07e0: 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69  mport"><b>tls::i
07f0: 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61  mport </b><i>cha
0800: 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f  nnel ?options?</
0810: 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72  i></a><br>.<a hr
0820: 65 66 3d 22 23 74 6c 73 3a 3a 75 6e 69 6d 70 6f  ef="#tls::unimpo
0830: 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d  rt"><b>tls::unim
0840: 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e  port </b><i>chan
0850: 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a  nel</i></a><br>.
0860: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 63  <a href="#tls::c
0870: 69 70 68 65 72 73 20 70 72 6f 74 6f 63 6f 6c 20  iphers protocol 
0880: 3f 76 65 72 62 6f 73 65 3f 22 3e 3c 73 74 72 6f  ?verbose?"><stro
0890: 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c  ng>tls::ciphers<
08a0: 2f 73 74 72 6f 6e 67 3e 0a 3c 65 6d 3e 70 72 6f  /strong>.<em>pro
08b0: 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 3c  tocol ?verbose?<
08c0: 2f 65 6d 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20  /em></a><br>.<a 
08d0: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 76 65 72 73  href="#tls::vers
08e0: 69 6f 6e 22 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72  ion"><b>tls::ver
08f0: 73 69 6f 6e 3c 2f 62 3e 3c 2f 61 3e 0a 3c 2f 70  sion</b></a>.</p
0900: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  >..<h3><a name="
0910: 44 45 53 43 52 49 50 54 49 4f 4e 22 3e 44 45 53  DESCRIPTION">DES
0920: 43 52 49 50 54 49 4f 4e 3c 2f 61 3e 3c 2f 68 33  CRIPTION</a></h3
0930: 3e 0a 0a 3c 70 3e 54 68 69 73 20 65 78 74 65 6e  >..<p>This exten
0940: 73 69 6f 6e 20 70 72 6f 76 69 64 65 73 20 61 20  sion provides a 
0950: 67 65 6e 65 72 69 63 20 62 69 6e 64 69 6e 67 20  generic binding 
0960: 74 6f 20 3c 61 0a 68 72 65 66 3d 22 68 74 74 70  to <a.href="http
0970: 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f  ://www.openssl.o
0980: 72 67 2f 22 3e 4f 70 65 6e 53 53 4c 3c 2f 61 3e  rg/">OpenSSL</a>
0990: 2c 20 75 74 69 6c 69 7a 69 6e 67 20 74 68 65 0a  , utilizing the.
09a0: 3c 73 74 72 6f 6e 67 3e 54 63 6c 5f 53 74 61 63  <strong>Tcl_Stac
09b0: 6b 43 68 61 6e 6e 65 6c 3c 2f 73 74 72 6f 6e 67  kChannel</strong
09c0: 3e 0a 41 50 49 20 66 6f 72 20 54 63 6c 20 38 2e  >.API for Tcl 8.
09d0: 32 20 61 6e 64 20 68 69 67 68 65 72 2e 20 54 68  2 and higher. Th
09e0: 65 20 73 6f 63 6b 65 74 73 20 62 65 68 61 76 65  e sockets behave
09f0: 20 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d   exactly the sam
0a00: 65 0a 61 73 20 63 68 61 6e 6e 65 6c 73 20 63 72  e.as channels cr
0a10: 65 61 74 65 64 20 75 73 69 6e 67 20 54 63 6c 27  eated using Tcl'
0a20: 73 20 62 75 69 6c 74 2d 69 6e 20 3c 73 74 72 6f  s built-in <stro
0a30: 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e  ng>socket</stron
0a40: 67 3e 0a 63 6f 6d 6d 61 6e 64 20 77 69 74 68 20  g>.command with 
0a50: 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f  additional optio
0a60: 6e 73 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 6c 69  ns for controlli
0a70: 6e 67 20 74 68 65 20 53 53 4c 20 73 65 73 73 69  ng the SSL sessi
0a80: 6f 6e 2e 0a 54 6f 20 75 73 65 20 54 4c 53 20 77  on..To use TLS w
0a90: 69 74 68 20 61 6e 20 65 61 72 6c 69 65 72 20 76  ith an earlier v
0aa0: 65 72 73 69 6f 6e 20 6f 66 20 54 63 6c 20 74 68  ersion of Tcl th
0ab0: 61 6e 20 38 2e 34 2c 20 70 6c 65 61 73 65 20 6f  an 8.4, please o
0ac0: 62 74 61 69 6e 0a 54 4c 53 20 31 2e 33 2e 0a 3c  btain.TLS 1.3..<
0ad0: 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65  /p>..<h3><a name
0ae0: 3d 22 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d  ="COMMANDS">COMM
0af0: 41 4e 44 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c  ANDS</a></h3>..<
0b00: 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f 6e 65 20  p>Typically one 
0b10: 77 6f 75 6c 64 20 75 73 65 20 74 68 65 20 3c 73  would use the <s
0b20: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65  trong>tls::socke
0b30: 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f 6d 6d 61  t </strong>comma
0b40: 6e 64 0a 77 68 69 63 68 20 70 72 6f 76 69 64 65  nd.which provide
0b50: 73 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20  s compatibility 
0b60: 77 69 74 68 20 74 68 65 20 6e 61 74 69 76 65 20  with the native 
0b70: 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b  Tcl <strong>sock
0b80: 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63 6f 6d 6d  et</strong>.comm
0b90: 61 6e 64 2e 20 49 6e 20 73 75 63 68 20 63 61 73  and. In such cas
0ba0: 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  es <strong>tls::
0bb0: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 20  import</strong> 
0bc0: 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 0a 75 73  should not be.us
0bd0: 65 64 20 64 69 72 65 63 74 6c 79 2e 3c 2f 70 3e  ed directly.</p>
0be0: 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c  ..<dl>.    <dt><
0bf0: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 69 6e 69  a name="tls::ini
0c00: 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20  t"><b>tls::init 
0c10: 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f  </b><i>?options?
0c20: 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20  </i></a></dt>.  
0c30: 20 20 3c 64 64 3e 54 68 69 73 20 72 6f 75 74 69    <dd>This routi
0c40: 6e 65 20 73 65 74 73 20 74 68 65 20 64 65 66 61  ne sets the defa
0c50: 75 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65 64  ult options used
0c60: 20 62 79 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a   by <strong>tls:
0c70: 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e  :socket</strong>
0c80: 0a 20 20 20 20 20 20 20 20 61 6e 64 20 69 73 20  .        and is 
0c90: 3c 65 6d 3e 6f 70 74 69 6f 6e 61 6c 3c 2f 65 6d  <em>optional</em
0ca0: 3e 2e 20 49 66 20 79 6f 75 20 63 61 6c 6c 20 3c  >. If you call <
0cb0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f  strong>tls::impo
0cc0: 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20  rt</strong>.    
0cd0: 20 20 20 20 64 69 72 65 63 74 6c 79 20 74 68 69      directly thi
0ce0: 73 20 72 6f 75 74 69 6e 65 20 68 61 73 20 6e 6f  s routine has no
0cf0: 20 65 66 66 65 63 74 2e 20 41 6e 79 20 6f 66 20   effect. Any of 
0d00: 74 68 65 20 6f 70 74 69 6f 6e 73 0a 20 20 20 20  the options.    
0d10: 20 20 20 20 74 68 61 74 20 3c 73 74 72 6f 6e 67      that <strong
0d20: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74  >tls::socket</st
0d30: 72 6f 6e 67 3e 20 61 63 63 65 70 74 73 20 63 61  rong> accepts ca
0d40: 6e 20 62 65 20 73 65 74 0a 20 20 20 20 20 20 20  n be set.       
0d50: 20 75 73 69 6e 67 20 74 68 69 73 20 63 6f 6d 6d   using this comm
0d60: 61 6e 64 2c 20 74 68 6f 75 67 68 20 79 6f 75 20  and, though you 
0d70: 73 68 6f 75 6c 64 20 6c 69 6d 69 74 20 79 6f 75  should limit you
0d80: 72 20 6f 70 74 69 6f 6e 73 0a 20 20 20 20 20 20  r options.      
0d90: 20 20 74 6f 20 6f 6e 6c 79 20 54 4c 53 20 72 65    to only TLS re
0da0: 6c 61 74 65 64 20 6f 6e 65 73 2e 3c 2f 64 64 3e  lated ones.</dd>
0db0: 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c  .    <dt>&nbsp;<
0dc0: 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20  /dt>.    <dt><a 
0dd0: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 6f 63 6b 65  name="tls::socke
0de0: 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65  t"><b>tls::socke
0df0: 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f  t </b><em>?optio
0e00: 6e 73 3f 0a 20 20 20 20 20 20 20 20 68 6f 73 74  ns?.        host
0e10: 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f   port</em></a></
0e20: 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 62 3e 74  dt>.    <dt><b>t
0e30: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65  ls::socket</b><e
0e40: 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d  m> ?-server comm
0e50: 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70  and? ?options? p
0e60: 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ort</em></dt>.  
0e70: 20 20 3c 64 64 3e 54 68 69 73 20 69 73 20 61 20    <dd>This is a 
0e80: 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e 20  helper function 
0e90: 74 68 61 74 20 75 74 69 6c 69 7a 65 73 20 74 68  that utilizes th
0ea0: 65 20 75 6e 64 65 72 6c 79 69 6e 67 0a 20 20 20  e underlying.   
0eb0: 20 20 20 20 20 63 6f 6d 6d 61 6e 64 73 20 28 3c       commands (<
0ec0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f  strong>tls::impo
0ed0: 72 74 3c 2f 73 74 72 6f 6e 67 3e 29 2e 20 49 74  rt</strong>). It
0ee0: 20 62 65 68 61 76 65 73 0a 20 20 20 20 20 20 20   behaves.       
0ef0: 20 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d   exactly the sam
0f00: 65 20 61 73 20 74 68 65 20 6e 61 74 69 76 65 20  e as the native 
0f10: 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b  Tcl <strong>sock
0f20: 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20  et</strong>.    
0f30: 20 20 20 20 63 6f 6d 6d 61 6e 64 20 65 78 63 65      command exce
0f40: 70 74 20 74 68 61 74 20 74 68 65 20 6f 70 74 69  pt that the opti
0f50: 6f 6e 73 20 63 61 6e 20 69 6e 63 6c 75 64 65 20  ons can include 
0f60: 61 6e 79 20 6f 66 20 74 68 65 0a 20 20 20 20 20  any of the.     
0f70: 20 20 20 61 70 70 6c 69 63 61 62 6c 65 20 3c 61     applicable <a
0f80: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 69 6d 70   href="#tls::imp
0f90: 6f 72 74 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  ort"><strong>tls
0fa0: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e  :import</strong>
0fb0: 3c 2f 61 3e 0a 20 20 20 20 20 20 20 20 6f 70 74  </a>.        opt
0fc0: 69 6f 6e 73 20 77 69 74 68 20 6f 6e 65 20 61 64  ions with one ad
0fd0: 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 3a  ditional option:
0fe0: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20  .<blockquote>.  
0ff0: 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c    <dl>.        <
1000: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 75 74 6f  dt><strong>-auto
1010: 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74 72 6f  servername</stro
1020: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
1030: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
1040: 64 64 3e 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79  dd>Automatically
1050: 20 73 65 6e 64 20 74 68 65 20 2d 73 65 72 76 65   send the -serve
1060: 72 6e 61 6d 65 20 61 73 20 74 68 65 20 3c 65 6d  rname as the <em
1070: 3e 68 6f 73 74 3c 2f 65 6d 3e 20 61 72 67 75 6d  >host</em> argum
1080: 65 6e 74 0a 20 20 20 20 20 20 20 20 20 20 20 20  ent.            
1090: 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74  (<strong>default
10a0: 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66  </strong>: <em>f
10b0: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a  alse</em>)</dd>.
10c0: 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63      </dl>.</bloc
10d0: 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 74 3e  kquote>.    <dt>
10e0: 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20  &nbsp;</dt>.    
10f0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73  <dt><a name="tls
1100: 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c 73 74  ::handshake"><st
1110: 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e 64 73 68  rong>tls::handsh
1120: 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ake</strong> <em
1130: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61  >channel</em></a
1140: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 46  ></dt>.    <dd>F
1150: 6f 72 63 65 73 20 68 61 6e 64 73 68 61 6b 65 20  orces handshake 
1160: 74 6f 20 74 61 6b 65 20 70 6c 61 63 65 2c 20 61  to take place, a
1170: 6e 64 20 72 65 74 75 72 6e 73 20 30 20 69 66 0a  nd returns 0 if.
1180: 20 20 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b          handshak
1190: 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 72  e is still in pr
11a0: 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63  ogress (non-bloc
11b0: 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 0a 20  king), or 1 if. 
11c0: 20 20 20 20 20 20 20 74 68 65 20 68 61 6e 64 73         the hands
11d0: 68 61 6b 65 20 77 61 73 20 73 75 63 63 65 73 73  hake was success
11e0: 66 75 6c 2e 20 49 66 20 74 68 65 20 68 61 6e 64  ful. If the hand
11f0: 73 68 61 6b 65 20 66 61 69 6c 65 64 0a 20 20 20  shake failed.   
1200: 20 20 20 20 20 74 68 69 73 20 72 6f 75 74 69 6e       this routin
1210: 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20  e will throw an 
1220: 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 20 20 20  error.</dd>.    
1230: 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a  <dt>&nbsp;</dt>.
1240: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
1250: 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73  "tls::status"><s
1260: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75  trong>tls::statu
1270: 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c  s</strong>.    <
1280: 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61 6e  em>?-local? chan
1290: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74  nel</em></a></dt
12a0: 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e  >.    <dd>Return
12b0: 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 65  s the current se
12c0: 63 75 72 69 74 79 20 73 74 61 74 75 73 20 6f 66  curity status of
12d0: 20 61 6e 20 53 53 4c 20 63 68 61 6e 6e 65 6c 2e   an SSL channel.
12e0: 20 54 68 65 0a 20 20 20 20 20 20 20 20 72 65 73   The.        res
12f0: 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66  ult is a list of
1300: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73   key-value pairs
1310: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 0a   describing the.
1320: 20 20 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 65          connecte
1330: 64 20 70 65 65 72 2e 20 49 66 20 74 68 65 20 72  d peer. If the r
1340: 65 73 75 6c 74 20 69 73 20 61 6e 20 65 6d 70 74  esult is an empt
1350: 79 20 6c 69 73 74 20 74 68 65 6e 20 74 68 65 0a  y list then the.
1360: 20 20 20 20 20 20 20 20 53 53 4c 20 68 61 6e 64          SSL hand
1370: 73 68 61 6b 65 20 68 61 73 20 6e 6f 74 20 79 65  shake has not ye
1380: 74 20 63 6f 6d 70 6c 65 74 65 64 2e 0a 20 20 20  t completed..   
1390: 20 20 20 20 20 49 66 20 3c 65 6d 3e 2d 6c 6f 63       If <em>-loc
13a0: 61 6c 3c 2f 65 6d 3e 20 69 73 20 67 69 76 65 6e  al</em> is given
13b0: 2c 20 74 68 65 6e 20 74 68 65 20 63 65 72 74 69  , then the certi
13c0: 66 69 63 61 74 65 20 69 6e 66 6f 72 6d 61 74 69  ficate informati
13d0: 6f 6e 0a 20 20 20 20 20 20 20 20 69 73 20 74 68  on.        is th
13e0: 65 20 6f 6e 65 20 75 73 65 64 20 6c 6f 63 61 6c  e one used local
13f0: 6c 79 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a  ly.</dd>.</dl>..
1400: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20  <blockquote>.   
1410: 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64   <dl>.        <d
1420: 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72  t><strong>issuer
1430: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e  </strong> <em>dn
1440: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1450: 20 20 20 3c 64 64 3e 54 68 65 20 64 69 73 74 69     <dd>The disti
1460: 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44  nguished name (D
1470: 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69 66  N) of the certif
1480: 69 63 61 74 65 0a 20 20 20 20 20 20 20 20 20 20  icate.          
1490: 20 20 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 20    issuer.</dd>. 
14a0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
14b0: 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72 6f  ng>subject</stro
14c0: 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c  ng> <em>dn</em><
14d0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
14e0: 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69 73 68  >The distinguish
14f0: 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20  ed name (DN) of 
1500: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 0a  the certificate.
1510: 20 20 20 20 20 20 20 20 20 20 20 20 73 75 62 6a              subj
1520: 65 63 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  ect.</dd>.      
1530: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f    <dt><strong>no
1540: 74 42 65 66 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e  tBefore</strong>
1550: 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f   <em>date</em></
1560: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e  dt>.        <dd>
1570: 54 68 65 20 62 65 67 69 6e 20 64 61 74 65 20 66  The begin date f
1580: 6f 72 20 74 68 65 20 76 61 6c 69 64 69 74 79 20  or the validity 
1590: 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61  of the certifica
15a0: 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  te.</dd>.       
15b0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74   <dt><strong>not
15c0: 41 66 74 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c  After</strong> <
15d0: 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74  em>date</em></dt
15e0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68  >.        <dd>Th
15f0: 65 20 65 78 70 69 72 79 20 64 61 74 65 20 66 6f  e expiry date fo
1600: 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  r the certificat
1610: 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  e.</dd>.        
1620: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69  <dt><strong>seri
1630: 61 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  al</strong> <em>
1640: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  n</em></dt>.    
1650: 20 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69      <dd>The seri
1660: 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65  al number of the
1670: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64   certificate.</d
1680: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1690: 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73  strong>cipher</s
16a0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65  trong> <em>ciphe
16b0: 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  r</em></dt>.    
16c0: 20 20 20 20 3c 64 64 3e 54 68 65 20 63 75 72 72      <dd>The curr
16d0: 65 6e 74 20 63 69 70 68 65 72 20 69 6e 20 75 73  ent cipher in us
16e0: 65 20 62 65 74 77 65 65 6e 20 74 68 65 20 63 6c  e between the cl
16f0: 69 65 6e 74 20 61 6e 64 0a 20 20 20 20 20 20 20  ient and.       
1700: 20 20 20 20 20 73 65 72 76 65 72 20 63 68 61 6e       server chan
1710: 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20  nels.</dd>.     
1720: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73     <dt><strong>s
1730: 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  bits</strong> <e
1740: 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  m>n</em></dt>.  
1750: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75        <dd>The nu
1760: 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75 73 65  mber of bits use
1770: 64 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f  d for the sessio
1780: 6e 20 6b 65 79 2e 3c 2f 64 64 3e 0a 20 20 20 20  n key.</dd>.    
1790: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
17a0: 63 65 72 74 69 66 69 63 61 74 65 3c 2f 73 74 72  certificate</str
17b0: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c  ong> <em>n</em><
17c0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
17d0: 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f 64 65 64  >The PEM encoded
17e0: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64   certificate.</d
17f0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c  d>.        <dt><
1800: 73 74 72 6f 6e 67 3e 76 65 72 73 69 6f 6e 3c 2f  strong>version</
1810: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 61 6c 75  strong> <em>valu
1820: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  e</em></dt>.    
1830: 20 20 20 20 3c 64 64 3e 54 68 65 20 70 72 6f 74      <dd>The prot
1840: 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65  ocol version use
1850: 64 20 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63  d for the connec
1860: 74 69 6f 6e 3a 0a 09 20 20 53 53 4c 76 32 2c 20  tion:..  SSLv2, 
1870: 53 53 4c 76 33 2c 20 54 4c 53 76 31 2c 20 54 4c  SSLv3, TLSv1, TL
1880: 53 76 31 2e 31 2c 20 54 4c 53 76 31 2e 32 2c 20  Sv1.1, TLSv1.2, 
1890: 75 6e 6b 6e 6f 77 6e 3c 2f 64 64 3e 0a 20 20 20  unknown</dd>.   
18a0: 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75   </dl>.</blockqu
18b0: 6f 74 65 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c  ote>..<dl>.    <
18c0: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
18d0: 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a  :import"><b>tls:
18e0: 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63  :import </b><i>c
18f0: 68 61 6e 6e 65 6c 0a 20 20 20 20 20 20 20 20 3f  hannel.        ?
1900: 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e  options?</i></a>
1910: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 53 53  </dt>.    <dd>SS
1920: 4c 2d 65 6e 61 62 6c 65 20 61 20 72 65 67 75 6c  L-enable a regul
1930: 61 72 20 54 63 6c 20 63 68 61 6e 6e 65 6c 20 2d  ar Tcl channel -
1940: 20 69 74 20 6e 65 65 64 20 6e 6f 74 20 62 65 20   it need not be 
1950: 61 0a 20 20 20 20 20 20 20 20 73 6f 63 6b 65 74  a.        socket
1960: 2c 20 62 75 74 20 6d 75 73 74 20 70 72 6f 76 69  , but must provi
1970: 64 65 20 62 69 2d 64 69 72 65 63 74 69 6f 6e 61  de bi-directiona
1980: 6c 20 66 6c 6f 77 2e 20 41 6c 73 6f 0a 20 20 20  l flow. Also.   
1990: 20 20 20 20 20 73 65 74 74 69 6e 67 20 73 65 73       setting ses
19a0: 73 69 6f 6e 20 70 61 72 61 6d 65 74 65 72 73 20  sion parameters 
19b0: 66 6f 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b  for SSL handshak
19c0: 65 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c  e.</dd>.</dl>..<
19d0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20  blockquote>.    
19e0: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  <dl>.        <dt
19f0: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c  ><strong>-cadir<
1a00: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72  /strong> <em>dir
1a10: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1a20: 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 74     <dd>Provide t
1a30: 68 65 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e  he directory con
1a40: 74 61 69 6e 69 6e 67 20 74 68 65 20 43 41 20 63  taining the CA c
1a50: 65 72 74 69 66 69 63 61 74 65 73 2e 3c 2f 64 64  ertificates.</dd
1a60: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
1a70: 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65 20 3c 2f  trong>-cafile </
1a80: 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e  strong><em>filen
1a90: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20  ame</em></dt>.  
1aa0: 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64        <dd>Provid
1ab0: 65 20 74 68 65 20 43 41 20 66 69 6c 65 2e 3c 2f  e the CA file.</
1ac0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
1ad0: 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 66 69 6c  <strong>-certfil
1ae0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66  e</strong> <em>f
1af0: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74  ilename</em></dt
1b00: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72  >.        <dd>Pr
1b10: 6f 76 69 64 65 20 74 68 65 20 6e 61 6d 65 20 6f  ovide the name o
1b20: 66 20 61 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e  f a file contain
1b30: 69 6e 67 20 63 65 72 74 69 66 69 63 61 74 65 20  ing certificate 
1b40: 74 6f 20 75 73 65 2e 3c 2f 64 64 3e 0a 20 20 20  to use.</dd>.   
1b50: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67       <dt><strong
1b60: 3e 2d 63 65 72 74 3c 2f 73 74 72 6f 6e 67 3e 20  >-cert</strong> 
1b70: 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d  <em>filename</em
1b80: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
1b90: 64 64 3e 50 72 6f 76 69 64 65 20 74 68 65 20 63  dd>Provide the c
1ba0: 6f 6e 74 65 6e 74 73 20 6f 66 20 61 20 63 65 72  ontents of a cer
1bb0: 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 2c  tificate to use,
1bc0: 20 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65   as a DER encode
1bd0: 64 20 62 69 6e 61 72 79 20 76 61 6c 75 65 20 28  d binary value (
1be0: 58 2e 35 30 39 20 44 45 52 29 2e 3c 2f 64 64 3e  X.509 DER).</dd>
1bf0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74  .        <dt><st
1c00: 72 6f 6e 67 3e 2d 63 69 70 68 65 72 20 3c 2f 73  rong>-cipher </s
1c10: 74 72 6f 6e 67 3e 3c 65 6d 3e 73 74 72 69 6e 67  trong><em>string
1c20: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
1c30: 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 74     <dd>Provide t
1c40: 68 65 20 63 69 70 68 65 72 20 73 75 69 74 65 73  he cipher suites
1c50: 20 74 6f 20 75 73 65 2e 20 53 79 6e 74 61 78 20   to use. Syntax 
1c60: 69 73 20 61 73 20 70 65 72 0a 20 20 20 20 20 20  is as per.      
1c70: 20 20 20 20 20 20 4f 70 65 6e 53 53 4c 2e 3c 2f        OpenSSL.</
1c80: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
1c90: 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64  <strong>-command
1ca0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61  </strong> <em>ca
1cb0: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e  llback</em></dt>
1cc0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 49 66 20  .        <dd>If 
1cd0: 73 70 65 63 69 66 69 65 64 2c 20 74 68 69 73 20  specified, this 
1ce0: 63 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62 65  callback will be
1cf0: 20 69 6e 76 6f 6b 65 64 20 61 74 20 73 65 76 65   invoked at seve
1d00: 72 61 6c 20 70 6f 69 6e 74 73 0a 20 20 20 20 20  ral points.     
1d10: 20 20 20 20 20 20 20 64 75 72 69 6e 67 20 74 68         during th
1d20: 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e 64 73 68  e OpenSSL handsh
1d30: 61 6b 65 2e 20 20 49 74 20 63 61 6e 20 70 61 73  ake.  It can pas
1d40: 73 20 65 72 72 6f 72 73 20 61 6e 64 20 74 72 61  s errors and tra
1d50: 63 69 6e 67 0a 20 20 20 20 20 20 20 20 20 20 20  cing.           
1d60: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e   information, an
1d70: 64 20 69 74 20 63 61 6e 20 61 6c 6c 6f 77 20 54  d it can allow T
1d80: 63 6c 20 73 63 72 69 70 74 73 20 74 6f 20 70 65  cl scripts to pe
1d90: 72 66 6f 72 6d 0a 20 20 20 20 20 20 20 20 20 20  rform.          
1da0: 20 20 74 68 65 69 72 20 6f 77 6e 20 76 61 6c 69    their own vali
1db0: 64 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 65  dation of the ce
1dc0: 72 74 69 66 69 63 61 74 65 20 69 6e 20 70 6c 61  rtificate in pla
1dd0: 63 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 20  ce of the.      
1de0: 20 20 20 20 20 20 64 65 66 61 75 6c 74 20 76 61        default va
1df0: 6c 69 64 61 74 69 6f 6e 20 70 72 6f 76 69 64 65  lidation provide
1e00: 64 20 62 79 20 4f 70 65 6e 53 53 4c 2e 0a 20 20  d by OpenSSL..  
1e10: 20 20 20 20 20 20 20 20 20 20 3c 62 72 3e 0a 20            <br>. 
1e20: 20 20 20 20 20 20 20 20 20 20 20 53 65 65 20 3c             See <
1e30: 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43  a href="#CALLBAC
1e40: 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42  K OPTIONS">CALLB
1e50: 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 20  ACK OPTIONS</a> 
1e60: 66 6f 72 0a 20 20 20 20 20 20 20 20 20 20 20 20  for.            
1e70: 66 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69  further discussi
1e80: 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  on.</dd>.       
1e90: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 64 68   <dt><strong>-dh
1ea0: 70 61 72 61 6d 73 20 3c 2f 73 74 72 6f 6e 67 3e  params </strong>
1eb0: 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d  <em>filename</em
1ec0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
1ed0: 64 64 3e 50 72 6f 76 69 64 65 20 61 20 44 69 66  dd>Provide a Dif
1ee0: 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 70 61 72 61  fie-Hellman para
1ef0: 6d 65 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64  meters file.</dd
1f00: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73  >.        <dt><s
1f10: 74 72 6f 6e 67 3e 2d 6b 65 79 66 69 6c 65 3c 2f  trong>-keyfile</
1f20: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65  strong> <em>file
1f30: 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  name</em></dt>. 
1f40: 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69         <dd>Provi
1f50: 64 65 20 74 68 65 20 70 72 69 76 61 74 65 20 6b  de the private k
1f60: 65 79 20 66 69 6c 65 2e 20 28 3c 73 74 72 6f 6e  ey file. (<stron
1f70: 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e  g>default</stron
1f80: 67 3e 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20  g>:.            
1f90: 76 61 6c 75 65 20 6f 66 20 2d 63 65 72 74 66 69  value of -certfi
1fa0: 6c 65 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  le)</dd>.       
1fb0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65   <dt><strong>-ke
1fc0: 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66  y</strong> <em>f
1fd0: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74  ilename</em></dt
1fe0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72  >.        <dd>Pr
1ff0: 6f 76 69 64 65 20 74 68 65 20 70 72 69 76 61 74  ovide the privat
2000: 65 20 6b 65 79 20 74 6f 20 75 73 65 20 61 73 20  e key to use as 
2010: 61 20 44 45 52 20 65 6e 63 6f 64 65 64 20 76 61  a DER encoded va
2020: 6c 75 65 20 28 50 4b 43 53 23 31 20 44 45 52 29  lue (PKCS#1 DER)
2030: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
2040: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6d 6f 64 65 6c  t><strong>-model
2050: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68  </strong> <em>ch
2060: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  annel</em></dt>.
2070: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 69 73          <dd>This
2080: 20 77 69 6c 6c 20 66 6f 72 63 65 20 74 68 69 73   will force this
2090: 20 63 68 61 6e 6e 65 6c 20 74 6f 20 73 68 61 72   channel to shar
20a0: 65 20 74 68 65 20 73 61 6d 65 20 3c 65 6d 3e 3c  e the same <em><
20b0: 73 74 72 6f 6e 67 3e 53 53 4c 5f 43 54 58 3c 2f  strong>SSL_CTX</
20c0: 73 74 72 6f 6e 67 3e 3c 2f 65 6d 3e 0a 20 20 20  strong></em>.   
20d0: 20 20 20 20 20 20 20 20 20 73 74 72 75 63 74 75           structu
20e0: 72 65 20 61 73 20 74 68 65 20 73 70 65 63 69 66  re as the specif
20f0: 69 65 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c  ied <em>channel<
2100: 2f 65 6d 3e 2c 20 61 6e 64 0a 20 20 20 20 20 20  /em>, and.      
2110: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 20        therefore 
2120: 73 68 61 72 65 20 63 61 6c 6c 62 61 63 6b 73 20  share callbacks 
2130: 65 74 63 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  etc.</dd>.      
2140: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70    <dt><strong>-p
2150: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e  assword</strong>
2160: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65   <em>callback</e
2170: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20  m></dt>.        
2180: 3c 64 64 3e 49 66 20 73 75 70 70 6c 69 65 64 2c  <dd>If supplied,
2190: 20 74 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 77   this callback w
21a0: 69 6c 6c 20 62 65 20 69 6e 76 6f 6b 65 64 20 77  ill be invoked w
21b0: 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64  hen OpenSSL need
21c0: 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 6f  s.            to
21d0: 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73 77 6f   obtain a passwo
21e0: 72 64 2c 20 74 79 70 69 63 61 6c 6c 79 20 74 6f  rd, typically to
21f0: 20 75 6e 6c 6f 63 6b 20 74 68 65 20 70 72 69 76   unlock the priv
2200: 61 74 65 20 6b 65 79 20 6f 66 0a 09 20 20 20 20  ate key of..    
2210: 61 20 63 65 72 74 69 66 69 63 61 74 65 2e 0a 20  a certificate.. 
2220: 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 63             The c
2230: 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72  allback should r
2240: 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 77  eturn a string w
2250: 68 69 63 68 20 72 65 70 72 65 73 65 6e 74 73 20  hich represents 
2260: 74 68 65 0a 20 20 20 20 20 20 20 20 20 20 20 20  the.            
2270: 70 61 73 73 77 6f 72 64 20 74 6f 20 62 65 20 75  password to be u
2280: 73 65 64 2e 0a 20 20 20 20 20 20 20 20 20 20 20  sed..           
2290: 20 3c 62 72 3e 0a 20 20 20 20 20 20 20 20 20 20   <br>.          
22a0: 20 20 53 65 65 20 3c 61 20 68 72 65 66 3d 22 23    See <a href="#
22b0: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53  CALLBACK OPTIONS
22c0: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f  ">CALLBACK OPTIO
22d0: 4e 53 3c 2f 61 3e 20 66 6f 72 0a 20 20 20 20 20  NS</a> for.     
22e0: 20 20 20 20 20 20 20 66 75 72 74 68 65 72 20 64         further d
22f0: 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a  iscussion.</dd>.
2300: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72          <dt><str
2310: 6f 6e 67 3e 2d 72 65 71 75 65 73 74 20 3c 2f 73  ong>-request </s
2320: 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f  trong><em>bool</
2330: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  em></dt>.       
2340: 20 3c 64 64 3e 52 65 71 75 65 73 74 20 61 20 63   <dd>Request a c
2350: 65 72 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20  ertificate from 
2360: 70 65 65 72 20 64 75 72 69 6e 67 20 53 53 4c 20  peer during SSL 
2370: 68 61 6e 64 73 68 61 6b 65 2e 0a 20 20 20 20 20  handshake..     
2380: 20 20 20 20 20 20 20 28 3c 73 74 72 6f 6e 67 3e         (<strong>
2390: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e  default</strong>
23a0: 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29  : <em>true</em>)
23b0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64  </dd>.        <d
23c0: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69  t><strong>-requi
23d0: 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  re</strong> <em>
23e0: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  bool</em></dt>. 
23f0: 20 20 20 20 20 20 20 3c 64 64 3e 52 65 71 75 69         <dd>Requi
2400: 72 65 20 61 20 76 61 6c 69 64 20 63 65 72 74 69  re a valid certi
2410: 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72  ficate from peer
2420: 20 64 75 72 69 6e 67 20 53 53 4c 0a 20 20 20 20   during SSL.    
2430: 20 20 20 20 20 20 20 20 68 61 6e 64 73 68 61 6b          handshak
2440: 65 2e 20 49 66 20 74 68 69 73 20 69 73 20 73 65  e. If this is se
2450: 74 20 74 6f 20 74 72 75 65 20 74 68 65 6e 20 3c  t to true then <
2460: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 3c  strong>-request<
2470: 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 20 20 20  /strong>.       
2480: 20 20 20 20 20 6d 75 73 74 20 61 6c 73 6f 20 62       must also b
2490: 65 20 73 65 74 20 74 6f 20 74 72 75 65 2e 20 28  e set to true. (
24a0: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c  <strong>default<
24b0: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61  /strong>: <em>fa
24c0: 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20  lse</em>)</dd>. 
24d0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f         <dt><stro
24e0: 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73 74 72 6f  ng>-server</stro
24f0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
2500: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c  ></dt>.        <
2510: 64 64 3e 48 61 6e 64 73 68 61 6b 65 20 61 73 20  dd>Handshake as 
2520: 73 65 72 76 65 72 20 69 66 20 74 72 75 65 2c 20  server if true, 
2530: 65 6c 73 65 20 68 61 6e 64 73 68 61 6b 65 20 61  else handshake a
2540: 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6c  s.            cl
2550: 69 65 6e 74 2e 28 3c 73 74 72 6f 6e 67 3e 64 65  ient.(<strong>de
2560: 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20  fault</strong>: 
2570: 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c  <em>false</em>)<
2580: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74  /dd>.        <dt
2590: 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72  ><strong>-server
25a0: 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  name</strong> <e
25b0: 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e  m>host</em></dt>
25c0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 4f 6e 6c  .        <dd>Onl
25d0: 79 20 61 76 61 69 6c 61 62 6c 65 20 69 66 20 74  y available if t
25e0: 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61  he OpenSSL libra
25f0: 72 79 20 74 68 65 20 70 61 63 6b 61 67 65 20 69  ry the package i
2600: 73 20 6c 69 6e 6b 65 64 0a 09 20 20 20 20 61 67  s linked..    ag
2610: 61 69 6e 73 74 20 73 75 70 70 6f 72 74 73 20 74  ainst supports t
2620: 68 65 20 54 4c 53 20 68 6f 73 74 6e 61 6d 65 20  he TLS hostname 
2630: 65 78 74 65 6e 73 69 6f 6e 20 66 6f 72 20 27 53  extension for 'S
2640: 65 72 76 65 72 20 4e 61 6d 65 0a 09 20 20 20 20  erver Name..    
2650: 49 6e 64 69 63 61 74 69 6f 6e 27 20 28 53 4e 49  Indication' (SNI
2660: 29 2e 20 55 73 65 20 74 6f 20 6e 61 6d 65 20 74  ). Use to name t
2670: 68 65 20 6c 6f 67 69 63 61 6c 20 68 6f 73 74 20  he logical host 
2680: 77 65 20 61 72 65 20 74 61 6c 6b 69 6e 67 0a 09  we are talking..
2690: 20 20 20 20 74 6f 20 61 6e 64 20 65 78 70 65 63      to and expec
26a0: 74 69 6e 67 20 61 20 63 65 72 74 69 66 69 63 61  ting a certifica
26b0: 74 65 20 66 6f 72 3c 2f 64 64 3e 0a 20 20 20 20  te for</dd>.    
26c0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e      <dt><strong>
26d0: 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c  -ssl2</strong> <
26e0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
26f0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e  >.        <dd>En
2700: 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20  able use of SSL 
2710: 76 32 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66  v2. (<strong>def
2720: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
2730: 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f  em>false</em>)</
2740: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e  dd>.        <dt>
2750: 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 20 3c 2f  <strong>-ssl3 </
2760: 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c  strong><em>bool<
2770: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20  /em></dt>.      
2780: 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65    <dd>Enable use
2790: 20 6f 66 20 53 53 4c 20 76 33 2e 20 28 3c 73 74   of SSL v3. (<st
27a0: 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74  rong>default</st
27b0: 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65  rong>: <em>false
27c0: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20  </em>)</dd>.    
27d0: 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67      <dt>-<strong
27e0: 3e 74 6c 73 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c  >tls1</strong> <
27f0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74  em>bool</em></dt
2800: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e  >.        <dd>En
2810: 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20  able use of TLS 
2820: 76 31 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66  v1. (<strong>def
2830: 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c  ault</strong>: <
2840: 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64  em>true</em>)</d
2850: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d  d>.        <dt>-
2860: 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 31 3c 2f  <strong>tls1.1</
2870: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c  strong> <em>bool
2880: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20  </em></dt>.     
2890: 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73     <dd>Enable us
28a0: 65 20 6f 66 20 54 4c 53 20 76 31 2e 31 20 28 3c  e of TLS v1.1 (<
28b0: 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f  strong>default</
28c0: 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 74 72 75  strong>: <em>tru
28d0: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20  e</em>)</dd>.   
28e0: 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e       <dt>-<stron
28f0: 67 3e 74 6c 73 31 2e 32 3c 2f 73 74 72 6f 6e 67  g>tls1.2</strong
2900: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c  > <em>bool</em><
2910: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64  /dt>.        <dd
2920: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54  >Enable use of T
2930: 4c 53 20 76 31 2e 32 20 28 3c 73 74 72 6f 6e 67  LS v1.2 (<strong
2940: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67  >default</strong
2950: 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e  >: <em>true</em>
2960: 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c  )</dd>.        <
2970: 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31  dt>-<strong>tls1
2980: 2e 33 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  .3</strong> <em>
2990: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  bool</em></dt>. 
29a0: 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c         <dd>Enabl
29b0: 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e  e use of TLS v1.
29c0: 33 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75  3 (<strong>defau
29d0: 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d  lt</strong>: <em
29e0: 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e  >true</em>)</dd>
29f0: 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f  .    </dl>.</blo
2a00: 63 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c 3e 0a 20  ckquote>..<dl>. 
2a10: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22     <dt><a name="
2a20: 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c  tls::unimport"><
2a30: 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 20  b>tls::unimport 
2a40: 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f  </b><i>channel</
2a50: 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  i></a></dt>.    
2a60: 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 66 6f 72  <dd>Provided for
2a70: 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 3c 73 74   symmetry to <st
2a80: 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74  rong>tls::import
2a90: 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 69 73 0a  </strong>, this.
2aa0: 20 20 20 20 20 20 75 6e 73 74 61 63 6b 73 20 74        unstacks t
2ab0: 68 65 20 53 53 4c 2d 65 6e 61 62 6c 69 6e 67 20  he SSL-enabling 
2ac0: 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54 63 6c  of a regular Tcl
2ad0: 20 63 68 61 6e 6e 65 6c 2e 20 20 41 6e 20 65 72   channel.  An er
2ae0: 72 6f 72 0a 20 20 20 20 20 20 69 73 20 74 68 72  ror.      is thr
2af0: 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 20 6e 6f  own if TLS is no
2b00: 74 20 74 68 65 20 74 6f 70 20 73 74 61 63 6b 65  t the top stacke
2b10: 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 65 2e 3c  d channel type.<
2b20: 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 64 6c 3e  /dd>.</dl>..<dl>
2b30: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
2b40: 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 70  ="tls::ciphers p
2b50: 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65  rotocol ?verbose
2b60: 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  ?"><strong>tls::
2b70: 63 69 70 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e  ciphers</strong>
2b80: 0a 20 20 20 20 20 20 20 20 3c 65 6d 3e 70 72 6f  .        <em>pro
2b90: 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 3c  tocol ?verbose?<
2ba0: 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20  /em></a></dt>.  
2bb0: 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 6c 69    <dd>Returns li
2bc0: 73 74 20 6f 66 20 73 75 70 70 6f 72 74 65 64 20  st of supported 
2bd0: 63 69 70 68 65 72 73 20 62 61 73 65 64 20 6f 6e  ciphers based on
2be0: 20 74 68 65 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f   the <em>protoco
2bf0: 6c 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 20 20 79  l</em>.        y
2c00: 6f 75 20 73 75 70 70 6c 79 2c 20 77 68 69 63 68  ou supply, which
2c10: 20 6d 75 73 74 20 62 65 20 6f 6e 65 20 6f 66 20   must be one of 
2c20: 3c 65 6d 3e 73 73 6c 32 2c 20 73 73 6c 33 2c 20  <em>ssl2, ssl3, 
2c30: 6f 72 20 74 6c 73 31 3c 2f 65 6d 3e 2e 0a 20 20  or tls1</em>..  
2c40: 20 20 20 20 20 20 49 66 20 3c 65 6d 3e 76 65 72        If <em>ver
2c50: 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 20 73 70 65  bose</em> is spe
2c60: 63 69 66 69 65 64 20 61 73 20 74 72 75 65 20 74  cified as true t
2c70: 68 65 6e 20 61 20 76 65 72 62 6f 73 65 2c 0a 20  hen a verbose,. 
2c80: 20 20 20 20 20 20 20 73 65 6d 69 2d 68 75 6d 61         semi-huma
2c90: 6e 20 72 65 61 64 61 62 6c 65 20 6c 69 73 74 20  n readable list 
2ca0: 69 73 20 72 65 74 75 72 6e 65 64 20 70 72 6f 76  is returned prov
2cb0: 69 64 69 6e 67 20 61 64 64 69 74 69 6f 6e 61 6c  iding additional
2cc0: 0a 20 20 20 20 20 20 20 20 69 6e 66 6f 72 6d 61  .        informa
2cd0: 74 69 6f 6e 20 6f 6e 20 74 68 65 20 6e 61 74 75  tion on the natu
2ce0: 72 65 20 6f 66 20 74 68 65 20 63 69 70 68 65 72  re of the cipher
2cf0: 20 73 75 70 70 6f 72 74 2e 20 49 6e 20 65 61 63   support. In eac
2d00: 68 0a 20 20 20 20 20 20 20 20 63 61 73 65 20 74  h.        case t
2d10: 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 20 54  he result is a T
2d20: 63 6c 20 6c 69 73 74 2e 3c 2f 64 64 3e 0a 3c 2f  cl list.</dd>.</
2d30: 64 6c 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64  dl>..<dl>.    <d
2d40: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
2d50: 76 65 72 73 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67  version"><strong
2d60: 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 73  >tls::version</s
2d70: 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a  trong></a></dt>.
2d80: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20      <dd>Returns 
2d90: 74 68 65 20 76 65 72 73 69 6f 6e 20 73 74 72 69  the version stri
2da0: 6e 67 20 64 65 66 69 6e 65 64 20 62 79 20 4f 70  ng defined by Op
2db0: 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c  enSSL.</dd>.</dl
2dc0: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  >..<h3><a name="
2dd0: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53  CALLBACK OPTIONS
2de0: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f  ">CALLBACK OPTIO
2df0: 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e  NS</a></h3>..<p>
2e00: 0a 41 73 20 69 6e 64 69 63 61 74 65 64 20 61 62  .As indicated ab
2e10: 6f 76 65 2c 20 69 6e 64 69 76 69 64 75 61 6c 20  ove, individual 
2e20: 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20 62 65 20  channels can be 
2e30: 67 69 76 65 6e 20 74 68 65 69 72 20 6f 77 6e 20  given their own 
2e40: 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20 68 61 6e  callbacks.to han
2e50: 64 6c 65 20 69 6e 74 65 72 6d 65 64 69 61 74 65  dle intermediate
2e60: 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20 74   processing by t
2e70: 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61  he OpenSSL libra
2e80: 72 79 2c 20 75 73 69 6e 67 20 74 68 65 0a 3c 65  ry, using the.<e
2e90: 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20  m>-command</em> 
2ea0: 61 6e 64 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72  and <em>-passwor
2eb0: 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 73 20 70  d</em> options p
2ec0: 61 73 73 65 64 20 74 6f 20 65 69 74 68 65 72 20  assed to either 
2ed0: 6f 66 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  of.<strong>tls::
2ee0: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20  socket</strong> 
2ef0: 6f 72 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  or <strong>tls::
2f00: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2e  import</strong>.
2f10: 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f  .</p>..<blockquo
2f20: 74 65 3e 0a 3c 64 6c 3e 0a 0a 20 20 20 20 3c 64  te>.<dl>..    <d
2f30: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61  t><strong>-comma
2f40: 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  nd</strong> <em>
2f50: 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64  callback</em></d
2f60: 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76  t>.    <dd>..Inv
2f70: 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 66 69  okes the specifi
2f80: 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c  ed <em>callback<
2f90: 2f 65 6d 3e 20 73 63 72 69 70 74 20 61 74 0a 09  /em> script at..
2fa0: 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64  several points d
2fb0: 75 72 69 6e 67 20 74 68 65 20 4f 70 65 6e 53 53  uring the OpenSS
2fc0: 4c 20 68 61 6e 64 73 68 61 6b 65 2e 0a 09 45 78  L handshake...Ex
2fd0: 63 65 70 74 20 61 73 20 69 6e 64 69 63 61 74 65  cept as indicate
2fe0: 64 20 62 65 6c 6f 77 2c 20 76 61 6c 75 65 73 20  d below, values 
2ff0: 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 74 68  returned from th
3000: 65 0a 09 63 61 6c 6c 62 61 63 6b 20 61 72 65 20  e..callback are 
3010: 69 67 6e 6f 72 65 64 2e 0a 09 41 72 67 75 6d 65  ignored...Argume
3020: 6e 74 73 20 61 70 70 65 6e 64 65 64 20 74 6f 20  nts appended to 
3030: 74 68 65 20 73 63 72 69 70 74 20 75 70 6f 6e 20  the script upon 
3040: 63 61 6c 6c 62 61 63 6b 20 74 61 6b 65 20 6f 6e  callback take on
3050: 65 20 6f 66 20 74 68 65 0a 09 66 6f 6c 6c 6f 77  e of the..follow
3060: 69 6e 67 20 66 6f 72 6d 73 3a 0a 0a 09 3c 62 72  ing forms:...<br
3070: 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a  >..<br>...<dl>..
3080: 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e  ..<dt>..  <stron
3090: 67 3e 69 6e 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20  g>info</strong> 
30a0: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f  <em>channel majo
30b0: 72 20 6d 69 6e 6f 72 20 6d 65 73 73 61 67 65 3c  r minor message<
30c0: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64  /em>..</dt>..<dd
30d0: 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f  >..  This form o
30e0: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e  f callback is in
30f0: 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65  voked by the Ope
3100: 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20  nSSL function.. 
3110: 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73   <code>SSL_CTX_s
3120: 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b  et_info_callback
3130: 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62  ()</code>...  <b
3140: 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 61  r>..  The <em>ma
3150: 6a 6f 72 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d  jor</em> and <em
3160: 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 72 67 75  >minor</em> argu
3170: 6d 65 6e 74 73 20 61 72 65 20 75 73 65 64 20 74  ments are used t
3180: 6f 0a 09 20 20 72 65 70 72 65 73 65 6e 74 20 74  o..  represent t
3190: 68 65 20 73 74 61 74 65 20 69 6e 66 6f 72 6d 61  he state informa
31a0: 74 69 6f 6e 20 62 69 74 6d 61 73 6b 2e 0a 09 20  tion bitmask... 
31b0: 20 3c 64 6c 3e 0a 09 20 20 3c 64 74 3e 50 6f 73   <dl>..  <dt>Pos
31c0: 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72  sible values for
31d0: 20 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20   <em>major</em> 
31e0: 61 72 65 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64  are:</dt>..  <dd
31f0: 3e 3c 63 6f 64 65 3e 68 61 6e 64 73 68 61 6b 65  ><code>handshake
3200: 2c 20 61 6c 65 72 74 2c 20 63 6f 6e 6e 65 63 74  , alert, connect
3210: 2c 20 61 63 63 65 70 74 3c 2f 63 6f 64 65 3e 2e  , accept</code>.
3220: 3c 2f 64 64 3e 0a 09 20 20 3c 64 74 3e 50 6f 73  </dd>..  <dt>Pos
3230: 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72  sible values for
3240: 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20   <em>minor</em> 
3250: 61 72 65 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64  are:</dt>..  <dd
3260: 3e 3c 63 6f 64 65 3e 73 74 61 72 74 2c 20 64 6f  ><code>start, do
3270: 6e 65 2c 20 72 65 61 64 2c 20 77 72 69 74 65 2c  ne, read, write,
3280: 20 6c 6f 6f 70 2c 20 65 78 69 74 3c 2f 63 6f 64   loop, exit</cod
3290: 65 3e 2e 3c 2f 64 64 3e 0a 09 20 20 3c 2f 64 6c  e>.</dd>..  </dl
32a0: 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 65 73  >..  The <em>mes
32b0: 73 61 67 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65  sage</em> argume
32c0: 6e 74 20 69 73 20 61 20 64 65 73 63 72 69 70 74  nt is a descript
32d0: 69 76 65 20 73 74 72 69 6e 67 20 77 68 69 63 68  ive string which
32e0: 20 6d 61 79 0a 09 20 20 62 65 20 67 65 6e 65 72   may..  be gener
32f0: 61 74 65 64 20 65 69 74 68 65 72 20 62 79 0a 09  ated either by..
3300: 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 74 61 74    <code>SSL_stat
3310: 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c  e_string_long()<
3320: 2f 63 6f 64 65 3e 20 6f 72 20 62 79 0a 09 20 20  /code> or by..  
3330: 3c 63 6f 64 65 3e 53 53 4c 5f 61 6c 65 72 74 5f  <code>SSL_alert_
3340: 64 65 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67  desc_string_long
3350: 28 29 3c 2f 63 6f 64 65 3e 2c 0a 09 20 20 64 65  ()</code>,..  de
3360: 70 65 6e 64 69 6e 67 20 6f 6e 20 63 6f 6e 74 65  pending on conte
3370: 78 74 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72  xt...</dd>...<br
3380: 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72  >...<dt>..  <str
3390: 6f 6e 67 3e 76 65 72 69 66 79 3c 2f 73 74 72 6f  ong>verify</stro
33a0: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20  ng> <em>channel 
33b0: 64 65 70 74 68 20 63 65 72 74 20 73 74 61 74 75  depth cert statu
33c0: 73 20 65 72 72 6f 72 3c 2f 65 6d 3e 0a 09 3c 2f  s error</em>..</
33d0: 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69  dt>..<dd>..  Thi
33e0: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
33f0: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79  ck is invoked by
3400: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e   the OpenSSL fun
3410: 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53  ction..  <code>S
3420: 53 4c 5f 73 65 74 5f 76 65 72 69 66 79 28 29 3c  SL_set_verify()<
3430: 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a  /code>...  <br>.
3440: 09 20 20 54 68 65 20 3c 65 6d 3e 64 65 70 74 68  .  The <em>depth
3450: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69  </em> argument i
3460: 73 20 61 6e 20 69 6e 74 65 67 65 72 20 72 65 70  s an integer rep
3470: 72 65 73 65 6e 74 69 6e 67 20 74 68 65 0a 09 20  resenting the.. 
3480: 20 63 75 72 72 65 6e 74 20 64 65 70 74 68 20 6f   current depth o
3490: 6e 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  n the certificat
34a0: 65 20 63 68 61 69 6e 2c 20 77 69 74 68 0a 09 20  e chain, with.. 
34b0: 20 3c 63 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20   <code>0</code> 
34c0: 61 73 20 74 68 65 20 73 75 62 6a 65 63 74 20 63  as the subject c
34d0: 65 72 74 69 66 69 63 61 74 65 20 61 6e 64 20 68  ertificate and h
34e0: 69 67 68 65 72 20 76 61 6c 75 65 73 0a 09 20 20  igher values..  
34f0: 64 65 6e 6f 74 69 6e 67 20 70 72 6f 67 72 65 73  denoting progres
3500: 73 69 76 65 6c 79 20 6d 6f 72 65 20 69 6e 64 69  sively more indi
3510: 72 65 63 74 20 69 73 73 75 65 72 20 63 65 72 74  rect issuer cert
3520: 69 66 69 63 61 74 65 73 2e 0a 09 20 20 3c 62 72  ificates...  <br
3530: 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 63 65 72  >..  The <em>cer
3540: 74 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20  t</em> argument 
3550: 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79  is a list of key
3560: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 73 69 6d  -value pairs sim
3570: 69 6c 61 72 0a 09 20 20 74 6f 20 74 68 6f 73 65  ilar..  to those
3580: 20 72 65 74 75 72 6e 65 64 20 62 79 0a 09 20 20   returned by..  
3590: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73  <a href="#tls::s
35a0: 74 61 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74  tatus"><strong>t
35b0: 6c 73 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f  ls::status</stro
35c0: 6e 67 3e 3c 2f 61 3e 2e 0a 09 20 20 3c 62 72 3e  ng></a>...  <br>
35d0: 0a 09 20 20 54 68 65 20 3c 65 6d 3e 73 74 61 74  ..  The <em>stat
35e0: 75 73 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74  us</em> argument
35f0: 20 69 73 20 61 6e 20 69 6e 74 65 67 65 72 20 72   is an integer r
3600: 65 70 72 65 73 65 6e 74 69 6e 67 20 74 68 65 0a  epresenting the.
3610: 09 20 20 63 75 72 72 65 6e 74 20 76 61 6c 69 64  .  current valid
3620: 69 74 79 20 6f 66 20 74 68 65 20 63 65 72 74 69  ity of the certi
3630: 66 69 63 61 74 65 2e 0a 09 20 20 41 20 76 61 6c  ficate...  A val
3640: 75 65 20 6f 66 20 3c 63 6f 64 65 3e 30 3c 2f 63  ue of <code>0</c
3650: 6f 64 65 3e 20 6d 65 61 6e 73 20 74 68 65 20 63  ode> means the c
3660: 65 72 74 69 66 69 63 61 74 65 20 69 73 20 64 65  ertificate is de
3670: 65 6d 65 64 20 69 6e 76 61 6c 69 64 2e 0a 09 20  emed invalid... 
3680: 20 41 20 76 61 6c 75 65 20 6f 66 20 3c 63 6f 64   A value of <cod
3690: 65 3e 31 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e 73  e>1</code> means
36a0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65   the certificate
36b0: 20 69 73 20 64 65 65 6d 65 64 20 76 61 6c 69 64   is deemed valid
36c0: 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65  ...  <br>..  The
36d0: 20 3c 65 6d 3e 65 72 72 6f 72 3c 2f 65 6d 3e 20   <em>error</em> 
36e0: 61 72 67 75 6d 65 6e 74 20 73 75 70 70 6c 69 65  argument supplie
36f0: 73 20 74 68 65 20 6d 65 73 73 61 67 65 2c 20 69  s the message, i
3700: 66 20 61 6e 79 2c 20 67 65 6e 65 72 61 74 65 64  f any, generated
3710: 0a 09 20 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e  ..  by..  <code>
3720: 58 35 30 39 5f 53 54 4f 52 45 5f 43 54 58 5f 67  X509_STORE_CTX_g
3730: 65 74 5f 65 72 72 6f 72 28 29 3c 2f 63 6f 64 65  et_error()</code
3740: 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 3c 62  >...  <br>..  <b
3750: 72 3e 0a 09 20 20 54 68 65 20 63 61 6c 6c 62 61  r>..  The callba
3760: 63 6b 20 6d 61 79 20 6f 76 65 72 72 69 64 65 20  ck may override 
3770: 6e 6f 72 6d 61 6c 20 76 61 6c 69 64 61 74 69 6f  normal validatio
3780: 6e 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20  n processing by 
3790: 65 78 70 6c 69 63 69 74 6c 79 0a 09 20 20 72 65  explicitly..  re
37a0: 74 75 72 6e 69 6e 67 20 6f 6e 65 20 6f 66 20 74  turning one of t
37b0: 68 65 20 61 62 6f 76 65 20 3c 65 6d 3e 73 74 61  he above <em>sta
37c0: 74 75 73 3c 2f 65 6d 3e 20 76 61 6c 75 65 73 2e  tus</em> values.
37d0: 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 2f 64 6c 3e 0a  ..</dd>...</dl>.
37e0: 20 20 20 20 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c      </dd>..    <
37f0: 62 72 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74  br>..    <dt><st
3800: 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f  rong>-password</
3810: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c  strong> <em>call
3820: 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20  back</em></dt>. 
3830: 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73     <dd>..Invokes
3840: 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c   the specified <
3850: 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e  em>callback</em>
3860: 20 73 63 72 69 70 74 20 77 68 65 6e 20 4f 70 65   script when Ope
3870: 6e 53 53 4c 20 6e 65 65 64 73 20 74 6f 0a 09 6f  nSSL needs to..o
3880: 62 74 61 69 6e 20 61 20 70 61 73 73 77 6f 72 64  btain a password
3890: 2e 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20  .  The callback 
38a0: 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 61 20  should return a 
38b0: 73 74 72 69 6e 67 20 77 68 69 63 68 0a 09 72 65  string which..re
38c0: 70 72 65 73 65 6e 74 73 20 74 68 65 20 70 61 73  presents the pas
38d0: 73 77 6f 72 64 20 74 6f 20 62 65 20 75 73 65 64  sword to be used
38e0: 2e 0a 09 4e 6f 20 61 72 67 75 6d 65 6e 74 73 20  ...No arguments 
38f0: 61 72 65 20 61 70 70 65 6e 64 65 64 20 74 6f 20  are appended to 
3900: 74 68 65 20 73 63 72 69 70 74 20 75 70 6f 6e 20  the script upon 
3910: 63 61 6c 6c 62 61 63 6b 2e 0a 20 20 20 20 3c 2f  callback..    </
3920: 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63  dd>.</dl>.</bloc
3930: 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 0a 52 65 66  kquote>..<p>.Ref
3940: 65 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74  erence implement
3950: 61 74 69 6f 6e 73 20 6f 66 20 74 68 65 73 65 20  ations of these 
3960: 63 61 6c 6c 62 61 63 6b 73 20 61 72 65 20 70 72  callbacks are pr
3970: 6f 76 69 64 65 64 20 69 6e 20 74 68 65 0a 64 69  ovided in the.di
3980: 73 74 72 69 62 75 74 69 6f 6e 20 61 73 20 3c 73  stribution as <s
3990: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62  trong>tls::callb
39a0: 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64  ack</strong> and
39b0: 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61  .<strong>tls::pa
39c0: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20  ssword</strong> 
39d0: 72 65 73 70 65 63 74 69 76 65 6c 79 2e 20 20 4e  respectively.  N
39e0: 6f 74 65 20 74 68 61 74 20 74 68 65 73 65 20 61  ote that these a
39f0: 72 65 0a 3c 65 6d 3e 73 61 6d 70 6c 65 3c 2f 65  re.<em>sample</e
3a00: 6d 3e 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  m> implementatio
3a10: 6e 73 20 6f 6e 6c 79 2e 20 20 49 6e 20 61 20 6d  ns only.  In a m
3a20: 6f 72 65 20 72 65 61 6c 69 73 74 69 63 20 64 65  ore realistic de
3a30: 70 6c 6f 79 6d 65 6e 74 0a 79 6f 75 20 77 6f 75  ployment.you wou
3a40: 6c 64 20 73 70 65 63 69 66 79 20 79 6f 75 72 20  ld specify your 
3a50: 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 20 73 63 72  own callback scr
3a60: 69 70 74 73 20 6f 6e 20 65 61 63 68 20 54 4c 53  ipts on each TLS
3a70: 20 63 68 61 6e 6e 65 6c 0a 75 73 69 6e 67 20 74   channel.using t
3a80: 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c  he <em>-command<
3a90: 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e 2d 70 61  /em> and <em>-pa
3aa0: 73 73 77 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69  ssword</em> opti
3ab0: 6f 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54  ons..</p>..<p>.T
3ac0: 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76  he default behav
3ad0: 69 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 65 6d  ior when the <em
3ae0: 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 6f  >-command</em> o
3af0: 70 74 69 6f 6e 20 69 73 20 6e 6f 74 20 73 70 65  ption is not spe
3b00: 63 69 66 69 65 64 20 69 73 20 66 6f 72 0a 54 4c  cified is for.TL
3b10: 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65  S to process the
3b20: 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72   associated libr
3b30: 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 20 69 6e  ary callbacks in
3b40: 74 65 72 6e 61 6c 6c 79 2e 0a 54 68 65 20 64 65  ternally..The de
3b50: 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77  fault behavior w
3b60: 68 65 6e 20 74 68 65 20 3c 65 6d 3e 2d 70 61 73  hen the <em>-pas
3b70: 73 77 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f  sword</em> optio
3b80: 6e 20 69 73 20 6e 6f 74 20 73 70 65 63 69 66 69  n is not specifi
3b90: 65 64 20 69 73 20 66 6f 72 0a 54 4c 53 20 74 6f  ed is for.TLS to
3ba0: 20 70 72 6f 63 65 73 73 20 74 68 65 20 61 73 73   process the ass
3bb0: 6f 63 69 61 74 65 64 20 6c 69 62 72 61 72 79 20  ociated library 
3bc0: 63 61 6c 6c 62 61 63 6b 73 20 62 79 20 61 74 74  callbacks by att
3bd0: 65 6d 70 74 69 6e 67 20 74 6f 20 63 61 6c 6c 0a  empting to call.
3be0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73  <strong>tls::pas
3bf0: 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2e 0a  sword</strong>..
3c00: 54 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 62  The difference b
3c10: 65 74 77 65 65 6e 20 74 68 65 73 65 20 74 77 6f  etween these two
3c20: 20 62 65 68 61 76 69 6f 72 73 20 69 73 20 61 20   behaviors is a 
3c30: 63 6f 6e 73 65 71 75 65 6e 63 65 20 6f 66 20 6d  consequence of m
3c40: 61 69 6e 74 61 69 6e 69 6e 67 0a 63 6f 6d 70 61  aintaining.compa
3c50: 74 69 62 69 6c 69 74 79 20 77 69 74 68 20 65 61  tibility with ea
3c60: 72 6c 69 65 72 20 69 6d 70 6c 65 6d 65 6e 74 61  rlier implementa
3c70: 74 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e  tions..</p>..<p>
3c80: 0a 54 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73  .The <strong>tls
3c90: 3a 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e  ::debug</strong>
3ca0: 20 76 61 72 69 61 62 6c 65 20 70 72 6f 76 69 64   variable provid
3cb0: 65 73 20 73 6f 6d 65 20 61 64 64 69 74 69 6f 6e  es some addition
3cc0: 61 6c 0a 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20  al.control over 
3cd0: 74 68 65 73 65 20 72 65 66 65 72 65 6e 63 65 20  these reference 
3ce0: 63 61 6c 6c 62 61 63 6b 73 2e 20 20 49 74 73 20  callbacks.  Its 
3cf0: 76 61 6c 75 65 20 69 73 20 7a 65 72 6f 20 62 79  value is zero by
3d00: 20 64 65 66 61 75 6c 74 2e 0a 48 69 67 68 65 72   default..Higher
3d10: 20 76 61 6c 75 65 73 20 70 72 6f 64 75 63 65 20   values produce 
3d20: 6d 6f 72 65 20 64 69 61 67 6e 6f 73 74 69 63 20  more diagnostic 
3d30: 6f 75 74 70 75 74 2c 20 61 6e 64 20 77 69 6c 6c  output, and will
3d40: 20 61 6c 73 6f 20 66 6f 72 63 65 20 74 68 65 0a   also force the.
3d50: 76 65 72 69 66 79 20 6d 65 74 68 6f 64 20 69 6e  verify method in
3d60: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61   <strong>tls::ca
3d70: 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20  llback</strong> 
3d80: 74 6f 20 61 63 63 65 70 74 20 74 68 65 0a 63 65  to accept the.ce
3d90: 72 74 69 66 69 63 61 74 65 2c 20 65 76 65 6e 20  rtificate, even 
3da0: 77 68 65 6e 20 69 74 20 69 73 20 69 6e 76 61 6c  when it is inval
3db0: 69 64 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65  id..</p>..<p>.<e
3dc0: 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 68  m>.The use of th
3dd0: 65 20 72 65 66 65 72 65 6e 63 65 20 63 61 6c 6c  e reference call
3de0: 62 61 63 6b 73 20 3c 73 74 72 6f 6e 67 3e 74 6c  backs <strong>tl
3df0: 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72  s::callback</str
3e00: 6f 6e 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67  ong> and.<strong
3e10: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f  >tls::password</
3e20: 73 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72  strong> is not r
3e30: 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 20 54 68 65  ecommended.  The
3e40: 79 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64  y may be removed
3e50: 0a 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c  .from future rel
3e60: 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70  eases..</em>.</p
3e70: 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20  >..<p>.<em>.The 
3e80: 75 73 65 20 6f 66 20 74 68 65 20 76 61 72 69 61  use of the varia
3e90: 62 6c 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  ble <strong>tls:
3ea0: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20  :debug</strong> 
3eb0: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64  is not recommend
3ec0: 65 64 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65  ed..It may be re
3ed0: 6d 6f 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72  moved from futur
3ee0: 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d  e releases..</em
3ef0: 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e  >.</p>..<h3><a n
3f00: 61 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50  ame="HTTPS EXAMP
3f10: 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c  LE">HTTPS EXAMPL
3f20: 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54  E</a></h3>..<p>T
3f30: 68 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 73  his example uses
3f40: 20 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 72   a sample server
3f50: 2e 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 69  .pem provided wi
3f60: 74 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61  th the TLS relea
3f70: 73 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20  se,.courtesy of 
3f80: 74 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e  the <strong>Open
3f90: 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f  SSL</strong> pro
3fa0: 6a 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e  ject.</p>..<pre>
3fb0: 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72  <code>.package r
3fc0: 65 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b  equire http.pack
3fd0: 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a  age require tls.
3fe0: 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20  .http::register 
3ff0: 68 74 74 70 73 20 34 34 33 20 3c 6e 6f 77 69 6b  https 443 <nowik
4000: 69 3e 5b 3c 2f 6e 6f 77 69 6b 69 3e 6c 69 73 74  i>[</nowiki>list
4010: 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d   ::tls::socket -
4020: 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74  autoservername t
4030: 72 75 65 20 2d 72 65 71 75 69 72 65 20 74 72 75  rue -require tru
4040: 65 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73  e -cadir /etc/ss
4050: 6c 2f 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f  l/certs]..set to
4060: 6b 20 3c 6e 6f 77 69 6b 69 3e 5b 3c 2f 6e 6f 77  k <nowiki>[</now
4070: 69 6b 69 3e 68 74 74 70 3a 3a 67 65 74 75 72 6c  iki>http::geturl
4080: 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c   https://www.tcl
4090: 2e 74 6b 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70  .tk/].</code></p
40a0: 72 65 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65  re>..<h3><a name
40b0: 3d 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44  ="SPECIAL CONSID
40c0: 45 52 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41  ERATIONS">SPECIA
40d0: 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53  L CONSIDERATIONS
40e0: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68  </a></h3>..<p>Th
40f0: 65 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f  e capabilities o
4100: 66 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 63  f this package c
4110: 61 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73  an vary enormous
4120: 6c 79 20 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f  ly based.upon ho
4130: 77 20 79 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c  w your OpenSSL l
4140: 69 62 72 61 72 79 20 77 61 73 20 63 6f 6e 66 69  ibrary was confi
4150: 67 75 72 65 64 20 61 6e 64 20 62 75 69 6c 74 2e  gured and built.
4160: 20 41 74 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63   At the.most mac
4170: 72 6f 2d 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c  ro-level OpenSSL
4180: 20 73 75 70 70 6f 72 74 73 20 61 20 26 71 75 6f   supports a &quo
4190: 74 3b 6e 6f 20 70 61 74 65 6e 74 73 26 71 75 6f  t;no patents&quo
41a0: 74 3b 20 62 75 69 6c 64 2c 0a 77 68 69 63 68 20  t; build,.which 
41b0: 64 69 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44  disables RSA, ID
41c0: 45 41 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e  EA, RC(2,4,5) an
41d0: 64 20 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72  d SSL2 - if your
41e0: 20 4f 70 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66   OpenSSL is.conf
41f0: 69 67 75 72 65 64 20 74 68 69 73 20 77 61 79 20  igured this way 
4200: 74 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65  then you will ne
4210: 65 64 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20  ed to build TLS 
4220: 77 69 74 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41  with the.-DNO_PA
4230: 54 45 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61  TENTS option - a
4240: 6e 64 20 74 68 65 20 72 65 73 75 6c 74 61 6e 74  nd the resultant
4250: 20 6d 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e   module will fun
4260: 63 74 69 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20  ction.correctly 
4270: 61 6e 64 20 61 6c 73 6f 20 73 75 70 70 6f 72 74  and also support
4280: 20 41 44 48 20 63 65 72 74 69 66 69 63 61 74 65   ADH certificate
4290: 2d 6c 65 73 73 20 65 6e 63 72 79 70 74 69 6f 6e  -less encryption
42a0: 2c 0a 68 6f 77 65 76 65 72 20 79 6f 75 20 77 69  ,.however you wi
42b0: 6c 6c 20 62 65 20 75 6e 61 62 6c 65 20 74 6f 20  ll be unable to 
42c0: 75 74 69 6c 69 7a 65 20 74 68 69 73 20 74 6f 20  utilize this to 
42d0: 73 70 65 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20  speak to normal 
42e0: 57 65 62 0a 53 65 72 76 65 72 73 2c 20 77 68 69  Web.Servers, whi
42f0: 63 68 20 74 79 70 69 63 61 6c 6c 79 20 72 65 71  ch typically req
4300: 75 69 72 65 20 52 53 41 20 73 75 70 70 6f 72 74  uire RSA support
4310: 2e 20 50 6c 65 61 73 65 20 73 65 65 20 3c 61 0a  . Please see <a.
4320: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
4330: 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68  .openssl.org/">h
4340: 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73  ttp://www.openss
4350: 6c 2e 6f 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d  l.org/</a> for.m
4360: 6f 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  ore information 
4370: 6f 6e 20 74 68 65 20 77 68 6f 6c 65 20 69 73 73  on the whole iss
4380: 75 65 20 6f 66 20 70 61 74 65 6e 74 73 20 61 6e  ue of patents an
4390: 64 20 55 53 20 65 78 70 6f 72 74 0a 72 65 73 74  d US export.rest
43a0: 72 69 63 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a  rictions. </p>..
43b0: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45  <h3><a name="SEE
43c0: 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c   ALSO">SEE ALSO<
43d0: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74  /a></h3>..<p><st
43e0: 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72  rong>socket</str
43f0: 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69  ong>, <strong>fi
4400: 6c 65 65 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e  leevent, </stron
4410: 67 3e 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a  g><a.href="http:
4420: 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72  //www.openssl.or
4430: 67 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e  g/"><strong>Open
4440: 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e  SSL</strong></a>
4450: 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65  </p>..<hr>..<pre
4460: 3e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70  >.Copyright &cop
4470: 79 3b 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77  y; 1999 Matt New
4480: 6d 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26  man..Copyright &
4490: 63 6f 70 79 3b 20 32 30 30 34 20 53 74 61 72 66  copy; 2004 Starf
44a0: 69 73 68 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70  ish Systems..</p
44b0: 72 65 3e 0a 0a 5a 20 33 30 31 63 31 31 66 33 62  re>..Z 301c11f3b
44c0: 38 38 66 39 38 62 38 39 39 32 62 63 63 32 65 62  88f98b8992bcc2eb
44d0: 65 61 39 34 65 39 36 0a                          ea94e96.