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 0a 0a sitional//EN">..
0040: 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a 3c <html>..<head>.<
0050: 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d meta http-equiv=
0060: 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a 63 "Content-Type".c
0070: 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 6d ontent="text/htm
0080: 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d 38 l; charset=iso-8
0090: 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e 61 859-1">.<meta na
00a0: 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20 63 me="Copyright" c
00b0: 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61 74 ontent="1999 Mat
00c0: 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34 20 t Newman / 2004
00d0: 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d 73 Starfish Systems
00e0: 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28 53 ">.<title>TLS (S
00f0: 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64 73 SL) Tcl Commands
0100: 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 3e </title>.</head>
0110: 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72 3d ..<body bgcolor=
0120: 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c 3e "#FFFFFF">..<dl>
0130: 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 . <dd><a href
0140: 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 ="#NAME">NAME</a
0150: 3e 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 20 > <dl>.
0160: 20 20 20 3c 64 64 3e 3c 73 74 72 6f 6e 67 3e 74 <dd><strong>t
0170: 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69 ls</strong> - bi
0180: 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67 nding to <strong
0190: 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 >OpenSSL</strong
01a0: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 >.
01b0: 20 20 74 6f 6f 6c 6b 69 74 2e 3c 2f 64 64 3e 0a toolkit.</dd>.
01c0: 20 20 20 20 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 </dl>.
01d0: 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e </dd>. <dd>
01e0: 3c 61 20 68 72 65 66 3d 22 23 53 59 4e 4f 50 53 <a href="#SYNOPS
01f0: 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 3e IS">SYNOPSIS</a>
0200: 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c </dd>. <dd><
0210: 64 6c 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 dl>.
0220: 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 <dd><b>package r
0230: 65 71 75 69 72 65 20 54 63 6c 20 3c 2f 62 3e 3c equire Tcl </b><
0240: 65 6d 3e 3f 38 2e 34 3f 3c 2f 65 6d 3e 3c 2f 64 em>?8.4?</em></d
0250: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c d>. <
0260: 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 65 dd><b>package re
0270: 71 75 69 72 65 20 74 6c 73 20 3c 2f 62 3e 3c 65 quire tls </b><e
0280: 6d 3e 3f 40 40 56 45 52 53 40 40 3f 3c 2f 65 6d m>?@@VERS@@?</em
0290: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 ></dd>.
02a0: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
02b0: 74 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c t>. <
02c0: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 dd><b>tls::init
02d0: 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f </b><i>?options?
02e0: 3c 2f 69 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 20 </i> </dd>.
02f0: 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c <dd><b>tl
0300: 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 s::socket </b><e
0310: 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73 74 m>?options? host
0320: 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a port</em></dd>.
0330: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e <dd>
0340: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f <b>tls::socket</
0350: 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20 b><em> ?-server
0360: 63 6f 6d 6d 61 6e 64 3f 0a 20 20 20 20 20 20 20 command?.
0370: 20 20 20 20 20 20 20 20 20 3f 6f 70 74 69 6f 6e ?option
0380: 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 64 s? port</em></dd
0390: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 >. <d
03a0: 64 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 d><b>tls::handsh
03b0: 61 6b 65 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e ake</b><em> chan
03c0: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 nel</em></dd>.
03d0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 <dd><b
03e0: 3e 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c 2f 62 >tls::status </b
03f0: 3e 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 ><em>?-local? ch
0400: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a annel</em></dd>.
0410: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e <dd>
0420: 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f <b>tls::import</
0430: 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c 20 3f b><em> channel ?
0440: 6f 70 74 69 6f 6e 73 3f 3c 2f 65 6d 3e 3c 2f 64 options?</em></d
0450: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c d>. <
0460: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 dd><b>tls::unimp
0470: 6f 72 74 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e ort</b><em> chan
0480: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 20 20 nel</em></dd>.
0490: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 <dd><b
04a0: 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 3c 2f >tls::ciphers </
04b0: 62 3e 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f b><em>protocol ?
04c0: 76 65 72 62 6f 73 65 3f 3c 2f 65 6d 3e 3c 2f 64 verbose?</em></d
04d0: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c d>. <
04e0: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69 dd><b>tls::versi
04f0: 6f 6e 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20 20 on</b></dd>.
0500: 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f </dl>. </
0510: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 dd>. <dd><a h
0520: 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22 3e ref="#COMMANDS">
0530: 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64 64 COMMANDS</a></dd
0540: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 >. <dd><a hre
0550: 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 f="#CALLBACK OPT
0560: 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f IONS">CALLBACK O
0570: 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a PTIONS</a></dd>.
0580: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d <dd><a href=
0590: 22 23 48 54 54 50 53 20 45 58 41 4d 50 4c 45 22 "#HTTPS EXAMPLE"
05a0: 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f >HTTPS EXAMPLE</
05b0: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e a></dd>. <dd>
05c0: 3c 61 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c <a href="#SEE AL
05d0: 53 4f 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53 SO">SPECIAL CONS
05e0: 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f IDERATIONS</a></
05f0: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 dd>. <dd><a h
0600: 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e ref="#SEE ALSO">
0610: 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 SEE ALSO</a></dd
0620: 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c >.</dl>..<hr>..<
0630: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 4e 41 4d 45 h3><a name="NAME
0640: 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f 68 33 3e 0a ">NAME</a></h3>.
0650: 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3c .<p><strong>tls<
0660: 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69 6e 64 69 /strong> - bindi
0670: 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 4f 70 ng to <strong>Op
0680: 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 0a 74 enSSL</strong>.t
0690: 6f 6f 6c 6b 69 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 oolkit.</p>..<h3
06a0: 3e 3c 61 20 6e 61 6d 65 3d 22 53 59 4e 4f 50 53 ><a name="SYNOPS
06b0: 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 3e IS">SYNOPSIS</a>
06c0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 62 3e 70 61 63 </h3>..<p><b>pac
06d0: 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 63 6c kage require Tcl
06e0: 20 38 2e 34 3c 2f 62 3e 3c 62 72 3e 0a 3c 62 3e 8.4</b><br>.<b>
06f0: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 package require
0700: 74 6c 73 20 40 40 56 45 52 53 40 40 3c 2f 62 3e tls @@VERS@@</b>
0710: 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 <br>.<br>.<a hre
0720: 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c f="#tls::init"><
0730: 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e b>tls::init </b>
0740: 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e <i>?options?</i>
0750: 3c 62 72 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 <br>.</a><a href
0760: 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e ="#tls::socket">
0770: 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c <b>tls::socket <
0780: 2f 62 3e 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f /b><em>?options?
0790: 20 68 6f 73 74 0a 70 6f 72 74 3c 2f 65 6d 3e 3c host.port</em><
07a0: 62 72 3e 0a 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b br>.<b>tls::sock
07b0: 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 et</b><em> ?-ser
07c0: 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 ver command? ?op
07d0: 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e tions? port</em>
07e0: 3c 62 72 3e 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 <br>.</a><a href
07f0: 3d 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e ="#tls::status">
0800: 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73 20 3c <b>tls::status <
0810: 2f 62 3e 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 /b><em>?-local?
0820: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 62 72 3e channel</em><br>
0830: 0a 3c 2f 61 3e 3c 61 20 68 72 65 66 3d 22 23 74 .</a><a href="#t
0840: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c ls::handshake"><
0850: 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 b>tls::handshake
0860: 3c 2f 62 3e 3c 65 6d 3e 20 63 68 61 6e 6e 65 6c </b><em> channel
0870: 3c 2f 65 6d 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 62 </em></a><br>.<b
0880: 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 r>.<a href="#tls
0890: 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 ::import"><b>tls
08a0: 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e ::import </b><i>
08b0: 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 channel ?options
08c0: 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 ?</i></a><br>.<a
08d0: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 75 6e 69 href="#tls::uni
08e0: 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 mport"><b>tls::u
08f0: 6e 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 nimport </b><i>c
0900: 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 hannel</i></a><b
0910: 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 r>.<a href="#tls
0920: 3a 3a 63 69 70 68 65 72 73 20 70 72 6f 74 6f 63 ::ciphers protoc
0930: 6f 6c 20 3f 76 65 72 62 6f 73 65 3f 22 3e 3c 73 ol ?verbose?"><s
0940: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 trong>tls::ciphe
0950: 72 73 3c 2f 73 74 72 6f 6e 67 3e 0a 3c 65 6d 3e rs</strong>.<em>
0960: 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 protocol ?verbos
0970: 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 62 72 3e 0a e?</em></a><br>.
0980: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 76 <a href="#tls::v
0990: 65 72 73 69 6f 6e 22 3e 3c 62 3e 74 6c 73 3a 3a ersion"><b>tls::
09a0: 76 65 72 73 69 6f 6e 3c 2f 62 3e 3c 2f 61 3e 0a version</b></a>.
09b0: 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d </p>..<h3><a nam
09c0: 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e 22 3e e="DESCRIPTION">
09d0: 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e 3c DESCRIPTION</a><
09e0: 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73 20 65 78 /h3>..<p>This ex
09f0: 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64 65 73 tension provides
0a00: 20 61 20 67 65 6e 65 72 69 63 20 62 69 6e 64 69 a generic bindi
0a10: 6e 67 20 74 6f 20 3c 61 0a 68 72 65 66 3d 22 68 ng to <a.href="h
0a20: 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 ttp://www.openss
0a30: 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e 53 53 4c 3c l.org/">OpenSSL<
0a40: 2f 61 3e 2c 20 75 74 69 6c 69 7a 69 6e 67 20 74 /a>, utilizing t
0a50: 68 65 0a 3c 73 74 72 6f 6e 67 3e 54 63 6c 5f 53 he.<strong>Tcl_S
0a60: 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73 74 72 tackChannel</str
0a70: 6f 6e 67 3e 0a 41 50 49 20 66 6f 72 20 54 63 6c ong>.API for Tcl
0a80: 20 38 2e 32 20 61 6e 64 20 68 69 67 68 65 72 2e 8.2 and higher.
0a90: 20 54 68 65 20 73 6f 63 6b 65 74 73 20 62 65 68 The sockets beh
0aa0: 61 76 65 20 65 78 61 63 74 6c 79 20 74 68 65 20 ave exactly the
0ab0: 73 61 6d 65 0a 61 73 20 63 68 61 6e 6e 65 6c 73 same.as channels
0ac0: 20 63 72 65 61 74 65 64 20 75 73 69 6e 67 20 54 created using T
0ad0: 63 6c 27 73 20 62 75 69 6c 74 2d 69 6e 20 3c 73 cl's built-in <s
0ae0: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 trong>socket</st
0af0: 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 20 77 69 rong>.command wi
0b00: 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 th additional op
0b10: 74 69 6f 6e 73 20 66 6f 72 20 63 6f 6e 74 72 6f tions for contro
0b20: 6c 6c 69 6e 67 20 74 68 65 20 53 53 4c 20 73 65 lling the SSL se
0b30: 73 73 69 6f 6e 2e 0a 54 6f 20 75 73 65 20 54 4c ssion..To use TL
0b40: 53 20 77 69 74 68 20 61 6e 20 65 61 72 6c 69 65 S with an earlie
0b50: 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63 6c r version of Tcl
0b60: 20 74 68 61 6e 20 38 2e 34 2c 20 70 6c 65 61 73 than 8.4, pleas
0b70: 65 20 6f 62 74 61 69 6e 0a 54 4c 53 20 31 2e 33 e obtain.TLS 1.3
0b80: 2e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e ..</p>..<h3><a n
0b90: 61 6d 65 3d 22 43 4f 4d 4d 41 4e 44 53 22 3e 43 ame="COMMANDS">C
0ba0: 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 68 33 3e OMMANDS</a></h3>
0bb0: 0a 0a 3c 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f ..<p>Typically o
0bc0: 6e 65 20 77 6f 75 6c 64 20 75 73 65 20 74 68 65 ne would use the
0bd0: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f <strong>tls::so
0be0: 63 6b 65 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f cket </strong>co
0bf0: 6d 6d 61 6e 64 0a 77 68 69 63 68 20 70 72 6f 76 mmand.which prov
0c00: 69 64 65 73 20 63 6f 6d 70 61 74 69 62 69 6c 69 ides compatibili
0c10: 74 79 20 77 69 74 68 20 74 68 65 20 6e 61 74 69 ty with the nati
0c20: 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 ve Tcl <strong>s
0c30: 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63 ocket</strong>.c
0c40: 6f 6d 6d 61 6e 64 2e 20 49 6e 20 73 75 63 68 20 ommand. In such
0c50: 63 61 73 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c cases <strong>tl
0c60: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e s::import</stron
0c70: 67 3e 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 g> should not be
0c80: 0a 75 73 65 64 20 64 69 72 65 63 74 6c 79 2e 3c .used directly.<
0c90: 2f 70 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 /p>..<dl>. <d
0ca0: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a t><a name="tls::
0cb0: 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e init"><b>tls::in
0cc0: 69 74 20 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f it </b><i>?optio
0cd0: 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e ns?</i></a></dt>
0ce0: 0a 20 20 20 20 3c 64 64 3e 54 68 69 73 20 72 6f . <dd>This ro
0cf0: 75 74 69 6e 65 20 73 65 74 73 20 74 68 65 20 64 utine sets the d
0d00: 65 66 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20 75 efault options u
0d10: 73 65 64 20 62 79 20 3c 73 74 72 6f 6e 67 3e 74 sed by <strong>t
0d20: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f ls::socket</stro
0d30: 6e 67 3e 0a 20 20 20 20 20 20 20 20 61 6e 64 20 ng>. and
0d40: 69 73 20 3c 65 6d 3e 6f 70 74 69 6f 6e 61 6c 3c is <em>optional<
0d50: 2f 65 6d 3e 2e 20 49 66 20 79 6f 75 20 63 61 6c /em>. If you cal
0d60: 6c 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 l <strong>tls::i
0d70: 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 mport</strong>.
0d80: 20 20 20 20 20 20 20 64 69 72 65 63 74 6c 79 20 directly
0d90: 74 68 69 73 20 72 6f 75 74 69 6e 65 20 68 61 73 this routine has
0da0: 20 6e 6f 20 65 66 66 65 63 74 2e 20 41 6e 79 20 no effect. Any
0db0: 6f 66 20 74 68 65 20 6f 70 74 69 6f 6e 73 0a 20 of the options.
0dc0: 20 20 20 20 20 20 20 74 68 61 74 20 3c 73 74 72 that <str
0dd0: 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c ong>tls::socket<
0de0: 2f 73 74 72 6f 6e 67 3e 20 61 63 63 65 70 74 73 /strong> accepts
0df0: 20 63 61 6e 20 62 65 20 73 65 74 0a 20 20 20 20 can be set.
0e00: 20 20 20 20 75 73 69 6e 67 20 74 68 69 73 20 63 using this c
0e10: 6f 6d 6d 61 6e 64 2c 20 74 68 6f 75 67 68 20 79 ommand, though y
0e20: 6f 75 20 73 68 6f 75 6c 64 20 6c 69 6d 69 74 20 ou should limit
0e30: 79 6f 75 72 20 6f 70 74 69 6f 6e 73 0a 20 20 20 your options.
0e40: 20 20 20 20 20 74 6f 20 6f 6e 6c 79 20 54 4c 53 to only TLS
0e50: 20 72 65 6c 61 74 65 64 20 6f 6e 65 73 2e 3c 2f related ones.</
0e60: 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 dd>. <dt>&nbs
0e70: 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e p;</dt>. <dt>
0e80: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 6f <a name="tls::so
0e90: 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f cket"><b>tls::so
0ea0: 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 cket </b><em>?op
0eb0: 74 69 6f 6e 73 3f 0a 20 20 20 20 20 20 20 20 68 tions?. h
0ec0: 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 ost port</em></a
0ed0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c ></dt>. <dt><
0ee0: 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 b>tls::socket</b
0ef0: 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 ><em> ?-server c
0f00: 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 ommand? ?options
0f10: 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e ? port</em></dt>
0f20: 0a 20 20 20 20 3c 64 64 3e 54 68 69 73 20 69 73 . <dd>This is
0f30: 20 61 20 68 65 6c 70 65 72 20 66 75 6e 63 74 69 a helper functi
0f40: 6f 6e 20 74 68 61 74 20 75 74 69 6c 69 7a 65 73 on that utilizes
0f50: 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 0a the underlying.
0f60: 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 73 commands
0f70: 20 28 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 (<strong>tls::i
0f80: 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 29 2e mport</strong>).
0f90: 20 49 74 20 62 65 68 61 76 65 73 0a 20 20 20 20 It behaves.
0fa0: 20 20 20 20 65 78 61 63 74 6c 79 20 74 68 65 20 exactly the
0fb0: 73 61 6d 65 20 61 73 20 74 68 65 20 6e 61 74 69 same as the nati
0fc0: 76 65 20 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 ve Tcl <strong>s
0fd0: 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 ocket</strong>.
0fe0: 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 20 65 command e
0ff0: 78 63 65 70 74 20 74 68 61 74 20 74 68 65 20 6f xcept that the o
1000: 70 74 69 6f 6e 73 20 63 61 6e 20 69 6e 63 6c 75 ptions can inclu
1010: 64 65 20 61 6e 79 20 6f 66 20 74 68 65 0a 20 20 de any of the.
1020: 20 20 20 20 20 20 61 70 70 6c 69 63 61 62 6c 65 applicable
1030: 20 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a <a href="#tls::
1040: 69 6d 70 6f 72 74 22 3e 3c 73 74 72 6f 6e 67 3e import"><strong>
1050: 74 6c 73 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f tls:import</stro
1060: 6e 67 3e 3c 2f 61 3e 0a 20 20 20 20 20 20 20 20 ng></a>.
1070: 6f 70 74 69 6f 6e 73 20 77 69 74 68 20 6f 6e 65 options with one
1080: 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 additional opti
1090: 6f 6e 3a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e on:.<blockquote>
10a0: 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 . <dl>.
10b0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 <dt><strong>-a
10c0: 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 utoservername</s
10d0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c trong> <em>bool<
10e0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 /em></dt>.
10f0: 20 20 3c 64 64 3e 41 75 74 6f 6d 61 74 69 63 61 <dd>Automatica
1100: 6c 6c 79 20 73 65 6e 64 20 74 68 65 20 2d 73 65 lly send the -se
1110: 72 76 65 72 6e 61 6d 65 20 61 73 20 74 68 65 20 rvername as the
1120: 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 20 61 72 <em>host</em> ar
1130: 67 75 6d 65 6e 74 0a 20 20 20 20 20 20 20 20 20 gument.
1140: 20 20 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 (<strong>defa
1150: 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 ult</strong>: <e
1160: 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 m>false</em>)</d
1170: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 d>. </dl>.</b
1180: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c lockquote>. <
1190: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 dt> </dt>.
11a0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
11b0: 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e tls::handshake">
11c0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e <strong>tls::han
11d0: 64 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 dshake</strong>
11e0: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e <em>channel</em>
11f0: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 </a></dt>. <d
1200: 64 3e 46 6f 72 63 65 73 20 68 61 6e 64 73 68 61 d>Forces handsha
1210: 6b 65 20 74 6f 20 74 61 6b 65 20 70 6c 61 63 65 ke to take place
1220: 2c 20 61 6e 64 20 72 65 74 75 72 6e 73 20 30 20 , and returns 0
1230: 69 66 0a 20 20 20 20 20 20 20 20 68 61 6e 64 73 if. hands
1240: 68 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e hake is still in
1250: 20 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 progress (non-b
1260: 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 locking), or 1 i
1270: 66 0a 20 20 20 20 20 20 20 20 74 68 65 20 68 61 f. the ha
1280: 6e 64 73 68 61 6b 65 20 77 61 73 20 73 75 63 63 ndshake was succ
1290: 65 73 73 66 75 6c 2e 20 49 66 20 74 68 65 20 68 essful. If the h
12a0: 61 6e 64 73 68 61 6b 65 20 66 61 69 6c 65 64 0a andshake failed.
12b0: 20 20 20 20 20 20 20 20 74 68 69 73 20 72 6f 75 this rou
12c0: 74 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 tine will throw
12d0: 61 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 an error.</dd>.
12e0: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
12f0: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 t>. <dt><a na
1300: 6d 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 me="tls::status"
1310: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 ><strong>tls::st
1320: 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 atus</strong>.
1330: 20 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 <em>?-local? c
1340: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c hannel</em></a><
1350: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 /dt>. <dd>Ret
1360: 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 urns the current
1370: 20 73 65 63 75 72 69 74 79 20 73 74 61 74 75 73 security status
1380: 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e 6e of an SSL chann
1390: 65 6c 2e 20 54 68 65 0a 20 20 20 20 20 20 20 20 el. The.
13a0: 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 result is a list
13b0: 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 of key-value pa
13c0: 69 72 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 irs describing t
13d0: 68 65 0a 20 20 20 20 20 20 20 20 63 6f 6e 6e 65 he. conne
13e0: 63 74 65 64 20 70 65 65 72 2e 20 49 66 20 74 68 cted peer. If th
13f0: 65 20 72 65 73 75 6c 74 20 69 73 20 61 6e 20 65 e result is an e
1400: 6d 70 74 79 20 6c 69 73 74 20 74 68 65 6e 20 74 mpty list then t
1410: 68 65 0a 20 20 20 20 20 20 20 20 53 53 4c 20 68 he. SSL h
1420: 61 6e 64 73 68 61 6b 65 20 68 61 73 20 6e 6f 74 andshake has not
1430: 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 64 2e 0a yet completed..
1440: 20 20 20 20 20 20 20 20 49 66 20 3c 65 6d 3e 2d If <em>-
1450: 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 20 67 69 local</em> is gi
1460: 76 65 6e 2c 20 74 68 65 6e 20 74 68 65 20 63 65 ven, then the ce
1470: 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f 72 6d rtificate inform
1480: 61 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 69 73 ation. is
1490: 20 74 68 65 20 6f 6e 65 20 75 73 65 64 20 6c 6f the one used lo
14a0: 63 61 6c 6c 79 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c cally.</dd>.</dl
14b0: 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a >..<blockquote>.
14c0: 20 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 <dl>.
14d0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 <dt><strong>iss
14e0: 75 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d uer</strong> <em
14f0: 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 >dn</em></dt>.
1500: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 64 69 <dd>The di
1510: 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 stinguished name
1520: 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 (DN) of the cer
1530: 74 69 66 69 63 61 74 65 0a 20 20 20 20 20 20 20 tificate.
1540: 20 20 20 20 20 69 73 73 75 65 72 2e 3c 2f 64 64 issuer.</dd
1550: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
1560: 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 trong>subject</s
1570: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 trong> <em>dn</e
1580: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
1590: 3c 64 64 3e 54 68 65 20 64 69 73 74 69 6e 67 75 <dd>The distingu
15a0: 69 73 68 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 ished name (DN)
15b0: 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 of the certifica
15c0: 74 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 te. s
15d0: 75 62 6a 65 63 74 2e 3c 2f 64 64 3e 0a 20 20 20 ubject.</dd>.
15e0: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 <dt><strong
15f0: 3e 6e 6f 74 42 65 66 6f 72 65 3c 2f 73 74 72 6f >notBefore</stro
1600: 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d ng> <em>date</em
1610: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
1620: 64 64 3e 54 68 65 20 62 65 67 69 6e 20 64 61 74 dd>The begin dat
1630: 65 20 66 6f 72 20 74 68 65 20 76 61 6c 69 64 69 e for the validi
1640: 74 79 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 ty of the certif
1650: 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 icate.</dd>.
1660: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
1670: 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72 6f 6e 67 notAfter</strong
1680: 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c > <em>date</em><
1690: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
16a0: 3e 54 68 65 20 65 78 70 69 72 79 20 64 61 74 65 >The expiry date
16b0: 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 66 69 for the certifi
16c0: 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 cate.</dd>.
16d0: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 <dt><strong>s
16e0: 65 72 69 61 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c erial</strong> <
16f0: 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 em>n</em></dt>.
1700: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 73 <dd>The s
1710: 65 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 erial number of
1720: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e the certificate.
1730: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
1740: 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 t><strong>cipher
1750: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 </strong> <em>ci
1760: 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 pher</em></dt>.
1770: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 63 <dd>The c
1780: 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e urrent cipher in
1790: 20 75 73 65 20 62 65 74 77 65 65 6e 20 74 68 65 use between the
17a0: 20 63 6c 69 65 6e 74 20 61 6e 64 0a 20 20 20 20 client and.
17b0: 20 20 20 20 20 20 20 20 73 65 72 76 65 72 20 63 server c
17c0: 68 61 6e 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 20 20 hannels.</dd>.
17d0: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e <dt><stron
17e0: 67 3e 73 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e g>sbits</strong>
17f0: 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e <em>n</em></dt>
1800: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 . <dd>The
1810: 20 6e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 20 number of bits
1820: 75 73 65 64 20 66 6f 72 20 74 68 65 20 73 65 73 used for the ses
1830: 73 69 6f 6e 20 6b 65 79 2e 3c 2f 64 64 3e 0a 20 sion key.</dd>.
1840: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f <dt><stro
1850: 6e 67 3e 63 65 72 74 69 66 69 63 61 74 65 3c 2f ng>certificate</
1860: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 strong> <em>n</e
1870: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
1880: 3c 64 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f <dd>The PEM enco
1890: 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65 2e ded certificate.
18a0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
18b0: 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 73 69 6f t><strong>versio
18c0: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 n</strong> <em>v
18d0: 61 6c 75 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 alue</em></dt>.
18e0: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 70 <dd>The p
18f0: 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 rotocol version
1900: 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 6f 6e used for the con
1910: 6e 65 63 74 69 6f 6e 3a 0a 09 20 20 53 53 4c 76 nection:.. SSLv
1920: 32 2c 20 53 53 4c 76 33 2c 20 54 4c 53 76 31 2c 2, SSLv3, TLSv1,
1930: 20 54 4c 53 76 31 2e 31 2c 20 54 4c 53 76 31 2e TLSv1.1, TLSv1.
1940: 32 2c 20 75 6e 6b 6e 6f 77 6e 3c 2f 64 64 3e 0a 2, unknown</dd>.
1950: 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 </dl>.</bloc
1960: 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c 3e 0a 20 20 kquote>..<dl>.
1970: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 <dt><a name="t
1980: 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 ls::import"><b>t
1990: 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c ls::import </b><
19a0: 69 3e 63 68 61 6e 6e 65 6c 0a 20 20 20 20 20 20 i>channel.
19b0: 20 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c ?options?</i><
19c0: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 /a></dt>. <dd
19d0: 3e 53 53 4c 2d 65 6e 61 62 6c 65 20 61 20 72 65 >SSL-enable a re
19e0: 67 75 6c 61 72 20 54 63 6c 20 63 68 61 6e 6e 65 gular Tcl channe
19f0: 6c 20 2d 20 69 74 20 6e 65 65 64 20 6e 6f 74 20 l - it need not
1a00: 62 65 20 61 0a 20 20 20 20 20 20 20 20 73 6f 63 be a. soc
1a10: 6b 65 74 2c 20 62 75 74 20 6d 75 73 74 20 70 72 ket, but must pr
1a20: 6f 76 69 64 65 20 62 69 2d 64 69 72 65 63 74 69 ovide bi-directi
1a30: 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41 6c 73 6f 0a onal flow. Also.
1a40: 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 20 setting
1a50: 73 65 73 73 69 6f 6e 20 70 61 72 61 6d 65 74 65 session paramete
1a60: 72 73 20 66 6f 72 20 53 53 4c 20 68 61 6e 64 73 rs for SSL hands
1a70: 68 61 6b 65 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e hake.</dd>.</dl>
1a80: 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 ..<blockquote>.
1a90: 20 20 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 <dl>.
1aa0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 64 <dt><strong>-cad
1ab0: 69 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e ir</strong> <em>
1ac0: 64 69 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 dir</em></dt>.
1ad0: 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 <dd>Provid
1ae0: 65 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 e the directory
1af0: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 43 containing the C
1b00: 41 20 63 65 72 74 69 66 69 63 61 74 65 73 2e 3c A certificates.<
1b10: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
1b20: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65 ><strong>-cafile
1b30: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 </strong><em>fi
1b40: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e lename</em></dt>
1b50: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 6f . <dd>Pro
1b60: 76 69 64 65 20 74 68 65 20 43 41 20 66 69 6c 65 vide the CA file
1b70: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c .</dd>. <
1b80: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 dt><strong>-cert
1b90: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 file</strong> <e
1ba0: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c m>filename</em><
1bb0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
1bc0: 3e 50 72 6f 76 69 64 65 20 74 68 65 20 6e 61 6d >Provide the nam
1bd0: 65 20 6f 66 20 61 20 66 69 6c 65 20 63 6f 6e 74 e of a file cont
1be0: 61 69 6e 69 6e 67 20 63 65 72 74 69 66 69 63 61 aining certifica
1bf0: 74 65 20 74 6f 20 75 73 65 2e 3c 2f 64 64 3e 0a te to use.</dd>.
1c00: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
1c10: 6f 6e 67 3e 2d 63 65 72 74 3c 2f 73 74 72 6f 6e ong>-cert</stron
1c20: 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c g> <em>filename<
1c30: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 /em></dt>.
1c40: 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 74 68 <dd>Provide th
1c50: 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 61 20 e contents of a
1c60: 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 certificate to u
1c70: 73 65 2c 20 61 73 20 61 20 44 45 52 20 65 6e 63 se, as a DER enc
1c80: 6f 64 65 64 20 62 69 6e 61 72 79 20 76 61 6c 75 oded binary valu
1c90: 65 20 28 58 2e 35 30 39 20 44 45 52 29 2e 3c 2f e (X.509 DER).</
1ca0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e dd>. <dt>
1cb0: 3c 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72 20 <strong>-cipher
1cc0: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 73 74 72 </strong><em>str
1cd0: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ing</em></dt>.
1ce0: 20 20 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 <dd>Provid
1cf0: 65 20 74 68 65 20 63 69 70 68 65 72 20 73 75 69 e the cipher sui
1d00: 74 65 73 20 74 6f 20 75 73 65 2e 20 53 79 6e 74 tes to use. Synt
1d10: 61 78 20 69 73 20 61 73 20 70 65 72 0a 20 20 20 ax is as per.
1d20: 20 20 20 20 20 20 20 20 20 4f 70 65 6e 53 53 4c OpenSSL
1d30: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c .</dd>. <
1d40: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d dt><strong>-comm
1d50: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d and</strong> <em
1d60: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f >callback</em></
1d70: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
1d80: 49 66 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 If specified, th
1d90: 69 73 20 63 61 6c 6c 62 61 63 6b 20 77 69 6c 6c is callback will
1da0: 20 62 65 20 69 6e 76 6f 6b 65 64 20 61 74 20 73 be invoked at s
1db0: 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 0a 20 20 everal points.
1dc0: 20 20 20 20 20 20 20 20 20 20 64 75 72 69 6e 67 during
1dd0: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e the OpenSSL han
1de0: 64 73 68 61 6b 65 2e 20 20 49 74 20 63 61 6e 20 dshake. It can
1df0: 70 61 73 73 20 65 72 72 6f 72 73 20 61 6e 64 20 pass errors and
1e00: 74 72 61 63 69 6e 67 0a 20 20 20 20 20 20 20 20 tracing.
1e10: 20 20 20 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c information,
1e20: 20 61 6e 64 20 69 74 20 63 61 6e 20 61 6c 6c 6f and it can allo
1e30: 77 20 54 63 6c 20 73 63 72 69 70 74 73 20 74 6f w Tcl scripts to
1e40: 20 70 65 72 66 6f 72 6d 0a 20 20 20 20 20 20 20 perform.
1e50: 20 20 20 20 20 74 68 65 69 72 20 6f 77 6e 20 76 their own v
1e60: 61 6c 69 64 61 74 69 6f 6e 20 6f 66 20 74 68 65 alidation of the
1e70: 20 63 65 72 74 69 66 69 63 61 74 65 20 69 6e 20 certificate in
1e80: 70 6c 61 63 65 20 6f 66 20 74 68 65 0a 20 20 20 place of the.
1e90: 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 default
1ea0: 20 76 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f 76 validation prov
1eb0: 69 64 65 64 20 62 79 20 4f 70 65 6e 53 53 4c 2e ided by OpenSSL.
1ec0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 62 72 . <br
1ed0: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 >. Se
1ee0: 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c e <a href="#CALL
1ef0: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 BACK OPTIONS">CA
1f00: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f LLBACK OPTIONS</
1f10: 61 3e 20 66 6f 72 0a 20 20 20 20 20 20 20 20 20 a> for.
1f20: 20 20 20 66 75 72 74 68 65 72 20 64 69 73 63 75 further discu
1f30: 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 ssion.</dd>.
1f40: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
1f50: 2d 64 68 70 61 72 61 6d 73 20 3c 2f 73 74 72 6f -dhparams </stro
1f60: 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c ng><em>filename<
1f70: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 /em></dt>.
1f80: 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 20 61 20 <dd>Provide a
1f90: 44 69 66 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 70 Diffie-Hellman p
1fa0: 61 72 61 6d 65 74 65 72 73 20 66 69 6c 65 2e 3c arameters file.<
1fb0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
1fc0: 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79 66 69 6c ><strong>-keyfil
1fd0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 e</strong> <em>f
1fe0: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 ilename</em></dt
1ff0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 50 72 >. <dd>Pr
2000: 6f 76 69 64 65 20 74 68 65 20 70 72 69 76 61 74 ovide the privat
2010: 65 20 6b 65 79 20 66 69 6c 65 2e 20 28 3c 73 74 e key file. (<st
2020: 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 rong>default</st
2030: 72 6f 6e 67 3e 3a 0a 20 20 20 20 20 20 20 20 20 rong>:.
2040: 20 20 20 76 61 6c 75 65 20 6f 66 20 2d 63 65 72 value of -cer
2050: 74 66 69 6c 65 29 3c 2f 64 64 3e 0a 20 20 20 20 tfile)</dd>.
2060: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
2070: 2d 6b 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 -key</strong> <e
2080: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c m>filename</em><
2090: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
20a0: 3e 50 72 6f 76 69 64 65 20 74 68 65 20 70 72 69 >Provide the pri
20b0: 76 61 74 65 20 6b 65 79 20 74 6f 20 75 73 65 20 vate key to use
20c0: 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64 as a DER encoded
20d0: 20 76 61 6c 75 65 20 28 50 4b 43 53 23 31 20 44 value (PKCS#1 D
20e0: 45 52 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 ER)</dd>.
20f0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6d 6f <dt><strong>-mo
2100: 64 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d del</strong> <em
2110: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 >channel</em></d
2120: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 t>. <dd>T
2130: 68 69 73 20 77 69 6c 6c 20 66 6f 72 63 65 20 74 his will force t
2140: 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f 20 73 his channel to s
2150: 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 3c 65 hare the same <e
2160: 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c 5f 43 54 m><strong>SSL_CT
2170: 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65 6d 3e 0a X</strong></em>.
2180: 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 75 stru
2190: 63 74 75 72 65 20 61 73 20 74 68 65 20 73 70 65 cture as the spe
21a0: 63 69 66 69 65 64 20 3c 65 6d 3e 63 68 61 6e 6e cified <em>chann
21b0: 65 6c 3c 2f 65 6d 3e 2c 20 61 6e 64 0a 20 20 20 el</em>, and.
21c0: 20 20 20 20 20 20 20 20 20 74 68 65 72 65 66 6f therefo
21d0: 72 65 20 73 68 61 72 65 20 63 61 6c 6c 62 61 63 re share callbac
21e0: 6b 73 20 65 74 63 2e 3c 2f 64 64 3e 0a 20 20 20 ks etc.</dd>.
21f0: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 <dt><strong
2200: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f >-password</stro
2210: 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b ng> <em>callback
2220: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2230: 20 20 20 3c 64 64 3e 49 66 20 73 75 70 70 6c 69 <dd>If suppli
2240: 65 64 2c 20 74 68 69 73 20 63 61 6c 6c 62 61 63 ed, this callbac
2250: 6b 20 77 69 6c 6c 20 62 65 20 69 6e 76 6f 6b 65 k will be invoke
2260: 64 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e d when OpenSSL n
2270: 65 65 64 73 0a 20 20 20 20 20 20 20 20 20 20 20 eeds.
2280: 20 74 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 73 to obtain a pas
2290: 73 77 6f 72 64 2c 20 74 79 70 69 63 61 6c 6c 79 sword, typically
22a0: 20 74 6f 20 75 6e 6c 6f 63 6b 20 74 68 65 20 70 to unlock the p
22b0: 72 69 76 61 74 65 20 6b 65 79 20 6f 66 0a 09 20 rivate key of..
22c0: 20 20 20 61 20 63 65 72 74 69 66 69 63 61 74 65 a certificate
22d0: 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 68 .. Th
22e0: 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c e callback shoul
22f0: 64 20 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e d return a strin
2300: 67 20 77 68 69 63 68 20 72 65 70 72 65 73 65 6e g which represen
2310: 74 73 20 74 68 65 0a 20 20 20 20 20 20 20 20 20 ts the.
2320: 20 20 20 70 61 73 73 77 6f 72 64 20 74 6f 20 62 password to b
2330: 65 20 75 73 65 64 2e 0a 20 20 20 20 20 20 20 20 e used..
2340: 20 20 20 20 3c 62 72 3e 0a 20 20 20 20 20 20 20 <br>.
2350: 20 20 20 20 20 53 65 65 20 3c 61 20 68 72 65 66 See <a href
2360: 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 ="#CALLBACK OPTI
2370: 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 ONS">CALLBACK OP
2380: 54 49 4f 4e 53 3c 2f 61 3e 20 66 6f 72 0a 20 20 TIONS</a> for.
2390: 20 20 20 20 20 20 20 20 20 20 66 75 72 74 68 65 furthe
23a0: 72 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 r discussion.</d
23b0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
23c0: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 20 strong>-request
23d0: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f </strong><em>boo
23e0: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 l</em></dt>.
23f0: 20 20 20 20 3c 64 64 3e 52 65 71 75 65 73 74 20 <dd>Request
2400: 61 20 63 65 72 74 69 66 69 63 61 74 65 20 66 72 a certificate fr
2410: 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67 20 53 om peer during S
2420: 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 0a 20 20 SL handshake..
2430: 20 20 20 20 20 20 20 20 20 20 28 3c 73 74 72 6f (<stro
2440: 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f ng>default</stro
2450: 6e 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 ng>: <em>true</e
2460: 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 m>)</dd>.
2470: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 <dt><strong>-re
2480: 71 75 69 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c quire</strong> <
2490: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 em>bool</em></dt
24a0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 52 65 >. <dd>Re
24b0: 71 75 69 72 65 20 61 20 76 61 6c 69 64 20 63 65 quire a valid ce
24c0: 72 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20 70 rtificate from p
24d0: 65 65 72 20 64 75 72 69 6e 67 20 53 53 4c 0a 20 eer during SSL.
24e0: 20 20 20 20 20 20 20 20 20 20 20 68 61 6e 64 73 hands
24f0: 68 61 6b 65 2e 20 49 66 20 74 68 69 73 20 69 73 hake. If this is
2500: 20 73 65 74 20 74 6f 20 74 72 75 65 20 74 68 65 set to true the
2510: 6e 20 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 n <strong>-reque
2520: 73 74 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 st</strong>.
2530: 20 20 20 20 20 20 20 20 6d 75 73 74 20 61 6c 73 must als
2540: 6f 20 62 65 20 73 65 74 20 74 6f 20 74 72 75 65 o be set to true
2550: 2e 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 . (<strong>defau
2560: 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d lt</strong>: <em
2570: 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 >false</em>)</dd
2580: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
2590: 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72 3c 2f 73 trong>-server</s
25a0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c trong> <em>bool<
25b0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 /em></dt>.
25c0: 20 20 3c 64 64 3e 48 61 6e 64 73 68 61 6b 65 20 <dd>Handshake
25d0: 61 73 20 73 65 72 76 65 72 20 69 66 20 74 72 75 as server if tru
25e0: 65 2c 20 65 6c 73 65 20 68 61 6e 64 73 68 61 6b e, else handshak
25f0: 65 20 61 73 0a 20 20 20 20 20 20 20 20 20 20 20 e as.
2600: 20 63 6c 69 65 6e 74 2e 28 3c 73 74 72 6f 6e 67 client.(<strong
2610: 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 >default</strong
2620: 3e 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d >: <em>false</em
2630: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 >)</dd>.
2640: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 <dt><strong>-ser
2650: 76 65 72 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e vername</strong>
2660: 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 3c 2f <em>host</em></
2670: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
2680: 4f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 69 Only available i
2690: 66 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 f the OpenSSL li
26a0: 62 72 61 72 79 20 74 68 65 20 70 61 63 6b 61 67 brary the packag
26b0: 65 20 69 73 20 6c 69 6e 6b 65 64 0a 09 20 20 20 e is linked..
26c0: 20 61 67 61 69 6e 73 74 20 73 75 70 70 6f 72 74 against support
26d0: 73 20 74 68 65 20 54 4c 53 20 68 6f 73 74 6e 61 s the TLS hostna
26e0: 6d 65 20 65 78 74 65 6e 73 69 6f 6e 20 66 6f 72 me extension for
26f0: 20 27 53 65 72 76 65 72 20 4e 61 6d 65 0a 09 20 'Server Name..
2700: 20 20 20 49 6e 64 69 63 61 74 69 6f 6e 27 20 28 Indication' (
2710: 53 4e 49 29 2e 20 55 73 65 20 74 6f 20 6e 61 6d SNI). Use to nam
2720: 65 20 74 68 65 20 6c 6f 67 69 63 61 6c 20 68 6f e the logical ho
2730: 73 74 20 77 65 20 61 72 65 20 74 61 6c 6b 69 6e st we are talkin
2740: 67 0a 09 20 20 20 20 74 6f 20 61 6e 64 20 65 78 g.. to and ex
2750: 70 65 63 74 69 6e 67 20 61 20 63 65 72 74 69 66 pecting a certif
2760: 69 63 61 74 65 20 66 6f 72 3c 2f 64 64 3e 0a 20 icate for</dd>.
2770: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f <dt><stro
2780: 6e 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 ng>-ssl2</strong
2790: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c > <em>bool</em><
27a0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
27b0: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 >Enable use of S
27c0: 53 4c 20 76 32 2e 20 28 3c 73 74 72 6f 6e 67 3e SL v2. (<strong>
27d0: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e default</strong>
27e0: 3a 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e : <em>false</em>
27f0: 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c )</dd>. <
2800: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 dt><strong>-ssl3
2810: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f </strong><em>bo
2820: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ol</em></dt>.
2830: 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 <dd>Enable
2840: 75 73 65 20 6f 66 20 53 53 4c 20 76 33 2e 20 28 use of SSL v3. (
2850: 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c 74 3c <strong>default<
2860: 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e 66 61 /strong>: <em>fa
2870: 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 lse</em>)</dd>.
2880: 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 72 <dt>-<str
2890: 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 6f 6e 67 ong>tls1</strong
28a0: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c > <em>bool</em><
28b0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
28c0: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 >Enable use of T
28d0: 4c 53 20 76 31 2e 20 28 3c 73 74 72 6f 6e 67 3e LS v1. (<strong>
28e0: 64 65 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e default</strong>
28f0: 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 : <em>true</em>)
2900: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
2910: 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e t>-<strong>tls1.
2920: 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 1</strong> <em>b
2930: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ool</em></dt>.
2940: 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 <dd>Enable
2950: 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 31 use of TLS v1.1
2960: 20 28 3c 73 74 72 6f 6e 67 3e 64 65 66 61 75 6c (<strong>defaul
2970: 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 3c 65 6d 3e t</strong>: <em>
2980: 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a true</em>)</dd>.
2990: 20 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 <dt>-<st
29a0: 72 6f 6e 67 3e 74 6c 73 31 2e 32 3c 2f 73 74 72 rong>tls1.2</str
29b0: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 ong> <em>bool</e
29c0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
29d0: 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f <dd>Enable use o
29e0: 66 20 54 4c 53 20 76 31 2e 32 20 28 3c 73 74 72 f TLS v1.2 (<str
29f0: 6f 6e 67 3e 64 65 66 61 75 6c 74 3c 2f 73 74 72 ong>default</str
2a00: 6f 6e 67 3e 3a 20 3c 65 6d 3e 74 72 75 65 3c 2f ong>: <em>true</
2a10: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 em>)</dd>.
2a20: 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 <dt>-<strong>t
2a30: 6c 73 31 2e 33 3c 2f 73 74 72 6f 6e 67 3e 20 3c ls1.3</strong> <
2a40: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 em>bool</em></dt
2a50: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e >. <dd>En
2a60: 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 able use of TLS
2a70: 76 31 2e 33 20 28 3c 73 74 72 6f 6e 67 3e 64 65 v1.3 (<strong>de
2a80: 66 61 75 6c 74 3c 2f 73 74 72 6f 6e 67 3e 3a 20 fault</strong>:
2a90: 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f <em>true</em>)</
2aa0: 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f dd>. </dl>.</
2ab0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 64 6c blockquote>..<dl
2ac0: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d >. <dt><a nam
2ad0: 65 3d 22 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 e="tls::unimport
2ae0: 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f "><b>tls::unimpo
2af0: 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 rt </b><i>channe
2b00: 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 l</i></a></dt>.
2b10: 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 <dd>Provided
2b20: 66 6f 72 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 for symmetry to
2b30: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 <strong>tls::imp
2b40: 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 ort</strong>, th
2b50: 69 73 0a 20 20 20 20 20 20 75 6e 73 74 61 63 6b is. unstack
2b60: 73 20 74 68 65 20 53 53 4c 2d 65 6e 61 62 6c 69 s the SSL-enabli
2b70: 6e 67 20 6f 66 20 61 20 72 65 67 75 6c 61 72 20 ng of a regular
2b80: 54 63 6c 20 63 68 61 6e 6e 65 6c 2e 20 20 41 6e Tcl channel. An
2b90: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 69 73 20 error. is
2ba0: 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 thrown if TLS is
2bb0: 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 73 74 61 not the top sta
2bc0: 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 cked channel typ
2bd0: 65 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c e.</dd>.</dl>..<
2be0: 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e dl>. <dt><a n
2bf0: 61 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 ame="tls::cipher
2c00: 73 20 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 s protocol ?verb
2c10: 6f 73 65 3f 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c ose?"><strong>tl
2c20: 73 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74 72 6f s::ciphers</stro
2c30: 6e 67 3e 0a 20 20 20 20 20 20 20 20 3c 65 6d 3e ng>. <em>
2c40: 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 62 6f 73 protocol ?verbos
2c50: 65 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e e?</em></a></dt>
2c60: 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 . <dd>Returns
2c70: 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f 72 74 list of support
2c80: 65 64 20 63 69 70 68 65 72 73 20 62 61 73 65 64 ed ciphers based
2c90: 20 6f 6e 20 74 68 65 20 3c 65 6d 3e 70 72 6f 74 on the <em>prot
2ca0: 6f 63 6f 6c 3c 2f 65 6d 3e 0a 20 20 20 20 20 20 ocol</em>.
2cb0: 20 20 79 6f 75 20 73 75 70 70 6c 79 2c 20 77 68 you supply, wh
2cc0: 69 63 68 20 6d 75 73 74 20 62 65 20 6f 6e 65 20 ich must be one
2cd0: 6f 66 20 3c 65 6d 3e 73 73 6c 32 2c 20 73 73 6c of <em>ssl2, ssl
2ce0: 33 2c 20 6f 72 20 74 6c 73 31 3c 2f 65 6d 3e 2e 3, or tls1</em>.
2cf0: 0a 20 20 20 20 20 20 20 20 49 66 20 3c 65 6d 3e . If <em>
2d00: 76 65 72 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 20 verbose</em> is
2d10: 73 70 65 63 69 66 69 65 64 20 61 73 20 74 72 75 specified as tru
2d20: 65 20 74 68 65 6e 20 61 20 76 65 72 62 6f 73 65 e then a verbose
2d30: 2c 0a 20 20 20 20 20 20 20 20 73 65 6d 69 2d 68 ,. semi-h
2d40: 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20 6c 69 uman readable li
2d50: 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 20 70 st is returned p
2d60: 72 6f 76 69 64 69 6e 67 20 61 64 64 69 74 69 6f roviding additio
2d70: 6e 61 6c 0a 20 20 20 20 20 20 20 20 69 6e 66 6f nal. info
2d80: 72 6d 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 6e rmation on the n
2d90: 61 74 75 72 65 20 6f 66 20 74 68 65 20 63 69 70 ature of the cip
2da0: 68 65 72 20 73 75 70 70 6f 72 74 2e 20 49 6e 20 her support. In
2db0: 65 61 63 68 0a 20 20 20 20 20 20 20 20 63 61 73 each. cas
2dc0: 65 20 74 68 65 20 72 65 73 75 6c 74 20 69 73 20 e the result is
2dd0: 61 20 54 63 6c 20 6c 69 73 74 2e 3c 2f 64 64 3e a Tcl list.</dd>
2de0: 0a 3c 2f 64 6c 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 .</dl>..<dl>.
2df0: 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c <dt><a name="tl
2e00: 73 3a 3a 76 65 72 73 69 6f 6e 22 3e 3c 73 74 72 s::version"><str
2e10: 6f 6e 67 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e ong>tls::version
2e20: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 </strong></a></d
2e30: 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 t>. <dd>Retur
2e40: 6e 73 20 74 68 65 20 76 65 72 73 69 6f 6e 20 73 ns the version s
2e50: 74 72 69 6e 67 20 64 65 66 69 6e 65 64 20 62 79 tring defined by
2e60: 20 4f 70 65 6e 53 53 4c 2e 3c 2f 64 64 3e 0a 3c OpenSSL.</dd>.<
2e70: 2f 64 6c 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d /dl>..<h3><a nam
2e80: 65 3d 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 e="CALLBACK OPTI
2e90: 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 ONS">CALLBACK OP
2ea0: 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a TIONS</a></h3>..
2eb0: 3c 70 3e 0a 41 73 20 69 6e 64 69 63 61 74 65 64 <p>.As indicated
2ec0: 20 61 62 6f 76 65 2c 20 69 6e 64 69 76 69 64 75 above, individu
2ed0: 61 6c 20 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20 al channels can
2ee0: 62 65 20 67 69 76 65 6e 20 74 68 65 69 72 20 6f be given their o
2ef0: 77 6e 20 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20 wn callbacks.to
2f00: 68 61 6e 64 6c 65 20 69 6e 74 65 72 6d 65 64 69 handle intermedi
2f10: 61 74 65 20 70 72 6f 63 65 73 73 69 6e 67 20 62 ate processing b
2f20: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 y the OpenSSL li
2f30: 62 72 61 72 79 2c 20 75 73 69 6e 67 20 74 68 65 brary, using the
2f40: 0a 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 .<em>-command</e
2f50: 6d 3e 20 61 6e 64 20 3c 65 6d 3e 2d 70 61 73 73 m> and <em>-pass
2f60: 77 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e word</em> option
2f70: 73 20 70 61 73 73 65 64 20 74 6f 20 65 69 74 68 s passed to eith
2f80: 65 72 20 6f 66 0a 3c 73 74 72 6f 6e 67 3e 74 6c er of.<strong>tl
2f90: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e s::socket</stron
2fa0: 67 3e 20 6f 72 20 3c 73 74 72 6f 6e 67 3e 74 6c g> or <strong>tl
2fb0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e s::import</stron
2fc0: 67 3e 2e 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b g>..</p>..<block
2fd0: 71 75 6f 74 65 3e 0a 3c 64 6c 3e 0a 0a 20 20 20 quote>.<dl>..
2fe0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f <dt><strong>-co
2ff0: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c mmand</strong> <
3000: 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e em>callback</em>
3010: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 </dt>. <dd>..
3020: 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 Invokes the spec
3030: 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 ified <em>callba
3040: 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 61 ck</em> script a
3050: 74 0a 09 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 t..several point
3060: 73 20 64 75 72 69 6e 67 20 74 68 65 20 4f 70 65 s during the Ope
3070: 6e 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 0a nSSL handshake..
3080: 09 45 78 63 65 70 74 20 61 73 20 69 6e 64 69 63 .Except as indic
3090: 61 74 65 64 20 62 65 6c 6f 77 2c 20 76 61 6c 75 ated below, valu
30a0: 65 73 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d es returned from
30b0: 20 74 68 65 0a 09 63 61 6c 6c 62 61 63 6b 20 61 the..callback a
30c0: 72 65 20 69 67 6e 6f 72 65 64 2e 0a 09 41 72 67 re ignored...Arg
30d0: 75 6d 65 6e 74 73 20 61 70 70 65 6e 64 65 64 20 uments appended
30e0: 74 6f 20 74 68 65 20 73 63 72 69 70 74 20 75 70 to the script up
30f0: 6f 6e 20 63 61 6c 6c 62 61 63 6b 20 74 61 6b 65 on callback take
3100: 20 6f 6e 65 20 6f 66 20 74 68 65 0a 09 66 6f 6c one of the..fol
3110: 6c 6f 77 69 6e 67 20 66 6f 72 6d 73 3a 0a 0a 09 lowing forms:...
3120: 3c 62 72 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c <br>..<br>...<dl
3130: 3e 0a 0a 3c 21 2d 2d 09 54 68 69 73 20 66 6f 72 >..<!--.This for
3140: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 m of callback is
3150: 20 64 69 73 61 62 6c 65 64 2e 0a 0a 09 3c 64 74 disabled....<dt
3160: 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 65 72 72 >.. <strong>err
3170: 6f 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e or</strong> <em>
3180: 63 68 61 6e 6e 65 6c 20 6d 65 73 73 61 67 65 3c channel message<
3190: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 /em>..</dt>..<dd
31a0: 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 65 73 >.. The <em>mes
31b0: 73 61 67 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 sage</em> argume
31c0: 6e 74 20 63 6f 6e 74 61 69 6e 73 20 61 6e 20 65 nt contains an e
31d0: 72 72 6f 72 20 6d 65 73 73 61 67 65 20 67 65 6e rror message gen
31e0: 65 72 61 74 65 64 0a 09 20 20 62 79 20 74 68 65 erated.. by the
31f0: 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f OpenSSL functio
3200: 6e 0a 09 20 20 3c 63 6f 64 65 3e 45 52 52 5f 72 n.. <code>ERR_r
3210: 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 69 eason_error_stri
3220: 6e 67 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 3c 2f ng()</code>...</
3230: 64 64 3e 0a 0a 09 3c 62 72 3e 0a 2d 2d 3e 0a 0a dd>...<br>.-->..
3240: 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 .<dt>.. <strong
3250: 3e 69 6e 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c >info</strong> <
3260: 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f 72 em>channel major
3270: 20 6d 69 6e 6f 72 20 6d 65 73 73 61 67 65 3c 2f minor message</
3280: 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e em>..</dt>..<dd>
3290: 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 .. This form of
32a0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 callback is inv
32b0: 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e oked by the Open
32c0: 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 SSL function..
32d0: 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73 65 <code>SSL_CTX_se
32e0: 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b 28 t_info_callback(
32f0: 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 )</code>... <br
3300: 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 61 6a >.. The <em>maj
3310: 6f 72 3c 2f 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e or</em> and <em>
3320: 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d minor</em> argum
3330: 65 6e 74 73 20 61 72 65 20 75 73 65 64 20 74 6f ents are used to
3340: 0a 09 20 20 72 65 70 72 65 73 65 6e 74 20 74 68 .. represent th
3350: 65 20 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 e state informat
3360: 69 6f 6e 20 62 69 74 6d 61 73 6b 2e 0a 09 20 20 ion bitmask...
3370: 3c 64 6c 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 <dl>.. <dt>Poss
3380: 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 20 ible values for
3390: 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 <em>major</em> a
33a0: 72 65 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e re:</dt>.. <dd>
33b0: 3c 63 6f 64 65 3e 68 61 6e 64 73 68 61 6b 65 2c <code>handshake,
33c0: 20 61 6c 65 72 74 2c 20 63 6f 6e 6e 65 63 74 2c alert, connect,
33d0: 20 61 63 63 65 70 74 3c 2f 63 6f 64 65 3e 2e 3c accept</code>.<
33e0: 2f 64 64 3e 0a 09 20 20 3c 64 74 3e 50 6f 73 73 /dd>.. <dt>Poss
33f0: 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 20 ible values for
3400: 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 61 <em>minor</em> a
3410: 72 65 3a 3c 2f 64 74 3e 0a 09 20 20 3c 64 64 3e re:</dt>.. <dd>
3420: 3c 63 6f 64 65 3e 73 74 61 72 74 2c 20 64 6f 6e <code>start, don
3430: 65 2c 20 72 65 61 64 2c 20 77 72 69 74 65 2c 20 e, read, write,
3440: 6c 6f 6f 70 2c 20 65 78 69 74 3c 2f 63 6f 64 65 loop, exit</code
3450: 3e 2e 3c 2f 64 64 3e 0a 09 20 20 3c 2f 64 6c 3e >.</dd>.. </dl>
3460: 0a 09 20 20 54 68 65 20 3c 65 6d 3e 6d 65 73 73 .. The <em>mess
3470: 61 67 65 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e age</em> argumen
3480: 74 20 69 73 20 61 20 64 65 73 63 72 69 70 74 69 t is a descripti
3490: 76 65 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 ve string which
34a0: 6d 61 79 0a 09 20 20 62 65 20 67 65 6e 65 72 61 may.. be genera
34b0: 74 65 64 20 65 69 74 68 65 72 20 62 79 0a 09 20 ted either by..
34c0: 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 74 61 74 65 <code>SSL_state
34d0: 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f _string_long()</
34e0: 63 6f 64 65 3e 20 6f 72 20 62 79 0a 09 20 20 3c code> or by.. <
34f0: 63 6f 64 65 3e 53 53 4c 5f 61 6c 65 72 74 5f 64 code>SSL_alert_d
3500: 65 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 esc_string_long(
3510: 29 3c 2f 63 6f 64 65 3e 2c 0a 09 20 20 64 65 70 )</code>,.. dep
3520: 65 6e 64 69 6e 67 20 6f 6e 20 63 6f 6e 74 65 78 ending on contex
3530: 74 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e t...</dd>...<br>
3540: 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f ...<dt>.. <stro
3550: 6e 67 3e 76 65 72 69 66 79 3c 2f 73 74 72 6f 6e ng>verify</stron
3560: 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 64 g> <em>channel d
3570: 65 70 74 68 20 63 65 72 74 20 73 74 61 74 75 73 epth cert status
3580: 20 65 72 72 6f 72 3c 2f 65 6d 3e 0a 09 3c 2f 64 error</em>..</d
3590: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 73 t>..<dd>.. This
35a0: 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 form of callbac
35b0: 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 k is invoked by
35c0: 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 the OpenSSL func
35d0: 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 53 tion.. <code>SS
35e0: 4c 5f 73 65 74 5f 76 65 72 69 66 79 28 29 3c 2f L_set_verify()</
35f0: 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 code>... <br>..
3600: 20 20 54 68 65 20 3c 65 6d 3e 64 65 70 74 68 3c The <em>depth<
3610: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 /em> argument is
3620: 20 61 6e 20 69 6e 74 65 67 65 72 20 72 65 70 72 an integer repr
3630: 65 73 65 6e 74 69 6e 67 20 74 68 65 0a 09 20 20 esenting the..
3640: 63 75 72 72 65 6e 74 20 64 65 70 74 68 20 6f 6e current depth on
3650: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 the certificate
3660: 20 63 68 61 69 6e 2c 20 77 69 74 68 0a 09 20 20 chain, with..
3670: 3c 63 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 61 <code>0</code> a
3680: 73 20 74 68 65 20 73 75 62 6a 65 63 74 20 63 65 s the subject ce
3690: 72 74 69 66 69 63 61 74 65 20 61 6e 64 20 68 69 rtificate and hi
36a0: 67 68 65 72 20 76 61 6c 75 65 73 0a 09 20 20 64 gher values.. d
36b0: 65 6e 6f 74 69 6e 67 20 70 72 6f 67 72 65 73 73 enoting progress
36c0: 69 76 65 6c 79 20 6d 6f 72 65 20 69 6e 64 69 72 ively more indir
36d0: 65 63 74 20 69 73 73 75 65 72 20 63 65 72 74 69 ect issuer certi
36e0: 66 69 63 61 74 65 73 2e 0a 09 20 20 3c 62 72 3e ficates... <br>
36f0: 0a 09 20 20 54 68 65 20 3c 65 6d 3e 63 65 72 74 .. The <em>cert
3700: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 </em> argument i
3710: 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79 2d s a list of key-
3720: 76 61 6c 75 65 20 70 61 69 72 73 20 73 69 6d 69 value pairs simi
3730: 6c 61 72 0a 09 20 20 74 6f 20 74 68 6f 73 65 20 lar.. to those
3740: 72 65 74 75 72 6e 65 64 20 62 79 0a 09 20 20 3c returned by.. <
3750: 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 a href="#tls::st
3760: 61 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c atus"><strong>tl
3770: 73 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e s::status</stron
3780: 67 3e 3c 2f 61 3e 2e 0a 09 20 20 3c 62 72 3e 0a g></a>... <br>.
3790: 09 20 20 54 68 65 20 3c 65 6d 3e 73 74 61 74 75 . The <em>statu
37a0: 73 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 s</em> argument
37b0: 69 73 20 61 6e 20 69 6e 74 65 67 65 72 20 72 65 is an integer re
37c0: 70 72 65 73 65 6e 74 69 6e 67 20 74 68 65 0a 09 presenting the..
37d0: 20 20 63 75 72 72 65 6e 74 20 76 61 6c 69 64 69 current validi
37e0: 74 79 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 ty of the certif
37f0: 69 63 61 74 65 2e 0a 09 20 20 41 20 76 61 6c 75 icate... A valu
3800: 65 20 6f 66 20 3c 63 6f 64 65 3e 30 3c 2f 63 6f e of <code>0</co
3810: 64 65 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65 de> means the ce
3820: 72 74 69 66 69 63 61 74 65 20 69 73 20 64 65 65 rtificate is dee
3830: 6d 65 64 20 69 6e 76 61 6c 69 64 2e 0a 09 20 20 med invalid...
3840: 41 20 76 61 6c 75 65 20 6f 66 20 3c 63 6f 64 65 A value of <code
3850: 3e 31 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e 73 20 >1</code> means
3860: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 the certificate
3870: 69 73 20 64 65 65 6d 65 64 20 76 61 6c 69 64 2e is deemed valid.
3880: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 .. <br>.. The
3890: 3c 65 6d 3e 65 72 72 6f 72 3c 2f 65 6d 3e 20 61 <em>error</em> a
38a0: 72 67 75 6d 65 6e 74 20 73 75 70 70 6c 69 65 73 rgument supplies
38b0: 20 74 68 65 20 6d 65 73 73 61 67 65 2c 20 69 66 the message, if
38c0: 20 61 6e 79 2c 20 67 65 6e 65 72 61 74 65 64 0a any, generated.
38d0: 09 20 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e 58 . by.. <code>X
38e0: 35 30 39 5f 53 54 4f 52 45 5f 43 54 58 5f 67 65 509_STORE_CTX_ge
38f0: 74 5f 65 72 72 6f 72 28 29 3c 2f 63 6f 64 65 3e t_error()</code>
3900: 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 3c 62 72 ... <br>.. <br
3910: 3e 0a 09 20 20 54 68 65 20 63 61 6c 6c 62 61 63 >.. The callbac
3920: 6b 20 6d 61 79 20 6f 76 65 72 72 69 64 65 20 6e k may override n
3930: 6f 72 6d 61 6c 20 76 61 6c 69 64 61 74 69 6f 6e ormal validation
3940: 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20 65 processing by e
3950: 78 70 6c 69 63 69 74 6c 79 0a 09 20 20 72 65 74 xplicitly.. ret
3960: 75 72 6e 69 6e 67 20 6f 6e 65 20 6f 66 20 74 68 urning one of th
3970: 65 20 61 62 6f 76 65 20 3c 65 6d 3e 73 74 61 74 e above <em>stat
3980: 75 73 3c 2f 65 6d 3e 20 76 61 6c 75 65 73 2e 0a us</em> values..
3990: 09 3c 2f 64 64 3e 0a 0a 09 3c 2f 64 6c 3e 0a 20 .</dd>...</dl>.
39a0: 20 20 20 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 62 </dd>.. <b
39b0: 72 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 r>.. <dt><str
39c0: 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 ong>-password</s
39d0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 trong> <em>callb
39e0: 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ack</em></dt>.
39f0: 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 <dd>..Invokes
3a00: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 the specified <e
3a10: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 m>callback</em>
3a20: 73 63 72 69 70 74 20 77 68 65 6e 20 4f 70 65 6e script when Open
3a30: 53 53 4c 20 6e 65 65 64 73 20 74 6f 0a 09 6f 62 SSL needs to..ob
3a40: 74 61 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2e tain a password.
3a50: 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 The callback s
3a60: 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 61 20 73 hould return a s
3a70: 74 72 69 6e 67 20 77 68 69 63 68 0a 09 72 65 70 tring which..rep
3a80: 72 65 73 65 6e 74 73 20 74 68 65 20 70 61 73 73 resents the pass
3a90: 77 6f 72 64 20 74 6f 20 62 65 20 75 73 65 64 2e word to be used.
3aa0: 0a 09 4e 6f 20 61 72 67 75 6d 65 6e 74 73 20 61 ..No arguments a
3ab0: 72 65 20 61 70 70 65 6e 64 65 64 20 74 6f 20 74 re appended to t
3ac0: 68 65 20 73 63 72 69 70 74 20 75 70 6f 6e 20 63 he script upon c
3ad0: 61 6c 6c 62 61 63 6b 2e 0a 20 20 20 20 3c 2f 64 allback.. </d
3ae0: 64 3e 0a 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b d>.</dl>.</block
3af0: 71 75 6f 74 65 3e 0a 0a 3c 70 3e 0a 52 65 66 65 quote>..<p>.Refe
3b00: 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 61 rence implementa
3b10: 74 69 6f 6e 73 20 6f 66 20 74 68 65 73 65 20 63 tions of these c
3b20: 61 6c 6c 62 61 63 6b 73 20 61 72 65 20 70 72 6f allbacks are pro
3b30: 76 69 64 65 64 20 69 6e 20 74 68 65 0a 64 69 73 vided in the.dis
3b40: 74 72 69 62 75 74 69 6f 6e 20 61 73 20 3c 73 74 tribution as <st
3b50: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 rong>tls::callba
3b60: 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 0a ck</strong> and.
3b70: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 <strong>tls::pas
3b80: 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 72 sword</strong> r
3b90: 65 73 70 65 63 74 69 76 65 6c 79 2e 20 20 4e 6f espectively. No
3ba0: 74 65 20 74 68 61 74 20 74 68 65 73 65 20 61 72 te that these ar
3bb0: 65 0a 3c 65 6d 3e 73 61 6d 70 6c 65 3c 2f 65 6d e.<em>sample</em
3bc0: 3e 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e > implementation
3bd0: 73 20 6f 6e 6c 79 2e 20 20 49 6e 20 61 20 6d 6f s only. In a mo
3be0: 72 65 20 72 65 61 6c 69 73 74 69 63 20 64 65 70 re realistic dep
3bf0: 6c 6f 79 6d 65 6e 74 0a 79 6f 75 20 77 6f 75 6c loyment.you woul
3c00: 64 20 73 70 65 63 69 66 79 20 79 6f 75 72 20 6f d specify your o
3c10: 77 6e 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 wn callback scri
3c20: 70 74 73 20 6f 6e 20 65 61 63 68 20 54 4c 53 20 pts on each TLS
3c30: 63 68 61 6e 6e 65 6c 0a 75 73 69 6e 67 20 74 68 channel.using th
3c40: 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f e <em>-command</
3c50: 65 6d 3e 20 61 6e 64 20 3c 65 6d 3e 2d 70 61 73 em> and <em>-pas
3c60: 73 77 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f sword</em> optio
3c70: 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 ns..</p>..<p>.Th
3c80: 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 e default behavi
3c90: 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 65 6d 3e or when the <em>
3ca0: 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 6f 70 -command</em> op
3cb0: 74 69 6f 6e 20 69 73 20 6e 6f 74 20 73 70 65 63 tion is not spec
3cc0: 69 66 69 65 64 20 69 73 20 66 6f 72 0a 54 4c 53 ified is for.TLS
3cd0: 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 to process the
3ce0: 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 associated libra
3cf0: 72 79 20 63 61 6c 6c 62 61 63 6b 73 20 69 6e 74 ry callbacks int
3d00: 65 72 6e 61 6c 6c 79 2e 0a 54 68 65 20 64 65 66 ernally..The def
3d10: 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 ault behavior wh
3d20: 65 6e 20 74 68 65 20 3c 65 6d 3e 2d 70 61 73 73 en the <em>-pass
3d30: 77 6f 72 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e word</em> option
3d40: 20 69 73 20 6e 6f 74 20 73 70 65 63 69 66 69 65 is not specifie
3d50: 64 20 69 73 20 66 6f 72 0a 54 4c 53 20 74 6f 20 d is for.TLS to
3d60: 70 72 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f process the asso
3d70: 63 69 61 74 65 64 20 6c 69 62 72 61 72 79 20 63 ciated library c
3d80: 61 6c 6c 62 61 63 6b 73 20 62 79 20 61 74 74 65 allbacks by atte
3d90: 6d 70 74 69 6e 67 20 74 6f 20 63 61 6c 6c 0a 3c mpting to call.<
3da0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 strong>tls::pass
3db0: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 54 word</strong>..T
3dc0: 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 62 65 he difference be
3dd0: 74 77 65 65 6e 20 74 68 65 73 65 20 74 77 6f 20 tween these two
3de0: 62 65 68 61 76 69 6f 72 73 20 69 73 20 61 20 63 behaviors is a c
3df0: 6f 6e 73 65 71 75 65 6e 63 65 20 6f 66 20 6d 61 onsequence of ma
3e00: 69 6e 74 61 69 6e 69 6e 67 0a 63 6f 6d 70 61 74 intaining.compat
3e10: 69 62 69 6c 69 74 79 20 77 69 74 68 20 65 61 72 ibility with ear
3e20: 6c 69 65 72 20 69 6d 70 6c 65 6d 65 6e 74 61 74 lier implementat
3e30: 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a ions..</p>..<p>.
3e40: 54 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a The <strong>tls:
3e50: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20 :debug</strong>
3e60: 76 61 72 69 61 62 6c 65 20 70 72 6f 76 69 64 65 variable provide
3e70: 73 20 73 6f 6d 65 20 61 64 64 69 74 69 6f 6e 61 s some additiona
3e80: 6c 0a 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20 74 l.control over t
3e90: 68 65 73 65 20 72 65 66 65 72 65 6e 63 65 20 63 hese reference c
3ea0: 61 6c 6c 62 61 63 6b 73 2e 20 20 49 74 73 20 76 allbacks. Its v
3eb0: 61 6c 75 65 20 69 73 20 7a 65 72 6f 20 62 79 20 alue is zero by
3ec0: 64 65 66 61 75 6c 74 2e 0a 48 69 67 68 65 72 20 default..Higher
3ed0: 76 61 6c 75 65 73 20 70 72 6f 64 75 63 65 20 6d values produce m
3ee0: 6f 72 65 20 64 69 61 67 6e 6f 73 74 69 63 20 6f ore diagnostic o
3ef0: 75 74 70 75 74 2c 20 61 6e 64 20 77 69 6c 6c 20 utput, and will
3f00: 61 6c 73 6f 20 66 6f 72 63 65 20 74 68 65 0a 76 also force the.v
3f10: 65 72 69 66 79 20 6d 65 74 68 6f 64 20 69 6e 20 erify method in
3f20: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c <strong>tls::cal
3f30: 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 74 lback</strong> t
3f40: 6f 20 61 63 63 65 70 74 20 74 68 65 0a 63 65 72 o accept the.cer
3f50: 74 69 66 69 63 61 74 65 2c 20 65 76 65 6e 20 77 tificate, even w
3f60: 68 65 6e 20 69 74 20 69 73 20 69 6e 76 61 6c 69 hen it is invali
3f70: 64 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65 6d d..</p>..<p>.<em
3f80: 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 68 65 >.The use of the
3f90: 20 72 65 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 reference callb
3fa0: 61 63 6b 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 acks <strong>tls
3fb0: 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f ::callback</stro
3fc0: 6e 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e ng> and.<strong>
3fd0: 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 tls::password</s
3fe0: 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72 65 trong> is not re
3ff0: 63 6f 6d 6d 65 6e 64 65 64 2e 20 20 54 68 65 79 commended. They
4000: 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64 0a may be removed.
4010: 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 from future rele
4020: 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e ases..</em>.</p>
4030: 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 ..<p>.<em>.The u
4040: 73 65 20 6f 66 20 74 68 65 20 76 61 72 69 61 62 se of the variab
4050: 6c 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a le <strong>tls::
4060: 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20 69 debug</strong> i
4070: 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 s not recommende
4080: 64 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65 6d d..It may be rem
4090: 6f 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 oved from future
40a0: 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e releases..</em>
40b0: 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 .</p>..<h3><a na
40c0: 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50 4c me="HTTPS EXAMPL
40d0: 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 E">HTTPS EXAMPLE
40e0: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 </a></h3>..<p>Th
40f0: 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 73 20 is example uses
4100: 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 72 2e a sample server.
4110: 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 69 74 pem provided wit
4120: 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73 h the TLS releas
4130: 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74 e,.courtesy of t
4140: 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 he <strong>OpenS
4150: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a SL</strong> proj
4160: 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 3c ect.</p>..<pre><
4170: 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 code>.package re
4180: 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 quire http.packa
4190: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a ge require tls..
41a0: 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 http::register h
41b0: 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a ttps 443 [list :
41c0: 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 :tls::socket -au
41d0: 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72 75 toservername tru
41e0: 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 65 20 e -require true
41f0: 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c 2f -cadir /etc/ssl/
4200: 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f 6b 20 certs]..set tok
4210: 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 68 74 [http::geturl ht
4220: 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 6b tps://www.tcl.tk
4230: 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e /].</code></pre>
4240: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 ..<h3><a name="S
4250: 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 PECIAL CONSIDERA
4260: 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c 20 43 TIONS">SPECIAL C
4270: 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 ONSIDERATIONS</a
4280: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 63 ></h3>..<p>The c
4290: 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74 apabilities of t
42a0: 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20 his package can
42b0: 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 vary enormously
42c0: 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77 20 79 based.upon how y
42d0: 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 our OpenSSL libr
42e0: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72 ary was configur
42f0: 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 74 ed and built. At
4300: 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72 6f 2d the.most macro-
4310: 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73 75 level OpenSSL su
4320: 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b 6e pports a "n
4330: 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b 20 o patents"
4340: 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64 69 73 build,.which dis
4350: 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41 2c ables RSA, IDEA,
4360: 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20 53 RC(2,4,5) and S
4370: 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f 70 SL2 - if your Op
4380: 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69 67 75 enSSL is.configu
4390: 72 65 64 20 74 68 69 73 20 77 61 79 20 74 68 65 red this way the
43a0: 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 20 n you will need
43b0: 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77 69 74 to build TLS wit
43c0: 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54 45 4e h the.-DNO_PATEN
43d0: 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e 64 20 TS option - and
43e0: 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20 6d 6f the resultant mo
43f0: 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63 74 69 dule will functi
4400: 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61 6e 64 on.correctly and
4410: 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20 41 44 also support AD
4420: 48 20 63 65 72 74 69 66 69 63 61 74 65 2d 6c 65 H certificate-le
4430: 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c 0a 68 ss encryption,.h
4440: 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c 6c 20 owever you will
4450: 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75 74 69 be unable to uti
4460: 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73 70 65 lize this to spe
4470: 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57 65 62 ak to normal Web
4480: 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63 68 20 .Servers, which
4490: 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75 69 72 typically requir
44a0: 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e 20 50 e RSA support. P
44b0: 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68 72 65 lease see <a.hre
44c0: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 f="http://www.op
44d0: 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74 74 70 enssl.org/">http
44e0: 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f ://www.openssl.o
44f0: 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f 72 65 rg/</a> for.more
4500: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 information on
4510: 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75 65 20 the whole issue
4520: 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64 20 55 of patents and U
4530: 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72 69 63 S export.restric
4540: 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c 68 33 tions. </p>..<h3
4550: 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20 41 4c ><a name="SEE AL
4560: 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e SO">SEE ALSO</a>
4570: 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f 6e </h3>..<p><stron
4580: 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 g>socket</strong
4590: 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65 >, <strong>filee
45a0: 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e 3c vent, </strong><
45b0: 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 a.href="http://w
45c0: 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 ww.openssl.org/"
45d0: 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c ><strong>OpenSSL
45e0: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70 </strong></a></p
45f0: 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e 0a 43 >..<hr>..<pre>.C
4600: 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b 20 opyright ©
4610: 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 1999 Matt Newman
4620: 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 ..Copyright &cop
4630: 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 73 68 y; 2004 Starfish
4640: 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72 65 3e Systems..</pre>
4650: 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c 3e .</body>.</html>
4660: 0a .