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 69 70 68 65 72 73 75 69 74 65 ong>-ciphersuite
19b0: 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 s</strong> <em>s
19c0: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
19d0: 20 20 20 20 20 20 20 20 3c 64 64 3e 4c 69 73 74 <dd>List
19e0: 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74 65 of cipher suite
19f0: 73 20 74 6f 20 75 73 65 2e 20 53 74 72 69 6e 67 s to use. String
1a00: 20 69 73 20 61 20 63 6f 6c 6f 6e 20 28 22 3a 22 is a colon (":"
1a10: 29 0a 09 20 20 20 20 73 65 70 61 72 61 74 65 64 ).. separated
1a20: 20 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72 20 list of cipher
1a30: 73 75 69 74 65 20 6e 61 6d 65 73 2e 20 28 54 4c suite names. (TL
1a40: 53 20 31 2e 33 20 6f 6e 6c 79 29 3c 2f 64 64 3e S 1.3 only)</dd>
1a50: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 . <dt><st
1a60: 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 rong>-command</s
1a70: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 trong> <em>callb
1a80: 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ack</em></dt>.
1a90: 20 20 20 20 20 20 3c 64 64 3e 43 61 6c 6c 62 61 <dd>Callba
1aa0: 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 61 74 20 ck to invoke at
1ab0: 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 several points d
1ac0: 75 72 69 6e 67 20 74 68 65 20 68 61 6e 64 73 68 uring the handsh
1ad0: 61 6b 65 2e 0a 09 20 20 20 20 54 68 69 73 20 69 ake... This i
1ae0: 73 20 75 73 65 64 20 74 6f 20 70 61 73 73 20 65 s used to pass e
1af0: 72 72 6f 72 73 20 61 6e 64 20 74 72 61 63 69 6e rrors and tracin
1b00: 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 g information, a
1b10: 6e 64 0a 09 20 20 20 20 69 74 20 63 61 6e 20 61 nd.. it can a
1b20: 6c 6c 6f 77 20 54 63 6c 20 73 63 72 69 70 74 73 llow Tcl scripts
1b30: 20 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 69 to perform thei
1b40: 72 20 6f 77 6e 20 63 65 72 74 69 66 69 63 61 74 r own certificat
1b50: 65 0a 09 20 20 20 20 76 61 6c 69 64 61 74 69 6f e.. validatio
1b60: 6e 20 69 6e 20 70 6c 61 63 65 20 6f 66 20 74 68 n in place of th
1b70: 65 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64 61 e default valida
1b80: 74 69 6f 6e 20 70 72 6f 76 69 64 65 64 20 62 79 tion provided by
1b90: 0a 09 20 20 20 20 4f 70 65 6e 53 53 4c 2e 20 53 .. OpenSSL. S
1ba0: 65 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c ee <a href="#CAL
1bb0: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 LBACK OPTIONS">C
1bc0: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c ALLBACK OPTIONS<
1bd0: 2f 61 3e 0a 09 20 20 20 20 66 6f 72 20 66 75 72 /a>.. for fur
1be0: 74 68 65 72 20 64 69 73 63 75 73 73 69 6f 6e 2e ther discussion.
1bf0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
1c00: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 64 68 70 61 72 t><strong>-dhpar
1c10: 61 6d 73 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d ams </strong><em
1c20: 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f >filename</em></
1c30: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
1c40: 53 70 65 63 69 66 79 20 74 68 65 20 44 69 66 66 Specify the Diff
1c50: 69 65 2d 48 65 6c 6c 6d 61 6e 20 70 61 72 61 6d ie-Hellman param
1c60: 65 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64 3e eters file.</dd>
1c70: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 . <dt><st
1c80: 72 6f 6e 67 3e 2d 6b 65 79 66 69 6c 65 3c 2f 73 rong>-keyfile</s
1c90: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e trong> <em>filen
1ca0: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ame</em></dt>.
1cb0: 20 20 20 20 20 20 3c 64 64 3e 53 70 65 63 69 66 <dd>Specif
1cc0: 79 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 y the private ke
1cd0: 79 20 66 69 6c 65 2e 20 28 64 65 66 61 75 6c 74 y file. (default
1ce0: 20 69 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 is.
1cf0: 76 61 6c 75 65 20 6f 66 20 2d 63 65 72 74 66 69 value of -certfi
1d00: 6c 65 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 le)</dd>.
1d10: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 <dt><strong>-ke
1d20: 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 y</strong> <em>f
1d30: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 ilename</em></dt
1d40: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 53 70 >. <dd>Sp
1d50: 65 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74 ecify the privat
1d60: 65 20 6b 65 79 20 74 6f 20 75 73 65 20 61 73 20 e key to use as
1d70: 61 20 44 45 52 20 65 6e 63 6f 64 65 64 20 76 61 a DER encoded va
1d80: 6c 75 65 20 28 50 4b 43 53 23 31 20 44 45 52 29 lue (PKCS#1 DER)
1d90: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
1da0: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6d 6f 64 65 6c t><strong>-model
1db0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 </strong> <em>ch
1dc0: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a annel</em></dt>.
1dd0: 20 20 20 20 20 20 20 20 3c 64 64 3e 46 6f 72 63 <dd>Forc
1de0: 65 20 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 e this channel t
1df0: 6f 20 73 68 61 72 65 20 74 68 65 20 73 61 6d 65 o share the same
1e00: 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c <em><strong>SSL
1e10: 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65 _CTX</strong></e
1e20: 6d 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 m>. s
1e30: 74 72 75 63 74 75 72 65 20 61 73 20 74 68 65 20 tructure as the
1e40: 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 68 specified <em>ch
1e50: 61 6e 6e 65 6c 3c 2f 65 6d 3e 2c 20 61 6e 64 0a annel</em>, and.
1e60: 20 20 20 20 20 20 20 20 20 20 20 20 74 68 65 72 ther
1e70: 65 66 6f 72 65 20 73 68 61 72 65 20 63 61 6c 6c efore share call
1e80: 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64 3e 0a backs etc.</dd>.
1e90: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
1ea0: 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 ong>-password</s
1eb0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 trong> <em>callb
1ec0: 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ack</em></dt>.
1ed0: 20 20 20 20 20 20 3c 64 64 3e 43 61 6c 6c 62 61 <dd>Callba
1ee0: 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 77 68 65 ck to invoke whe
1ef0: 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 20 n OpenSSL needs
1f00: 74 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73 to obtain a pass
1f10: 77 6f 72 64 2c 0a 09 20 20 20 20 74 79 70 69 63 word,.. typic
1f20: 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63 6b 20 74 ally to unlock t
1f30: 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 20 6f he private key o
1f40: 66 20 61 20 63 65 72 74 69 66 69 63 61 74 65 2e f a certificate.
1f50: 20 54 68 65 0a 20 20 20 20 20 20 20 20 20 20 20 The.
1f60: 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 callback should
1f70: 20 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 return a string
1f80: 20 77 68 69 63 68 20 72 65 70 72 65 73 65 6e 74 which represent
1f90: 73 20 74 68 65 20 70 61 73 73 77 6f 72 64 0a 20 s the password.
1fa0: 20 20 20 20 20 20 20 20 20 20 20 74 6f 20 62 65 to be
1fb0: 20 75 73 65 64 2e 20 53 65 65 20 3c 61 20 68 72 used. See <a hr
1fc0: 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 ef="#CALLBACK OP
1fd0: 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 TIONS">CALLBACK
1fe0: 4f 50 54 49 4f 4e 53 3c 2f 61 3e 0a 09 20 20 20 OPTIONS</a>..
1ff0: 20 66 6f 72 20 66 75 72 74 68 65 72 20 64 69 73 for further dis
2000: 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 cussion.</dd>.
2010: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e <dt><stron
2020: 67 3e 2d 72 65 71 75 65 73 74 20 3c 2f 73 74 72 g>-request </str
2030: 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d ong><em>bool</em
2040: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
2050: 64 64 3e 52 65 71 75 65 73 74 20 61 20 63 65 72 dd>Request a cer
2060: 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 tificate from pe
2070: 65 72 20 64 75 72 69 6e 67 20 53 53 4c 20 68 61 er during SSL ha
2080: 6e 64 73 68 61 6b 65 2e 0a 20 20 20 20 20 20 20 ndshake..
2090: 20 20 20 20 20 28 64 65 66 61 75 6c 74 20 69 73 (default is
20a0: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c <em>true</em>)<
20b0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
20c0: 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 ><strong>-requir
20d0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 e</strong> <em>b
20e0: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ool</em></dt>.
20f0: 20 20 20 20 20 20 3c 64 64 3e 52 65 71 75 69 72 <dd>Requir
2100: 65 20 61 20 76 61 6c 69 64 20 63 65 72 74 69 66 e a valid certif
2110: 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 icate from peer
2120: 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 73 during SSL hands
2130: 68 61 6b 65 2e 0a 09 20 20 20 20 49 66 20 74 68 hake... If th
2140: 69 73 20 69 73 20 73 65 74 20 74 6f 20 74 72 75 is is set to tru
2150: 65 2c 20 74 68 65 6e 20 3c 73 74 72 6f 6e 67 3e e, then <strong>
2160: 2d 72 65 71 75 65 73 74 3c 2f 73 74 72 6f 6e 67 -request</strong
2170: 3e 20 6d 75 73 74 0a 20 20 20 20 20 20 20 20 20 > must.
2180: 20 20 20 61 6c 73 6f 20 62 65 20 73 65 74 20 74 also be set t
2190: 6f 20 74 72 75 65 2e 20 28 64 65 66 61 75 6c 74 o true. (default
21a0: 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 is <em>false</e
21b0: 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 m>)</dd>.
21c0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 <dt><strong>-se
21d0: 63 75 72 69 74 79 6c 65 76 65 6c 3c 2f 73 74 72 curitylevel</str
21e0: 6f 6e 67 3e 20 3c 65 6d 3e 69 6e 74 65 67 65 72 ong> <em>integer
21f0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2200: 20 20 20 3c 64 64 3e 53 65 74 20 73 65 63 75 72 <dd>Set secur
2210: 69 74 79 20 6c 65 76 65 6c 2e 20 4d 75 73 74 20 ity level. Must
2220: 62 65 20 30 20 74 6f 20 35 2e 20 54 68 65 20 73 be 0 to 5. The s
2230: 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 61 66 ecurity level af
2240: 66 65 63 74 73 0a 09 20 20 20 20 63 69 70 68 65 fects.. ciphe
2250: 72 20 73 75 69 74 65 20 65 6e 63 72 79 70 74 69 r suite encrypti
2260: 6f 6e 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20 73 on algorithms, s
2270: 75 70 70 6f 72 74 65 64 20 45 43 43 20 63 75 72 upported ECC cur
2280: 76 65 73 2c 0a 09 20 20 20 20 73 75 70 70 6f 72 ves,.. suppor
2290: 74 65 64 20 73 69 67 6e 61 74 75 72 65 20 61 6c ted signature al
22a0: 67 6f 72 69 74 68 6d 73 2c 20 44 48 20 70 61 72 gorithms, DH par
22b0: 61 6d 65 74 65 72 20 73 69 7a 65 73 2c 20 63 65 ameter sizes, ce
22c0: 72 74 69 66 69 63 61 74 65 0a 09 20 20 20 20 6b rtificate.. k
22d0: 65 79 20 73 69 7a 65 73 20 61 6e 64 20 73 69 67 ey sizes and sig
22e0: 6e 61 74 75 72 65 20 61 6c 67 6f 72 69 74 68 6d nature algorithm
22f0: 73 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 s. The default i
2300: 73 20 31 2e 0a 09 20 20 20 20 4c 65 76 65 6c 20 s 1... Level
2310: 33 20 61 6e 64 20 68 69 67 68 65 72 20 64 69 73 3 and higher dis
2320: 61 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 able support for
2330: 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 73 session tickets
2340: 20 61 6e 64 20 6f 6e 6c 79 0a 09 20 20 20 20 61 and only.. a
2350: 63 63 65 70 74 20 63 69 70 68 65 72 20 73 75 69 ccept cipher sui
2360: 74 65 73 20 74 68 61 74 20 70 72 6f 76 69 64 65 tes that provide
2370: 20 66 6f 72 77 61 72 64 20 73 65 63 72 65 63 79 forward secrecy
2380: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c .</dd>. <
2390: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 dt><strong>-serv
23a0: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e er</strong> <em>
23b0: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 bool</em></dt>.
23c0: 20 20 20 20 20 20 20 3c 64 64 3e 48 61 6e 64 73 <dd>Hands
23d0: 68 61 6b 65 20 61 73 20 73 65 72 76 65 72 20 69 hake as server i
23e0: 66 20 74 72 75 65 2c 20 65 6c 73 65 20 68 61 6e f true, else han
23f0: 64 73 68 61 6b 65 20 61 73 0a 20 20 20 20 20 20 dshake as.
2400: 20 20 20 20 20 20 63 6c 69 65 6e 74 2e 20 28 64 client. (d
2410: 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 efault is <em>fa
2420: 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 lse</em>)</dd>.
2430: 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f <dt><stro
2440: 6e 67 3e 2d 73 65 72 76 65 72 6e 61 6d 65 3c 2f ng>-servername</
2450: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f 73 74 strong> <em>host
2460: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2470: 20 20 20 3c 64 64 3e 53 70 65 63 69 66 79 20 73 <dd>Specify s
2480: 65 72 76 65 72 20 68 6f 73 74 6e 61 6d 65 2e 20 erver hostname.
2490: 4f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 69 Only available i
24a0: 66 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 f the OpenSSL li
24b0: 62 72 61 72 79 0a 09 20 20 20 20 74 68 65 20 70 brary.. the p
24c0: 61 63 6b 61 67 65 20 69 73 20 6c 69 6e 6b 65 64 ackage is linked
24d0: 20 61 67 61 69 6e 73 74 20 73 75 70 70 6f 72 74 against support
24e0: 73 20 74 68 65 20 54 4c 53 20 68 6f 73 74 6e 61 s the TLS hostna
24f0: 6d 65 20 65 78 74 65 6e 73 69 6f 6e 0a 09 20 20 me extension..
2500: 20 20 66 6f 72 20 27 53 65 72 76 65 72 20 4e 61 for 'Server Na
2510: 6d 65 20 49 6e 64 69 63 61 74 69 6f 6e 27 20 28 me Indication' (
2520: 53 4e 49 29 2e 20 55 73 65 20 74 6f 20 6e 61 6d SNI). Use to nam
2530: 65 20 74 68 65 20 6c 6f 67 69 63 61 6c 20 68 6f e the logical ho
2540: 73 74 0a 09 20 20 20 20 77 65 20 61 72 65 20 74 st.. we are t
2550: 61 6c 6b 69 6e 67 20 74 6f 20 61 6e 64 20 65 78 alking to and ex
2560: 70 65 63 74 69 6e 67 20 61 20 63 65 72 74 69 66 pecting a certif
2570: 69 63 61 74 65 20 66 6f 72 2e 3c 2f 64 64 3e 0a icate for.</dd>.
2580: 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 <dt><str
2590: 6f 6e 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e ong>-ssl2</stron
25a0: 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e g> <em>bool</em>
25b0: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dt>. <d
25c0: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 d>Enable use of
25d0: 53 53 4c 20 76 32 2e 20 28 64 65 66 61 75 6c 74 SSL v2. (default
25e0: 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 is <em>false</e
25f0: 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 m>)</dd>.
2600: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 <dt><strong>-ss
2610: 6c 33 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e l3 </strong><em>
2620: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 bool</em></dt>.
2630: 20 20 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c <dd>Enabl
2640: 65 20 75 73 65 20 6f 66 20 53 53 4c 20 76 33 2e e use of SSL v3.
2650: 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d (default is <em
2660: 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 >false</em>)</dd
2670: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c >. <dt>-<
2680: 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 strong>tls1</str
2690: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 ong> <em>bool</e
26a0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
26b0: 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f <dd>Enable use o
26c0: 66 20 54 4c 53 20 76 31 2e 20 28 64 65 66 61 75 f TLS v1. (defau
26d0: 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f lt is <em>true</
26e0: 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 20 20 em>)</dd>.
26f0: 20 20 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 <dt>-<strong>t
2700: 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c ls1.1</strong> <
2710: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 em>bool</em></dt
2720: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 45 6e >. <dd>En
2730: 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 able use of TLS
2740: 76 31 2e 31 20 28 64 65 66 61 75 6c 74 20 69 73 v1.1 (default is
2750: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c <em>true</em>)<
2760: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
2770: 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 32 >-<strong>tls1.2
2780: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f </strong> <em>bo
2790: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 ol</em></dt>.
27a0: 20 20 20 20 20 3c 64 64 3e 45 6e 61 62 6c 65 20 <dd>Enable
27b0: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 32 20 use of TLS v1.2
27c0: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e (default is <em>
27d0: 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a true</em>)</dd>.
27e0: 20 20 20 20 20 20 20 20 3c 64 74 3e 2d 3c 73 74 <dt>-<st
27f0: 72 6f 6e 67 3e 74 6c 73 31 2e 33 3c 2f 73 74 72 rong>tls1.3</str
2800: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 ong> <em>bool</e
2810: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
2820: 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f <dd>Enable use o
2830: 66 20 54 4c 53 20 76 31 2e 33 20 28 64 65 66 61 f TLS v1.3 (defa
2840: 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c ult is <em>true<
2850: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 20 20 20 20 3c /em>)</dd>. <
2860: 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 /dl>.</blockquot
2870: 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e e>.. <dt><a n
2880: 61 6d 65 3d 22 74 6c 73 3a 3a 75 6e 69 6d 70 6f ame="tls::unimpo
2890: 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d rt"><b>tls::unim
28a0: 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e port </b><i>chan
28b0: 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e nel</i></a></dt>
28c0: 0a 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 . <dd>Provide
28d0: 64 20 66 6f 72 20 73 79 6d 6d 65 74 72 79 20 74 d for symmetry t
28e0: 6f 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 o <strong>tls::i
28f0: 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 mport</strong>,
2900: 74 68 69 73 0a 20 20 20 20 20 20 75 6e 73 74 61 this. unsta
2910: 63 6b 73 20 74 68 65 20 53 53 4c 2d 65 6e 61 62 cks the SSL-enab
2920: 6c 69 6e 67 20 6f 66 20 61 20 72 65 67 75 6c 61 ling of a regula
2930: 72 20 54 63 6c 20 63 68 61 6e 6e 65 6c 2e 20 20 r Tcl channel.
2940: 41 6e 20 65 72 72 6f 72 0a 20 20 20 20 20 20 69 An error. i
2950: 73 20 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 20 s thrown if TLS
2960: 69 73 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 73 is not the top s
2970: 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 74 tacked channel t
2980: 79 70 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 ype.</dd>. <d
2990: 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 t> </dt>.
29a0: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 <dt><a name="t
29b0: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c ls::handshake"><
29c0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e 64 strong>tls::hand
29d0: 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c shake</strong> <
29e0: 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c em>channel</em><
29f0: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 /a></dt>. <dd
2a00: 3e 46 6f 72 63 65 73 20 68 61 6e 64 73 68 61 6b >Forces handshak
2a10: 65 20 74 6f 20 74 61 6b 65 20 70 6c 61 63 65 2c e to take place,
2a20: 20 61 6e 64 20 72 65 74 75 72 6e 73 20 30 20 69 and returns 0 i
2a30: 66 0a 20 20 20 20 20 20 20 20 68 61 6e 64 73 68 f. handsh
2a40: 61 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 ake is still in
2a50: 70 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c progress (non-bl
2a60: 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 ocking), or 1 if
2a70: 0a 20 20 20 20 20 20 20 20 74 68 65 20 68 61 6e . the han
2a80: 64 73 68 61 6b 65 20 77 61 73 20 73 75 63 63 65 dshake was succe
2a90: 73 73 66 75 6c 2e 20 49 66 20 74 68 65 20 68 61 ssful. If the ha
2aa0: 6e 64 73 68 61 6b 65 20 66 61 69 6c 65 64 0a 20 ndshake failed.
2ab0: 20 20 20 20 20 20 20 74 68 69 73 20 72 6f 75 74 this rout
2ac0: 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 ine will throw a
2ad0: 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 20 n error.</dd>.
2ae0: 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 <dt> </dt
2af0: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d >. <dt><a nam
2b00: 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e e="tls::status">
2b10: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 <strong>tls::sta
2b20: 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 tus</strong>.
2b30: 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 <em>?-local? ch
2b40: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f annel</em></a></
2b50: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 dt>. <dd>Retu
2b60: 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 rns the current
2b70: 63 65 72 74 69 66 69 63 61 74 65 20 73 74 61 74 certificate stat
2b80: 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 us of an SSL cha
2b90: 6e 6e 65 6c 2e 20 54 68 65 0a 20 20 20 20 20 20 nnel. The.
2ba0: 20 20 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69 result is a li
2bb0: 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 st of key-value
2bc0: 70 61 69 72 73 20 64 65 73 63 72 69 62 69 6e 67 pairs describing
2bd0: 20 74 68 65 0a 20 20 20 20 20 20 20 20 63 6f 6e the. con
2be0: 6e 65 63 74 65 64 20 70 65 65 72 2e 20 49 66 20 nected peer. If
2bf0: 74 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 6e the result is an
2c00: 20 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65 6e empty list then
2c10: 20 74 68 65 0a 20 20 20 20 20 20 20 20 53 53 4c the. SSL
2c20: 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73 20 6e handshake has n
2c30: 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 64 ot yet completed
2c40: 2e 0a 20 20 20 20 20 20 20 20 49 66 20 3c 65 6d .. If <em
2c50: 3e 2d 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 20 >-local</em> is
2c60: 67 69 76 65 6e 2c 20 74 68 65 6e 20 74 68 65 20 given, then the
2c70: 63 65 72 74 69 66 69 63 61 74 65 20 69 6e 66 6f certificate info
2c80: 72 6d 61 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 rmation.
2c90: 69 73 20 74 68 65 20 6f 6e 65 20 75 73 65 64 20 is the one used
2ca0: 6c 6f 63 61 6c 6c 79 2e 3c 2f 64 64 3e 0a 0a 3c locally.</dd>..<
2cb0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 blockquote>.
2cc0: 3c 64 6c 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 <dl>. <dt
2cd0: 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 3c ><strong>issuer<
2ce0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c /strong> <em>dn<
2cf0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 /em></dt>.
2d00: 20 20 3c 64 64 3e 54 68 65 20 64 69 73 74 69 6e <dd>The distin
2d10: 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 4e guished name (DN
2d20: 29 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 ) of the certifi
2d30: 63 61 74 65 0a 20 20 20 20 20 20 20 20 20 20 20 cate.
2d40: 20 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 20 20 issuer.</dd>.
2d50: 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e <dt><stron
2d60: 67 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72 6f 6e g>subject</stron
2d70: 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f g> <em>dn</em></
2d80: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
2d90: 54 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 The distinguishe
2da0: 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 d name (DN) of t
2db0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 0a 20 he certificate.
2dc0: 20 20 20 20 20 20 20 20 20 20 20 73 75 62 6a 65 subje
2dd0: 63 74 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 ct.</dd>.
2de0: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 <dt><strong>not
2df0: 42 65 66 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 Before</strong>
2e00: 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 <em>date</em></d
2e10: 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 t>. <dd>T
2e20: 68 65 20 62 65 67 69 6e 20 64 61 74 65 20 66 6f he begin date fo
2e30: 72 20 74 68 65 20 76 61 6c 69 64 69 74 79 20 6f r the validity o
2e40: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 f the certificat
2e50: 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 e.</dd>.
2e60: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 41 <dt><strong>notA
2e70: 66 74 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 fter</strong> <e
2e80: 6d 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e m>date</em></dt>
2e90: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 . <dd>The
2ea0: 20 65 78 70 69 72 79 20 64 61 74 65 20 66 6f 72 expiry date for
2eb0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 the certificate
2ec0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c .</dd>. <
2ed0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 69 61 dt><strong>seria
2ee0: 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e l</strong> <em>n
2ef0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2f00: 20 20 20 3c 64 64 3e 54 68 65 20 73 65 72 69 61 <dd>The seria
2f10: 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 l number of the
2f20: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 certificate.</dd
2f30: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
2f40: 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 trong>cipher</st
2f50: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 rong> <em>cipher
2f60: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 </em></dt>.
2f70: 20 20 20 3c 64 64 3e 54 68 65 20 63 75 72 72 65 <dd>The curre
2f80: 6e 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 65 nt cipher in use
2f90: 20 62 65 74 77 65 65 6e 20 74 68 65 20 63 6c 69 between the cli
2fa0: 65 6e 74 20 61 6e 64 0a 20 20 20 20 20 20 20 20 ent and.
2fb0: 20 20 20 20 73 65 72 76 65 72 20 63 68 61 6e 6e server chann
2fc0: 65 6c 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 els.</dd>.
2fd0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 62 <dt><strong>sb
2fe0: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d its</strong> <em
2ff0: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 >n</em></dt>.
3000: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d <dd>The num
3010: 62 65 72 20 6f 66 20 62 69 74 73 20 75 73 65 64 ber of bits used
3020: 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f 6e for the session
3030: 20 6b 65 79 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 key.</dd>.
3040: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 <dt><strong>c
3050: 65 72 74 69 66 69 63 61 74 65 3c 2f 73 74 72 6f ertificate</stro
3060: 6e 67 3e 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d ng> <em>cert</em
3070: 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c ></dt>. <
3080: 64 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f 64 dd>The PEM encod
3090: 65 64 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c ed certificate.<
30a0: 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 /dd>. <dt
30b0: 3e 3c 73 74 72 6f 6e 67 3e 73 68 61 31 5f 68 61 ><strong>sha1_ha
30c0: 73 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e sh</strong> <em>
30d0: 68 61 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 hash</em></dt>.
30e0: 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 53 <dd>The S
30f0: 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 HA1 hash of the
3100: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 certificate.</dd
3110: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
3120: 74 72 6f 6e 67 3e 73 68 61 32 35 36 5f 68 61 73 trong>sha256_has
3130: 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 h</strong> <em>h
3140: 61 73 68 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ash</em></dt>.
3150: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 53 48 <dd>The SH
3160: 41 32 35 36 20 68 61 73 68 20 6f 66 20 74 68 65 A256 hash of the
3170: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 certificate.</d
3180: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
3190: 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74 72 strong>alpn</str
31a0: 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f ong> <em>protoco
31b0: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 l</em></dt>.
31c0: 20 20 20 20 3c 64 64 3e 54 68 65 20 70 72 6f 74 <dd>The prot
31d0: 6f 63 6f 6c 20 73 65 6c 65 63 74 65 64 20 61 66 ocol selected af
31e0: 74 65 72 20 41 70 70 6c 69 63 61 74 69 6f 6e 2d ter Application-
31f0: 4c 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c 0a 09 Layer Protocol..
3200: 20 20 20 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 Negotiation
3210: 28 41 4c 50 4e 29 2e 3c 2f 64 64 3e 0a 20 20 20 (ALPN).</dd>.
3220: 20 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 <dt><strong
3230: 3e 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 >version</strong
3240: 3e 20 3c 65 6d 3e 76 61 6c 75 65 3c 2f 65 6d 3e > <em>value</em>
3250: 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dt>. <d
3260: 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 d>The protocol v
3270: 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 ersion used for
3280: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 0a the connection:.
3290: 09 20 20 53 53 4c 76 32 2c 20 53 53 4c 76 33 2c . SSLv2, SSLv3,
32a0: 20 54 4c 53 76 31 2c 20 54 4c 53 76 31 2e 31 2c TLSv1, TLSv1.1,
32b0: 20 54 4c 53 76 31 2e 32 2c 20 54 4c 53 76 31 2e TLSv1.2, TLSv1.
32c0: 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 3c 2f 64 3, or unknown</d
32d0: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 d>. </dl>.</b
32e0: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 20 lockquote>..
32f0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
3300: 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c 73 ::connection"><s
3310: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 trong>tls::conne
3320: 63 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 0a 20 ction</strong>.
3330: 20 20 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f <em>channel</
3340: 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 em></a></dt>.
3350: 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 <dd>Returns the
3360: 20 63 75 72 72 65 6e 74 20 63 6f 6e 6e 65 63 74 current connect
3370: 69 6f 6e 20 73 74 61 74 75 73 20 6f 66 20 61 6e ion status of an
3380: 20 53 53 4c 20 63 68 61 6e 6e 65 6c 2e 20 54 68 SSL channel. Th
3390: 65 0a 20 20 20 20 20 20 20 20 72 65 73 75 6c 74 e. result
33a0: 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 is a list of ke
33b0: 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 65 y-value pairs de
33c0: 73 63 72 69 62 69 6e 67 20 74 68 65 0a 20 20 20 scribing the.
33d0: 20 20 20 20 20 63 6f 6e 6e 65 63 74 65 64 20 70 connected p
33e0: 65 65 72 2e 3c 2f 64 64 3e 0a 0a 3c 62 6c 6f 63 eer.</dd>..<bloc
33f0: 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c 3e kquote>. <dl>
3400: 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 74 . <dt><st
3410: 72 6f 6e 67 3e 73 74 61 74 65 3c 2f 73 74 72 6f rong>state</stro
3420: 6e 67 3e 20 3c 65 6d 3e 73 74 61 74 65 3c 2f 65 ng> <em>state</e
3430: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
3440: 3c 64 64 3e 53 74 61 74 65 20 6f 66 20 74 68 65 <dd>State of the
3450: 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 20 69 6e 69 connection: ini
3460: 74 69 61 6c 69 7a 69 6e 67 2c 20 68 61 6e 64 73 tializing, hands
3470: 68 61 6b 65 2c 20 65 73 74 61 62 6c 69 73 68 65 hake, establishe
3480: 64 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c d</dd>. <
3490: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 76 65 dt><strong>serve
34a0: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e r</strong> <em>n
34b0: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ame</em></dt>.
34c0: 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 61 <dd>The na
34d0: 6d 65 20 6f 66 20 74 68 65 20 63 6f 6e 6e 65 63 me of the connec
34e0: 74 65 64 20 74 6f 20 73 65 72 76 65 72 2e 3c 2f ted to server.</
34f0: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e dd>. <dt>
3500: 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c <strong>protocol
3510: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 </strong> <em>ve
3520: 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a rsion</em></dt>.
3530: 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 20 <dd>The
3540: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e protocol version
3550: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 6f used for the co
3560: 6e 6e 65 63 74 69 6f 6e 3a 0a 09 20 20 20 20 53 nnection:.. S
3570: 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31 2c SL2, SSL3, TLS1,
3580: 20 54 4c 53 31 2e 31 2c 20 54 4c 53 31 2e 32 2c TLS1.1, TLS1.2,
3590: 20 54 4c 53 31 2e 33 2c 20 6f 72 20 75 6e 6b 6e TLS1.3, or unkn
35a0: 6f 77 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 own.</dd>.
35b0: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 <dt><strong>se
35c0: 63 75 72 69 74 79 6c 65 76 65 6c 3c 2f 73 74 72 curitylevel</str
35d0: 6f 6e 67 3e 20 3c 65 6d 3e 6c 65 76 65 6c 3c 2f ong> <em>level</
35e0: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 em></dt>.
35f0: 20 3c 64 64 3e 54 68 65 20 73 65 63 75 72 69 74 <dd>The securit
3600: 79 20 6c 65 76 65 6c 20 75 73 65 64 20 66 6f 72 y level used for
3610: 20 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20 63 69 selection of ci
3620: 70 68 65 72 73 2c 20 6b 65 79 20 73 69 7a 65 2c phers, key size,
3630: 20 65 74 63 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 etc.</dd>.
3640: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 <dt><strong>c
3650: 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c ipher</strong> <
3660: 65 6d 3e 63 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f em>cipher</em></
3670: 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e dt>. <dd>
3680: 54 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 The current ciph
3690: 65 72 20 69 6e 20 75 73 65 20 66 6f 72 20 74 68 er in use for th
36a0: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 e connection.</d
36b0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
36c0: 73 74 72 6f 6e 67 3e 73 74 61 6e 64 61 72 64 5f strong>standard_
36d0: 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 name</strong> <e
36e0: 6d 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e m>name</em></dt>
36f0: 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 54 68 65 . <dd>The
3700: 20 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e 61 standard RFC na
3710: 6d 65 20 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 me of cipher.</d
3720: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
3730: 73 74 72 6f 6e 67 3e 62 69 74 73 3c 2f 73 74 72 strong>bits</str
3740: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c ong> <em>n</em><
3750: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
3760: 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 >The number of p
3770: 72 6f 63 65 73 73 65 64 20 62 69 74 73 20 75 73 rocessed bits us
3780: 65 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f ed for cipher.</
3790: 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e dd>. <dt>
37a0: 3c 73 74 72 6f 6e 67 3e 73 65 63 72 65 74 5f 62 <strong>secret_b
37b0: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d its</strong> <em
37c0: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 >n</em></dt>.
37d0: 20 20 20 20 20 3c 64 64 3e 54 68 65 20 6e 75 6d <dd>The num
37e0: 62 65 72 20 6f 66 20 73 65 63 72 65 74 20 62 69 ber of secret bi
37f0: 74 73 20 75 73 65 64 20 66 6f 72 20 63 69 70 68 ts used for ciph
3800: 65 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 er.</dd>.
3810: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6d 69 6e <dt><strong>min
3820: 5f 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 _version</strong
3830: 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 > <em>version</e
3840: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
3850: 3c 64 64 3e 54 68 65 20 6d 69 6e 69 6d 75 6d 20 <dd>The minimum
3860: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e protocol version
3870: 20 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 for cipher.</dd
3880: 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 73 >. <dt><s
3890: 74 72 6f 6e 67 3e 64 65 73 63 72 69 70 74 69 6f trong>descriptio
38a0: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 n</strong> <em>s
38b0: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
38c0: 20 20 20 20 20 20 20 20 3c 64 64 3e 41 20 74 65 <dd>A te
38d0: 78 74 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f xt description o
38e0: 66 20 74 68 65 20 63 69 70 68 65 72 2e 3c 2f 64 f the cipher.</d
38f0: 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 74 3e 3c d>. <dt><
3900: 73 74 72 6f 6e 67 3e 72 65 6e 65 67 6f 74 69 61 strong>renegotia
3910: 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 tion</strong> <e
3920: 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 m>state</em></dt
3930: 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 3e 57 68 >. <dd>Wh
3940: 65 74 68 65 72 20 70 72 6f 74 6f 63 6f 6c 20 72 ether protocol r
3950: 65 6e 65 67 6f 74 69 61 74 69 6f 6e 20 69 73 20 enegotiation is
3960: 61 6c 6c 6f 77 65 64 20 6f 72 20 64 69 73 61 6c allowed or disal
3970: 6c 6f 77 65 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 lowed.</dd>.
3980: 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e <dt><strong>
3990: 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 alpn</strong> <e
39a0: 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c m>protocol</em><
39b0: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 3c 64 64 /dt>. <dd
39c0: 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65 >The protocol se
39d0: 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 70 70 lected after App
39e0: 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 lication-Layer P
39f0: 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65 67 rotocol.. Neg
3a00: 6f 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e otiation (ALPN).
3a10: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 3c 64 </dd>. <d
3a20: 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f t><strong>sessio
3a30: 6e 5f 72 65 75 73 65 64 3c 2f 73 74 72 6f 6e 67 n_reused</strong
3a40: 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 > <em>boolean</e
3a50: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 m></dt>.
3a60: 3c 64 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 <dd>Whether the
3a70: 73 65 73 73 69 6f 6e 20 68 61 73 20 62 65 65 6e session has been
3a80: 20 72 65 75 73 65 64 20 6f 72 20 6e 6f 74 2e 3c reused or not.<
3a90: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c /dd>. </dl>.<
3aa0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 /blockquote>..
3ab0: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 <dt><a name="t
3ac0: 6c 73 3a 3a 63 69 70 68 65 72 73 22 3e 3c 73 74 ls::ciphers"><st
3ad0: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 72 rong>tls::cipher
3ae0: 73 3c 2f 73 74 72 6f 6e 67 3e 20 0a 20 20 20 20 s</strong> .
3af0: 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 20 3f 76 65 <em>protocol ?ve
3b00: 72 62 6f 73 65 3f 20 3f 73 75 70 70 6f 72 74 65 rbose? ?supporte
3b10: 64 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e d?</em></a></dt>
3b20: 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 . <dd>Returns
3b30: 20 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f a list of suppo
3b40: 72 74 65 64 20 63 69 70 68 65 72 73 20 61 76 61 rted ciphers ava
3b50: 69 6c 61 62 6c 65 20 66 6f 72 20 3c 65 6d 3e 70 ilable for <em>p
3b60: 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 2c 0a 20 20 rotocol</em>,.
3b70: 20 20 20 20 20 20 77 68 65 72 65 20 70 72 6f 74 where prot
3b80: 6f 63 6f 6c 20 6d 75 73 74 20 62 65 20 6f 6e 65 ocol must be one
3b90: 20 6f 66 20 3c 62 3e 73 73 6c 32 2c 20 73 73 6c of <b>ssl2, ssl
3ba0: 33 2c 20 74 6c 73 31 2c 20 74 6c 73 31 2e 31 2c 3, tls1, tls1.1,
3bb0: 0a 09 74 6c 73 31 2e 32 2c 3c 2f 62 3e 20 6f 72 ..tls1.2,</b> or
3bc0: 20 3c 62 3e 74 6c 73 31 2e 33 3c 2f 62 3e 2e 20 <b>tls1.3</b>.
3bd0: 49 66 20 3c 65 6d 3e 76 65 72 62 6f 73 65 3c 2f If <em>verbose</
3be0: 65 6d 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 em> is specified
3bf0: 20 61 73 0a 09 74 72 75 65 20 74 68 65 6e 20 61 as..true then a
3c00: 20 76 65 72 62 6f 73 65 2c 20 68 75 6d 61 6e 20 verbose, human
3c10: 72 65 61 64 61 62 6c 65 20 6c 69 73 74 20 69 73 readable list is
3c20: 20 72 65 74 75 72 6e 65 64 20 77 69 74 68 0a 09 returned with..
3c30: 61 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 additional infor
3c40: 6d 61 74 69 6f 6e 20 6f 6e 20 74 68 65 20 63 69 mation on the ci
3c50: 70 68 65 72 2e 20 49 66 20 3c 65 6d 3e 73 75 70 pher. If <em>sup
3c60: 70 6f 72 74 65 64 3c 2f 65 6d 3e 0a 09 69 73 20 ported</em>..is
3c70: 73 70 65 63 69 66 69 65 64 20 61 73 20 74 72 75 specified as tru
3c80: 65 2c 20 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 e, then only the
3c90: 20 63 69 70 68 65 72 73 20 73 75 70 70 6f 72 74 ciphers support
3ca0: 65 64 20 66 6f 72 20 70 72 6f 74 6f 63 6f 6c 0a ed for protocol.
3cb0: 09 77 69 6c 6c 20 62 65 20 6c 69 73 74 65 64 2e .will be listed.
3cc0: 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c </dd>.. <dt><
3cd0: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 70 72 6f a name="tls::pro
3ce0: 74 6f 63 6f 6c 73 22 3e 3c 73 74 72 6f 6e 67 3e tocols"><strong>
3cf0: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f tls::protocols</
3d00: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e strong></a></dt>
3d10: 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 . <dd>Returns
3d20: 20 61 20 6c 69 73 74 20 6f 66 20 73 75 70 70 6f a list of suppo
3d30: 72 74 65 64 20 70 72 6f 74 6f 63 6f 6c 73 2e 20 rted protocols.
3d40: 56 61 6c 69 64 20 76 61 6c 75 65 73 20 61 72 65 Valid values are
3d50: 3a 0a 09 3c 62 3e 73 73 6c 32 3c 2f 62 3e 2c 20 :..<b>ssl2</b>,
3d60: 3c 62 3e 73 73 6c 33 3c 2f 62 3e 2c 20 3c 62 3e <b>ssl3</b>, <b>
3d70: 74 6c 73 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 tls1</b>, <b>tls
3d80: 31 2e 31 3c 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 1.1</b>, <b>tls1
3d90: 2e 32 3c 2f 62 3e 2c 0a 09 61 6e 64 20 3c 62 3e .2</b>,..and <b>
3da0: 74 6c 73 31 2e 33 3c 2f 62 3e 2e 3c 2f 64 64 3e tls1.3</b>.</dd>
3db0: 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d .. <dt><a nam
3dc0: 65 3d 22 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 22 e="tls::version"
3dd0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 65 ><strong>tls::ve
3de0: 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 3c 2f rsion</strong></
3df0: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e a></dt>. <dd>
3e00: 52 65 74 75 72 6e 73 20 74 68 65 20 4f 70 65 6e Returns the Open
3e10: 53 53 4c 20 76 65 72 73 69 6f 6e 20 73 74 72 69 SSL version stri
3e20: 6e 67 2e 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a ng.</dd>.</dl>..
3e30: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 41 4c <h3><a name="CAL
3e40: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 LBACK OPTIONS">C
3e50: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c ALLBACK OPTIONS<
3e60: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 /a></h3>..<p>.As
3e70: 20 69 6e 64 69 63 61 74 65 64 20 61 62 6f 76 65 indicated above
3e80: 2c 20 69 6e 64 69 76 69 64 75 61 6c 20 63 68 61 , individual cha
3e90: 6e 6e 65 6c 73 20 63 61 6e 20 62 65 20 67 69 76 nnels can be giv
3ea0: 65 6e 20 74 68 65 69 72 20 6f 77 6e 20 63 61 6c en their own cal
3eb0: 6c 62 61 63 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 lbacks.to handle
3ec0: 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20 70 72 intermediate pr
3ed0: 6f 63 65 73 73 69 6e 67 20 62 79 20 74 68 65 20 ocessing by the
3ee0: 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 2c OpenSSL library,
3ef0: 20 75 73 69 6e 67 20 74 68 65 0a 3c 65 6d 3e 2d using the.<em>-
3f00: 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e 64 command</em> and
3f10: 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f <em>-password</
3f20: 65 6d 3e 20 6f 70 74 69 6f 6e 73 20 70 61 73 73 em> options pass
3f30: 65 64 20 74 6f 20 65 69 74 68 65 72 20 6f 66 0a ed to either of.
3f40: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 <strong>tls::soc
3f50: 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 6f 72 20 ket</strong> or
3f60: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 <strong>tls::imp
3f70: 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 3c 2f ort</strong>..</
3f80: 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e p>..<blockquote>
3f90: 0a 3c 64 6c 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c .<dl>.. <dt><
3fa0: 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c strong>-command<
3fb0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c /strong> <em>cal
3fc0: 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a lback</em></dt>.
3fd0: 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 <dd>..Invoke
3fe0: 73 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 s the specified
3ff0: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d <em>callback</em
4000: 3e 20 73 63 72 69 70 74 20 61 74 0a 09 73 65 76 > script at..sev
4010: 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 eral points duri
4020: 6e 67 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 ng the OpenSSL h
4030: 61 6e 64 73 68 61 6b 65 2e 0a 09 45 78 63 65 70 andshake...Excep
4040: 74 20 61 73 20 69 6e 64 69 63 61 74 65 64 20 62 t as indicated b
4050: 65 6c 6f 77 2c 20 76 61 6c 75 65 73 20 72 65 74 elow, values ret
4060: 75 72 6e 65 64 20 66 72 6f 6d 20 74 68 65 0a 09 urned from the..
4070: 63 61 6c 6c 62 61 63 6b 20 61 72 65 20 69 67 6e callback are ign
4080: 6f 72 65 64 2e 0a 09 41 72 67 75 6d 65 6e 74 73 ored...Arguments
4090: 20 61 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65 appended to the
40a0: 20 73 63 72 69 70 74 20 75 70 6f 6e 20 63 61 6c script upon cal
40b0: 6c 62 61 63 6b 20 74 61 6b 65 20 6f 6e 65 20 6f lback take one o
40c0: 66 20 74 68 65 0a 09 66 6f 6c 6c 6f 77 69 6e 67 f the..following
40d0: 20 66 6f 72 6d 73 3a 0a 0a 09 3c 62 72 3e 0a 09 forms:...<br>..
40e0: 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 3c 21 2d <br>...<dl>..<!-
40f0: 2d 09 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 -.This form of c
4100: 61 6c 6c 62 61 63 6b 20 69 73 20 64 69 73 61 62 allback is disab
4110: 6c 65 64 2e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c led....<dt>.. <
4120: 73 74 72 6f 6e 67 3e 65 72 72 6f 72 3c 2f 73 74 strong>error</st
4130: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 rong> <em>channe
4140: 6c 20 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 l message</em>..
4150: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 </dt>..<dd>.. T
4160: 68 65 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f he <em>message</
4170: 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 63 6f 6e em> argument con
4180: 74 61 69 6e 73 20 61 6e 20 65 72 72 6f 72 20 6d tains an error m
4190: 65 73 73 61 67 65 20 67 65 6e 65 72 61 74 65 64 essage generated
41a0: 0a 09 20 20 62 79 20 74 68 65 20 4f 70 65 6e 53 .. by the OpenS
41b0: 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 3c SL function.. <
41c0: 63 6f 64 65 3e 45 52 52 5f 72 65 61 73 6f 6e 5f code>ERR_reason_
41d0: 65 72 72 6f 72 5f 73 74 72 69 6e 67 28 29 3c 2f error_string()</
41e0: 63 6f 64 65 3e 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 code>...</dd>...
41f0: 3c 62 72 3e 0a 2d 2d 3e 0a 0a 09 3c 64 74 3e 0a <br>.-->...<dt>.
4200: 09 20 20 3c 73 74 72 6f 6e 67 3e 69 6e 66 6f 3c . <strong>info<
4210: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 /strong> <em>cha
4220: 6e 6e 65 6c 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 nnel major minor
4230: 20 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c message</em>..<
4240: 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 /dt>..<dd>.. Th
4250: 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 is form of callb
4260: 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 ack is invoked b
4270: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 y the OpenSSL fu
4280: 6e 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e nction.. <code>
4290: 53 53 4c 5f 43 54 58 5f 73 65 74 5f 69 6e 66 6f SSL_CTX_set_info
42a0: 5f 63 61 6c 6c 62 61 63 6b 28 29 3c 2f 63 6f 64 _callback()</cod
42b0: 65 3e 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 e>... <br>.. T
42c0: 68 65 20 3c 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d he <em>major</em
42d0: 3e 20 61 6e 64 20 3c 65 6d 3e 6d 69 6e 6f 72 3c > and <em>minor<
42e0: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 73 20 61 /em> arguments a
42f0: 72 65 20 75 73 65 64 20 74 6f 0a 09 20 20 72 65 re used to.. re
4300: 70 72 65 73 65 6e 74 20 74 68 65 20 73 74 61 74 present the stat
4310: 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 62 69 e information bi
4320: 74 6d 61 73 6b 2e 0a 09 20 20 3c 64 6c 3e 0a 09 tmask... <dl>..
4330: 20 20 3c 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 <dt>Possible v
4340: 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 61 alues for <em>ma
4350: 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 jor</em> are:</d
4360: 74 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e t>.. <dd><code>
4370: 68 61 6e 64 73 68 61 6b 65 2c 20 61 6c 65 72 74 handshake, alert
4380: 2c 20 63 6f 6e 6e 65 63 74 2c 20 61 63 63 65 70 , connect, accep
4390: 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64 3e 0a 09 t</code>.</dd>..
43a0: 20 20 3c 64 74 3e 50 6f 73 73 69 62 6c 65 20 76 <dt>Possible v
43b0: 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 69 alues for <em>mi
43c0: 6e 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 3c 2f 64 nor</em> are:</d
43d0: 74 3e 0a 09 20 20 3c 64 64 3e 3c 63 6f 64 65 3e t>.. <dd><code>
43e0: 73 74 61 72 74 2c 20 64 6f 6e 65 2c 20 72 65 61 start, done, rea
43f0: 64 2c 20 77 72 69 74 65 2c 20 6c 6f 6f 70 2c 20 d, write, loop,
4400: 65 78 69 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 64 64 exit</code>.</dd
4410: 3e 0a 09 20 20 3c 2f 64 6c 3e 0a 09 20 20 54 68 >.. </dl>.. Th
4420: 65 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 e <em>message</e
4430: 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 m> argument is a
4440: 20 64 65 73 63 72 69 70 74 69 76 65 20 73 74 72 descriptive str
4450: 69 6e 67 20 77 68 69 63 68 20 6d 61 79 0a 09 20 ing which may..
4460: 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 65 69 be generated ei
4470: 74 68 65 72 20 62 79 0a 09 20 20 3c 63 6f 64 65 ther by.. <code
4480: 3e 53 53 4c 5f 73 74 61 74 65 5f 73 74 72 69 6e >SSL_state_strin
4490: 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 20 g_long()</code>
44a0: 6f 72 20 62 79 0a 09 20 20 3c 63 6f 64 65 3e 53 or by.. <code>S
44b0: 53 4c 5f 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 SL_alert_desc_st
44c0: 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 ring_long()</cod
44d0: 65 3e 2c 0a 09 20 20 64 65 70 65 6e 64 69 6e 67 e>,.. depending
44e0: 20 6f 6e 20 63 6f 6e 74 65 78 74 2e 0a 09 3c 2f on context...</
44f0: 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74 dd>...<br>...<dt
4500: 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 76 65 72 >.. <strong>ver
4510: 69 66 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ify</strong> <em
4520: 3e 63 68 61 6e 6e 65 6c 20 64 65 70 74 68 20 63 >channel depth c
4530: 65 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72 ert status error
4540: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 </em>..</dt>..<d
4550: 64 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 d>.. This form
4560: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 of callback is i
4570: 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 nvoked by the Op
4580: 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 enSSL function..
4590: 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 65 74 5f <code>SSL_set_
45a0: 76 65 72 69 66 79 28 29 3c 2f 63 6f 64 65 3e 2e verify()</code>.
45b0: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 20 .. <br>.. The
45c0: 3c 65 6d 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 <em>depth</em> a
45d0: 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e rgument is an in
45e0: 74 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 69 teger representi
45f0: 6e 67 20 74 68 65 0a 09 20 20 63 75 72 72 65 6e ng the.. curren
4600: 74 20 64 65 70 74 68 20 6f 6e 20 74 68 65 20 63 t depth on the c
4610: 65 72 74 69 66 69 63 61 74 65 20 63 68 61 69 6e ertificate chain
4620: 2c 20 77 69 74 68 0a 09 20 20 3c 63 6f 64 65 3e , with.. <code>
4630: 30 3c 2f 63 6f 64 65 3e 20 61 73 20 74 68 65 20 0</code> as the
4640: 73 75 62 6a 65 63 74 20 63 65 72 74 69 66 69 63 subject certific
4650: 61 74 65 20 61 6e 64 20 68 69 67 68 65 72 20 76 ate and higher v
4660: 61 6c 75 65 73 0a 09 20 20 64 65 6e 6f 74 69 6e alues.. denotin
4670: 67 20 70 72 6f 67 72 65 73 73 69 76 65 6c 79 20 g progressively
4680: 6d 6f 72 65 20 69 6e 64 69 72 65 63 74 20 69 73 more indirect is
4690: 73 75 65 72 20 63 65 72 74 69 66 69 63 61 74 65 suer certificate
46a0: 73 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 s... <br>.. Th
46b0: 65 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 e <em>cert</em>
46c0: 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 argument is a li
46d0: 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 st of key-value
46e0: 70 61 69 72 73 20 73 69 6d 69 6c 61 72 0a 09 20 pairs similar..
46f0: 20 74 6f 20 74 68 6f 73 65 20 72 65 74 75 72 6e to those return
4700: 65 64 20 62 79 0a 09 20 20 3c 61 20 68 72 65 66 ed by.. <a href
4710: 3d 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e ="#tls::status">
4720: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 <strong>tls::sta
4730: 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e tus</strong></a>
4740: 2e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 68 65 ... <br>.. The
4750: 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e <em>status</em>
4760: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 argument is an
4770: 69 6e 74 65 67 65 72 20 72 65 70 72 65 73 65 6e integer represen
4780: 74 69 6e 67 20 74 68 65 0a 09 20 20 63 75 72 72 ting the.. curr
4790: 65 6e 74 20 76 61 6c 69 64 69 74 79 20 6f 66 20 ent validity of
47a0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e the certificate.
47b0: 0a 09 20 20 41 20 76 61 6c 75 65 20 6f 66 20 3c .. A value of <
47c0: 63 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 6d 65 code>0</code> me
47d0: 61 6e 73 20 74 68 65 20 63 65 72 74 69 66 69 63 ans the certific
47e0: 61 74 65 20 69 73 20 64 65 65 6d 65 64 20 69 6e ate is deemed in
47f0: 76 61 6c 69 64 2e 0a 09 20 20 41 20 76 61 6c 75 valid... A valu
4800: 65 20 6f 66 20 3c 63 6f 64 65 3e 31 3c 2f 63 6f e of <code>1</co
4810: 64 65 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65 de> means the ce
4820: 72 74 69 66 69 63 61 74 65 20 69 73 20 64 65 65 rtificate is dee
4830: 6d 65 64 20 76 61 6c 69 64 2e 0a 09 20 20 3c 62 med valid... <b
4840: 72 3e 0a 09 20 20 54 68 65 20 3c 65 6d 3e 65 72 r>.. The <em>er
4850: 72 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e ror</em> argumen
4860: 74 20 73 75 70 70 6c 69 65 73 20 74 68 65 20 6d t supplies the m
4870: 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 essage, if any,
4880: 67 65 6e 65 72 61 74 65 64 0a 09 20 20 62 79 0a generated.. by.
4890: 09 20 20 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 . <code>X509_ST
48a0: 4f 52 45 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f ORE_CTX_get_erro
48b0: 72 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 3c r()</code>... <
48c0: 62 72 3e 0a 09 20 20 3c 62 72 3e 0a 09 20 20 54 br>.. <br>.. T
48d0: 68 65 20 63 61 6c 6c 62 61 63 6b 20 6d 61 79 20 he callback may
48e0: 6f 76 65 72 72 69 64 65 20 6e 6f 72 6d 61 6c 20 override normal
48f0: 76 61 6c 69 64 61 74 69 6f 6e 20 70 72 6f 63 65 validation proce
4900: 73 73 69 6e 67 20 62 79 20 65 78 70 6c 69 63 69 ssing by explici
4910: 74 6c 79 0a 09 20 20 72 65 74 75 72 6e 69 6e 67 tly.. returning
4920: 20 6f 6e 65 20 6f 66 20 74 68 65 20 61 62 6f 76 one of the abov
4930: 65 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d e <em>status</em
4940: 3e 20 76 61 6c 75 65 73 2e 0a 09 3c 2f 64 64 3e > values...</dd>
4950: 0a 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 ...</dl>. </d
4960: 64 3e 0a 0a 20 20 20 20 3c 62 72 3e 0a 0a 20 20 d>.. <br>..
4970: 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 <dt><strong>-p
4980: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e assword</strong>
4990: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 <em>callback</e
49a0: 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e m></dt>. <dd>
49b0: 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 ..Invokes the sp
49c0: 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c ecified <em>call
49d0: 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 back</em> script
49e0: 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 when OpenSSL ne
49f0: 65 64 73 20 74 6f 0a 09 6f 62 74 61 69 6e 20 61 eds to..obtain a
4a00: 20 70 61 73 73 77 6f 72 64 2e 20 20 54 68 65 20 password. The
4a10: 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 callback should
4a20: 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 return a string
4a30: 77 68 69 63 68 0a 09 72 65 70 72 65 73 65 6e 74 which..represent
4a40: 73 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 74 s the password t
4a50: 6f 20 62 65 20 75 73 65 64 2e 0a 09 4e 6f 20 61 o be used...No a
4a60: 72 67 75 6d 65 6e 74 73 20 61 72 65 20 61 70 70 rguments are app
4a70: 65 6e 64 65 64 20 74 6f 20 74 68 65 20 73 63 72 ended to the scr
4a80: 69 70 74 20 75 70 6f 6e 20 63 61 6c 6c 62 61 63 ipt upon callbac
4a90: 6b 2e 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 k.. </dd>.</d
4aa0: 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e l>.</blockquote>
4ab0: 0a 0a 3c 70 3e 0a 52 65 66 65 72 65 6e 63 65 20 ..<p>.Reference
4ac0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 implementations
4ad0: 6f 66 20 74 68 65 73 65 20 63 61 6c 6c 62 61 63 of these callbac
4ae0: 6b 73 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 ks are provided
4af0: 69 6e 20 74 68 65 0a 64 69 73 74 72 69 62 75 74 in the.distribut
4b00: 69 6f 6e 20 61 73 20 3c 73 74 72 6f 6e 67 3e 74 ion as <strong>t
4b10: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 ls::callback</st
4b20: 72 6f 6e 67 3e 20 61 6e 64 0a 3c 73 74 72 6f 6e rong> and.<stron
4b30: 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c g>tls::password<
4b40: 2f 73 74 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 /strong> respect
4b50: 69 76 65 6c 79 2e 20 20 4e 6f 74 65 20 74 68 61 ively. Note tha
4b60: 74 20 74 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e t these are.<em>
4b70: 73 61 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c sample</em> impl
4b80: 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 ementations only
4b90: 2e 20 20 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 . In a more rea
4ba0: 6c 69 73 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e listic deploymen
4bb0: 74 0a 79 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 t.you would spec
4bc0: 69 66 79 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c ify your own cal
4bd0: 6c 62 61 63 6b 20 73 63 72 69 70 74 73 20 6f 6e lback scripts on
4be0: 20 65 61 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 each TLS channe
4bf0: 6c 0a 75 73 69 6e 67 20 74 68 65 20 3c 65 6d 3e l.using the <em>
4c00: 2d 63 6f 6d 6d 61 6e 64 3c 2f 65 6d 3e 20 61 6e -command</em> an
4c10: 64 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c d <em>-password<
4c20: 2f 65 6d 3e 20 6f 70 74 69 6f 6e 73 2e 0a 3c 2f /em> options..</
4c30: 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 64 65 66 61 p>..<p>.The defa
4c40: 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 65 ult behavior whe
4c50: 6e 20 74 68 65 20 3c 65 6d 3e 2d 63 6f 6d 6d 61 n the <em>-comma
4c60: 6e 64 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20 69 nd</em> option i
4c70: 73 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20 s not specified
4c80: 69 73 20 66 6f 72 0a 54 4c 53 20 74 6f 20 70 72 is for.TLS to pr
4c90: 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f 63 69 ocess the associ
4ca0: 61 74 65 64 20 6c 69 62 72 61 72 79 20 63 61 6c ated library cal
4cb0: 6c 62 61 63 6b 73 20 69 6e 74 65 72 6e 61 6c 6c lbacks internall
4cc0: 79 2e 0a 54 68 65 20 64 65 66 61 75 6c 74 20 62 y..The default b
4cd0: 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65 ehavior when the
4ce0: 20 3c 65 6d 3e 2d 70 61 73 73 77 6f 72 64 3c 2f <em>-password</
4cf0: 65 6d 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f em> option is no
4d00: 74 20 73 70 65 63 69 66 69 65 64 20 69 73 20 66 t specified is f
4d10: 6f 72 0a 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 or.TLS to proces
4d20: 73 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 s the associated
4d30: 20 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63 library callbac
4d40: 6b 73 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67 ks by attempting
4d50: 20 74 6f 20 63 61 6c 6c 0a 3c 73 74 72 6f 6e 67 to call.<strong
4d60: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f >tls::password</
4d70: 73 74 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66 strong>..The dif
4d80: 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20 ference between
4d90: 74 68 65 73 65 20 74 77 6f 20 62 65 68 61 76 69 these two behavi
4da0: 6f 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75 ors is a consequ
4db0: 65 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e ence of maintain
4dc0: 69 6e 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74 ing.compatibilit
4dd0: 79 20 77 69 74 68 20 65 61 72 6c 69 65 72 20 69 y with earlier i
4de0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a mplementations..
4df0: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73 </p>..<p>.The <s
4e00: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 trong>tls::debug
4e10: 3c 2f 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 </strong> variab
4e20: 6c 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 le provides some
4e30: 20 61 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 additional.cont
4e40: 72 6f 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72 rol over these r
4e50: 65 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 eference callbac
4e60: 6b 73 2e 20 20 49 74 73 20 76 61 6c 75 65 20 69 ks. Its value i
4e70: 73 20 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c s zero by defaul
4e80: 74 2e 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73 t..Higher values
4e90: 20 70 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 produce more di
4ea0: 61 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c agnostic output,
4eb0: 20 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 and will also f
4ec0: 6f 72 63 65 20 74 68 65 0a 76 65 72 69 66 79 20 orce the.verify
4ed0: 6d 65 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e method in <stron
4ee0: 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c g>tls::callback<
4ef0: 2f 73 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 /strong> to acce
4f00: 70 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 pt the.certifica
4f10: 74 65 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74 te, even when it
4f20: 20 69 73 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70 is invalid..</p
4f30: 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 >..<p>.<em>.The
4f40: 75 73 65 20 6f 66 20 74 68 65 20 72 65 66 65 72 use of the refer
4f50: 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c ence callbacks <
4f60: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c strong>tls::call
4f70: 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e back</strong> an
4f80: 64 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 d.<strong>tls::p
4f90: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e assword</strong>
4fa0: 20 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e is not recommen
4fb0: 64 65 64 2e 20 20 54 68 65 79 20 6d 61 79 20 62 ded. They may b
4fc0: 65 20 72 65 6d 6f 76 65 64 0a 66 72 6f 6d 20 66 e removed.from f
4fd0: 75 74 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a uture releases..
4fe0: 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a </em>.</p>..<p>.
4ff0: 3c 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 <em>.The use of
5000: 74 68 65 20 76 61 72 69 61 62 6c 65 20 3c 73 74 the variable <st
5010: 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c rong>tls::debug<
5020: 2f 73 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 /strong> is not
5030: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 20 recommended..It
5040: 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20 66 may be removed f
5050: 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 rom future relea
5060: 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a ses..</em>.</p>.
5070: 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 .<h3><a name="DE
5080: 42 55 47 22 3e 44 45 42 55 47 3c 2f 61 3e 3c 2f BUG">DEBUG</a></
5090: 68 33 3e 0a 0a 54 4c 53 20 6b 65 79 20 6c 6f 67 h3>..TLS key log
50a0: 67 69 6e 67 20 63 61 6e 20 62 65 20 65 6e 61 62 ging can be enab
50b0: 6c 65 64 20 62 79 20 73 65 74 74 69 6e 67 20 74 led by setting t
50c0: 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 he environment v
50d0: 61 72 69 61 62 6c 65 0a 3c 62 3e 53 53 4c 4b 45 ariable.<b>SSLKE
50e0: 59 4c 4f 47 46 49 4c 45 3c 2f 62 3e 20 74 6f 20 YLOGFILE</b> to
50f0: 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 the name of the
5100: 66 69 6c 65 20 74 6f 20 6c 6f 67 20 74 6f 2e 20 file to log to.
5110: 54 68 65 6e 20 77 68 65 6e 65 76 65 72 20 54 4c Then whenever TL
5120: 53 0a 6b 65 79 20 6d 61 74 65 72 69 61 6c 20 69 S.key material i
5130: 73 20 67 65 6e 65 72 61 74 65 64 20 6f 72 20 72 s generated or r
5140: 65 63 65 69 76 65 64 20 69 74 20 77 69 6c 6c 20 eceived it will
5150: 62 65 20 6c 6f 67 67 65 64 20 74 6f 20 74 68 65 be logged to the
5160: 20 66 69 6c 65 2e 0a 0a 3c 68 33 3e 3c 61 20 6e file...<h3><a n
5170: 61 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50 ame="HTTPS EXAMP
5180: 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c LE">HTTPS EXAMPL
5190: 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 E</a></h3>..<p>T
51a0: 68 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 73 his example uses
51b0: 20 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 72 a sample server
51c0: 2e 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 69 .pem provided wi
51d0: 74 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 61 th the TLS relea
51e0: 73 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 20 se,.courtesy of
51f0: 74 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e the <strong>Open
5200: 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 6f SSL</strong> pro
5210: 6a 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 3e ject.</p>..<pre>
5220: 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 <code>.package r
5230: 65 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b equire http.pack
5240: 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a age require tls.
5250: 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20 .http::register
5260: 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20 https 443 [list
5270: 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 ::tls::socket -a
5280: 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72 utoservername tr
5290: 75 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 65 ue -require true
52a0: 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 6c -cadir /etc/ssl
52b0: 2f 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f 6b /certs]..set tok
52c0: 20 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 68 [http::geturl h
52d0: 74 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e 74 ttps://www.tcl.t
52e0: 6b 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 k/].</code></pre
52f0: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 >..<h3><a name="
5300: 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 SPECIAL CONSIDER
5310: 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c 20 ATIONS">SPECIAL
5320: 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f CONSIDERATIONS</
5330: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 20 a></h3>..<p>The
5340: 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 20 capabilities of
5350: 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 6e this package can
5360: 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c 79 vary enormously
5370: 20 62 61 73 65 64 0a 75 70 6f 6e 20 68 6f 77 20 based.upon how
5380: 79 6f 75 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 your OpenSSL lib
5390: 72 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 rary was configu
53a0: 72 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 41 red and built. A
53b0: 74 20 74 68 65 0a 6d 6f 73 74 20 6d 61 63 72 6f t the.most macro
53c0: 2d 6c 65 76 65 6c 20 4f 70 65 6e 53 53 4c 20 73 -level OpenSSL s
53d0: 75 70 70 6f 72 74 73 20 61 20 26 71 75 6f 74 3b upports a "
53e0: 6e 6f 20 70 61 74 65 6e 74 73 26 71 75 6f 74 3b no patents"
53f0: 20 62 75 69 6c 64 2c 0a 77 68 69 63 68 20 64 69 build,.which di
5400: 73 61 62 6c 65 73 20 52 53 41 2c 20 49 44 45 41 sables RSA, IDEA
5410: 2c 20 52 43 28 32 2c 34 2c 35 29 20 61 6e 64 20 , RC(2,4,5) and
5420: 53 53 4c 32 20 2d 20 69 66 20 79 6f 75 72 20 4f SSL2 - if your O
5430: 70 65 6e 53 53 4c 20 69 73 0a 63 6f 6e 66 69 67 penSSL is.config
5440: 75 72 65 64 20 74 68 69 73 20 77 61 79 20 74 68 ured this way th
5450: 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 en you will need
5460: 20 74 6f 20 62 75 69 6c 64 20 54 4c 53 20 77 69 to build TLS wi
5470: 74 68 20 74 68 65 0a 2d 44 4e 4f 5f 50 41 54 45 th the.-DNO_PATE
5480: 4e 54 53 20 6f 70 74 69 6f 6e 20 2d 20 61 6e 64 NTS option - and
5490: 20 74 68 65 20 72 65 73 75 6c 74 61 6e 74 20 6d the resultant m
54a0: 6f 64 75 6c 65 20 77 69 6c 6c 20 66 75 6e 63 74 odule will funct
54b0: 69 6f 6e 0a 63 6f 72 72 65 63 74 6c 79 20 61 6e ion.correctly an
54c0: 64 20 61 6c 73 6f 20 73 75 70 70 6f 72 74 20 41 d also support A
54d0: 44 48 20 63 65 72 74 69 66 69 63 61 74 65 2d 6c DH certificate-l
54e0: 65 73 73 20 65 6e 63 72 79 70 74 69 6f 6e 2c 0a ess encryption,.
54f0: 68 6f 77 65 76 65 72 20 79 6f 75 20 77 69 6c 6c however you will
5500: 20 62 65 20 75 6e 61 62 6c 65 20 74 6f 20 75 74 be unable to ut
5510: 69 6c 69 7a 65 20 74 68 69 73 20 74 6f 20 73 70 ilize this to sp
5520: 65 61 6b 20 74 6f 20 6e 6f 72 6d 61 6c 20 57 65 eak to normal We
5530: 62 0a 53 65 72 76 65 72 73 2c 20 77 68 69 63 68 b.Servers, which
5540: 20 74 79 70 69 63 61 6c 6c 79 20 72 65 71 75 69 typically requi
5550: 72 65 20 52 53 41 20 73 75 70 70 6f 72 74 2e 20 re RSA support.
5560: 50 6c 65 61 73 65 20 73 65 65 20 3c 61 0a 68 72 Please see <a.hr
5570: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f ef="http://www.o
5580: 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 68 74 74 penssl.org/">htt
5590: 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e p://www.openssl.
55a0: 6f 72 67 2f 3c 2f 61 3e 20 66 6f 72 0a 6d 6f 72 org/</a> for.mor
55b0: 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e e information on
55c0: 20 74 68 65 20 77 68 6f 6c 65 20 69 73 73 75 65 the whole issue
55d0: 20 6f 66 20 70 61 74 65 6e 74 73 20 61 6e 64 20 of patents and
55e0: 55 53 20 65 78 70 6f 72 74 0a 72 65 73 74 72 69 US export.restri
55f0: 63 74 69 6f 6e 73 2e 20 3c 2f 70 3e 0a 0a 3c 68 ctions. </p>..<h
5600: 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 20 41 3><a name="SEE A
5610: 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 LSO">SEE ALSO</a
5620: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f ></h3>..<p><stro
5630: 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e ng>socket</stron
5640: 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 g>, <strong>file
5650: 65 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e 67 3e event, </strong>
5660: 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f <a.href="http://
5670: 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f www.openssl.org/
5680: 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 "><strong>OpenSS
5690: 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f L</strong></a></
56a0: 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e 0a p>..<hr>..<pre>.
56b0: 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b Copyright ©
56c0: 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d 61 1999 Matt Newma
56d0: 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f n..Copyright &co
56e0: 70 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 73 py; 2004 Starfis
56f0: 68 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 72 65 h Systems..</pre
5700: 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c >.</body>.</html
5710: 3e 0a >.