0000: 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 20 70 <!doctype html p
0010: 75 62 6c 69 63 20 22 2d 2f 2f 57 33 43 2f 2f 44 ublic "-//W3C//D
0020: 54 44 20 48 54 4d 4c 20 34 2e 30 20 54 72 61 6e TD HTML 4.0 Tran
0030: 73 69 74 69 6f 6e 61 6c 2f 2f 45 4e 22 3e 20 0a sitional//EN"> .
0040: 0a 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a .<html>..<head>.
0050: 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 <meta http-equiv
0060: 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a ="Content-Type".
0070: 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 content="text/ht
0080: 6d 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d ml; charset=iso-
0090: 38 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e 8859-1">.<meta n
00a0: 61 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20 ame="Copyright"
00b0: 63 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61 content="1999 Ma
00c0: 74 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34 tt Newman / 2004
00d0: 20 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d Starfish System
00e0: 73 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28 s">.<title>TLS (
00f0: 53 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64 SSL) Tcl Command
0100: 73 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 s</title>.</head
0110: 3e 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72 >..<body bgcolor
0120: 3d 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c ="#FFFFFF">..<dl
0130: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 >. <dd><a hre
0140: 66 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f f="#NAME">NAME</
0150: 61 3e 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 a> <dl>.
0160: 3c 64 64 3e 3c 62 3e 74 6c 73 3c 2f 62 3e 20 2d <dd><b>tls</b> -
0170: 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 62 3e 4f binding to <b>O
0180: 70 65 6e 53 53 4c 3c 2f 62 3e 20 74 6f 6f 6c 6b penSSL</b> toolk
0190: 69 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 it.</dd>. </d
01a0: 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 20 20 20 l>. </dd>.
01b0: 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 <dd><a href="#S
01c0: 59 4e 4f 50 53 49 53 22 3e 53 59 4e 4f 50 53 49 YNOPSIS">SYNOPSI
01d0: 53 3c 2f 61 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 S</a> </dd>.
01e0: 3c 64 64 3e 3c 64 6c 3e 0a 20 20 20 20 20 20 20 <dd><dl>.
01f0: 20 20 20 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b <dd><b>pack
0200: 61 67 65 20 72 65 71 75 69 72 65 20 54 63 6c 3c age require Tcl<
0210: 2f 62 3e 20 3c 65 6d 3e 3f 38 2e 34 3f 3c 2f 65 /b> <em>?8.4?</e
0220: 6d 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 m></dd>.
0230: 20 20 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 <dd><b>packa
0240: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f ge require tls</
0250: 62 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 b></dd>.
0260: 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f <dt> </
0270: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 dt>.
0280: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 <dd><b>tls::init
0290: 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e </b> <em>?option
02a0: 73 3f 3c 2f 65 6d 3e 20 3c 2f 64 64 3e 0a 20 20 s?</em> </dd>.
02b0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 <dd><b
02c0: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e >tls::socket</b>
02d0: 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 <em>?options? h
02e0: 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 ost port</em></d
02f0: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c d>. <
0300: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 dd><b>tls::socke
0310: 74 3c 2f 62 3e 20 3c 65 6d 3e 20 3f 2d 73 65 72 t</b> <em> ?-ser
0320: 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 ver command? ?op
0330: 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e tions? port</em>
0340: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 </dd>.
0350: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 68 61 <dd><b>tls::ha
0360: 6e 64 73 68 61 6b 65 3c 2f 62 3e 20 3c 65 6d 3e ndshake</b> <em>
0370: 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 channel</em></d
0380: 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c d>. <
0390: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 dd><b>tls::statu
03a0: 73 20 3c 2f 62 3e 20 3c 65 6d 3e 3f 2d 6c 6f 63 s </b> <em>?-loc
03b0: 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e al? channel</em>
03c0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 </dd>.
03d0: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 6f <dd><b>tls::co
03e0: 6e 6e 65 63 74 69 6f 6e 20 3c 2f 62 3e 20 3c 65 nnection </b> <e
03f0: 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f m>channel</em></
0400: 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 dd>.
0410: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6d 70 6f <dd><b>tls::impo
0420: 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63 68 61 6e 6e rt</b> <em>chann
0430: 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 65 6d el ?options?</em
0440: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20 ></dd>.
0450: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 <dd><b>tls::u
0460: 6e 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e nimport</b> <em>
0470: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 channel</em></dd
0480: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 >. <d
0490: 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 t> </dt>.
04a0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 <dd><b
04b0: 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 3c 2f >tls::ciphers </
04c0: 62 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 b> <em>protocol
04d0: 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 70 6f ?verbose? ?suppo
04e0: 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a rted?</em></dd>.
04f0: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e <dd>
0500: 3c 62 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c <b>tls::protocol
0510: 73 3c 2f 62 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 s</b></dd>.
0520: 20 20 20 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c <dd><b>tl
0530: 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 62 3e 3c 2f s::version</b></
0540: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 2f 64 6c dd>. </dl
0550: 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 >. </dd>.
0560: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 4f <dd><a href="#CO
0570: 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 MMANDS">COMMANDS
0580: 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 </a></dd>. <d
0590: 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c d><a href="#CALL
05a0: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 BACK OPTIONS">CA
05b0: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f LLBACK OPTIONS</
05c0: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e a></dd>. <dd>
05d0: 3c 61 20 68 72 65 66 3d 22 23 48 54 54 50 53 20 <a href="#HTTPS
05e0: 45 58 41 4d 50 4c 45 22 3e 48 54 54 50 53 20 45 EXAMPLE">HTTPS E
05f0: 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 64 64 3e 0a XAMPLE</a></dd>.
0600: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d <dd><a href=
0610: 22 23 53 45 45 20 41 4c 53 4f 22 3e 53 50 45 43 "#SEE ALSO">SPEC
0620: 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f IAL CONSIDERATIO
0630: 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 NS</a></dd>.
0640: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 45 <dd><a href="#SE
0650: 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f E ALSO">SEE ALSO
0660: 3c 2f 61 3e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a </a></dd>.</dl>.
0670: 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 .<hr>..<h3><a na
0680: 6d 65 3d 22 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f me="NAME">NAME</
0690: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 a></h3>..<p><str
06a0: 6f 6e 67 3e 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e ong>tls</strong>
06b0: 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 73 - binding to <s
06c0: 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 trong>OpenSSL</s
06d0: 74 72 6f 6e 67 3e 0a 74 6f 6f 6c 6b 69 74 2e 3c trong>.toolkit.<
06e0: 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 /p>..<h3><a name
06f0: 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53 59 4e 4f ="SYNOPSIS">SYNO
0700: 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c PSIS</a></h3>..<
0710: 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 65 71 p><b>package req
0720: 75 69 72 65 20 54 63 6c 20 38 2e 34 3c 2f 62 3e uire Tcl 8.4</b>
0730: 3c 62 72 3e 0a 3c 62 3e 70 61 63 6b 61 67 65 20 <br>.<b>package
0740: 72 65 71 75 69 72 65 20 74 6c 73 3c 2f 62 3e 3c require tls</b><
0750: 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 66 br>.<br>.<a href
0760: 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 ="#tls::init"><b
0770: 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f 62 3e 20 3c >tls::init</b> <
0780: 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c i>?options?</i><
0790: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d /a><br>.<a href=
07a0: 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c "#tls::socket"><
07b0: 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 b>tls::socket</b
07c0: 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 > <i>?options? h
07d0: 6f 73 74 20 70 6f 72 74 3c 2f 69 3e 3c 62 72 3e ost port</i><br>
07e0: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a .<a href="#tls::
07f0: 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a socket"><b>tls::
0800: 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 69 3e 3f 2d socket</b> <i>?-
0810: 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 server command?
0820: 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f ?options? port</
0830: 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 i></a><br>.<a hr
0840: 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 ef="#tls::status
0850: 22 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73 "><b>tls::status
0860: 3c 2f 62 3e 20 3c 69 3e 3f 2d 6c 6f 63 61 6c 3f </b> <i>?-local?
0870: 20 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e channel</i></a>
0880: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 <br>.<a href="#t
0890: 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e ls::connection">
08a0: 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 <b>tls::connecti
08b0: 6f 6e 3c 2f 62 3e 20 3c 69 3e 63 68 61 6e 6e 65 on</b> <i>channe
08c0: 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 l</i></a><br>.<a
08d0: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 68 61 6e href="#tls::han
08e0: 64 73 68 61 6b 65 22 3e 3c 62 3e 74 6c 73 3a 3a dshake"><b>tls::
08f0: 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e 20 3c 69 handshake</b> <i
0900: 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e >channel</i></a>
0910: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 <br>.<a href="#t
0920: 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 ls::import"><b>t
0930: 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c ls::import</b> <
0940: 69 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f i>channel ?optio
0950: 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a ns?</i></a><br>.
0960: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 75 <a href="#tls::u
0970: 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a nimport"><b>tls:
0980: 3a 75 6e 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 69 :unimport</b> <i
0990: 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e >channel</i></a>
09a0: 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 <br>.<br>.<a hre
09b0: 66 3d 22 23 74 6c 73 3a 3a 63 69 70 68 65 72 73 f="#tls::ciphers
09c0: 22 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70 68 65 72 "><b>tls::cipher
09d0: 73 3c 2f 62 3e 20 3c 69 3e 70 72 6f 74 6f 63 6f s</b> <i>protoco
09e0: 6c 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 l ?verbose? ?sup
09f0: 70 6f 72 74 65 64 3f 3c 2f 69 3e 3c 2f 61 3e 3c ported?</i></a><
0a00: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c br>.<a href="#tl
0a10: 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e 3c 62 s::protocols"><b
0a20: 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c >tls::protocols<
0a30: 2f 62 3e 3c 2f 61 3e 0a 3c 61 20 68 72 65 66 3d /b></a>.<a href=
0a40: 22 23 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 3e "#tls::version">
0a50: 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c <b>tls::version<
0a60: 2f 62 3e 3c 2f 61 3e 0a 3c 2f 70 3e 0a 0a 3c 68 /b></a>.</p>..<h
0a70: 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 53 43 52 3><a name="DESCR
0a80: 49 50 54 49 4f 4e 22 3e 44 45 53 43 52 49 50 54 IPTION">DESCRIPT
0a90: 49 4f 4e 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 ION</a></h3>..<p
0aa0: 3e 54 68 69 73 20 65 78 74 65 6e 73 69 6f 6e 20 >This extension
0ab0: 70 72 6f 76 69 64 65 73 20 61 20 67 65 6e 65 72 provides a gener
0ac0: 69 63 20 62 69 6e 64 69 6e 67 20 74 6f 20 3c 61 ic binding to <a
0ad0: 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 .href="http://ww
0ae0: 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e w.openssl.org/">
0af0: 4f 70 65 6e 53 53 4c 3c 2f 61 3e 2c 20 75 74 69 OpenSSL</a>, uti
0b00: 6c 69 7a 69 6e 67 20 74 68 65 0a 3c 73 74 72 6f lizing the.<stro
0b10: 6e 67 3e 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e ng>Tcl_StackChan
0b20: 6e 65 6c 3c 2f 73 74 72 6f 6e 67 3e 0a 41 50 49 nel</strong>.API
0b30: 20 66 6f 72 20 54 63 6c 20 38 2e 34 20 61 6e 64 for Tcl 8.4 and
0b40: 20 68 69 67 68 65 72 2e 20 54 68 65 20 73 6f 63 higher. The soc
0b50: 6b 65 74 73 20 62 65 68 61 76 65 20 65 78 61 63 kets behave exac
0b60: 74 6c 79 20 74 68 65 20 73 61 6d 65 0a 61 73 20 tly the same.as
0b70: 63 68 61 6e 6e 65 6c 73 20 63 72 65 61 74 65 64 channels created
0b80: 20 75 73 69 6e 67 20 54 63 6c 27 73 20 62 75 69 using Tcl's bui
0b90: 6c 74 2d 69 6e 20 3c 73 74 72 6f 6e 67 3e 73 6f lt-in <strong>so
0ba0: 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63 6f cket</strong>.co
0bb0: 6d 6d 61 6e 64 20 77 69 74 68 20 61 64 64 69 74 mmand with addit
0bc0: 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 66 6f ional options fo
0bd0: 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 74 68 r controlling th
0be0: 65 20 53 53 4c 20 73 65 73 73 69 6f 6e 2e 0a 3c e SSL session..<
0bf0: 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 /p>..<h3><a name
0c00: 3d 22 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d ="COMMANDS">COMM
0c10: 41 4e 44 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c ANDS</a></h3>..<
0c20: 70 3e 54 79 70 69 63 61 6c 6c 79 20 6f 6e 65 20 p>Typically one
0c30: 77 6f 75 6c 64 20 75 73 65 20 74 68 65 20 3c 73 would use the <s
0c40: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 trong>tls::socke
0c50: 74 20 3c 2f 73 74 72 6f 6e 67 3e 63 6f 6d 6d 61 t </strong>comma
0c60: 6e 64 0a 77 68 69 63 68 20 70 72 6f 76 69 64 65 nd.which provide
0c70: 73 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 s compatibility
0c80: 77 69 74 68 20 74 68 65 20 6e 61 74 69 76 65 20 with the native
0c90: 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b Tcl <strong>sock
0ca0: 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 63 6f 6d 6d et</strong>.comm
0cb0: 61 6e 64 2e 20 49 6e 20 73 75 63 68 20 63 61 73 and. In such cas
0cc0: 65 73 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a es <strong>tls::
0cd0: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 20 import</strong>
0ce0: 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 0a 75 73 should not be.us
0cf0: 65 64 20 64 69 72 65 63 74 6c 79 2e 3c 2f 70 3e ed directly.</p>
0d00: 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c ..<dl>. <dt><
0d10: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 69 6e 69 a name="tls::ini
0d20: 74 22 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 t"><b>tls::init
0d30: 3c 2f 62 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f </b><i>?options?
0d40: 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 </i></a></dt>.
0d50: 20 20 3c 64 64 3e 4f 70 74 69 6f 6e 61 6c 20 66 <dd>Optional f
0d60: 75 6e 63 74 69 6f 6e 20 74 6f 20 73 65 74 20 74 unction to set t
0d70: 68 65 20 64 65 66 61 75 6c 74 20 6f 70 74 69 6f he default optio
0d80: 6e 73 20 75 73 65 64 20 62 79 0a 09 3c 73 74 72 ns used by..<str
0d90: 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c ong>tls::socket<
0da0: 2f 73 74 72 6f 6e 67 3e 2e 20 49 66 20 79 6f 75 /strong>. If you
0db0: 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74 6c call <strong>tl
0dc0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e s::import</stron
0dd0: 67 3e 0a 20 20 20 20 20 20 20 20 64 69 72 65 63 g>. direc
0de0: 74 6c 79 20 74 68 69 73 20 72 6f 75 74 69 6e 65 tly this routine
0df0: 20 68 61 73 20 6e 6f 20 65 66 66 65 63 74 2e 20 has no effect.
0e00: 41 6e 79 20 6f 66 20 74 68 65 20 6f 70 74 69 6f Any of the optio
0e10: 6e 73 0a 20 20 20 20 20 20 20 20 74 68 61 74 20 ns. that
0e20: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 <strong>tls::soc
0e30: 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 61 63 63 ket</strong> acc
0e40: 65 70 74 73 20 63 61 6e 20 62 65 20 73 65 74 0a epts can be set.
0e50: 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 74 68 using th
0e60: 69 73 20 63 6f 6d 6d 61 6e 64 2c 20 74 68 6f 75 is command, thou
0e70: 67 68 20 79 6f 75 20 73 68 6f 75 6c 64 20 6c 69 gh you should li
0e80: 6d 69 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 73 mit your options
0e90: 0a 20 20 20 20 20 20 20 20 74 6f 20 6f 6e 6c 79 . to only
0ea0: 20 54 4c 53 20 72 65 6c 61 74 65 64 20 6f 6e 65 TLS related one
0eb0: 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e s.</dd>. <dt>
0ec0: 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 </dt>.
0ed0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
0ee0: 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 ::socket"><b>tls
0ef0: 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d ::socket </b><em
0f00: 3e 3f 6f 70 74 69 6f 6e 73 3f 0a 20 20 20 20 20 >?options?.
0f10: 20 20 20 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d host port</em
0f20: 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c ></a></dt>. <
0f30: 64 74 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 dt><b>tls::socke
0f40: 74 3c 2f 62 3e 3c 65 6d 3e 20 3f 2d 73 65 72 76 t</b><em> ?-serv
0f50: 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 er command? ?opt
0f60: 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65 6d 3e 3c ions? port</em><
0f70: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 54 68 69 /dt>. <dd>Thi
0f80: 73 20 69 73 20 61 20 68 65 6c 70 65 72 20 66 75 s is a helper fu
0f90: 6e 63 74 69 6f 6e 20 74 68 61 74 20 75 74 69 6c nction that util
0fa0: 69 7a 65 73 20 74 68 65 20 75 6e 64 65 72 6c 79 izes the underly
0fb0: 69 6e 67 0a 20 20 20 20 20 20 20 20 63 6f 6d 6d ing. comm
0fc0: 61 6e 64 73 20 28 3c 73 74 72 6f 6e 67 3e 74 6c ands (<strong>tl
0fd0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e s::import</stron
0fe0: 67 3e 29 2e 20 49 74 20 62 65 68 61 76 65 73 0a g>). It behaves.
0ff0: 20 20 20 20 20 20 20 20 65 78 61 63 74 6c 79 20 exactly
1000: 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 65 20 the same as the
1010: 6e 61 74 69 76 65 20 54 63 6c 20 3c 73 74 72 6f native Tcl <stro
1020: 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e ng>socket</stron
1030: 67 3e 0a 20 20 20 20 20 20 20 20 63 6f 6d 6d 61 g>. comma
1040: 6e 64 20 65 78 63 65 70 74 20 74 68 61 74 20 74 nd except that t
1050: 68 65 20 6f 70 74 69 6f 6e 73 20 63 61 6e 20 69 he options can i
1060: 6e 63 6c 75 64 65 20 61 6e 79 20 6f 66 20 74 68 nclude any of th
1070: 65 0a 20 20 20 20 20 20 20 20 61 70 70 6c 69 63 e. applic
1080: 61 62 6c 65 20 3c 61 20 68 72 65 66 3d 22 23 74 able <a href="#t
1090: 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 73 74 72 ls::import"><str
10a0: 6f 6e 67 3e 74 6c 73 3a 69 6d 70 6f 72 74 3c 2f ong>tls:import</
10b0: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 0a 20 20 20 20 strong></a>.
10c0: 20 20 20 20 6f 70 74 69 6f 6e 73 20 77 69 74 68 options with
10d0: 20 6f 6e 65 20 61 64 64 69 74 69 6f 6e 61 6c 20 one additional
10e0: 6f 70 74 69 6f 6e 3a 0a 3c 62 6c 6f 63 6b 71 75 option:.<blockqu
10f0: 6f 74 65 3e 0a 20 20 20 20 3c 64 6c 3e 0a 20 20 ote>. <dl>.
1100: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e <dt><stron
1110: 67 3e 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d g>-autoservernam
1120: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 e</strong> <em>b
1130: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ool</em></dt>.
1140: 20 20 20 20 20 20 3c 64 64 3e 41 75 74 6f 6d 61 <dd>Automa
1150: 74 69 63 61 6c 6c 79 20 73 65 6e 64 20 74 68 65 tically send the
1160: 20 2d 73 65 72 76 65 72 6e 61 6d 65 20 61 73 20 -servername as
1170: 74 68 65 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d the <em>host</em
1180: 3e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 20 > argument.
1190: 20 20 20 20 20 20 20 28 64 65 66 61 75 6c 74 20 (default
11a0: 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d is <em>false</em
11b0: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c >)</dd>. </dl
11c0: 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a >.</blockquote>.
11d0: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 . <dt><a name
11e0: 3d 22 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c ="tls::import"><
11f0: 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f b>tls::import </
1200: 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0a 20 20 20 b><i>channel.
1210: 20 20 20 20 20 3f 6f 70 74 69 6f 6e 73 3f 3c 2f ?options?</
1220: 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 i></a></dt>.
1230: 3c 64 64 3e 53 53 4c 2d 65 6e 61 62 6c 65 20 61 <dd>SSL-enable a
1240: 20 72 65 67 75 6c 61 72 20 54 63 6c 20 63 68 61 regular Tcl cha
1250: 6e 6e 65 6c 20 2d 20 69 74 20 6e 65 65 64 20 6e nnel - it need n
1260: 6f 74 20 62 65 20 61 0a 20 20 20 20 20 20 20 20 ot be a.
1270: 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73 74 socket, but must
1280: 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72 65 provide bi-dire
1290: 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41 6c ctional flow. Al
12a0: 73 6f 0a 20 20 20 20 20 20 20 20 73 65 74 74 69 so. setti
12b0: 6e 67 20 73 65 73 73 69 6f 6e 20 70 61 72 61 6d ng session param
12c0: 65 74 65 72 73 20 66 6f 72 20 53 53 4c 20 68 61 eters for SSL ha
12d0: 6e 64 73 68 61 6b 65 2e 3c 2f 64 64 3e 0a 0a 3c ndshake.</dd>..<
12e0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 blockquote>.
12f0: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 <dl>. <dt
1300: 3e 3c 73 74 72 6f 6e 67 3e 2d 61 6c 70 6e 3c 2f ><strong>-alpn</
1310: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 strong> <em>list
1320: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
1330: 20 20 20 3c 64 64 3e 4c 69 73 74 20 6f 66 20 70 <dd>List of p
1340: 72 6f 74 6f 63 6f 6c 73 20 74 6f 20 6f 66 66 65 rotocols to offe
1350: 72 20 64 75 72 69 6e 67 20 41 70 70 6c 69 63 61 r during Applica
1360: 74 69 6f 6e 2d 4c 61 79 65 72 0a 09 20 20 20 20 tion-Layer..
1370: 50 72 6f 74 6f 63 6f 6c 20 4e 65 67 6f 74 69 61 Protocol Negotia
1380: 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 20 46 6f 72 tion (ALPN). For
1390: 20 65 78 61 6d 70 6c 65 3a 20 68 32 2c 20 68 74 example: h2, ht
13a0: 74 70 2f 31 2e 31 2c 20 65 74 63 2e 3c 2f 64 64 tp/1.1, etc.</dd
13b0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
13c0: 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f 73 74 trong>-cadir</st
13d0: 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c 2f 65 rong> <em>dir</e
13e0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
13f0: 3c 64 64 3e 53 70 65 63 69 66 79 20 74 68 65 20 <dd>Specify the
1400: 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 directory contai
1410: 6e 69 6e 67 20 74 68 65 20 43 41 20 63 65 72 74 ning the CA cert
1420: 69 66 69 63 61 74 65 73 2e 20 54 68 65 0a 09 20 ificates. The..
1430: 20 20 20 64 65 66 61 75 6c 74 20 64 69 72 65 63 default direc
1440: 74 6f 72 79 20 69 73 20 70 6c 61 74 66 6f 72 6d tory is platform
1450: 20 73 70 65 63 69 66 69 63 20 61 6e 64 20 63 61 specific and ca
1460: 6e 20 62 65 20 73 65 74 20 61 74 0a 09 20 20 20 n be set at..
1470: 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 2e 20 54 compile time. T
1480: 68 69 73 20 63 61 6e 20 62 65 20 6f 76 65 72 72 his can be overr
1490: 69 64 64 65 6e 20 76 69 61 20 74 68 65 20 3c 62 idden via the <b
14a0: 3e 53 53 4c 5f 43 45 52 54 5f 44 49 52 3c 2f 62 >SSL_CERT_DIR</b
14b0: 3e 0a 09 20 20 20 20 65 6e 76 69 72 6f 6e 6d 65 >.. environme
14c0: 6e 74 20 76 61 72 69 61 62 6c 65 2e 3c 2f 64 64 nt variable.</dd
14d0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
14e0: 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65 20 3c 2f trong>-cafile </
14f0: 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e strong><em>filen
1500: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ame</em></dt>.
1510: 20 20 20 20 20 20 3c 64 64 3e 53 70 65 63 69 66 <dd>Specif
1520: 79 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 y the certificat
1530: 65 20 61 75 74 68 6f 72 69 74 79 20 28 43 41 29 e authority (CA)
1540: 20 66 69 6c 65 20 74 6f 20 75 73 65 2e 3c 2f 64 file to use.</d
1550: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
1560: 73 74 72 6f 6e 67 3e 2d 63 65 72 74 66 69 6c 65 strong>-certfile
1570: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 </strong> <em>fi
1580: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e lename</em></dt>
1590: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 65 . <dd>Spe
15a0: 63 69 66 79 20 74 68 65 20 66 69 6c 65 6e 61 6d cify the filenam
15b0: 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 e containing the
15c0: 20 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 certificate to
15d0: 75 73 65 2e 20 54 68 65 0a 09 20 20 20 20 64 65 use. The.. de
15e0: 66 61 75 6c 74 20 6e 61 6d 65 20 69 73 20 3c 62 fault name is <b
15f0: 3e 63 65 72 74 2e 70 65 6d 3c 2f 62 3e 2e 20 54 >cert.pem</b>. T
1600: 68 69 73 20 63 61 6e 20 62 65 20 6f 76 65 72 72 his can be overr
1610: 69 64 64 65 6e 20 76 69 61 0a 09 20 20 20 20 74 idden via.. t
1620: 68 65 20 3c 62 3e 53 53 4c 5f 43 45 52 54 5f 46 he <b>SSL_CERT_F
1630: 49 4c 45 3c 2f 62 3e 20 65 6e 76 69 72 6f 6e 6d ILE</b> environm
1640: 65 6e 74 20 76 61 72 69 61 62 6c 65 2e 3c 2f 64 ent variable.</d
1650: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
1660: 73 74 72 6f 6e 67 3e 2d 63 65 72 74 3c 2f 73 74 strong>-cert</st
1670: 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61 rong> <em>filena
1680: 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 me</em></dt>.
1690: 20 20 20 20 20 3c 64 64 3e 53 70 65 63 69 66 79 <dd>Specify
16a0: 20 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 the contents of
16b0: 20 61 20 63 65 72 74 69 66 69 63 61 74 65 20 74 a certificate t
16c0: 6f 20 75 73 65 2c 20 61 73 20 61 20 44 45 52 0a o use, as a DER.
16d0: 09 20 20 20 20 65 6e 63 6f 64 65 64 20 62 69 6e . encoded bin
16e0: 61 72 79 20 76 61 6c 75 65 20 28 58 2e 35 30 39 ary value (X.509
16f0: 20 44 45 52 29 2e 3c 2f 64 64 3e 0a 20 20 20 20 DER).</dd>.
1700: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
1710: 2d 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e -cipher</strong>
1720: 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e <em>string</em>
1730: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dt>. <d
1740: 64 3e 4c 69 73 74 20 6f 66 20 63 69 70 68 65 72 d>List of cipher
1750: 73 20 74 6f 20 75 73 65 2e 20 53 74 72 69 6e 67 s to use. String
1760: 20 69 73 20 61 20 63 6f 6c 6f 6e 20 28 22 3a 22 is a colon (":"
1770: 29 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74 ) separated list
1780: 0a 09 20 20 20 20 6f 66 20 63 69 70 68 65 72 73 .. of ciphers
1790: 20 6f 72 20 63 69 70 68 65 72 20 73 75 69 74 65 or cipher suite
17a0: 73 2e 20 43 69 70 68 65 72 20 73 75 69 74 65 73 s. Cipher suites
17b0: 20 63 61 6e 20 62 65 20 63 6f 6d 62 69 6e 65 64 can be combined
17c0: 0a 09 20 20 20 20 75 73 69 6e 67 20 74 68 65 20 .. using the
17d0: 3c 62 3e 2b 3c 2f 62 3e 20 63 68 61 72 61 63 74 <b>+</b> charact
17e0: 65 72 2e 20 50 72 65 66 69 78 65 73 20 63 61 6e er. Prefixes can
17f0: 20 62 65 20 75 73 65 64 20 74 6f 20 70 65 72 6d be used to perm
1800: 61 6e 65 6e 74 6c 79 0a 09 20 20 20 20 72 65 6d anently.. rem
1810: 6f 76 65 20 28 22 21 22 29 2c 20 64 65 6c 65 74 ove ("!"), delet
1820: 65 20 28 22 2d 22 29 2c 20 6f 72 20 6d 6f 76 65 e ("-"), or move
1830: 20 61 20 63 79 70 68 65 72 20 74 6f 20 74 68 65 a cypher to the
1840: 20 65 6e 64 20 6f 66 0a 09 20 20 20 20 74 68 65 end of.. the
1850: 20 6c 69 73 74 20 28 22 2b 22 29 2e 20 4b 65 79 list ("+"). Key
1860: 77 6f 72 64 73 20 3c 62 3e 40 53 54 52 45 4e 47 words <b>@STRENG
1870: 54 48 3c 2f 62 3e 20 28 73 6f 72 74 20 62 79 20 TH</b> (sort by
1880: 61 6c 67 6f 72 69 74 68 6d 0a 09 20 20 20 20 6b algorithm.. k
1890: 65 79 20 6c 65 6e 67 74 68 29 2c 20 3c 62 3e 40 ey length), <b>@
18a0: 53 45 43 4c 45 56 45 4c 3d 3c 2f 62 3e 3c 69 3e SECLEVEL=</b><i>
18b0: 6e 3c 2f 69 3e 20 28 73 65 74 20 73 65 63 75 72 n</i> (set secur
18c0: 69 74 79 20 6c 65 76 65 6c 20 74 6f 0a 09 20 20 ity level to..
18d0: 20 20 6e 29 2c 20 61 6e 64 20 3c 62 3e 44 45 46 n), and <b>DEF
18e0: 41 55 4c 54 3c 2f 62 3e 20 28 75 73 65 20 64 65 AULT</b> (use de
18f0: 66 61 75 6c 74 20 63 69 70 68 65 72 20 6c 69 73 fault cipher lis
1900: 74 2c 20 61 74 20 73 74 61 72 74 20 6f 6e 6c 79 t, at start only
1910: 29 0a 09 20 20 20 20 63 61 6e 20 61 6c 73 6f 20 ).. can also
1920: 62 65 20 73 70 65 63 69 66 69 65 64 2e 20 53 65 be specified. Se
1930: 65 20 4f 70 65 6e 53 53 4c 20 64 6f 63 75 6d 65 e OpenSSL docume
1940: 6e 74 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 ntation for the
1950: 66 75 6c 6c 0a 09 20 20 20 20 6c 69 73 74 20 6f full.. list o
1960: 66 20 76 61 6c 69 64 20 76 61 6c 75 65 73 2e 20 f valid values.
1970: 28 54 4c 53 20 31 2e 32 20 61 6e 64 20 65 61 72 (TLS 1.2 and ear
1980: 6c 69 65 72 20 6f 6e 6c 79 29 3c 2f 64 64 3e 0a lier only)</dd>.
1990: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
19a0: 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 ong>-command</st
19b0: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 rong> <em>callba
19c0: 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ck</em></dt>.
19d0: 20 20 20 20 20 3c 64 64 3e 43 61 6c 6c 62 61 63 <dd>Callbac
19e0: 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 61 74 20 73 k to invoke at s
19f0: 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 75 everal points du
1a00: 72 69 6e 67 20 74 68 65 20 68 61 6e 64 73 68 61 ring the handsha
1a10: 6b 65 2e 0a 09 20 20 20 20 54 68 69 73 20 69 73 ke... This is
1a20: 20 75 73 65 64 20 74 6f 20 70 61 73 73 20 65 72 used to pass er
1a30: 72 6f 72 73 20 61 6e 64 20 74 72 61 63 69 6e 67 rors and tracing
1a40: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e information, an
1a50: 64 0a 09 20 20 20 20 69 74 20 63 61 6e 20 61 6c d.. it can al
1a60: 6c 6f 77 20 54 63 6c 20 73 63 72 69 70 74 73 20 low Tcl scripts
1a70: 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72 to perform their
1a80: 20 6f 77 6e 20 63 65 72 74 69 66 69 63 61 74 65 own certificate
1a90: 0a 09 20 20 20 20 76 61 6c 69 64 61 74 69 6f 6e .. validation
1aa0: 20 69 6e 20 70 6c 61 63 65 20 6f 66 20 74 68 65 in place of the
1ab0: 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64 61 74 default validat
1ac0: 69 6f 6e 20 70 72 6f 76 69 64 65 64 20 62 79 0a ion provided by.
1ad0: 09 20 20 20 20 4f 70 65 6e 53 53 4c 2e 20 53 65 . OpenSSL. Se
1ae0: 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c e <a href="#CALL
1af0: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 BACK OPTIONS">CA
1b00: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f LLBACK OPTIONS</
1b10: 61 3e 0a 09 20 20 20 20 66 6f 72 20 66 75 72 74 a>.. for furt
1b20: 68 65 72 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c her discussion.<
1b30: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
1b40: 3e 3c 73 74 72 6f 6e 67 3e 2d 64 68 70 61 72 61 ><strong>-dhpara
1b50: 6d 73 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e ms </strong><em>
1b60: 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 filename</em></d
1b70: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 t>. <dd>S
1b80: 70 65 63 69 66 79 20 74 68 65 20 44 69 66 66 69 pecify the Diffi
1b90: 65 2d 48 65 6c 6c 6d 61 6e 20 70 61 72 61 6d 65 e-Hellman parame
1ba0: 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64 3e 0a ters file.</dd>.
1bb0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
1bc0: 6f 6e 67 3e 2d 6b 65 79 66 69 6c 65 3c 2f 73 74 ong>-keyfile</st
1bd0: 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61 rong> <em>filena
1be0: 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 me</em></dt>.
1bf0: 20 20 20 20 20 3c 64 64 3e 53 70 65 63 69 66 79 <dd>Specify
1c00: 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 the private key
1c10: 20 66 69 6c 65 2e 20 28 64 65 66 61 75 6c 74 20 file. (default
1c20: 69 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 is. v
1c30: 61 6c 75 65 20 6f 66 20 2d 63 65 72 74 66 69 6c alue of -certfil
1c40: 65 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 e)</dd>.
1c50: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79 <dt><strong>-key
1c60: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 </strong> <em>fi
1c70: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e lename</em></dt>
1c80: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 65 . <dd>Spe
1c90: 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74 65 cify the private
1ca0: 20 6b 65 79 20 74 6f 20 75 73 65 20 61 73 20 61 key to use as a
1cb0: 20 44 45 52 20 65 6e 63 6f 64 65 64 20 76 61 6c DER encoded val
1cc0: 75 65 20 28 50 4b 43 53 23 31 20 44 45 52 29 3c ue (PKCS#1 DER)<
1cd0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
1ce0: 3e 3c 73 74 72 6f 6e 67 3e 2d 6d 6f 64 65 6c 3c ><strong>-model<
1cf0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 /strong> <em>cha
1d00: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 nnel</em></dt>.
1d10: 20 20 20 20 20 20 20 3c 64 64 3e 46 6f 72 63 65 <dd>Force
1d20: 20 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f this channel to
1d30: 20 73 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 share the same
1d40: 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c 5f <em><strong>SSL_
1d50: 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65 6d CTX</strong></em
1d60: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 >. st
1d70: 72 75 63 74 75 72 65 20 61 73 20 74 68 65 20 73 ructure as the s
1d80: 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 68 61 pecified <em>cha
1d90: 6e 6e 65 6c 3c 2f 65 6d 3e 2c 20 61 6e 64 0a 20 nnel</em>, and.
1da0: 20 20 20 20 20 20 20 20 20 20 20 74 68 65 72 65 there
1db0: 66 6f 72 65 20 73 68 61 72 65 20 63 61 6c 6c 62 fore share callb
1dc0: 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64 3e 0a 20 acks etc.</dd>.
1dd0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f <dt><stro
1de0: 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 ng>-password</st
1df0: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 rong> <em>callba
1e00: 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ck</em></dt>.
1e10: 20 20 20 20 20 3c 64 64 3e 43 61 6c 6c 62 61 63 <dd>Callbac
1e20: 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 77 68 65 6e k to invoke when
1e30: 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 20 74 OpenSSL needs t
1e40: 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73 77 o obtain a passw
1e50: 6f 72 64 2c 0a 09 20 20 20 20 74 79 70 69 63 61 ord,.. typica
1e60: 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63 6b 20 74 68 lly to unlock th
1e70: 65 20 70 72 69 76 61 74 65 20 6b 65 79 20 6f 66 e private key of
1e80: 20 61 20 63 65 72 74 69 66 69 63 61 74 65 2e 20 a certificate.
1e90: 54 68 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 The.
1ea0: 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 callback should
1eb0: 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 return a string
1ec0: 77 68 69 63 68 20 72 65 70 72 65 73 65 6e 74 73 which represents
1ed0: 20 74 68 65 20 70 61 73 73 77 6f 72 64 0a 20 20 the password.
1ee0: 20 20 20 20 20 20 20 20 20 20 74 6f 20 62 65 20 to be
1ef0: 75 73 65 64 2e 20 53 65 65 20 3c 61 20 68 72 65 used. See <a hre
1f00: 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 f="#CALLBACK OPT
1f10: 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f IONS">CALLBACK O
1f20: 50 54 49 4f 4e 53 3c 2f 61 3e 0a 09 20 20 20 20 PTIONS</a>..
1f30: 66 6f 72 20 66 75 72 74 68 65 72 20 64 69 73 63 for further disc
1f40: 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 ussion.</dd>.
1f50: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 <dt><strong
1f60: 3e 2d 72 65 71 75 65 73 74 20 3c 2f 73 74 72 6f >-request </stro
1f70: 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e ng><em>bool</em>
1f80: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dt>. <d
1f90: 64 3e 52 65 71 75 65 73 74 20 61 20 63 65 72 74 d>Request a cert
1fa0: 69 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 ificate from pee
1fb0: 72 20 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e r during SSL han
1fc0: 64 73 68 61 6b 65 2e 0a 20 20 20 20 20 20 20 20 dshake..
1fd0: 20 20 20 20 28 64 65 66 61 75 6c 74 20 69 73 20 (default is
1fe0: 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f <em>true</em>)</
1ff0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e dd>. <dt>
2000: 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 65 <strong>-require
2010: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f </strong> <em>bo
2020: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ol</em></dt>.
2030: 20 20 20 20 20 3c 64 64 3e 52 65 71 75 69 72 65 <dd>Require
2040: 20 61 20 76 61 6c 69 64 20 63 65 72 74 69 66 69 a valid certifi
2050: 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64 cate from peer d
2060: 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73 68 uring SSL handsh
2070: 61 6b 65 2e 0a 09 20 20 20 20 49 66 20 74 68 69 ake... If thi
2080: 73 20 69 73 20 73 65 74 20 74 6f 20 74 72 75 65 s is set to true
2090: 2c 20 74 68 65 6e 20 3c 73 74 72 6f 6e 67 3e 2d , then <strong>-
20a0: 72 65 71 75 65 73 74 3c 2f 73 74 72 6f 6e 67 3e request</strong>
20b0: 20 6d 75 73 74 0a 20 20 20 20 20 20 20 20 20 20 must.
20c0: 20 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 6f also be set to
20d0: 20 74 72 75 65 2e 20 28 64 65 66 61 75 6c 74 20 true. (default
20e0: 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d is <em>false</em
20f0: 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 >)</dd>.
2100: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 <dt><strong>-ser
2110: 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ver</strong> <em
2120: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >bool</em></dt>.
2130: 20 20 20 20 20 20 20 20 3c 64 64 3e 48 61 6e 64 <dd>Hand
2140: 73 68 61 6b 65 20 61 73 20 73 65 72 76 65 72 20 shake as server
2150: 69 66 20 74 72 75 65 2c 20 65 6c 73 65 20 68 61 if true, else ha
2160: 6e 64 73 68 61 6b 65 20 61 73 0a 20 20 20 20 20 ndshake as.
2170: 20 20 20 20 20 20 20 63 6c 69 65 6e 74 2e 20 28 client. (
2180: 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 default is <em>f
2190: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a alse</em>)</dd>.
21a0: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
21b0: 6f 6e 67 3e 2d 73 65 72 76 65 72 6e 61 6d 65 3c ong>-servername<
21c0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f 73 /strong> <em>hos
21d0: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 t</em></dt>.
21e0: 20 20 20 20 3c 64 64 3e 53 70 65 63 69 66 79 20 <dd>Specify
21f0: 73 65 72 76 65 72 20 68 6f 73 74 6e 61 6d 65 2e server hostname.
2200: 20 4f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 Only available
2210: 69 66 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c if the OpenSSL l
2220: 69 62 72 61 72 79 0a 09 20 20 20 20 74 68 65 20 ibrary.. the
2230: 70 61 63 6b 61 67 65 20 69 73 20 6c 69 6e 6b 65 package is linke
2240: 64 20 61 67 61 69 6e 73 74 20 73 75 70 70 6f 72 d against suppor
2250: 74 73 20 74 68 65 20 54 4c 53 20 68 6f 73 74 6e ts the TLS hostn
2260: 61 6d 65 20 65 78 74 65 6e 73 69 6f 6e 0a 09 20 ame extension..
2270: 20 20 20 66 6f 72 20 27 53 65 72 76 65 72 20 4e for 'Server N
2280: 61 6d 65 20 49 6e 64 69 63 61 74 69 6f 6e 27 20 ame Indication'
2290: 28 53 4e 49 29 2e 20 55 73 65 20 74 6f 20 6e 61 (SNI). Use to na
22a0: 6d 65 20 74 68 65 20 6c 6f 67 69 63 61 6c 20 68 me the logical h
22b0: 6f 73 74 0a 09 20 20 20 20 77 65 20 61 72 65 20 ost.. we are
22c0: 74 61 6c 6b 69 6e 67 20 74 6f 20 61 6e 64 20 65 talking to and e
22d0: 78 70 65 63 74 69 6e 67 20 61 20 63 65 72 74 69 xpecting a certi
22e0: 66 69 63 61 74 65 20 66 6f 72 2e 3c 2f 64 64 3e ficate for.</dd>
22f0: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 . <dt><st
2300: 72 6f 6e 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f rong>-ssl2</stro
2310: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d ng> <em>bool</em
2320: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
2330: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 dd>Enable use of
2340: 20 53 53 4c 20 76 32 2e 20 28 64 65 66 61 75 6c SSL v2. (defaul
2350: 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f t is <em>false</
2360: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 em>)</dd>.
2370: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 <dt><strong>-s
2380: 73 6c 33 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d sl3 </strong><em
2390: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >bool</em></dt>.
23a0: 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 <dd>Enab
23b0: 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20 76 33 le use of SSL v3
23c0: 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 . (default is <e
23d0: 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 m>false</em>)</d
23e0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d d>. <dt>-
23f0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 <strong>tls1</st
2400: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f rong> <em>bool</
2410: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 em></dt>.
2420: 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 <dd>Enable use
2430: 6f 66 20 54 4c 53 20 76 31 2e 20 28 64 65 66 61 of TLS v1. (defa
2440: 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c ult is <em>true<
2450: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 /em>)</dd>.
2460: 20 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e <dt>-<strong>
2470: 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e 20 tls1.1</strong>
2480: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 <em>bool</em></d
2490: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 t>. <dd>E
24a0: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 nable use of TLS
24b0: 20 76 31 2e 31 20 28 64 65 66 61 75 6c 74 20 69 v1.1 (default i
24c0: 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 s <em>true</em>)
24d0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
24e0: 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e t>-<strong>tls1.
24f0: 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 2</strong> <em>b
2500: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ool</em></dt>.
2510: 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 <dd>Enable
2520: 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 32 use of TLS v1.2
2530: 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d (default is <em
2540: 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e >true</em>)</dd>
2550: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 . <dt>-<s
2560: 74 72 6f 6e 67 3e 74 6c 73 31 2e 33 3c 2f 73 74 trong>tls1.3</st
2570: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f rong> <em>bool</
2580: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 em></dt>.
2590: 20 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 <dd>Enable use
25a0: 6f 66 20 54 4c 53 20 76 31 2e 33 20 28 64 65 66 of TLS v1.3 (def
25b0: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 ault is <em>true
25c0: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 </em>)</dd>.
25d0: 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f </dl>.</blockquo
25e0: 74 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 te>.. <dt><a
25f0: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 75 6e 69 6d 70 name="tls::unimp
2600: 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 ort"><b>tls::uni
2610: 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 mport </b><i>cha
2620: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 nnel</i></a></dt
2630: 3e 0a 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 >. <dd>Provid
2640: 65 64 20 66 6f 72 20 73 79 6d 6d 65 74 72 79 20 ed for symmetry
2650: 74 6f 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a to <strong>tls::
2660: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2c import</strong>,
2670: 20 74 68 69 73 0a 20 20 20 20 20 20 75 6e 73 74 this. unst
2680: 61 63 6b 73 20 74 68 65 20 53 53 4c 2d 65 6e 61 acks the SSL-ena
2690: 62 6c 69 6e 67 20 6f 66 20 61 20 72 65 67 75 6c bling of a regul
26a0: 61 72 20 54 63 6c 20 63 68 61 6e 6e 65 6c 2e 20 ar Tcl channel.
26b0: 20 41 6e 20 65 72 72 6f 72 0a 20 20 20 20 20 20 An error.
26c0: 69 73 20 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 is thrown if TLS
26d0: 20 69 73 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 is not the top
26e0: 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 stacked channel
26f0: 74 79 70 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c type.</dd>. <
2700: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 dt> </dt>.
2710: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
2720: 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e tls::handshake">
2730: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e <strong>tls::han
2740: 64 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 dshake</strong>
2750: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e <em>channel</em>
2760: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 </a></dt>. <d
2770: 64 3e 46 6f 72 63 65 73 20 68 61 6e 64 73 68 61 d>Forces handsha
2780: 6b 65 20 74 6f 20 74 61 6b 65 20 70 6c 61 63 65 ke to take place
2790: 2c 20 61 6e 64 20 72 65 74 75 72 6e 73 20 30 20 , and returns 0
27a0: 69 66 0a 20 20 20 20 20 20 20 20 68 61 6e 64 73 if. hands
27b0: 68 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e hake is still in
27c0: 20 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 progress (non-b
27d0: 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 locking), or 1 i
27e0: 66 0a 20 20 20 20 20 20 20 20 74 68 65 20 68 61 f. the ha
27f0: 6e 64 73 68 61 6b 65 20 77 61 73 20 73 75 63 63 ndshake was succ
2800: 65 73 73 66 75 6c 2e 20 49 66 20 74 68 65 20 68 essful. If the h
2810: 61 6e 64 73 68 61 6b 65 20 66 61 69 6c 65 64 0a andshake failed.
2820: 20 20 20 20 20 20 20 20 74 68 69 73 20 72 6f 75 this rou
2830: 74 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 tine will throw
2840: 61 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 an error.</dd>.
2850: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
2860: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 t>. <dt><a na
2870: 6d 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 me="tls::status"
2880: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 ><strong>tls::st
2890: 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 atus</strong>.
28a0: 20 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 <em>?-local? c
28b0: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c hannel</em></a><
28c0: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 /dt>. <dd>Ret
28d0: 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 urns the current
28e0: 20 63 65 72 74 69 66 69 63 61 74 65 20 73 74 61 certificate sta
28f0: 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 tus of an SSL ch
2900: 61 6e 6e 65 6c 2e 20 54 68 65 0a 20 20 20 20 20 annel. The.
2910: 20 20 20 72 65 73 75 6c 74 20 69 73 20 61 20 6c result is a l
2920: 69 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 ist of key-value
2930: 20 70 61 69 72 73 20 64 65 73 63 72 69 62 69 6e pairs describin
2940: 67 20 74 68 65 0a 20 20 20 20 20 20 20 20 63 6f g the. co
2950: 6e 6e 65 63 74 65 64 20 70 65 65 72 2e 20 49 66 nnected peer. If
2960: 20 74 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 the result is a
2970: 6e 20 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65 n empty list the
2980: 6e 20 74 68 65 0a 20 20 20 20 20 20 20 20 53 53 n the. SS
2990: 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73 20 L handshake has
29a0: 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 not yet complete
29b0: 64 2e 0a 20 20 20 20 20 20 20 20 49 66 20 3c 65 d.. If <e
29c0: 6d 3e 2d 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 m>-local</em> is
29d0: 20 67 69 76 65 6e 2c 20 74 68 65 6e 20 74 68 65 given, then the
29e0: 20 63 65 72 74 69 66 69 63 61 74 65 20 69 6e 66 certificate inf
29f0: 6f 72 6d 61 74 69 6f 6e 0a 20 20 20 20 20 20 20 ormation.
2a00: 20 69 73 20 74 68 65 20 6f 6e 65 20 75 73 65 64 is the one used
2a10: 20 6c 6f 63 61 6c 6c 79 2e 3c 2f 64 64 3e 0a 0a locally.</dd>..
2a20: 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 <blockquote>.
2a30: 20 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 <dl>. <d
2a40: 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 t><strong>issuer
2a50: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e </strong> <em>dn
2a60: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2a70: 20 20 20 3c 64 64 3e 54 68 65 20 64 69 73 74 69 <dd>The disti
2a80: 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 nguished name (D
2a90: 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 N) of the certif
2aa0: 69 63 61 74 65 0a 20 20 20 20 20 20 20 20 20 20 icate.
2ab0: 20 20 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 20 issuer.</dd>.
2ac0: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f <dt><stro
2ad0: 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72 6f ng>subject</stro
2ae0: 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c ng> <em>dn</em><
2af0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
2b00: 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 >The distinguish
2b10: 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 ed name (DN) of
2b20: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 0a the certificate.
2b30: 20 20 20 20 20 20 20 20 20 20 20 20 73 75 62 6a subj
2b40: 65 63 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 ect.</dd>.
2b50: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f <dt><strong>no
2b60: 74 42 65 66 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e tBefore</strong>
2b70: 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f <em>date</em></
2b80: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
2b90: 54 68 65 20 62 65 67 69 6e 20 64 61 74 65 20 66 The begin date f
2ba0: 6f 72 20 74 68 65 20 76 61 6c 69 64 69 74 79 20 or the validity
2bb0: 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 of the certifica
2bc0: 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 te.</dd>.
2bd0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 <dt><strong>not
2be0: 41 66 74 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c After</strong> <
2bf0: 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 em>date</em></dt
2c00: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 >. <dd>Th
2c10: 65 20 65 78 70 69 72 79 20 64 61 74 65 20 66 6f e expiry date fo
2c20: 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 r the certificat
2c30: 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 e.</dd>.
2c40: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69 <dt><strong>seri
2c50: 61 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e al</strong> <em>
2c60: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 n</em></dt>.
2c70: 20 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69 <dd>The seri
2c80: 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 al number of the
2c90: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 certificate.</d
2ca0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
2cb0: 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 strong>cipher</s
2cc0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 trong> <em>ciphe
2cd0: 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 r</em></dt>.
2ce0: 20 20 20 20 3c 64 64 3e 54 68 65 20 63 75 72 72 <dd>The curr
2cf0: 65 6e 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 ent cipher in us
2d00: 65 20 62 65 74 77 65 65 6e 20 74 68 65 20 63 6c e between the cl
2d10: 69 65 6e 74 20 61 6e 64 0a 20 20 20 20 20 20 20 ient and.
2d20: 20 20 20 20 20 73 65 72 76 65 72 20 63 68 61 6e server chan
2d30: 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 nels.</dd>.
2d40: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 <dt><strong>s
2d50: 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 bits</strong> <e
2d60: 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 m>n</em></dt>.
2d70: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 <dd>The nu
2d80: 6d 62 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 mber of bits use
2d90: 64 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f d for the sessio
2da0: 6e 20 6b 65 79 2e 3c 2f 64 64 3e 0a 20 20 20 20 n key.</dd>.
2db0: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
2dc0: 63 65 72 74 69 66 69 63 61 74 65 3c 2f 73 74 72 certificate</str
2dd0: 6f 6e 67 3e 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 ong> <em>cert</e
2de0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
2df0: 3c 64 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f <dd>The PEM enco
2e00: 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65 2e ded certificate.
2e10: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
2e20: 74 3e 3c 73 74 72 6f 6e 67 3e 73 68 61 31 5f 68 t><strong>sha1_h
2e30: 61 73 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ash</strong> <em
2e40: 3e 68 61 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >hash</em></dt>.
2e50: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 <dd>The
2e60: 53 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 SHA1 hash of the
2e70: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 certificate.</d
2e80: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
2e90: 73 74 72 6f 6e 67 3e 73 68 61 32 35 36 5f 68 61 strong>sha256_ha
2ea0: 73 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e sh</strong> <em>
2eb0: 68 61 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 hash</em></dt>.
2ec0: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 53 <dd>The S
2ed0: 48 41 32 35 36 20 68 61 73 68 20 6f 66 20 74 68 HA256 hash of th
2ee0: 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f e certificate.</
2ef0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e dd>. <dt>
2f00: 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74 <strong>alpn</st
2f10: 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63 rong> <em>protoc
2f20: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ol</em></dt>.
2f30: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 70 72 6f <dd>The pro
2f40: 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64 20 61 tocol selected a
2f50: 66 74 65 72 20 41 70 70 6c 69 63 61 74 69 6f 6e fter Application
2f60: 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c 0a -Layer Protocol.
2f70: 09 20 20 20 20 4e 65 67 6f 74 69 61 74 69 6f 6e . Negotiation
2f80: 20 28 41 4c 50 4e 29 2e 3c 2f 64 64 3e 0a 20 20 (ALPN).</dd>.
2f90: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e <dt><stron
2fa0: 67 3e 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e g>version</stron
2fb0: 67 3e 20 3c 65 6d 3e 76 61 6c 75 65 3c 2f 65 6d g> <em>value</em
2fc0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
2fd0: 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 dd>The protocol
2fe0: 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 version used for
2ff0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a the connection:
3000: 0a 09 20 20 53 53 4c 76 32 2c 20 53 53 4c 76 33 .. SSLv2, SSLv3
3010: 2c 20 54 4c 53 76 31 2c 20 54 4c 53 76 31 2e 31 , TLSv1, TLSv1.1
3020: 2c 20 54 4c 53 76 31 2e 32 2c 20 54 4c 53 76 31 , TLSv1.2, TLSv1
3030: 2e 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 3c 2f .3, or unknown</
3040: 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f dd>. </dl>.</
3050: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 blockquote>..
3060: 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c <dt><a name="tl
3070: 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c s::connection"><
3080: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 6f 6e 6e strong>tls::conn
3090: 65 63 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 0a ection</strong>.
30a0: 20 20 20 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c <em>channel<
30b0: 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 /em></a></dt>.
30c0: 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 <dd>Returns th
30d0: 65 20 63 75 72 72 65 6e 74 20 63 6f 6e 6e 65 63 e current connec
30e0: 74 69 6f 6e 20 73 74 61 74 75 73 20 6f 66 20 61 tion status of a
30f0: 6e 20 53 53 4c 20 63 68 61 6e 6e 65 6c 2e 20 54 n SSL channel. T
3100: 68 65 0a 20 20 20 20 20 20 20 20 72 65 73 75 6c he. resul
3110: 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b t is a list of k
3120: 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 ey-value pairs d
3130: 65 73 63 72 69 62 69 6e 67 20 74 68 65 0a 20 20 escribing the.
3140: 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 65 64 20 connected
3150: 70 65 65 72 2e 3c 2f 64 64 3e 0a 0a 3c 62 6c 6f peer.</dd>..<blo
3160: 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c ckquote>. <dl
3170: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
3180: 74 72 6f 6e 67 3e 73 74 61 74 65 3c 2f 73 74 72 trong>state</str
3190: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 61 74 65 3c 2f ong> <em>state</
31a0: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 em></dt>.
31b0: 20 3c 64 64 3e 53 74 61 74 65 20 6f 66 20 74 68 <dd>State of th
31c0: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 20 69 6e e connection: in
31d0: 69 74 69 61 6c 69 7a 69 6e 67 2c 20 68 61 6e 64 itializing, hand
31e0: 73 68 61 6b 65 2c 20 65 73 74 61 62 6c 69 73 68 shake, establish
31f0: 65 64 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 ed</dd>.
3200: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 76 <dt><strong>serv
3210: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e er</strong> <em>
3220: 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 name</em></dt>.
3230: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e <dd>The n
3240: 61 6d 65 20 6f 66 20 74 68 65 20 63 6f 6e 6e 65 ame of the conne
3250: 63 74 65 64 20 74 6f 20 73 65 72 76 65 72 2e 3c cted to server.<
3260: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
3270: 3e 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f ><strong>protoco
3280: 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 l</strong> <em>v
3290: 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e ersion</em></dt>
32a0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 . <dd>The
32b0: 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f protocol versio
32c0: 6e 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 n used for the c
32d0: 6f 6e 6e 65 63 74 69 6f 6e 3a 0a 09 20 20 20 20 onnection:..
32e0: 53 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31 SSL2, SSL3, TLS1
32f0: 2c 20 54 4c 53 31 2e 31 2c 20 54 4c 53 31 2e 32 , TLS1.1, TLS1.2
3300: 2c 20 54 4c 53 31 2e 33 2c 20 6f 72 20 75 6e 6b , TLS1.3, or unk
3310: 6e 6f 77 6e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 nown</dd>.
3320: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 <dt><strong>ci
3330: 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 pher</strong> <e
3340: 6d 3e 63 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64 m>cipher</em></d
3350: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 t>. <dd>T
3360: 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 he current ciphe
3370: 72 20 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65 r in use for the
3380: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 connection.</dd
3390: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
33a0: 74 72 6f 6e 67 3e 73 74 61 6e 64 61 72 64 5f 6e trong>standard_n
33b0: 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ame</strong> <em
33c0: 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >name</em></dt>.
33d0: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 <dd>The
33e0: 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e 61 6d standard RFC nam
33f0: 65 20 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 64 e of cipher.</dd
3400: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
3410: 74 72 6f 6e 67 3e 62 69 74 73 3c 2f 73 74 72 6f trong>bits</stro
3420: 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f ng> <em>n</em></
3430: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
3440: 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 72 The number of pr
3450: 6f 63 65 73 73 65 64 20 62 69 74 73 20 75 73 65 ocessed bits use
3460: 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 d for cipher.</d
3470: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
3480: 73 74 72 6f 6e 67 3e 73 65 63 72 65 74 5f 62 69 strong>secret_bi
3490: 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e ts</strong> <em>
34a0: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 n</em></dt>.
34b0: 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d 62 <dd>The numb
34c0: 65 72 20 6f 66 20 73 65 63 72 65 74 20 62 69 74 er of secret bit
34d0: 73 20 75 73 65 64 20 66 6f 72 20 63 69 70 68 65 s used for ciphe
34e0: 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 r.</dd>.
34f0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6d 69 6e 5f <dt><strong>min_
3500: 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e version</strong>
3510: 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d <em>version</em
3520: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
3530: 64 64 3e 54 68 65 20 6d 69 6e 69 6d 75 6d 20 70 dd>The minimum p
3540: 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 rotocol version
3550: 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e for cipher.</dd>
3560: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 . <dt><st
3570: 72 6f 6e 67 3e 64 65 73 63 72 69 70 74 69 6f 6e rong>description
3580: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 </strong> <em>st
3590: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 ring</em></dt>.
35a0: 20 20 20 20 20 20 20 3c 64 64 3e 41 20 74 65 78 <dd>A tex
35b0: 74 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 66 t description of
35c0: 20 74 68 65 20 63 69 70 68 65 72 2e 3c 2f 64 64 the cipher.</dd
35d0: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
35e0: 74 72 6f 6e 67 3e 72 65 6e 65 67 6f 74 69 61 74 trong>renegotiat
35f0: 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ion</strong> <em
3600: 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e >state</em></dt>
3610: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 57 68 65 . <dd>Whe
3620: 74 68 65 72 20 70 72 6f 74 6f 63 6f 6c 20 72 65 ther protocol re
3630: 6e 65 67 6f 74 69 61 74 69 6f 6e 20 69 73 20 61 negotiation is a
3640: 6c 6c 6f 77 65 64 20 6f 72 20 64 69 73 61 6c 6c llowed or disall
3650: 6f 77 65 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 owed.</dd>.
3660: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 <dt><strong>a
3670: 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d lpn</strong> <em
3680: 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c 2f >protocol</em></
3690: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
36a0: 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c The protocol sel
36b0: 65 63 74 65 64 20 61 66 74 65 72 20 41 70 70 6c ected after Appl
36c0: 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 ication-Layer Pr
36d0: 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65 67 6f otocol.. Nego
36e0: 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 3c tiation (ALPN).<
36f0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
3700: 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e ><strong>session
3710: 5f 72 65 75 73 65 64 3c 2f 73 74 72 6f 6e 67 3e _reused</strong>
3720: 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d <em>boolean</em
3730: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
3740: 64 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 73 dd>Whether the s
3750: 65 73 73 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 ession has been
3760: 72 65 75 73 65 64 20 6f 72 20 6e 6f 74 2e 3c 2f reused or not.</
3770: 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f dd>. </dl>.</
3780: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 blockquote>..
3790: 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c <dt><a name="tl
37a0: 73 3a 3a 63 69 70 68 65 72 73 22 3e 3c 73 74 72 s::ciphers"><str
37b0: 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 ong>tls::ciphers
37c0: 3c 2f 73 74 72 6f 6e 67 3e 20 0a 20 20 20 20 3c </strong> . <
37d0: 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 72 em>protocol ?ver
37e0: 62 6f 73 65 3f 20 3f 73 75 70 70 6f 72 74 65 64 bose? ?supported
37f0: 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a ?</em></a></dt>.
3800: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 <dd>Returns
3810: 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f 72 a list of suppor
3820: 74 65 64 20 63 69 70 68 65 72 73 20 61 76 61 69 ted ciphers avai
3830: 6c 61 62 6c 65 20 66 6f 72 20 3c 65 6d 3e 70 72 lable for <em>pr
3840: 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 2c 0a 20 20 20 otocol</em>,.
3850: 20 20 20 20 20 77 68 65 72 65 20 70 72 6f 74 6f where proto
3860: 63 6f 6c 20 6d 75 73 74 20 62 65 20 6f 6e 65 20 col must be one
3870: 6f 66 20 3c 62 3e 73 73 6c 32 2c 20 73 73 6c 33 of <b>ssl2, ssl3
3880: 2c 20 74 6c 73 31 2c 20 74 6c 73 31 2e 31 2c 0a , tls1, tls1.1,.
3890: 09 74 6c 73 31 2e 32 2c 3c 2f 62 3e 20 6f 72 20 .tls1.2,</b> or
38a0: 3c 62 3e 74 6c 73 31 2e 33 3c 2f 62 3e 2e 20 49 <b>tls1.3</b>. I
38b0: 66 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f 65 f <em>verbose</e
38c0: 6d 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20 m> is specified
38d0: 61 73 0a 09 74 72 75 65 20 74 68 65 6e 20 61 20 as..true then a
38e0: 76 65 72 62 6f 73 65 2c 20 68 75 6d 61 6e 20 72 verbose, human r
38f0: 65 61 64 61 62 6c 65 20 6c 69 73 74 20 69 73 20 eadable list is
3900: 72 65 74 75 72 6e 65 64 20 77 69 74 68 0a 09 61 returned with..a
3910: 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d dditional inform
3920: 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 63 69 70 ation on the cip
3930: 68 65 72 2e 20 49 66 20 3c 65 6d 3e 73 75 70 70 her. If <em>supp
3940: 6f 72 74 65 64 3c 2f 65 6d 3e 0a 09 69 73 20 73 orted</em>..is s
3950: 70 65 63 69 66 69 65 64 20 61 73 20 74 72 75 65 pecified as true
3960: 2c 20 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20 , then only the
3970: 63 69 70 68 65 72 73 20 73 75 70 70 6f 72 74 65 ciphers supporte
3980: 64 20 66 6f 72 20 70 72 6f 74 6f 63 6f 6c 0a 09 d for protocol..
3990: 77 69 6c 6c 20 62 65 20 6c 69 73 74 65 64 2e 3c will be listed.<
39a0: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 /dd>.. <dt><a
39b0: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 70 72 6f 74 name="tls::prot
39c0: 6f 63 6f 6c 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 ocols"><strong>t
39d0: 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 73 ls::protocols</s
39e0: 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a trong></a></dt>.
39f0: 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 <dd>Returns
3a00: 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f 72 a list of suppor
3a10: 74 65 64 20 70 72 6f 74 6f 63 6f 6c 73 2e 20 56 ted protocols. V
3a20: 61 6c 69 64 20 76 61 6c 75 65 73 20 61 72 65 3a alid values are:
3a30: 0a 09 3c 62 3e 73 73 6c 32 3c 2f 62 3e 2c 20 3c ..<b>ssl2</b>, <
3a40: 62 3e 73 73 6c 33 3c 2f 62 3e 2c 20 3c 62 3e 74 b>ssl3</b>, <b>t
3a50: 6c 73 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 ls1</b>, <b>tls1
3a60: 2e 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 2e .1</b>, <b>tls1.
3a70: 32 3c 2f 62 3e 2c 0a 09 61 6e 64 20 3c 62 3e 74 2</b>,..and <b>t
3a80: 6c 73 31 2e 33 3c 2f 62 3e 2e 3c 2f 64 64 3e 0a ls1.3</b>.</dd>.
3a90: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 . <dt><a name
3aa0: 3d 22 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 3e ="tls::version">
3ab0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 65 72 <strong>tls::ver
3ac0: 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 sion</strong></a
3ad0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 ></dt>. <dd>R
3ae0: 65 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e 53 eturns the OpenS
3af0: 53 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69 6e SL version strin
3b00: 67 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c g.</dd>.</dl>..<
3b10: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 41 4c 4c h3><a name="CALL
3b20: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 BACK OPTIONS">CA
3b30: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f LLBACK OPTIONS</
3b40: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 20 a></h3>..<p>.As
3b50: 69 6e 64 69 63 61 74 65 64 20 61 62 6f 76 65 2c indicated above,
3b60: 20 69 6e 64 69 76 69 64 75 61 6c 20 63 68 61 6e individual chan
3b70: 6e 65 6c 73 20 63 61 6e 20 62 65 20 67 69 76 65 nels can be give
3b80: 6e 20 74 68 65 69 72 20 6f 77 6e 20 63 61 6c 6c n their own call
3b90: 62 61 63 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 20 backs.to handle
3ba0: 69 6e 74 65 72 6d 65 64 69 61 74 65 20 70 72 6f intermediate pro
3bb0: 63 65 73 73 69 6e 67 20 62 79 20 74 68 65 20 4f cessing by the O
3bc0: 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 penSSL library,
3bd0: 75 73 69 6e 67 20 74 68 65 0a 3c 65 6d 3e 2d 63 using the.<em>-c
3be0: 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 20 ommand</em> and
3bf0: 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 <em>-password</e
3c00: 6d 3e 20 6f 70 74 69 6f 6e 73 20 70 61 73 73 65 m> options passe
3c10: 64 20 74 6f 20 65 69 74 68 65 72 20 6f 66 0a 3c d to either of.<
3c20: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b strong>tls::sock
3c30: 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 6f 72 20 3c et</strong> or <
3c40: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f strong>tls::impo
3c50: 72 74 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 3c 2f 70 rt</strong>..</p
3c60: 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a >..<blockquote>.
3c70: 3c 64 6c 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 <dl>.. <dt><s
3c80: 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f trong>-command</
3c90: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c strong> <em>call
3ca0: 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 back</em></dt>.
3cb0: 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 <dd>..Invokes
3cc0: 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c the specified <
3cd0: 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e em>callback</em>
3ce0: 20 73 63 72 69 70 74 20 61 74 0a 09 73 65 76 65 script at..seve
3cf0: 72 61 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 6e ral points durin
3d00: 67 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 61 g the OpenSSL ha
3d10: 6e 64 73 68 61 6b 65 2e 0a 09 45 78 63 65 70 74 ndshake...Except
3d20: 20 61 73 20 69 6e 64 69 63 61 74 65 64 20 62 65 as indicated be
3d30: 6c 6f 77 2c 20 76 61 6c 75 65 73 20 72 65 74 75 low, values retu
3d40: 72 6e 65 64 20 66 72 6f 6d 20 74 68 65 0a 09 63 rned from the..c
3d50: 61 6c 6c 62 61 63 6b 20 61 72 65 20 69 67 6e 6f allback are igno
3d60: 72 65 64 2e 0a 09 41 72 67 75 6d 65 6e 74 73 20 red...Arguments
3d70: 61 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65 20 appended to the
3d80: 73 63 72 69 70 74 20 75 70 6f 6e 20 63 61 6c 6c script upon call
3d90: 62 61 63 6b 20 74 61 6b 65 20 6f 6e 65 20 6f 66 back take one of
3da0: 20 74 68 65 0a 09 66 6f 6c 6c 6f 77 69 6e 67 20 the..following
3db0: 66 6f 72 6d 73 3a 0a 0a 09 3c 62 72 3e 0a 09 3c forms:...<br>..<
3dc0: 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 3c 21 2d 2d br>...<dl>..<!--
3dd0: 09 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 .This form of ca
3de0: 6c 6c 62 61 63 6b 20 69 73 20 64 69 73 61 62 6c llback is disabl
3df0: 65 64 2e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 ed....<dt>.. <s
3e00: 74 72 6f 6e 67 3e 65 72 72 6f 72 3c 2f 73 74 72 trong>error</str
3e10: 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c ong> <em>channel
3e20: 20 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c message</em>..<
3e30: 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 /dt>..<dd>.. Th
3e40: 65 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 e <em>message</e
3e50: 6d 3e 20 61 72 67 75 6d 65 6e 74 20 63 6f 6e 74 m> argument cont
3e60: 61 69 6e 73 20 61 6e 20 65 72 72 6f 72 20 6d 65 ains an error me
3e70: 73 73 61 67 65 20 67 65 6e 65 72 61 74 65 64 0a ssage generated.
3e80: 09 20 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 . by the OpenSS
3e90: 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 L function.. <c
3ea0: 6f 64 65 3e 45 52 52 5f 72 65 61 73 6f 6e 5f 65 ode>ERR_reason_e
3eb0: 72 72 6f 72 5f 73 74 72 69 6e 67 28 29 3c 2f 63 rror_string()</c
3ec0: 6f 64 65 3e 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c ode>...</dd>...<
3ed0: 62 72 3e 0a 2d 2d 3e 0a 0a 09 3c 64 74 3e 0a 09 br>.-->...<dt>..
3ee0: 20 20 3c 73 74 72 6f 6e 67 3e 69 6e 66 6f 3c 2f <strong>info</
3ef0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e strong> <em>chan
3f00: 6e 65 6c 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 nel major minor
3f10: 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f message</em>..</
3f20: 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 dt>..<dd>.. Thi
3f30: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 s form of callba
3f40: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 ck is invoked by
3f50: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e the OpenSSL fun
3f60: 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 ction.. <code>S
3f70: 53 4c 5f 43 54 58 5f 73 65 74 5f 69 6e 66 6f 5f SL_CTX_set_info_
3f80: 63 61 6c 6c 62 61 63 6b 28 29 3c 2f 63 6f 64 65 callback()</code
3f90: 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 >... <br>.. Th
3fa0: 65 20 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e e <em>major</em>
3fb0: 20 61 6e 64 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f and <em>minor</
3fc0: 65 6d 3e 20 61 72 67 75 6d 65 6e 74 73 20 61 72 em> arguments ar
3fd0: 65 20 75 73 65 64 20 74 6f 0a 09 20 20 72 65 70 e used to.. rep
3fe0: 72 65 73 65 6e 74 20 74 68 65 20 73 74 61 74 65 resent the state
3ff0: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 62 69 74 information bit
4000: 6d 61 73 6b 2e 0a 09 20 20 3c 64 6c 3e 0a 09 20 mask... <dl>..
4010: 20 3c 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 61 <dt>Possible va
4020: 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 61 6a lues for <em>maj
4030: 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 or</em> are:</dt
4040: 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e 68 >.. <dd><code>h
4050: 61 6e 64 73 68 61 6b 65 2c 20 61 6c 65 72 74 2c andshake, alert,
4060: 20 63 6f 6e 6e 65 63 74 2c 20 61 63 63 65 70 74 connect, accept
4070: 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64 3e 0a 09 20 </code>.</dd>..
4080: 20 3c 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 61 <dt>Possible va
4090: 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 69 6e lues for <em>min
40a0: 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 74 or</em> are:</dt
40b0: 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e 73 >.. <dd><code>s
40c0: 74 61 72 74 2c 20 64 6f 6e 65 2c 20 72 65 61 64 tart, done, read
40d0: 2c 20 77 72 69 74 65 2c 20 6c 6f 6f 70 2c 20 65 , write, loop, e
40e0: 78 69 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64 3e xit</code>.</dd>
40f0: 0a 09 20 20 3c 2f 64 6c 3e 0a 09 20 20 54 68 65 .. </dl>.. The
4100: 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d <em>message</em
4110: 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20 > argument is a
4120: 64 65 73 63 72 69 70 74 69 76 65 20 73 74 72 69 descriptive stri
4130: 6e 67 20 77 68 69 63 68 20 6d 61 79 0a 09 20 20 ng which may..
4140: 62 65 20 67 65 6e 65 72 61 74 65 64 20 65 69 74 be generated eit
4150: 68 65 72 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e her by.. <code>
4160: 53 53 4c 5f 73 74 61 74 65 5f 73 74 72 69 6e 67 SSL_state_string
4170: 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 20 6f _long()</code> o
4180: 72 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e 53 53 r by.. <code>SS
4190: 4c 5f 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 72 L_alert_desc_str
41a0: 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 ing_long()</code
41b0: 3e 2c 0a 09 20 20 64 65 70 65 6e 64 69 6e 67 20 >,.. depending
41c0: 6f 6e 20 63 6f 6e 74 65 78 74 2e 0a 09 3c 2f 64 on context...</d
41d0: 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e d>...<br>...<dt>
41e0: 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 76 65 72 69 .. <strong>veri
41f0: 66 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e fy</strong> <em>
4200: 63 68 61 6e 6e 65 6c 20 64 65 70 74 68 20 63 65 channel depth ce
4210: 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72 3c rt status error<
4220: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 /em>..</dt>..<dd
4230: 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f >.. This form o
4240: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e f callback is in
4250: 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 voked by the Ope
4260: 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 nSSL function..
4270: 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 65 74 5f 76 <code>SSL_set_v
4280: 65 72 69 66 79 28 29 3c 2f 63 6f 64 65 3e 2e 0a erify()</code>..
4290: 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 3c . <br>.. The <
42a0: 65 6d 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 72 em>depth</em> ar
42b0: 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74 gument is an int
42c0: 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e eger representin
42d0: 67 20 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74 g the.. current
42e0: 20 64 65 70 74 68 20 6f 6e 20 74 68 65 20 63 65 depth on the ce
42f0: 72 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c rtificate chain,
4300: 20 77 69 74 68 0a 09 20 20 3c 63 6f 64 65 3e 30 with.. <code>0
4310: 3c 2f 63 6f 64 65 3e 20 61 73 20 74 68 65 20 73 </code> as the s
4320: 75 62 6a 65 63 74 20 63 65 72 74 69 66 69 63 61 ubject certifica
4330: 74 65 20 61 6e 64 20 68 69 67 68 65 72 20 76 61 te and higher va
4340: 6c 75 65 73 0a 09 20 20 64 65 6e 6f 74 69 6e 67 lues.. denoting
4350: 20 70 72 6f 67 72 65 73 73 69 76 65 6c 79 20 6d progressively m
4360: 6f 72 65 20 69 6e 64 69 72 65 63 74 20 69 73 73 ore indirect iss
4370: 75 65 72 20 63 65 72 74 69 66 69 63 61 74 65 73 uer certificates
4380: 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 ... <br>.. The
4390: 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 61 <em>cert</em> a
43a0: 72 67 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 73 rgument is a lis
43b0: 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 t of key-value p
43c0: 61 69 72 73 20 73 69 6d 69 6c 61 72 0a 09 20 20 airs similar..
43d0: 74 6f 20 74 68 6f 73 65 20 72 65 74 75 72 6e 65 to those returne
43e0: 64 20 62 79 0a 09 20 20 3c 61 20 68 72 65 66 3d d by.. <a href=
43f0: 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c "#tls::status"><
4400: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 strong>tls::stat
4410: 75 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e us</strong></a>.
4420: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 .. <br>.. The
4430: 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 <em>status</em>
4440: 61 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 69 argument is an i
4450: 6e 74 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 nteger represent
4460: 69 6e 67 20 74 68 65 0a 09 20 20 63 75 72 72 65 ing the.. curre
4470: 6e 74 20 76 61 6c 69 64 69 74 79 20 6f 66 20 74 nt validity of t
4480: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 0a he certificate..
4490: 09 20 20 41 20 76 61 6c 75 65 20 6f 66 20 3c 63 . A value of <c
44a0: 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 6d 65 61 ode>0</code> mea
44b0: 6e 73 20 74 68 65 20 63 65 72 74 69 66 69 63 61 ns the certifica
44c0: 74 65 20 69 73 20 64 65 65 6d 65 64 20 69 6e 76 te is deemed inv
44d0: 61 6c 69 64 2e 0a 09 20 20 41 20 76 61 6c 75 65 alid... A value
44e0: 20 6f 66 20 3c 63 6f 64 65 3e 31 3c 2f 63 6f 64 of <code>1</cod
44f0: 65 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65 72 e> means the cer
4500: 74 69 66 69 63 61 74 65 20 69 73 20 64 65 65 6d tificate is deem
4510: 65 64 20 76 61 6c 69 64 2e 0a 09 20 20 3c 62 72 ed valid... <br
4520: 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 65 72 72 >.. The <em>err
4530: 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 or</em> argument
4540: 20 73 75 70 70 6c 69 65 73 20 74 68 65 20 6d 65 supplies the me
4550: 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 ssage, if any, g
4560: 65 6e 65 72 61 74 65 64 0a 09 20 20 62 79 0a 09 enerated.. by..
4570: 20 20 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f <code>X509_STO
4580: 52 45 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f 72 RE_CTX_get_error
4590: 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c 62 ()</code>... <b
45a0: 72 3e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 r>.. <br>.. Th
45b0: 65 20 63 61 6c 6c 62 61 63 6b 20 6d 61 79 20 6f e callback may o
45c0: 76 65 72 72 69 64 65 20 6e 6f 72 6d 61 6c 20 76 verride normal v
45d0: 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f 63 65 73 alidation proces
45e0: 73 69 6e 67 20 62 79 20 65 78 70 6c 69 63 69 74 sing by explicit
45f0: 6c 79 0a 09 20 20 72 65 74 75 72 6e 69 6e 67 20 ly.. returning
4600: 6f 6e 65 20 6f 66 20 74 68 65 20 61 62 6f 76 65 one of the above
4610: 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e <em>status</em>
4620: 20 76 61 6c 75 65 73 2e 0a 09 3c 2f 64 64 3e 0a values...</dd>.
4630: 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 ..</dl>. </dd
4640: 3e 0a 0a 20 20 20 20 3c 62 72 3e 0a 0a 20 20 20 >.. <br>..
4650: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 <dt><strong>-pa
4660: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 ssword</strong>
4670: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d <em>callback</em
4680: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a ></dt>. <dd>.
4690: 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 .Invokes the spe
46a0: 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 cified <em>callb
46b0: 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 ack</em> script
46c0: 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 when OpenSSL nee
46d0: 64 73 20 74 6f 0a 09 6f 62 74 61 69 6e 20 61 20 ds to..obtain a
46e0: 70 61 73 73 77 6f 72 64 2e 20 20 54 68 65 20 63 password. The c
46f0: 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 allback should r
4700: 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 77 eturn a string w
4710: 68 69 63 68 0a 09 72 65 70 72 65 73 65 6e 74 73 hich..represents
4720: 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 74 6f the password to
4730: 20 62 65 20 75 73 65 64 2e 0a 09 4e 6f 20 61 72 be used...No ar
4740: 67 75 6d 65 6e 74 73 20 61 72 65 20 61 70 70 65 guments are appe
4750: 6e 64 65 64 20 74 6f 20 74 68 65 20 73 63 72 69 nded to the scri
4760: 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62 61 63 6b pt upon callback
4770: 2e 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c .. </dd>.</dl
4780: 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a >.</blockquote>.
4790: 0a 3c 70 3e 0a 52 65 66 65 72 65 6e 63 65 20 69 .<p>.Reference i
47a0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f mplementations o
47b0: 66 20 74 68 65 73 65 20 63 61 6c 6c 62 61 63 6b f these callback
47c0: 73 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 69 s are provided i
47d0: 6e 20 74 68 65 0a 64 69 73 74 72 69 62 75 74 69 n the.distributi
47e0: 6f 6e 20 61 73 20 3c 73 74 72 6f 6e 67 3e 74 6c on as <strong>tl
47f0: 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 s::callback</str
4800: 6f 6e 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 ong> and.<strong
4810: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f >tls::password</
4820: 73 74 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 69 strong> respecti
4830: 76 65 6c 79 2e 20 20 4e 6f 74 65 20 74 68 61 74 vely. Note that
4840: 20 74 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e 73 these are.<em>s
4850: 61 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c 65 ample</em> imple
4860: 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 2e mentations only.
4870: 20 20 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 6c In a more real
4880: 69 73 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e 74 istic deployment
4890: 0a 79 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 69 .you would speci
48a0: 66 79 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c 6c fy your own call
48b0: 62 61 63 6b 20 73 63 72 69 70 74 73 20 6f 6e 20 back scripts on
48c0: 65 61 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 6c each TLS channel
48d0: 0a 75 73 69 6e 67 20 74 68 65 20 3c 65 6d 3e 2d .using the <em>-
48e0: 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 command</em> and
48f0: 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f <em>-password</
4900: 65 6d 3e 20 6f 70 74 69 6f 6e 73 2e 0a 3c 2f 70 em> options..</p
4910: 3e 0a 0a 3c 70 3e 0a 54 68 65 20 64 65 66 61 75 >..<p>.The defau
4920: 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e lt behavior when
4930: 20 74 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 6e the <em>-comman
4940: 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 d</em> option is
4950: 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20 69 not specified i
4960: 73 20 66 6f 72 0a 54 4c 53 20 74 6f 20 70 72 6f s for.TLS to pro
4970: 63 65 73 73 20 74 68 65 20 61 73 73 6f 63 69 61 cess the associa
4980: 74 65 64 20 6c 69 62 72 61 72 79 20 63 61 6c 6c ted library call
4990: 62 61 63 6b 73 20 69 6e 74 65 72 6e 61 6c 6c 79 backs internally
49a0: 2e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 ..The default be
49b0: 68 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 havior when the
49c0: 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 65 <em>-password</e
49d0: 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f 74 m> option is not
49e0: 20 73 70 65 63 69 66 69 65 64 20 69 73 20 66 6f specified is fo
49f0: 72 0a 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 r.TLS to process
4a00: 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 20 the associated
4a10: 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b library callback
4a20: 73 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67 20 s by attempting
4a30: 74 6f 20 63 61 6c 6c 0a 3c 73 74 72 6f 6e 67 3e to call.<strong>
4a40: 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 tls::password</s
4a50: 74 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66 66 trong>..The diff
4a60: 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20 74 erence between t
4a70: 68 65 73 65 20 74 77 6f 20 62 65 68 61 76 69 6f hese two behavio
4a80: 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75 65 rs is a conseque
4a90: 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e 69 nce of maintaini
4aa0: 6e 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 ng.compatibility
4ab0: 20 77 69 74 68 20 65 61 72 6c 69 65 72 20 69 6d with earlier im
4ac0: 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a 3c plementations..<
4ad0: 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73 74 /p>..<p>.The <st
4ae0: 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c rong>tls::debug<
4af0: 2f 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 6c /strong> variabl
4b00: 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 e provides some
4b10: 61 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72 additional.contr
4b20: 6f 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72 65 ol over these re
4b30: 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b ference callback
4b40: 73 2e 20 20 49 74 73 20 76 61 6c 75 65 20 69 73 s. Its value is
4b50: 20 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c 74 zero by default
4b60: 2e 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73 20 ..Higher values
4b70: 70 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 61 produce more dia
4b80: 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 20 gnostic output,
4b90: 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f and will also fo
4ba0: 72 63 65 20 74 68 65 0a 76 65 72 69 66 79 20 6d rce the.verify m
4bb0: 65 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e 67 ethod in <strong
4bc0: 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f >tls::callback</
4bd0: 73 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 70 strong> to accep
4be0: 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 74 t the.certificat
4bf0: 65 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74 20 e, even when it
4c00: 69 73 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70 3e is invalid..</p>
4c10: 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 ..<p>.<em>.The u
4c20: 73 65 20 6f 66 20 74 68 65 20 72 65 66 65 72 65 se of the refere
4c30: 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c 73 nce callbacks <s
4c40: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 trong>tls::callb
4c50: 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 ack</strong> and
4c60: 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 .<strong>tls::pa
4c70: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 ssword</strong>
4c80: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 is not recommend
4c90: 65 64 2e 20 20 54 68 65 79 20 6d 61 79 20 62 65 ed. They may be
4ca0: 20 72 65 6d 6f 76 65 64 0a 66 72 6f 6d 20 66 75 removed.from fu
4cb0: 74 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c ture releases..<
4cc0: 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c /em>.</p>..<p>.<
4cd0: 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 em>.The use of t
4ce0: 68 65 20 76 61 72 69 61 62 6c 65 20 3c 73 74 72 he variable <str
4cf0: 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f ong>tls::debug</
4d00: 73 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72 strong> is not r
4d10: 65 63 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 20 6d ecommended..It m
4d20: 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 ay be removed fr
4d30: 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 73 om future releas
4d40: 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a es..</em>.</p>..
4d50: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 42 <h3><a name="DEB
4d60: 55 47 22 3e 44 45 42 55 47 3c 2f 61 3e 3c 2f 68 UG">DEBUG</a></h
4d70: 33 3e 0a 0a 54 4c 53 20 6b 65 79 20 6c 6f 67 67 3>..TLS key logg
4d80: 69 6e 67 20 63 61 6e 20 62 65 20 65 6e 61 62 6c ing can be enabl
4d90: 65 64 20 62 79 20 73 65 74 74 69 6e 67 20 74 68 ed by setting th
4da0: 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 e environment va
4db0: 72 69 61 62 6c 65 0a 3c 62 3e 53 53 4c 4b 45 59 riable.<b>SSLKEY
4dc0: 4c 4f 47 46 49 4c 45 3c 2f 62 3e 20 74 6f 20 74 LOGFILE</b> to t
4dd0: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 66 he name of the f
4de0: 69 6c 65 20 74 6f 20 6c 6f 67 20 74 6f 2e 20 54 ile to log to. T
4df0: 68 65 6e 20 77 68 65 6e 65 76 65 72 20 54 4c 53 hen whenever TLS
4e00: 0a 6b 65 79 20 6d 61 74 65 72 69 61 6c 20 69 73 .key material is
4e10: 20 67 65 6e 65 72 61 74 65 64 20 6f 72 20 72 65 generated or re
4e20: 63 65 69 76 65 64 20 69 74 20 77 69 6c 6c 20 62 ceived it will b
4e30: 65 20 6c 6f 67 67 65 64 20 74 6f 20 74 68 65 20 e logged to the
4e40: 66 69 6c 65 2e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 file...<h3><a na
4e50: 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50 4c me="HTTPS EXAMPL
4e60: 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 E">HTTPS EXAMPLE
4e70: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 </a></h3>..<p>Th
4e80: 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 73 20 is example uses
4e90: 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 72 2e a sample server.
4ea0: 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 69 74 pem provided wit
4eb0: 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 73 h the TLS releas
4ec0: 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 74 e,.courtesy of t
4ed0: 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 he <strong>OpenS
4ee0: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f 6a SL</strong> proj
4ef0: 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 3c ect.</p>..<pre><
4f00: 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 code>.package re
4f10: 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 quire http.packa
4f20: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 0a ge require tls..
4f30: 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 68 http::register h
4f40: 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 3a ttps 443 [list :
4f50: 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 :tls::socket -au
4f60: 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72 75 toservername tru
4f70: 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 65 20 e -require true
4f80: 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c 2f -cadir /etc/ssl/
4f90: 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f 6b 20 certs]..set tok
4fa0: 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 68 74 [http::geturl ht
4fb0: 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 6b tps://www.tcl.tk
4fc0: 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e /].</code></pre>
4fd0: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 ..<h3><a name="S
4fe0: 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 PECIAL CONSIDERA
4ff0: 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c 20 43 TIONS">SPECIAL C
5000: 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 ONSIDERATIONS</a
5010: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 63 ></h3>..<p>The c
5020: 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 74 apabilities of t
5030: 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e 20 his package can
5040: 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 20 vary enormously
5050: 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77 20 79 based.upon how y
5060: 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 our OpenSSL libr
5070: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72 ary was configur
5080: 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 74 ed and built. At
5090: 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72 6f 2d the.most macro-
50a0: 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73 75 level OpenSSL su
50b0: 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b 6e pports a "n
50c0: 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b 20 o patents"
50d0: 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64 69 73 build,.which dis
50e0: 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41 2c ables RSA, IDEA,
50f0: 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20 53 RC(2,4,5) and S
5100: 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f 70 SL2 - if your Op
5110: 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69 67 75 enSSL is.configu
5120: 72 65 64 20 74 68 69 73 20 77 61 79 20 74 68 65 red this way the
5130: 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 20 n you will need
5140: 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77 69 74 to build TLS wit
5150: 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54 45 4e h the.-DNO_PATEN
5160: 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e 64 20 TS option - and
5170: 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20 6d 6f the resultant mo
5180: 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63 74 69 dule will functi
5190: 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61 6e 64 on.correctly and
51a0: 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20 41 44 also support AD
51b0: 48 20 63 65 72 74 69 66 69 63 61 74 65 2d 6c 65 H certificate-le
51c0: 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c 0a 68 ss encryption,.h
51d0: 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c 6c 20 owever you will
51e0: 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75 74 69 be unable to uti
51f0: 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73 70 65 lize this to spe
5200: 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57 65 62 ak to normal Web
5210: 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63 68 20 .Servers, which
5220: 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75 69 72 typically requir
5230: 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e 20 50 e RSA support. P
5240: 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68 72 65 lease see <a.hre
5250: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 f="http://www.op
5260: 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74 74 70 enssl.org/">http
5270: 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f ://www.openssl.o
5280: 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f 72 65 rg/</a> for.more
5290: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 information on
52a0: 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75 65 20 the whole issue
52b0: 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64 20 55 of patents and U
52c0: 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72 69 63 S export.restric
52d0: 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c 68 33 tions. </p>..<h3
52e0: 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20 41 4c ><a name="SEE AL
52f0: 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e SO">SEE ALSO</a>
5300: 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f 6e </h3>..<p><stron
5310: 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 g>socket</strong
5320: 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65 >, <strong>filee
5330: 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e 3c vent, </strong><
5340: 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 a.href="http://w
5350: 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 ww.openssl.org/"
5360: 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c ><strong>OpenSSL
5370: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 70 </strong></a></p
5380: 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e 0a 43 >..<hr>..<pre>.C
5390: 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b 20 opyright ©
53a0: 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 6e 1999 Matt Newman
53b0: 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 ..Copyright &cop
53c0: 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 73 68 y; 2004 Starfish
53d0: 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72 65 3e Systems..</pre>
53e0: 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c 3e .</body>.</html>
53f0: 0a .