0000: 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 20 70 <!doctype html p
0010: 75 62 6c 69 63 20 22 2d 2f 2f 57 33 43 2f 2f 44 ublic "-//W3C//D
0020: 54 44 20 48 54 4d 4c 20 34 2e 30 20 54 72 61 6e TD HTML 4.0 Tran
0030: 73 69 74 69 6f 6e 61 6c 2f 2f 45 4e 22 3e 0a 0a sitional//EN">..
0040: 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a 3c <html>..<head>.<
0050: 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d meta http-equiv=
0060: 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a 63 "Content-Type".c
0070: 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 6d ontent="text/htm
0080: 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d 38 l; charset=iso-8
0090: 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e 61 859-1">.<meta na
00a0: 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20 63 me="Copyright" c
00b0: 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61 74 ontent="1999 Mat
00c0: 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34 20 t Newman / 2004
00d0: 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d 73 Starfish Systems
00e0: 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28 53 ">.<title>TLS (S
00f0: 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64 73 SL) Tcl Commands
0100: 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 3e </title>.</head>
0110: 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72 3d ..<body bgcolor=
0120: 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c 3e "#FFFFFF">..<dl>
0130: 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 . <dd><a href
0140: 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 ="#NAME">NAME</a
0150: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 64 3e >. <dl>..<dd>
0160: 3c 62 3e 74 6c 73 3c 2f 62 3e 20 2d 20 62 69 6e <b>tls</b> - bin
0170: 64 69 6e 67 20 74 6f 20 3c 62 3e 4f 70 65 6e 53 ding to <b>OpenS
0180: 53 4c 3c 2f 62 3e 20 74 6f 6f 6c 6b 69 74 2e 3c SL</b> toolkit.<
0190: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 /dd>. </dl>.
01a0: 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 </dd>. <dd
01b0: 3e 3c 61 20 68 72 65 66 3d 22 23 53 59 4e 4f 50 ><a href="#SYNOP
01c0: 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 SIS">SYNOPSIS</a
01d0: 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e > </dd>. <dd>
01e0: 3c 64 6c 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62 <dl>.. <dd><b
01f0: 3e 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 >package require
0200: 20 54 63 6c 3c 2f 62 3e 20 3c 65 6d 3e 3f 38 2e Tcl</b> <em>?8.
0210: 34 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 4?</em></dd>..
0220: 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 <dd><b>package
0230: 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f 62 3e require tls</b>
0240: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 74 3e 26 </dd>.. <dt>&
0250: 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 20 20 20 20 nbsp;</dt>..
0260: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 <dd><b>tls::init
0270: 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e </b> <em>?option
0280: 73 3f 3c 2f 65 6d 3e 20 3c 2f 64 64 3e 0a 09 20 s?</em> </dd>..
0290: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 <dd><b>tls::s
02a0: 6f 63 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f ocket</b> <em>?o
02b0: 70 74 69 6f 6e 73 3f 20 68 6f 73 74 20 70 6f 72 ptions? host por
02c0: 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 t</em></dd>..
02d0: 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 <dd><b>tls::soc
02e0: 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e 20 3f 2d 73 ket</b> <em> ?-s
02f0: 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f erver command? ?
0300: 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65 options? port</e
0310: 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64 m></dd>.. <dd
0320: 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 ><b>tls::handsha
0330: 6b 65 3c 2f 62 3e 20 3c 65 6d 3e 20 63 68 61 6e ke</b> <em> chan
0340: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 nel</em></dd>..
0350: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 <dd><b>tls::s
0360: 74 61 74 75 73 20 3c 2f 62 3e 20 3c 65 6d 3e 3f tatus </b> <em>?
0370: 2d 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c -local? channel<
0380: 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c /em></dd>.. <
0390: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 dd><b>tls::conne
03a0: 63 74 69 6f 6e 20 3c 2f 62 3e 20 3c 65 6d 3e 63 ction </b> <em>c
03b0: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e hannel</em></dd>
03c0: 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 .. <dd><b>tls
03d0: 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d ::import</b> <em
03e0: 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e >channel ?option
03f0: 73 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 s?</em></dd>..
0400: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e <dd><b>tls::un
0410: 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63 import</b> <em>c
0420: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e hannel</em></dd>
0430: 0a 09 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b .. <dt>
0440: 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 3e 3c </dt>.. <dd><
0450: 62 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f b>tls::ciphers</
0460: 62 3e 20 3c 65 6d 3e 3f 70 72 6f 74 6f 63 6f 6c b> <em>?protocol
0470: 3f 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 ? ?verbose? ?sup
0480: 70 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 64 64 ported?</em></dd
0490: 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c >.. <dd><b>tl
04a0: 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62 3e s::protocols</b>
04b0: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64 3e 3c </dd>.. <dd><
04c0: 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f b>tls::version</
04d0: 62 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 74 b></dd>.. <dt
04e0: 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 20 20 > </dt>..
04f0: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 64 69 <dd><b>tls::di
0500: 67 65 73 74 3c 2f 62 3e 20 3c 65 6d 3e 74 79 70 gest</b> <em>typ
0510: 65 20 3f 2d 62 69 6e 7c 2d 68 65 78 3f 20 3f 2d e ?-bin|-hex? ?-
0520: 6b 65 79 20 68 6d 61 63 5f 6b 65 79 3f 20 5b 2d key hmac_key? [-
0530: 66 69 6c 65 20 66 69 6c 65 6e 61 6d 65 20 7c 20 file filename |
0540: 2d 63 68 61 6e 20 63 68 61 6e 6e 65 6c 20 7c 20 -chan channel |
0550: 3f 2d 64 61 74 61 3f 20 64 61 74 61 5d 3c 2f 65 ?-data? data]</e
0560: 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64 m></dd>.. <dd
0570: 3e 3c 62 3e 74 6c 73 3a 3a 64 69 67 65 73 74 73 ><b>tls::digests
0580: 3c 2f 62 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c </b></dd>.. <
0590: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 6d 64 34 3c 2f dd><b>tls::md4</
05a0: 62 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e b> <em>data</em>
05b0: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64 3e 3c </dd>.. <dd><
05c0: 62 3e 74 6c 73 3a 3a 6d 64 35 3c 2f 62 3e 20 3c b>tls::md5</b> <
05d0: 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 3c 2f 64 64 em>data</em></dd
05e0: 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c >.. <dd><b>tl
05f0: 73 3a 3a 73 68 61 31 3c 2f 62 3e 20 3c 65 6d 3e s::sha1</b> <em>
0600: 64 61 74 61 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 data</em></dd>..
0610: 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a <dd><b>tls::
0620: 73 68 61 32 35 36 3c 2f 62 3e 20 3c 65 6d 3e 64 sha256</b> <em>d
0630: 61 74 61 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c ata</em></dd>..<
0640: 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 20 /dl>. </dd>.
0650: 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 <dd><a href="
0660: 23 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 #COMMANDS">COMMA
0670: 4e 44 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 NDS</a></dd>.
0680: 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 <dd><a href="#C
0690: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 ALLBACK OPTIONS"
06a0: 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e >CALLBACK OPTION
06b0: 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c S</a></dd>. <
06c0: 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 48 54 54 dd><a href="#HTT
06d0: 50 53 20 45 58 41 4d 50 4c 45 22 3e 48 54 54 50 PS EXAMPLE">HTTP
06e0: 53 20 45 58 41 4d 50 4c 45 3c 2f 61 3e 3c 2f 64 S EXAMPLE</a></d
06f0: 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 d>. <dd><a hr
0700: 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e 53 ef="#SEE ALSO">S
0710: 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 PECIAL CONSIDERA
0720: 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 TIONS</a></dd>.
0730: 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 <dd><a href="
0740: 23 53 45 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 #SEE ALSO">SEE A
0750: 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 3e 0a 3c 2f 64 LSO</a></dd>.</d
0760: 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 l>..<hr>..<h3><a
0770: 20 6e 61 6d 65 3d 22 4e 41 4d 45 22 3e 4e 41 4d name="NAME">NAM
0780: 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c E</a></h3>..<p><
0790: 73 74 72 6f 6e 67 3e 74 6c 73 3c 2f 73 74 72 6f strong>tls</stro
07a0: 6e 67 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f ng> - binding to
07b0: 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 53 4c <strong>OpenSSL
07c0: 3c 2f 73 74 72 6f 6e 67 3e 0a 74 6f 6f 6c 6b 69 </strong>.toolki
07d0: 74 2e 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e t.</p>..<h3><a n
07e0: 61 6d 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53 ame="SYNOPSIS">S
07f0: 59 4e 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e YNOPSIS</a></h3>
0800: 0a 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20 ..<p><b>package
0810: 72 65 71 75 69 72 65 20 54 63 6c 20 38 2e 35 3c require Tcl 8.5<
0820: 2f 62 3e 3c 62 72 3e 0a 3c 62 3e 70 61 63 6b 61 /b><br>.<b>packa
0830: 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f ge require tls</
0840: 62 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 b><br>.<br>.<a h
0850: 72 65 66 3d 22 23 74 6c 73 3a 3a 69 6e 69 74 22 ref="#tls::init"
0860: 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f 62 ><b>tls::init</b
0870: 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f > <i>?options?</
0880: 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 i></a><br>.<a hr
0890: 65 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b 65 74 ef="#tls::socket
08a0: 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 "><b>tls::socket
08b0: 3c 2f 62 3e 20 3c 69 3e 3f 6f 70 74 69 6f 6e 73 </b> <i>?options
08c0: 3f 20 68 6f 73 74 20 70 6f 72 74 3c 2f 69 3e 3c ? host port</i><
08d0: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c br>.<a href="#tl
08e0: 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c s::socket"><b>tl
08f0: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 69 s::socket</b> <i
0900: 3e 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e >?-server comman
0910: 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 d? ?options? por
0920: 74 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 t</i></a><br>.<a
0930: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 74 61 href="#tls::sta
0940: 74 75 73 22 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 tus"><b>tls::sta
0950: 74 75 73 3c 2f 62 3e 20 3c 69 3e 3f 2d 6c 6f 63 tus</b> <i>?-loc
0960: 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c al? channel</i><
0970: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d /a><br>.<a href=
0980: 22 23 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f "#tls::connectio
0990: 6e 22 3e 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 n"><b>tls::conne
09a0: 63 74 69 6f 6e 3c 2f 62 3e 20 3c 69 3e 63 68 61 ction</b> <i>cha
09b0: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e nnel</i></a><br>
09c0: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a .<a href="#tls::
09d0: 68 61 6e 64 73 68 61 6b 65 22 3e 3c 62 3e 74 6c handshake"><b>tl
09e0: 73 3a 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 62 3e s::handshake</b>
09f0: 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c <i>channel</i><
0a00: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d /a><br>.<a href=
0a10: 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c "#tls::import"><
0a20: 62 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62 b>tls::import</b
0a30: 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 > <i>channel ?op
0a40: 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 tions?</i></a><b
0a50: 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 r>.<a href="#tls
0a60: 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 ::unimport"><b>t
0a70: 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 3c 2f 62 3e ls::unimport</b>
0a80: 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 3e 3c <i>channel</i><
0a90: 2f 61 3e 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 /a><br>.<br>.<a
0aa0: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 63 69 70 68 href="#tls::ciph
0ab0: 65 72 73 22 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70 ers"><b>tls::cip
0ac0: 68 65 72 73 3c 2f 62 3e 20 3c 69 3e 3f 70 72 6f hers</b> <i>?pro
0ad0: 74 6f 63 6f 6c 3f 20 3f 76 65 72 62 6f 73 65 3f tocol? ?verbose?
0ae0: 20 3f 73 75 70 70 6f 72 74 65 64 3f 3c 2f 69 3e ?supported?</i>
0af0: 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 </a><br>.<a href
0b00: 3d 22 23 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c ="#tls::protocol
0b10: 73 22 3e 3c 62 3e 74 6c 73 3a 3a 70 72 6f 74 6f s"><b>tls::proto
0b20: 63 6f 6c 73 3c 2f 62 3e 3c 2f 61 3e 3c 62 72 3e cols</b></a><br>
0b30: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a .<a href="#tls::
0b40: 76 65 72 73 69 6f 6e 22 3e 3c 62 3e 74 6c 73 3a version"><b>tls:
0b50: 3a 76 65 72 73 69 6f 6e 3c 2f 62 3e 3c 2f 61 3e :version</b></a>
0b60: 3c 62 72 3e 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 <br>.<br>.<a hre
0b70: 66 3d 22 23 74 6c 73 3a 3a 64 69 67 65 73 74 22 f="#tls::digest"
0b80: 3e 3c 62 3e 74 6c 73 3a 3a 64 69 67 65 73 74 3c ><b>tls::digest<
0b90: 2f 62 3e 20 3c 69 3e 74 79 70 65 20 3f 2d 62 69 /b> <i>type ?-bi
0ba0: 6e 7c 2d 68 65 78 3f 20 3f 2d 6b 65 79 20 68 6d n|-hex? ?-key hm
0bb0: 61 63 5f 6b 65 79 3f 20 5b 2d 66 69 6c 65 20 66 ac_key? [-file f
0bc0: 69 6c 65 6e 61 6d 65 20 7c 20 2d 63 68 61 6e 20 ilename | -chan
0bd0: 63 68 61 6e 6e 65 6c 20 7c 20 3f 2d 64 61 74 61 channel | ?-data
0be0: 3f 20 64 61 74 61 5d 3c 2f 69 3e 3c 2f 61 3e 3c ? data]</i></a><
0bf0: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c br>.<a href="#tl
0c00: 73 3a 3a 64 69 67 65 73 74 73 22 3e 3c 62 3e 74 s::digests"><b>t
0c10: 6c 73 3a 3a 64 69 67 65 73 74 73 3c 2f 62 3e 3c ls::digests</b><
0c20: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d /a><br>.<a href=
0c30: 22 23 74 6c 73 3a 3a 6d 64 34 22 3e 3c 62 3e 74 "#tls::md4"><b>t
0c40: 6c 73 3a 3a 6d 64 34 3c 2f 62 3e 20 3c 69 3e 64 ls::md4</b> <i>d
0c50: 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a ata</i></a><br>.
0c60: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 6d <a href="#tls::m
0c70: 64 35 22 3e 3c 62 3e 74 6c 73 3a 3a 6d 64 35 3c d5"><b>tls::md5<
0c80: 2f 62 3e 20 3c 69 3e 64 61 74 61 3c 2f 69 3e 3c /b> <i>data</i><
0c90: 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d /a><br>.<a href=
0ca0: 22 23 74 6c 73 3a 3a 73 68 61 31 22 3e 3c 62 3e "#tls::sha1"><b>
0cb0: 74 6c 73 3a 3a 73 68 61 31 3c 2f 62 3e 20 3c 69 tls::sha1</b> <i
0cc0: 3e 64 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 >data</i></a><br
0cd0: 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a >.<a href="#tls:
0ce0: 3a 73 68 61 32 35 36 22 3e 3c 62 3e 74 6c 73 3a :sha256"><b>tls:
0cf0: 3a 73 68 61 32 35 36 3c 2f 62 3e 20 3c 69 3e 64 :sha256</b> <i>d
0d00: 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a ata</i></a><br>.
0d10: 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d </p>..<h3><a nam
0d20: 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e 22 3e e="DESCRIPTION">
0d30: 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e 3c DESCRIPTION</a><
0d40: 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73 20 65 78 /h3>..<p>This ex
0d50: 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64 65 73 tension provides
0d60: 20 61 20 67 65 6e 65 72 69 63 20 62 69 6e 64 69 a generic bindi
0d70: 6e 67 20 74 6f 20 3c 61 0a 68 72 65 66 3d 22 68 ng to <a.href="h
0d80: 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 ttp://www.openss
0d90: 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e 53 53 4c 3c l.org/">OpenSSL<
0da0: 2f 61 3e 2c 20 75 74 69 6c 69 7a 69 6e 67 20 74 /a>, utilizing t
0db0: 68 65 0a 3c 73 74 72 6f 6e 67 3e 54 63 6c 5f 53 he.<strong>Tcl_S
0dc0: 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73 74 72 tackChannel</str
0dd0: 6f 6e 67 3e 0a 41 50 49 20 66 6f 72 20 54 63 6c ong>.API for Tcl
0de0: 20 38 2e 34 20 61 6e 64 20 68 69 67 68 65 72 2e 8.4 and higher.
0df0: 20 54 68 65 20 73 6f 63 6b 65 74 73 20 62 65 68 The sockets beh
0e00: 61 76 65 20 65 78 61 63 74 6c 79 20 74 68 65 20 ave exactly the
0e10: 73 61 6d 65 0a 61 73 20 63 68 61 6e 6e 65 6c 73 same.as channels
0e20: 20 63 72 65 61 74 65 64 20 75 73 69 6e 67 20 54 created using T
0e30: 63 6c 27 73 20 62 75 69 6c 74 2d 69 6e 20 3c 73 cl's built-in <s
0e40: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 trong>socket</st
0e50: 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 20 77 69 rong>.command wi
0e60: 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20 6f 70 th additional op
0e70: 74 69 6f 6e 73 20 66 6f 72 20 63 6f 6e 74 72 6f tions for contro
0e80: 6c 6c 69 6e 67 20 74 68 65 20 53 53 4c 20 73 65 lling the SSL se
0e90: 73 73 69 6f 6e 2e 0a 3c 2f 70 3e 0a 0a 3c 68 33 ssion..</p>..<h3
0ea0: 3e 3c 61 20 6e 61 6d 65 3d 22 43 4f 4d 4d 41 4e ><a name="COMMAN
0eb0: 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e DS">COMMANDS</a>
0ec0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 79 70 69 63 61 </h3>..<p>Typica
0ed0: 6c 6c 79 20 6f 6e 65 20 77 6f 75 6c 64 20 75 73 lly one would us
0ee0: 65 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 74 6c e the <strong>tl
0ef0: 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 73 74 72 6f s::socket </stro
0f00: 6e 67 3e 63 6f 6d 6d 61 6e 64 0a 77 68 69 63 68 ng>command.which
0f10: 20 70 72 6f 76 69 64 65 73 20 63 6f 6d 70 61 74 provides compat
0f20: 69 62 69 6c 69 74 79 20 77 69 74 68 20 74 68 65 ibility with the
0f30: 20 6e 61 74 69 76 65 20 54 63 6c 20 3c 73 74 72 native Tcl <str
0f40: 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 6f ong>socket</stro
0f50: 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 2e 20 49 6e 20 ng>.command. In
0f60: 73 75 63 68 20 63 61 73 65 73 20 3c 73 74 72 6f such cases <stro
0f70: 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f ng>tls::import</
0f80: 73 74 72 6f 6e 67 3e 20 73 68 6f 75 6c 64 20 6e strong> should n
0f90: 6f 74 20 62 65 0a 75 73 65 64 20 64 69 72 65 63 ot be.used direc
0fa0: 74 6c 79 2e 3c 2f 70 3e 0a 0a 3c 64 6c 3e 0a 20 tly.</p>..<dl>.
0fb0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
0fc0: 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c tls::init"><b>tl
0fd0: 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69 3e 3f s::init </b><i>?
0fe0: 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e options?</i></a>
0ff0: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 4f 70 </dt>. <dd>Op
1000: 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 20 tional function
1010: 74 6f 20 73 65 74 20 74 68 65 20 64 65 66 61 75 to set the defau
1020: 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65 64 20 lt options used
1030: 62 79 0a 09 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a by..<strong>tls:
1040: 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e :socket</strong>
1050: 2e 20 49 66 20 79 6f 75 20 63 61 6c 6c 20 3c 73 . If you call <s
1060: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 trong>tls::impor
1070: 74 3c 2f 73 74 72 6f 6e 67 3e 0a 09 64 69 72 65 t</strong>..dire
1080: 63 74 6c 79 20 74 68 69 73 20 72 6f 75 74 69 6e ctly this routin
1090: 65 20 68 61 73 20 6e 6f 20 65 66 66 65 63 74 2e e has no effect.
10a0: 20 41 6e 79 20 6f 66 20 74 68 65 20 6f 70 74 69 Any of the opti
10b0: 6f 6e 73 0a 09 74 68 61 74 20 3c 73 74 72 6f 6e ons..that <stron
10c0: 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 g>tls::socket</s
10d0: 74 72 6f 6e 67 3e 20 61 63 63 65 70 74 73 20 63 trong> accepts c
10e0: 61 6e 20 62 65 20 73 65 74 0a 09 75 73 69 6e 67 an be set..using
10f0: 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c 20 74 this command, t
1100: 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75 6c 64 hough you should
1110: 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70 74 69 limit your opti
1120: 6f 6e 73 0a 09 74 6f 20 6f 6e 6c 79 20 54 4c 53 ons..to only TLS
1130: 20 72 65 6c 61 74 65 64 20 6f 6e 65 73 2e 3c 2f related ones.</
1140: 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 dd>. <dt>&nbs
1150: 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e p;</dt>. <dt>
1160: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 6f <a name="tls::so
1170: 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f cket"><b>tls::so
1180: 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f 6f 70 cket </b><em>?op
1190: 74 69 6f 6e 73 3f 0a 09 68 6f 73 74 20 70 6f 72 tions?..host por
11a0: 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a t</em></a></dt>.
11b0: 20 20 20 20 3c 64 74 3e 3c 62 3e 74 6c 73 3a 3a <dt><b>tls::
11c0: 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e 20 3f socket</b><em> ?
11d0: 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f -server command?
11e0: 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c ?options? port<
11f0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 /em></dt>. <d
1200: 64 3e 54 68 69 73 20 69 73 20 61 20 68 65 6c 70 d>This is a help
1210: 65 72 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 er function that
1220: 20 75 74 69 6c 69 7a 65 73 20 74 68 65 20 75 6e utilizes the un
1230: 64 65 72 6c 79 69 6e 67 0a 09 63 6f 6d 6d 61 6e derlying..comman
1240: 64 73 20 28 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a ds (<strong>tls:
1250: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e :import</strong>
1260: 29 2e 20 49 74 20 62 65 68 61 76 65 73 0a 09 65 ). It behaves..e
1270: 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 xactly the same
1280: 61 73 20 74 68 65 20 6e 61 74 69 76 65 20 54 63 as the native Tc
1290: 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 l <strong>socket
12a0: 3c 2f 73 74 72 6f 6e 67 3e 0a 09 63 6f 6d 6d 61 </strong>..comma
12b0: 6e 64 20 65 78 63 65 70 74 20 74 68 61 74 20 74 nd except that t
12c0: 68 65 20 6f 70 74 69 6f 6e 73 20 63 61 6e 20 69 he options can i
12d0: 6e 63 6c 75 64 65 20 61 6e 79 20 6f 66 20 74 68 nclude any of th
12e0: 65 0a 09 61 70 70 6c 69 63 61 62 6c 65 20 3c 61 e..applicable <a
12f0: 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 69 6d 70 href="#tls::imp
1300: 6f 72 74 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 ort"><strong>tls
1310: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e :import</strong>
1320: 3c 2f 61 3e 0a 09 6f 70 74 69 6f 6e 73 20 77 69 </a>..options wi
1330: 74 68 20 6f 6e 65 20 61 64 64 69 74 69 6f 6e 61 th one additiona
1340: 6c 20 6f 70 74 69 6f 6e 3a 0a 3c 62 6c 6f 63 6b l option:.<block
1350: 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c 3e 0a quote>. <dl>.
1360: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 75 .<dt><strong>-au
1370: 74 6f 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74 toservername</st
1380: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f rong> <em>bool</
1390: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 41 75 em></dt>..<dd>Au
13a0: 74 6f 6d 61 74 69 63 61 6c 6c 79 20 73 65 6e 64 tomatically send
13b0: 20 74 68 65 20 2d 73 65 72 76 65 72 6e 61 6d 65 the -servername
13c0: 20 61 73 20 74 68 65 20 3c 65 6d 3e 68 6f 73 74 as the <em>host
13d0: 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 0a 09 </em> argument..
13e0: 20 20 20 20 28 64 65 66 61 75 6c 74 20 69 73 20 (default is
13f0: 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c <em>false</em>)<
1400: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c /dd>. </dl>.<
1410: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 /blockquote>..
1420: 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 <dt><a name="t
1430: 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 ls::import"><b>t
1440: 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c ls::import </b><
1450: 69 3e 63 68 61 6e 6e 65 6c 0a 09 3f 6f 70 74 69 i>channel..?opti
1460: 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 ons?</i></a></dt
1470: 3e 0a 20 20 20 20 3c 64 64 3e 53 53 4c 2d 65 6e >. <dd>SSL-en
1480: 61 62 6c 65 20 61 20 72 65 67 75 6c 61 72 20 54 able a regular T
1490: 63 6c 20 63 68 61 6e 6e 65 6c 20 2d 20 69 74 20 cl channel - it
14a0: 6e 65 65 64 20 6e 6f 74 20 62 65 20 61 0a 09 73 need not be a..s
14b0: 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73 74 20 ocket, but must
14c0: 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72 65 63 provide bi-direc
14d0: 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41 6c 73 tional flow. Als
14e0: 6f 0a 09 73 65 74 74 69 6e 67 20 73 65 73 73 69 o..setting sessi
14f0: 6f 6e 20 70 61 72 61 6d 65 74 65 72 73 20 66 6f on parameters fo
1500: 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e r SSL handshake.
1510: 3c 2f 64 64 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f </dd>..<blockquo
1520: 74 65 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 te>. <dl>..<d
1530: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 6c 70 6e 3c t><strong>-alpn<
1540: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 /strong> <em>lis
1550: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 t</em></dt>..<dd
1560: 3e 4c 69 73 74 20 6f 66 20 70 72 6f 74 6f 63 6f >List of protoco
1570: 6c 73 20 74 6f 20 6f 66 66 65 72 20 64 75 72 69 ls to offer duri
1580: 6e 67 20 41 70 70 6c 69 63 61 74 69 6f 6e 2d 4c ng Application-L
1590: 61 79 65 72 0a 09 20 20 20 20 50 72 6f 74 6f 63 ayer.. Protoc
15a0: 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 ol Negotiation (
15b0: 41 4c 50 4e 29 2e 20 46 6f 72 20 65 78 61 6d 70 ALPN). For examp
15c0: 6c 65 3a 20 3c 65 6d 3e 68 32 3c 2f 65 6d 3e 20 le: <em>h2</em>
15d0: 61 6e 64 0a 09 20 20 20 20 3c 65 6d 3e 68 74 74 and.. <em>htt
15e0: 70 2f 31 2e 31 3c 2f 65 6d 3e 2c 20 62 75 74 20 p/1.1</em>, but
15f0: 6e 6f 74 20 3c 65 6d 3e 68 33 3c 2f 65 6d 3e 20 not <em>h3</em>
1600: 6f 72 20 3c 65 6d 3e 71 75 69 63 3c 2f 65 6d 3e or <em>quic</em>
1610: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
1620: 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f 73 74 72 6f ong>-cadir</stro
1630: 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c 2f 65 6d 3e ng> <em>dir</em>
1640: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 74 20 74 </dt>..<dd>Set t
1650: 68 65 20 43 41 20 63 65 72 74 69 66 69 63 61 74 he CA certificat
1660: 65 73 20 70 61 74 68 2e 20 54 68 65 20 64 65 66 es path. The def
1670: 61 75 6c 74 20 64 69 72 65 63 74 6f 72 79 20 69 ault directory i
1680: 73 20 70 6c 61 74 66 6f 72 6d 0a 09 20 20 20 20 s platform..
1690: 73 70 65 63 69 66 69 63 20 61 6e 64 20 63 61 6e specific and can
16a0: 20 62 65 20 73 65 74 20 61 74 20 63 6f 6d 70 69 be set at compi
16b0: 6c 65 20 74 69 6d 65 2e 20 54 68 69 73 20 63 61 le time. This ca
16c0: 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e 0a n be overridden.
16d0: 09 20 20 20 20 76 69 61 20 74 68 65 20 3c 62 3e . via the <b>
16e0: 53 53 4c 5f 43 45 52 54 5f 44 49 52 3c 2f 62 3e SSL_CERT_DIR</b>
16f0: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 environment var
1700: 69 61 62 6c 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 iable.</dd>..<dt
1710: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69 6c 65 ><strong>-cafile
1720: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 69 </strong><em>fi
1730: 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e lename</em></dt>
1740: 0a 09 3c 64 64 3e 53 65 74 20 74 68 65 20 63 65 ..<dd>Set the ce
1750: 72 74 69 66 69 63 61 74 65 20 61 75 74 68 6f 72 rtificate author
1760: 69 74 79 20 28 43 41 29 20 63 65 72 74 69 66 69 ity (CA) certifi
1770: 63 61 74 65 73 20 66 69 6c 65 2e 20 54 68 65 20 cates file. The
1780: 64 65 66 61 75 6c 74 0a 09 20 20 20 20 69 73 20 default.. is
1790: 74 68 65 20 63 65 72 74 2e 70 65 6d 20 66 69 6c the cert.pem fil
17a0: 65 20 69 6e 20 74 68 65 20 4f 70 73 6e 53 53 4c e in the OpsnSSL
17b0: 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68 69 73 directory. This
17c0: 20 63 61 6e 20 61 6c 73 6f 20 62 65 0a 09 20 20 can also be..
17d0: 20 20 6f 76 65 72 72 69 64 64 65 6e 20 76 69 61 overridden via
17e0: 20 74 68 65 20 3c 62 3e 53 53 4c 5f 43 45 52 54 the <b>SSL_CERT
17f0: 5f 46 49 4c 45 3c 2f 62 3e 20 65 6e 76 69 72 6f _FILE</b> enviro
1800: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 2e 3c nment variable.<
1810: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
1820: 67 3e 2d 63 65 72 74 66 69 6c 65 3c 2f 73 74 72 g>-certfile</str
1830: 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d ong> <em>filenam
1840: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 e</em></dt>..<dd
1850: 3e 53 70 65 63 69 66 79 20 74 68 65 20 66 69 6c >Specify the fil
1860: 65 6e 61 6d 65 20 77 69 74 68 20 74 68 65 20 63 ename with the c
1870: 65 72 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 ertificate to us
1880: 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 e.</dd>..<dt><st
1890: 72 6f 6e 67 3e 2d 63 65 72 74 3c 2f 73 74 72 6f rong>-cert</stro
18a0: 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 ng> <em>filename
18b0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
18c0: 53 70 65 63 69 66 79 20 74 68 65 20 63 6f 6e 74 Specify the cont
18d0: 65 6e 74 73 20 6f 66 20 61 20 63 65 72 74 69 66 ents of a certif
18e0: 69 63 61 74 65 20 74 6f 20 75 73 65 2c 20 61 73 icate to use, as
18f0: 20 61 20 44 45 52 0a 09 20 20 20 20 65 6e 63 6f a DER.. enco
1900: 64 65 64 20 62 69 6e 61 72 79 20 76 61 6c 75 65 ded binary value
1910: 20 28 58 2e 35 30 39 20 44 45 52 29 2e 3c 2f 64 (X.509 DER).</d
1920: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
1930: 2d 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e -cipher</strong>
1940: 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e <em>string</em>
1950: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 </dt>..<dd>List
1960: 6f 66 20 63 69 70 68 65 72 73 20 74 6f 20 75 73 of ciphers to us
1970: 65 2e 20 53 74 72 69 6e 67 20 69 73 20 61 20 63 e. String is a c
1980: 6f 6c 6f 6e 20 28 22 3a 22 29 20 73 65 70 61 72 olon (":") separ
1990: 61 74 65 64 20 6c 69 73 74 0a 09 20 20 20 20 6f ated list.. o
19a0: 66 20 63 69 70 68 65 72 73 20 6f 72 20 63 69 70 f ciphers or cip
19b0: 68 65 72 20 73 75 69 74 65 73 2e 20 43 69 70 68 her suites. Ciph
19c0: 65 72 20 73 75 69 74 65 73 20 63 61 6e 20 62 65 er suites can be
19d0: 20 63 6f 6d 62 69 6e 65 64 0a 09 20 20 20 20 75 combined.. u
19e0: 73 69 6e 67 20 74 68 65 20 3c 62 3e 2b 3c 2f 62 sing the <b>+</b
19f0: 3e 20 63 68 61 72 61 63 74 65 72 2e 20 50 72 65 > character. Pre
1a00: 66 69 78 65 73 20 63 61 6e 20 62 65 20 75 73 65 fixes can be use
1a10: 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74 6c 79 d to permanently
1a20: 0a 09 20 20 20 20 72 65 6d 6f 76 65 20 28 22 21 .. remove ("!
1a30: 22 29 2c 20 64 65 6c 65 74 65 20 28 22 2d 22 29 "), delete ("-")
1a40: 2c 20 6f 72 20 6d 6f 76 65 20 61 20 63 79 70 68 , or move a cyph
1a50: 65 72 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 er to the end of
1a60: 0a 09 20 20 20 20 74 68 65 20 6c 69 73 74 20 28 .. the list (
1a70: 22 2b 22 29 2e 20 4b 65 79 77 6f 72 64 73 20 3c "+"). Keywords <
1a80: 62 3e 40 53 54 52 45 4e 47 54 48 3c 2f 62 3e 20 b>@STRENGTH</b>
1a90: 28 73 6f 72 74 20 62 79 20 61 6c 67 6f 72 69 74 (sort by algorit
1aa0: 68 6d 0a 09 20 20 20 20 6b 65 79 20 6c 65 6e 67 hm.. key leng
1ab0: 74 68 29 2c 20 3c 62 3e 40 53 45 43 4c 45 56 45 th), <b>@SECLEVE
1ac0: 4c 3d 3c 2f 62 3e 3c 69 3e 6e 3c 2f 69 3e 20 28 L=</b><i>n</i> (
1ad0: 73 65 74 20 73 65 63 75 72 69 74 79 20 6c 65 76 set security lev
1ae0: 65 6c 20 74 6f 0a 09 20 20 20 20 6e 29 2c 20 61 el to.. n), a
1af0: 6e 64 20 3c 62 3e 44 45 46 41 55 4c 54 3c 2f 62 nd <b>DEFAULT</b
1b00: 3e 20 28 75 73 65 20 64 65 66 61 75 6c 74 20 63 > (use default c
1b10: 69 70 68 65 72 20 6c 69 73 74 2c 20 61 74 20 73 ipher list, at s
1b20: 74 61 72 74 20 6f 6e 6c 79 29 0a 09 20 20 20 20 tart only)..
1b30: 63 61 6e 20 61 6c 73 6f 20 62 65 20 73 70 65 63 can also be spec
1b40: 69 66 69 65 64 2e 20 53 65 65 20 4f 70 65 6e 53 ified. See OpenS
1b50: 53 4c 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e SL documentation
1b60: 20 66 6f 72 20 74 68 65 20 66 75 6c 6c 0a 09 20 for the full..
1b70: 20 20 20 6c 69 73 74 20 6f 66 20 76 61 6c 69 64 list of valid
1b80: 20 76 61 6c 75 65 73 2e 20 28 54 4c 53 20 31 2e values. (TLS 1.
1b90: 32 20 61 6e 64 20 65 61 72 6c 69 65 72 20 6f 6e 2 and earlier on
1ba0: 6c 79 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 ly)</dd>..<dt><s
1bb0: 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72 73 75 69 trong>-ciphersui
1bc0: 74 65 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d tes</strong> <em
1bd0: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 >string</em></dt
1be0: 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 63 >..<dd>List of c
1bf0: 69 70 68 65 72 20 73 75 69 74 65 73 20 74 6f 20 ipher suites to
1c00: 75 73 65 2e 20 53 74 72 69 6e 67 20 69 73 20 61 use. String is a
1c10: 20 63 6f 6c 6f 6e 20 28 22 3a 22 29 0a 09 20 20 colon (":")..
1c20: 20 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74 separated list
1c30: 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74 65 of cipher suite
1c40: 20 6e 61 6d 65 73 2e 20 28 54 4c 53 20 31 2e 33 names. (TLS 1.3
1c50: 20 6f 6e 6c 79 29 3c 2f 64 64 3e 0a 09 3c 64 74 only)</dd>..<dt
1c60: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e ><strong>-comman
1c70: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 d</strong> <em>c
1c80: 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 allback</em></dt
1c90: 3e 0a 09 3c 64 64 3e 43 61 6c 6c 62 61 63 6b 20 >..<dd>Callback
1ca0: 74 6f 20 69 6e 76 6f 6b 65 20 61 74 20 73 65 76 to invoke at sev
1cb0: 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 75 72 69 eral points duri
1cc0: 6e 67 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 ng the handshake
1cd0: 2e 0a 09 20 20 20 20 54 68 69 73 20 69 73 20 75 ... This is u
1ce0: 73 65 64 20 74 6f 20 70 61 73 73 20 65 72 72 6f sed to pass erro
1cf0: 72 73 20 61 6e 64 20 74 72 61 63 69 6e 67 20 69 rs and tracing i
1d00: 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e 64 0a nformation, and.
1d10: 09 20 20 20 20 69 74 20 63 61 6e 20 61 6c 6c 6f . it can allo
1d20: 77 20 54 63 6c 20 73 63 72 69 70 74 73 20 74 6f w Tcl scripts to
1d30: 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72 20 6f perform their o
1d40: 77 6e 20 63 65 72 74 69 66 69 63 61 74 65 0a 09 wn certificate..
1d50: 20 20 20 20 76 61 6c 69 64 61 74 69 6f 6e 20 69 validation i
1d60: 6e 20 70 6c 61 63 65 20 6f 66 20 74 68 65 20 64 n place of the d
1d70: 65 66 61 75 6c 74 20 76 61 6c 69 64 61 74 69 6f efault validatio
1d80: 6e 20 70 72 6f 76 69 64 65 64 20 62 79 0a 09 20 n provided by..
1d90: 20 20 20 4f 70 65 6e 53 53 4c 2e 20 53 65 65 20 OpenSSL. See
1da0: 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 <a href="#CALLBA
1db0: 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c CK OPTIONS">CALL
1dc0: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e BACK OPTIONS</a>
1dd0: 0a 09 20 20 20 20 66 6f 72 20 66 75 72 74 68 65 .. for furthe
1de0: 72 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 r discussion.</d
1df0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
1e00: 2d 64 68 70 61 72 61 6d 73 20 3c 2f 73 74 72 6f -dhparams </stro
1e10: 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c ng><em>filename<
1e20: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 /em></dt>..<dd>S
1e30: 70 65 63 69 66 79 20 74 68 65 20 44 69 66 66 69 pecify the Diffi
1e40: 65 2d 48 65 6c 6c 6d 61 6e 20 70 61 72 61 6d 65 e-Hellman parame
1e50: 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64 3e 0a ters file.</dd>.
1e60: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 .<dt><strong>-ke
1e70: 79 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c yfile</strong> <
1e80: 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e em>filename</em>
1e90: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 </dt>..<dd>Speci
1ea0: 66 79 20 74 68 65 20 70 72 69 76 61 74 65 20 6b fy the private k
1eb0: 65 79 20 66 69 6c 65 2e 20 28 64 65 66 61 75 6c ey file. (defaul
1ec0: 74 20 69 73 0a 09 20 20 20 20 76 61 6c 75 65 20 t is.. value
1ed0: 6f 66 20 2d 63 65 72 74 66 69 6c 65 29 3c 2f 64 of -certfile)</d
1ee0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
1ef0: 2d 6b 65 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 -key</strong> <e
1f00: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c m>filename</em><
1f10: 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 /dt>..<dd>Specif
1f20: 79 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 y the private ke
1f30: 79 20 74 6f 20 75 73 65 20 61 73 20 61 20 44 45 y to use as a DE
1f40: 52 20 65 6e 63 6f 64 65 64 20 76 61 6c 75 65 20 R encoded value
1f50: 28 50 4b 43 53 23 31 20 44 45 52 29 3c 2f 64 64 (PKCS#1 DER)</dd
1f60: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d >..<dt><strong>-
1f70: 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c model</strong> <
1f80: 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c em>channel</em><
1f90: 2f 64 74 3e 0a 09 3c 64 64 3e 46 6f 72 63 65 20 /dt>..<dd>Force
1fa0: 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f 20 this channel to
1fb0: 73 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 3c share the same <
1fc0: 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c 5f 43 em><strong>SSL_C
1fd0: 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65 6d 3e TX</strong></em>
1fe0: 0a 09 20 20 20 20 73 74 72 75 63 74 75 72 65 20 .. structure
1ff0: 61 73 20 74 68 65 20 73 70 65 63 69 66 69 65 64 as the specified
2000: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d <em>channel</em
2010: 3e 2c 20 61 6e 64 0a 09 20 20 20 20 74 68 65 72 >, and.. ther
2020: 65 66 6f 72 65 20 73 68 61 72 65 20 63 61 6c 6c efore share call
2030: 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64 3e 0a backs etc.</dd>.
2040: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 .<dt><strong>-pa
2050: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 ssword</strong>
2060: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d <em>callback</em
2070: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 61 6c 6c ></dt>..<dd>Call
2080: 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 77 back to invoke w
2090: 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 hen OpenSSL need
20a0: 73 20 74 6f 20 6f 62 74 61 69 6e 20 61 20 70 61 s to obtain a pa
20b0: 73 73 77 6f 72 64 2c 0a 09 20 20 20 20 74 79 70 ssword,.. typ
20c0: 69 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f 63 6b ically to unlock
20d0: 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 the private key
20e0: 20 6f 66 20 61 20 63 65 72 74 69 66 69 63 61 74 of a certificat
20f0: 65 2e 20 54 68 65 0a 09 20 20 20 20 63 61 6c 6c e. The.. call
2100: 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 back should retu
2110: 72 6e 20 61 20 73 74 72 69 6e 67 20 77 68 69 63 rn a string whic
2120: 68 20 72 65 70 72 65 73 65 6e 74 73 20 74 68 65 h represents the
2130: 20 70 61 73 73 77 6f 72 64 0a 09 20 20 20 20 74 password.. t
2140: 6f 20 62 65 20 75 73 65 64 2e 20 53 65 65 20 3c o be used. See <
2150: 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 a href="#CALLBAC
2160: 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 K OPTIONS">CALLB
2170: 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 0a ACK OPTIONS</a>.
2180: 09 20 20 20 20 66 6f 72 20 66 75 72 74 68 65 72 . for further
2190: 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f 64 64 discussion.</dd
21a0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d >..<dt><strong>-
21b0: 70 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65 3c 2f post_handshake</
21c0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c strong> <em>bool
21d0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
21e0: 41 6c 6c 6f 77 20 70 6f 73 74 2d 68 61 6e 64 73 Allow post-hands
21f0: 68 61 6b 65 20 74 69 63 6b 65 74 20 75 70 64 61 hake ticket upda
2200: 74 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c tes.</dd>..<dt><
2210: 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 20 strong>-request
2220: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f </strong><em>boo
2230: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 l</em></dt>..<dd
2240: 3e 52 65 71 75 65 73 74 20 61 20 63 65 72 74 69 >Request a certi
2250: 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 ficate from peer
2260: 20 64 75 72 69 6e 67 20 53 53 4c 20 68 61 6e 64 during SSL hand
2270: 73 68 61 6b 65 2e 0a 09 20 20 20 20 28 64 65 66 shake... (def
2280: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 ault is <em>true
2290: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 </em>)</dd>..<dt
22a0: 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 ><strong>-requir
22b0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 e</strong> <em>b
22c0: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ool</em></dt>..<
22d0: 64 64 3e 52 65 71 75 69 72 65 20 61 20 76 61 6c dd>Require a val
22e0: 69 64 20 63 65 72 74 69 66 69 63 61 74 65 20 66 id certificate f
22f0: 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67 20 rom peer during
2300: 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 0a 09 SSL handshake...
2310: 20 20 20 20 49 66 20 74 68 69 73 20 69 73 20 73 If this is s
2320: 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68 65 6e et to true, then
2330: 20 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 <strong>-reques
2340: 74 3c 2f 73 74 72 6f 6e 67 3e 20 6d 75 73 74 0a t</strong> must.
2350: 09 20 20 20 20 61 6c 73 6f 20 62 65 20 73 65 74 . also be set
2360: 20 74 6f 20 74 72 75 65 2e 20 28 64 65 66 61 75 to true. (defau
2370: 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c lt is <em>false<
2380: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e /em>)</dd>..<dt>
2390: 3c 73 74 72 6f 6e 67 3e 2d 73 65 63 75 72 69 74 <strong>-securit
23a0: 79 6c 65 76 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 ylevel</strong>
23b0: 3c 65 6d 3e 69 6e 74 65 67 65 72 3c 2f 65 6d 3e <em>integer</em>
23c0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 74 20 73 </dt>..<dd>Set s
23d0: 65 63 75 72 69 74 79 20 6c 65 76 65 6c 2e 20 4d ecurity level. M
23e0: 75 73 74 20 62 65 20 30 20 74 6f 20 35 2e 20 54 ust be 0 to 5. T
23f0: 68 65 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 he security leve
2400: 6c 20 61 66 66 65 63 74 73 0a 09 20 20 20 20 63 l affects.. c
2410: 69 70 68 65 72 20 73 75 69 74 65 20 65 6e 63 72 ipher suite encr
2420: 79 70 74 69 6f 6e 20 61 6c 67 6f 72 69 74 68 6d yption algorithm
2430: 73 2c 20 73 75 70 70 6f 72 74 65 64 20 45 43 43 s, supported ECC
2440: 20 63 75 72 76 65 73 2c 0a 09 20 20 20 20 73 75 curves,.. su
2450: 70 70 6f 72 74 65 64 20 73 69 67 6e 61 74 75 72 pported signatur
2460: 65 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20 44 48 e algorithms, DH
2470: 20 70 61 72 61 6d 65 74 65 72 20 73 69 7a 65 73 parameter sizes
2480: 2c 20 63 65 72 74 69 66 69 63 61 74 65 0a 09 20 , certificate..
2490: 20 20 20 6b 65 79 20 73 69 7a 65 73 20 61 6e 64 key sizes and
24a0: 20 73 69 67 6e 61 74 75 72 65 20 61 6c 67 6f 72 signature algor
24b0: 69 74 68 6d 73 2e 20 54 68 65 20 64 65 66 61 75 ithms. The defau
24c0: 6c 74 20 69 73 20 31 2e 0a 09 20 20 20 20 4c 65 lt is 1... Le
24d0: 76 65 6c 20 33 20 61 6e 64 20 68 69 67 68 65 72 vel 3 and higher
24e0: 20 64 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 disable support
24f0: 20 66 6f 72 20 73 65 73 73 69 6f 6e 20 74 69 63 for session tic
2500: 6b 65 74 73 20 61 6e 64 20 6f 6e 6c 79 0a 09 20 kets and only..
2510: 20 20 20 61 63 63 65 70 74 20 63 69 70 68 65 72 accept cipher
2520: 20 73 75 69 74 65 73 20 74 68 61 74 20 70 72 6f suites that pro
2530: 76 69 64 65 20 66 6f 72 77 61 72 64 20 73 65 63 vide forward sec
2540: 72 65 63 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e recy.</dd>..<dt>
2550: 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72 3c <strong>-server<
2560: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f /strong> <em>boo
2570: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 l</em></dt>..<dd
2580: 3e 48 61 6e 64 73 68 61 6b 65 20 61 73 20 73 65 >Handshake as se
2590: 72 76 65 72 20 69 66 20 74 72 75 65 2c 20 65 6c rver if true, el
25a0: 73 65 20 68 61 6e 64 73 68 61 6b 65 20 61 73 0a se handshake as.
25b0: 09 20 20 20 20 63 6c 69 65 6e 74 2e 20 28 64 65 . client. (de
25c0: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c fault is <em>fal
25d0: 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c se</em>)</dd>..<
25e0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 dt><strong>-serv
25f0: 65 72 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 ername</strong>
2600: 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 3c 2f 64 <em>host</em></d
2610: 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 79 20 t>..<dd>Specify
2620: 73 65 72 76 65 72 20 68 6f 73 74 6e 61 6d 65 2e server hostname.
2630: 20 4f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 Only available
2640: 69 66 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c if the OpenSSL l
2650: 69 62 72 61 72 79 0a 09 20 20 20 20 74 68 65 20 ibrary.. the
2660: 70 61 63 6b 61 67 65 20 69 73 20 6c 69 6e 6b 65 package is linke
2670: 64 20 61 67 61 69 6e 73 74 20 73 75 70 70 6f 72 d against suppor
2680: 74 73 20 74 68 65 20 54 4c 53 20 68 6f 73 74 6e ts the TLS hostn
2690: 61 6d 65 20 65 78 74 65 6e 73 69 6f 6e 0a 09 20 ame extension..
26a0: 20 20 20 66 6f 72 20 27 53 65 72 76 65 72 20 4e for 'Server N
26b0: 61 6d 65 20 49 6e 64 69 63 61 74 69 6f 6e 27 20 ame Indication'
26c0: 28 53 4e 49 29 2e 20 55 73 65 20 74 6f 20 6e 61 (SNI). Use to na
26d0: 6d 65 20 74 68 65 20 6c 6f 67 69 63 61 6c 20 68 me the logical h
26e0: 6f 73 74 0a 09 20 20 20 20 77 65 20 61 72 65 20 ost.. we are
26f0: 74 61 6c 6b 69 6e 67 20 74 6f 20 61 6e 64 20 65 talking to and e
2700: 78 70 65 63 74 69 6e 67 20 61 20 63 65 72 74 69 xpecting a certi
2710: 66 69 63 61 74 65 20 66 6f 72 2e 3c 2f 64 64 3e ficate for.</dd>
2720: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 ..<dt><strong>-s
2730: 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 72 6f 6e ession_id</stron
2740: 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 g> <em>string</e
2750: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 73 m></dt>..<dd>Ses
2760: 73 69 6f 6e 20 69 64 20 74 6f 20 72 65 73 75 6d sion id to resum
2770: 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a e session.</dd>.
2780: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 .<dt><strong>-ss
2790: 6c 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e l2</strong> <em>
27a0: 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 bool</em></dt>..
27b0: 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f <dd>Enable use o
27c0: 66 20 53 53 4c 20 76 32 2e 20 28 64 65 66 61 75 f SSL v2. (defau
27d0: 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c lt is <em>false<
27e0: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e /em>)</dd>..<dt>
27f0: 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 20 3c 2f <strong>-ssl3 </
2800: 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c strong><em>bool<
2810: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 /em></dt>..<dd>E
2820: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c nable use of SSL
2830: 20 76 33 2e 20 28 64 65 66 61 75 6c 74 20 69 73 v3. (default is
2840: 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 <em>false</em>)
2850: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c 73 74 72 </dd>..<dt>-<str
2860: 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 6f 6e 67 ong>tls1</strong
2870: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c > <em>bool</em><
2880: 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 /dt>..<dd>Enable
2890: 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 20 use of TLS v1.
28a0: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e (default is <em>
28b0: 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a true</em>)</dd>.
28c0: 09 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c .<dt>-<strong>tl
28d0: 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 s1.1</strong> <e
28e0: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e m>bool</em></dt>
28f0: 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 ..<dd>Enable use
2900: 20 6f 66 20 54 4c 53 20 76 31 2e 31 20 28 64 65 of TLS v1.1 (de
2910: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 fault is <em>tru
2920: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 e</em>)</dd>..<d
2930: 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e t>-<strong>tls1.
2940: 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 2</strong> <em>b
2950: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ool</em></dt>..<
2960: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 dd>Enable use of
2970: 20 54 4c 53 20 76 31 2e 32 20 28 64 65 66 61 75 TLS v1.2 (defau
2980: 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f lt is <em>true</
2990: 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d em>)</dd>..<dt>-
29a0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 33 3c 2f <strong>tls1.3</
29b0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c strong> <em>bool
29c0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
29d0: 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c Enable use of TL
29e0: 53 20 76 31 2e 33 20 28 64 65 66 61 75 6c 74 20 S v1.3 (default
29f0: 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e is <em>true</em>
2a00: 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 )</dd>..<dt><str
2a10: 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 63 6f 6d ong>-validatecom
2a20: 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 mand</strong> <e
2a30: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c m>callback</em><
2a40: 2f 64 74 3e 0a 09 3c 64 64 3e 43 61 6c 6c 62 61 /dt>..<dd>Callba
2a50: 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 74 6f 20 ck to invoke to
2a60: 76 65 72 69 66 79 20 6f 72 20 76 61 6c 69 64 61 verify or valida
2a70: 74 65 20 70 72 6f 74 6f 63 6f 6c 20 63 6f 6e 66 te protocol conf
2a80: 69 67 0a 09 20 20 20 20 70 61 72 61 6d 65 74 65 ig.. paramete
2a90: 72 73 20 64 75 72 69 6e 67 20 74 68 65 20 70 72 rs during the pr
2aa0: 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61 74 69 otocol negotiati
2ab0: 6f 6e 20 70 68 61 73 65 2e 20 53 65 65 0a 09 20 on phase. See..
2ac0: 20 20 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c <a href="#CAL
2ad0: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 LBACK OPTIONS">C
2ae0: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c ALLBACK OPTIONS<
2af0: 2f 61 3e 0a 09 20 20 20 20 66 6f 72 20 66 75 72 /a>.. for fur
2b00: 74 68 65 72 20 64 69 73 63 75 73 73 69 6f 6e 2e ther discussion.
2b10: 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a </dd>. </dl>.
2b20: 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 </blockquote>..
2b30: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
2b40: 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 22 3e 3c tls::unimport"><
2b50: 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 20 b>tls::unimport
2b60: 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f </b><i>channel</
2b70: 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 i></a></dt>.
2b80: 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 66 6f 72 <dd>Provided for
2b90: 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 3c 73 74 symmetry to <st
2ba0: 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 rong>tls::import
2bb0: 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 69 73 0a </strong>, this.
2bc0: 20 20 20 20 20 20 75 6e 73 74 61 63 6b 73 20 74 unstacks t
2bd0: 68 65 20 53 53 4c 2d 65 6e 61 62 6c 69 6e 67 20 he SSL-enabling
2be0: 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54 63 6c of a regular Tcl
2bf0: 20 63 68 61 6e 6e 65 6c 2e 20 20 41 6e 20 65 72 channel. An er
2c00: 72 6f 72 0a 20 20 20 20 20 20 69 73 20 74 68 72 ror. is thr
2c10: 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 20 6e 6f own if TLS is no
2c20: 74 20 74 68 65 20 74 6f 70 20 73 74 61 63 6b 65 t the top stacke
2c30: 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 65 2e 3c d channel type.<
2c40: 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 /dd>. <dt>&nb
2c50: 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 sp;</dt>. <dt
2c60: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 68 ><a name="tls::h
2c70: 61 6e 64 73 68 61 6b 65 22 3e 3c 73 74 72 6f 6e andshake"><stron
2c80: 67 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 g>tls::handshake
2c90: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 </strong> <em>ch
2ca0: 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f annel</em></a></
2cb0: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 46 6f 72 63 dt>. <dd>Forc
2cc0: 65 73 20 68 61 6e 64 73 68 61 6b 65 20 74 6f 20 es handshake to
2cd0: 74 61 6b 65 20 70 6c 61 63 65 2c 20 61 6e 64 20 take place, and
2ce0: 72 65 74 75 72 6e 73 20 30 20 69 66 0a 09 68 61 returns 0 if..ha
2cf0: 6e 64 73 68 61 6b 65 20 69 73 20 73 74 69 6c 6c ndshake is still
2d00: 20 69 6e 20 70 72 6f 67 72 65 73 73 20 28 6e 6f in progress (no
2d10: 6e 2d 62 6c 6f 63 6b 69 6e 67 29 2c 20 6f 72 20 n-blocking), or
2d20: 31 20 69 66 0a 09 74 68 65 20 68 61 6e 64 73 68 1 if..the handsh
2d30: 61 6b 65 20 77 61 73 20 73 75 63 63 65 73 73 66 ake was successf
2d40: 75 6c 2e 20 49 66 20 74 68 65 20 68 61 6e 64 73 ul. If the hands
2d50: 68 61 6b 65 20 66 61 69 6c 65 64 0a 09 74 68 69 hake failed..thi
2d60: 73 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c 20 74 s routine will t
2d70: 68 72 6f 77 20 61 6e 20 65 72 72 6f 72 2e 3c 2f hrow an error.</
2d80: 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 dd>. <dt>&nbs
2d90: 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e p;</dt>. <dt>
2da0: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 74 <a name="tls::st
2db0: 61 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c atus"><strong>tl
2dc0: 73 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72 6f 6e s::status</stron
2dd0: 67 3e 0a 20 20 20 20 3c 65 6d 3e 3f 2d 6c 6f 63 g>. <em>?-loc
2de0: 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e al? channel</em>
2df0: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 </a></dt>. <d
2e00: 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 d>Returns the cu
2e10: 72 72 65 6e 74 20 73 74 61 74 75 73 20 6f 66 20 rrent status of
2e20: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 the certificate
2e30: 66 6f 72 20 61 6e 20 53 53 4c 0a 09 63 68 61 6e for an SSL..chan
2e40: 6e 65 6c 2e 20 54 68 65 20 72 65 73 75 6c 74 20 nel. The result
2e50: 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79 is a list of key
2e60: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 65 73 -value pairs des
2e70: 63 72 69 62 69 6e 67 0a 09 74 68 65 20 63 65 72 cribing..the cer
2e80: 74 69 66 69 63 61 74 65 2e 20 49 66 20 74 68 65 tificate. If the
2e90: 20 72 65 73 75 6c 74 20 69 73 20 61 6e 20 65 6d result is an em
2ea0: 70 74 79 20 6c 69 73 74 20 74 68 65 6e 20 74 68 pty list then th
2eb0: 65 0a 09 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 e..SSL handshake
2ec0: 20 68 61 73 20 6e 6f 74 20 79 65 74 20 63 6f 6d has not yet com
2ed0: 70 6c 65 74 65 64 2e 20 49 66 20 3c 65 6d 3e 2d pleted. If <em>-
2ee0: 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 0a 09 73 local</em> is..s
2ef0: 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 74 pecified, then t
2f00: 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69 66 69 he local certifi
2f10: 63 61 74 65 20 69 73 20 75 73 65 64 2e 3c 2f 64 cate is used.</d
2f20: 64 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a d>.<blockquote>.
2f30: 09 3c 62 3e 53 53 4c 20 53 74 61 74 75 73 3c 2f .<b>SSL Status</
2f40: 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 b>. <dl>..<dt
2f50: 3e 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 ><strong>alpn</s
2f60: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f trong> <em>proto
2f70: 63 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c col</em></dt>..<
2f80: 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 dd>The protocol
2f90: 73 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 selected after A
2fa0: 70 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 pplication-Layer
2fb0: 20 50 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e Protocol.. N
2fc0: 65 67 6f 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e egotiation (ALPN
2fd0: 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 ).</dd>..<dt><st
2fe0: 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 rong>cipher</str
2ff0: 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c ong> <em>cipher<
3000: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
3010: 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 he current ciphe
3020: 72 20 69 6e 20 75 73 65 20 62 65 74 77 65 65 6e r in use between
3030: 20 74 68 65 20 63 6c 69 65 6e 74 20 61 6e 64 0a the client and.
3040: 09 20 20 20 20 73 65 72 76 65 72 20 63 68 61 6e . server chan
3050: 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e nels.</dd>..<dt>
3060: 3c 73 74 72 6f 6e 67 3e 70 65 65 72 6e 61 6d 65 <strong>peername
3070: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 </strong> <em>na
3080: 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 me</em></dt>..<d
3090: 64 3e 54 68 65 20 70 65 65 72 6e 61 6d 65 20 66 d>The peername f
30a0: 72 6f 6d 20 74 68 65 20 63 65 72 74 69 66 69 63 rom the certific
30b0: 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ate.</dd>..<dt><
30c0: 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c strong>protocol<
30d0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 /strong> <em>ver
30e0: 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 sion</em></dt>..
30f0: 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c <dd>The protocol
3100: 20 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f version used fo
3110: 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e r the connection
3120: 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20 53 53 4c :.. SSL2, SSL
3130: 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c 3, TLS1, TLS1.1,
3140: 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c TLS1.2, TLS1.3,
3150: 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64 or unknown.</dd
3160: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
3170: 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 bits</strong> <e
3180: 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c m>n</em></dt>..<
3190: 64 64 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 dd>The number of
31a0: 20 62 69 74 73 20 75 73 65 64 20 66 6f 72 20 74 bits used for t
31b0: 68 65 20 73 65 73 73 69 6f 6e 20 6b 65 79 2e 3c he session key.<
31c0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
31d0: 67 3e 73 69 67 6e 61 74 75 72 65 48 61 73 68 41 g>signatureHashA
31e0: 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 lgorithm</strong
31f0: 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c > <em>algorithm<
3200: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
3210: 68 65 20 73 69 67 6e 61 74 75 72 65 20 68 61 73 he signature has
3220: 68 20 61 6c 67 6f 72 69 74 68 6d 2e 3c 2f 64 64 h algorithm.</dd
3230: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
3240: 69 67 6e 61 74 75 72 65 54 79 70 65 3c 2f 73 74 ignatureType</st
3250: 72 6f 6e 67 3e 20 3c 65 6d 3e 74 79 70 65 3c 2f rong> <em>type</
3260: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 em></dt>..<dd>Th
3270: 65 20 73 69 67 6e 61 74 75 72 65 20 74 79 70 65 e signature type
3280: 20 76 61 6c 75 65 2e 3c 2f 64 64 3e 0a 09 3c 64 value.</dd>..<d
3290: 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 79 t><strong>verify
32a0: 44 65 70 74 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c Depth</strong> <
32b0: 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 em>n</em></dt>..
32c0: 3c 64 64 3e 4d 61 78 69 6d 75 6d 20 64 65 70 74 <dd>Maximum dept
32d0: 68 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 66 h for the certif
32e0: 69 63 61 74 65 20 63 68 61 69 6e 20 76 65 72 69 icate chain veri
32f0: 66 69 63 61 74 69 6f 6e 2e 0a 09 20 20 20 20 44 fication... D
3300: 65 66 61 75 6c 74 20 69 73 20 2d 31 2c 20 74 6f efault is -1, to
3310: 20 63 68 65 63 6b 20 61 6c 6c 2e 3c 2f 64 64 3e check all.</dd>
3320: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 ..<dt><strong>ve
3330: 72 69 66 79 4d 6f 64 65 3c 2f 73 74 72 6f 6e 67 rifyMode</strong
3340: 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c > <em>list</em><
3350: 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f /dt>..<dd>List o
3360: 66 20 63 65 72 74 69 66 69 63 61 74 65 20 76 65 f certificate ve
3370: 72 69 66 69 63 61 74 69 6f 6e 20 6d 6f 64 65 73 rification modes
3380: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
3390: 6f 6e 67 3e 76 65 72 69 66 79 52 65 73 75 6c 74 ong>verifyResult
33a0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 72 65 </strong> <em>re
33b0: 73 75 6c 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 sult</em></dt>..
33c0: 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 <dd>Certificate
33d0: 76 65 72 69 66 69 63 61 74 69 6f 6e 20 72 65 73 verification res
33e0: 75 6c 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ult.</dd>..<dt><
33f0: 73 74 72 6f 6e 67 3e 63 61 5f 6e 61 6d 65 73 3c strong>ca_names<
3400: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 /strong> <em>lis
3410: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 t</em></dt>..<dd
3420: 3e 4c 69 73 74 20 6f 66 20 74 68 65 20 43 65 72 >List of the Cer
3430: 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 tificate Authori
3440: 74 69 65 73 20 75 73 65 64 20 74 6f 20 63 72 65 ties used to cre
3450: 61 74 65 20 74 68 65 20 63 65 72 74 69 66 69 63 ate the certific
3460: 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f ate.</dd>. </
3470: 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 dl>.</blockquote
3480: 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 09 >.<blockquote>..
3490: 3c 62 3e 43 65 72 74 69 66 69 63 61 74 65 20 53 <b>Certificate S
34a0: 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20 3c 64 tatus</b>. <d
34b0: 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e l>..<dt><strong>
34c0: 61 6c 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d all</strong> <em
34d0: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 >string</em></dt
34e0: 3e 0a 09 3c 64 64 3e 44 75 6d 70 20 6f 66 20 61 >..<dd>Dump of a
34f0: 6c 6c 20 63 65 72 74 69 66 69 63 61 74 65 20 69 ll certificate i
3500: 6e 66 6f 2e 3c 2f 64 64 3e 0a 0a 09 3c 64 74 3e nfo.</dd>...<dt>
3510: 3c 73 74 72 6f 6e 67 3e 76 65 72 73 69 6f 6e 3c <strong>version<
3520: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 61 6c /strong> <em>val
3530: 75 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ue</em></dt>..<d
3540: 64 3e 54 68 65 20 63 65 72 74 69 66 69 63 61 74 d>The certificat
3550: 65 20 76 65 72 73 69 6f 6e 2e 3c 2f 64 64 3e 0a e version.</dd>.
3560: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 .<dt><strong>ser
3570: 69 61 6c 4e 75 6d 62 65 72 3c 2f 73 74 72 6f 6e ialNumber</stron
3580: 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 g> <em>n</em></d
3590: 74 3e 0a 09 3c 64 64 3e 54 68 65 20 73 65 72 69 t>..<dd>The seri
35a0: 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 al number of the
35b0: 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 certificate as
35c0: 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e hex string.</dd>
35d0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 ..<dt><strong>si
35e0: 67 6e 61 74 75 72 65 3c 2f 73 74 72 6f 6e 67 3e gnature</strong>
35f0: 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f <em>algorithm</
3600: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 69 em></dt>..<dd>Ci
3610: 70 68 65 72 20 61 6c 67 6f 72 69 74 68 6d 20 75 pher algorithm u
3620: 73 65 64 20 66 6f 72 20 63 65 72 74 69 66 69 63 sed for certific
3630: 61 74 65 20 73 69 67 6e 61 74 75 72 65 2e 3c 2f ate signature.</
3640: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
3650: 3e 69 73 73 75 65 72 3c 2f 73 74 72 6f 6e 67 3e >issuer</strong>
3660: 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 <em>dn</em></dt
3670: 3e 0a 09 3c 64 64 3e 54 68 65 20 64 69 73 74 69 >..<dd>The disti
3680: 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 nguished name (D
3690: 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 N) of the certif
36a0: 69 63 61 74 65 20 69 73 73 75 65 72 2e 3c 2f 64 icate issuer.</d
36b0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
36c0: 6e 6f 74 42 65 66 6f 72 65 3c 2f 73 74 72 6f 6e notBefore</stron
36d0: 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e g> <em>date</em>
36e0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 62 </dt>..<dd>The b
36f0: 65 67 69 6e 20 64 61 74 65 20 66 6f 72 20 74 68 egin date for th
3700: 65 20 76 61 6c 69 64 69 74 79 20 6f 66 20 74 68 e validity of th
3710: 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f e certificate.</
3720: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
3730: 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72 6f 6e >notAfter</stron
3740: 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 6d 3e g> <em>date</em>
3750: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 65 </dt>..<dd>The e
3760: 78 70 69 72 61 74 69 6f 6e 20 64 61 74 65 20 66 xpiration date f
3770: 6f 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 or the certifica
3780: 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 te.</dd>..<dt><s
3790: 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 trong>subject</s
37a0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 trong> <em>dn</e
37b0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
37c0: 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e distinguished n
37d0: 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20 ame (DN) of the
37e0: 63 65 72 74 69 66 69 63 61 74 65 20 73 75 62 6a certificate subj
37f0: 65 63 74 2e 0a 09 20 20 20 20 46 69 65 6c 64 73 ect... Fields
3800: 20 69 6e 63 6c 75 64 65 3a 20 43 6f 6d 6d 6f 6e include: Common
3810: 20 4e 61 6d 65 20 28 43 4e 29 2c 20 4f 72 67 61 Name (CN), Orga
3820: 6e 69 7a 61 74 69 6f 6e 20 28 4f 29 2c 20 4c 6f nization (O), Lo
3830: 63 61 6c 69 74 79 0a 09 20 20 20 20 6f 72 20 43 cality.. or C
3840: 69 74 79 20 28 4c 29 2c 20 53 74 61 74 65 20 6f ity (L), State o
3850: 72 20 50 72 6f 76 69 6e 63 65 20 28 53 29 2c 20 r Province (S),
3860: 61 6e 64 20 43 6f 75 6e 74 72 79 20 4e 61 6d 65 and Country Name
3870: 20 28 43 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e (C).</dd>..<dt>
3880: 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 55 6e <strong>issuerUn
3890: 69 71 75 65 49 44 3c 2f 73 74 72 6f 6e 67 3e 20 iqueID</strong>
38a0: 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c <em>string</em><
38b0: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 69 73 /dt>..<dd>The is
38c0: 73 75 65 72 20 75 6e 69 71 75 65 20 69 64 2e 3c suer unique id.<
38d0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
38e0: 67 3e 73 75 62 6a 65 63 74 55 6e 69 71 75 65 49 g>subjectUniqueI
38f0: 44 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 D</strong> <em>s
3900: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
3910: 09 3c 64 64 3e 54 68 65 20 73 75 62 6a 65 63 74 .<dd>The subject
3920: 20 75 6e 69 71 75 65 20 69 64 2e 3c 2f 64 64 3e unique id.</dd>
3930: 0a 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e ...<dt><strong>n
3940: 75 6d 5f 65 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 um_extensions</s
3950: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d trong> <em>n</em
3960: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4e 75 6d 62 ></dt>..<dd>Numb
3970: 65 72 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 er of certificat
3980: 65 20 65 78 74 65 6e 73 69 6f 6e 73 2e 3c 2f 64 e extensions.</d
3990: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
39a0: 65 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 74 72 6f extensions</stro
39b0: 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d ng> <em>list</em
39c0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 ></dt>..<dd>List
39d0: 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 65 20 of certificate
39e0: 65 78 74 65 6e 73 69 6f 6e 20 6e 61 6d 65 73 2e extension names.
39f0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3a00: 6e 67 3e 61 75 74 68 6f 72 69 74 79 4b 65 79 49 ng>authorityKeyI
3a10: 64 65 6e 74 69 66 69 65 72 3c 2f 73 74 72 6f 6e dentifier</stron
3a20: 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 g> <em>string</e
3a30: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 28 41 4b m></dt>..<dd>(AK
3a40: 49 29 20 4b 65 79 20 69 64 65 6e 74 69 66 69 65 I) Key identifie
3a50: 72 20 6f 66 20 74 68 65 20 49 73 73 75 69 6e 67 r of the Issuing
3a60: 20 43 41 20 63 65 72 74 69 66 69 63 61 74 65 20 CA certificate
3a70: 74 68 61 74 20 73 69 67 6e 65 64 0a 09 20 20 20 that signed..
3a80: 20 74 68 65 20 53 53 4c 20 63 65 72 74 69 66 69 the SSL certifi
3a90: 63 61 74 65 20 61 73 20 68 65 78 20 73 74 72 69 cate as hex stri
3aa0: 6e 67 2e 20 54 68 69 73 20 76 61 6c 75 65 20 6d ng. This value m
3ab0: 61 74 63 68 65 73 20 74 68 65 20 53 4b 49 0a 09 atches the SKI..
3ac0: 20 20 20 20 76 61 6c 75 65 20 6f 66 20 74 68 65 value of the
3ad0: 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20 43 41 Intermediate CA
3ae0: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 certificate.</d
3af0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3b00: 73 75 62 6a 65 63 74 4b 65 79 49 64 65 6e 74 69 subjectKeyIdenti
3b10: 66 69 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 fier</strong> <e
3b20: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 m>string</em></d
3b30: 74 3e 0a 09 3c 64 64 3e 28 53 4b 49 29 20 48 61 t>..<dd>(SKI) Ha
3b40: 73 68 20 6f 66 20 74 68 65 20 70 75 62 6c 69 63 sh of the public
3b50: 20 6b 65 79 20 69 6e 73 69 64 65 20 74 68 65 20 key inside the
3b60: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 68 certificate as h
3b70: 65 78 0a 09 20 20 20 73 74 72 69 6e 67 2e 20 55 ex.. string. U
3b80: 73 65 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20 sed to identify
3b90: 63 65 72 74 69 66 69 63 61 74 65 73 20 74 68 61 certificates tha
3ba0: 74 20 63 6f 6e 74 61 69 6e 20 61 20 70 61 72 74 t contain a part
3bb0: 69 63 75 6c 61 72 0a 09 20 20 20 70 75 62 6c 69 icular.. publi
3bc0: 63 20 6b 65 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 c key.</dd>..<dt
3bd0: 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 ><strong>subject
3be0: 41 6c 74 4e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e AltName</strong>
3bf0: 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f <em>list</em></
3c00: 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 dt>..<dd>List of
3c10: 20 61 6c 6c 20 6f 66 20 74 68 65 20 61 6c 74 65 all of the alte
3c20: 72 6e 61 74 69 76 65 20 64 6f 6d 61 69 6e 20 6e rnative domain n
3c30: 61 6d 65 73 2c 20 73 75 62 20 64 6f 6d 61 69 6e ames, sub domain
3c40: 73 2c 0a 09 20 20 20 20 61 6e 64 20 49 50 20 61 s,.. and IP a
3c50: 64 64 72 65 73 73 65 73 20 74 68 61 74 20 61 72 ddresses that ar
3c60: 65 20 73 65 63 75 72 65 64 20 62 79 20 74 68 65 e secured by the
3c70: 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 certificate.</d
3c80: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3c90: 6f 63 73 70 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 ocsp</strong> <e
3ca0: 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e m>list</em></dt>
3cb0: 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 61 6c ..<dd>List of al
3cc0: 6c 20 4f 6e 6c 69 6e 65 20 43 65 72 74 69 66 69 l Online Certifi
3cd0: 63 61 74 65 20 53 74 61 74 75 73 20 50 72 6f 74 cate Status Prot
3ce0: 6f 63 6f 6c 20 28 4f 43 53 50 29 20 55 52 4c 73 ocol (OCSP) URLs
3cf0: 2e 3c 2f 64 64 3e 0a 0a 09 3c 64 74 3e 3c 73 74 .</dd>...<dt><st
3d00: 72 6f 6e 67 3e 63 65 72 74 69 66 69 63 61 74 65 rong>certificate
3d10: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 65 </strong> <em>ce
3d20: 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 rt</em></dt>..<d
3d30: 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f 64 65 d>The PEM encode
3d40: 64 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f d certificate.</
3d50: 64 64 3e 0a 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e dd>...<dt><stron
3d60: 67 3e 73 69 67 6e 61 74 75 72 65 41 6c 67 6f 72 g>signatureAlgor
3d70: 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 ithm</strong> <e
3d80: 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e m>algorithm</em>
3d90: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 69 70 68 65 </dt>..<dd>Ciphe
3da0: 72 20 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 r algorithm used
3db0: 20 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 for certificate
3dc0: 20 73 69 67 6e 61 74 75 72 65 2e 3c 2f 64 64 3e signature.</dd>
3dd0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 ..<dt><strong>si
3de0: 67 6e 61 74 75 72 65 56 61 6c 75 65 3c 2f 73 74 gnatureValue</st
3df0: 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 rong> <em>string
3e00: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
3e10: 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e Certificate sign
3e20: 61 74 75 72 65 20 61 73 20 68 65 78 20 73 74 72 ature as hex str
3e30: 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ing.</dd>..<dt><
3e40: 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 strong>signature
3e50: 44 69 67 65 73 74 3c 2f 73 74 72 6f 6e 67 3e 20 Digest</strong>
3e60: 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e <em>version</em>
3e70: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 65 72 74 69 </dt>..<dd>Certi
3e80: 66 69 63 61 74 65 20 73 69 67 6e 69 6e 67 20 64 ficate signing d
3e90: 69 67 65 73 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 igest.</dd>..<dt
3ea0: 3e 3c 73 74 72 6f 6e 67 3e 70 75 62 6c 69 63 4b ><strong>publicK
3eb0: 65 79 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72 eyAlgorithm</str
3ec0: 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 ong> <em>algorit
3ed0: 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 hm</em></dt>..<d
3ee0: 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 73 69 d>Certificate si
3ef0: 67 6e 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b gnature public k
3f00: 65 79 20 61 6c 67 6f 72 69 74 68 6d 2e 3c 2f 64 ey algorithm.</d
3f10: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3f20: 70 75 62 6c 69 63 4b 65 79 3c 2f 73 74 72 6f 6e publicKey</stron
3f30: 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 g> <em>string</e
3f40: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 65 72 m></dt>..<dd>Cer
3f50: 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 tificate signatu
3f60: 72 65 20 70 75 62 6c 69 63 20 6b 65 79 20 61 73 re public key as
3f70: 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 hex string.</dd
3f80: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 62 >..<dt><strong>b
3f90: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d its</strong> <em
3fa0: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 >n</em></dt>..<d
3fb0: 64 3e 4e 75 6d 62 65 72 20 6f 66 20 62 69 74 73 d>Number of bits
3fc0: 20 75 73 65 64 20 66 6f 72 20 63 65 72 74 69 66 used for certif
3fd0: 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 icate signature
3fe0: 6b 65 79 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 key</dd>..<dt><s
3ff0: 74 72 6f 6e 67 3e 73 65 6c 66 5f 73 69 67 6e 65 trong>self_signe
4000: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 d</strong> <em>b
4010: 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e oolean</em></dt>
4020: 0a 09 3c 64 64 3e 49 73 20 63 65 72 74 69 66 69 ..<dd>Is certifi
4030: 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 73 cate signature s
4040: 65 6c 66 20 73 69 67 6e 65 64 2e 3c 2f 64 64 3e elf signed.</dd>
4050: 0a 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 ...<dt><strong>s
4060: 68 61 31 5f 68 61 73 68 3c 2f 73 74 72 6f 6e 67 ha1_hash</strong
4070: 3e 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d 3e 3c > <em>hash</em><
4080: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 53 48 /dt>..<dd>The SH
4090: 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 63 A1 hash of the c
40a0: 65 72 74 69 66 69 63 61 74 65 20 61 73 20 68 65 ertificate as he
40b0: 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 x string.</dd>..
40c0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 68 61 32 <dt><strong>sha2
40d0: 35 36 5f 68 61 73 68 3c 2f 73 74 72 6f 6e 67 3e 56_hash</strong>
40e0: 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d 3e 3c 2f <em>hash</em></
40f0: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 53 48 41 dt>..<dd>The SHA
4100: 32 35 36 20 68 61 73 68 20 6f 66 20 74 68 65 20 256 hash of the
4110: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 68 certificate as h
4120: 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a ex string.</dd>.
4130: 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 </dl>.</bloc
4140: 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74 kquote>.. <dt
4150: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 ><a name="tls::c
4160: 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c 73 74 72 6f onnection"><stro
4170: 6e 67 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 ng>tls::connecti
4180: 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 on</strong>.
4190: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e <em>channel</em>
41a0: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 </a></dt>. <d
41b0: 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 d>Returns the cu
41c0: 72 72 65 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e rrent connection
41d0: 20 73 74 61 74 75 73 20 6f 66 20 61 6e 20 53 53 status of an SS
41e0: 4c 20 63 68 61 6e 6e 65 6c 2e 20 54 68 65 0a 09 L channel. The..
41f0: 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69 73 74 result is a list
4200: 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 of key-value pa
4210: 69 72 73 20 64 65 73 63 72 69 62 69 6e 67 20 74 irs describing t
4220: 68 65 0a 09 63 6f 6e 6e 65 63 74 65 64 20 70 65 he..connected pe
4230: 65 72 2e 3c 2f 64 64 3e 0a 3c 62 6c 6f 63 6b 71 er.</dd>.<blockq
4240: 75 6f 74 65 3e 0a 09 3c 62 3e 53 53 4c 20 53 74 uote>..<b>SSL St
4250: 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c atus</b>. <dl
4260: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
4270: 74 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 tate</strong> <e
4280: 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 m>state</em></dt
4290: 3e 0a 09 3c 64 64 3e 53 74 61 74 65 20 6f 66 20 >..<dd>State of
42a0: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c the connection.<
42b0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
42c0: 67 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74 g>servername</st
42d0: 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f rong> <em>name</
42e0: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 em></dt>..<dd>Th
42f0: 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 63 6f e name of the co
4300: 6e 6e 65 63 74 65 64 20 74 6f 20 73 65 72 76 65 nnected to serve
4310: 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 r.</dd>..<dt><st
4320: 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 73 rong>protocol</s
4330: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 69 trong> <em>versi
4340: 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 on</em></dt>..<d
4350: 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 d>The protocol v
4360: 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 ersion used for
4370: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 0a the connection:.
4380: 09 20 20 20 20 53 53 4c 32 2c 20 53 53 4c 33 2c . SSL2, SSL3,
4390: 20 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c 20 54 TLS1, TLS1.1, T
43a0: 4c 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c 20 6f LS1.2, TLS1.3, o
43b0: 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64 3e 0a r unknown.</dd>.
43c0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 72 65 6e .<dt><strong>ren
43d0: 65 67 6f 74 69 61 74 69 6f 6e 3c 2f 73 74 72 6f egotiation</stro
43e0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c ng> <em>boolean<
43f0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 /em></dt>..<dd>W
4400: 68 65 74 68 65 72 20 70 72 6f 74 6f 63 6f 6c 20 hether protocol
4410: 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e 20 69 73 renegotiation is
4420: 20 73 75 70 70 6f 72 74 65 64 20 6f 72 20 6e 6f supported or no
4430: 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 t.</dd>..<dt><st
4440: 72 6f 6e 67 3e 73 65 63 75 72 69 74 79 6c 65 76 rong>securitylev
4450: 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e el</strong> <em>
4460: 6c 65 76 65 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a level</em></dt>.
4470: 09 3c 64 64 3e 54 68 65 20 73 65 63 75 72 69 74 .<dd>The securit
4480: 79 20 6c 65 76 65 6c 20 75 73 65 64 20 66 6f 72 y level used for
4490: 20 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20 63 69 selection of ci
44a0: 70 68 65 72 73 2c 20 6b 65 79 20 73 69 7a 65 2c phers, key size,
44b0: 20 65 74 63 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e etc.</dd>..<dt>
44c0: 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f <strong>session_
44d0: 72 65 75 73 65 64 3c 2f 73 74 72 6f 6e 67 3e 20 reused</strong>
44e0: 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e <em>boolean</em>
44f0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 68 65 74 68 </dt>..<dd>Wheth
4500: 65 72 20 74 68 65 20 73 65 73 73 69 6f 6e 20 68 er the session h
4510: 61 73 20 62 65 65 6e 20 72 65 75 73 65 64 20 6f as been reused o
4520: 72 20 6e 6f 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 r not.</dd>..<dt
4530: 3e 3c 73 74 72 6f 6e 67 3e 69 73 5f 73 65 72 76 ><strong>is_serv
4540: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e er</strong> <em>
4550: 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 boolean</em></dt
4560: 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72 20 74 >..<dd>Whether t
4570: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 73 he connection is
4580: 20 63 6f 6e 66 69 67 75 72 65 64 20 61 73 20 61 configured as a
4590: 20 73 65 72 76 65 72 20 28 31 29 20 6f 72 20 63 server (1) or c
45a0: 6c 69 65 6e 74 20 28 30 29 2e 3c 2f 64 64 3e 0a lient (0).</dd>.
45b0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 6f 6d .<dt><strong>com
45c0: 70 72 65 73 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 pression</strong
45d0: 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c > <em>mode</em><
45e0: 2f 64 74 3e 0a 09 3c 64 64 3e 43 6f 6d 70 72 65 /dt>..<dd>Compre
45f0: 73 73 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c 2f 64 ssion method.</d
4600: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4610: 65 78 70 61 6e 73 69 6f 6e 3c 2f 73 74 72 6f 6e expansion</stron
4620: 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e g> <em>mode</em>
4630: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 78 70 61 6e </dt>..<dd>Expan
4640: 73 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c 2f 64 64 sion method.</dd
4650: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c >. </dl>.</bl
4660: 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 6c 6f 63 6b ockquote>.<block
4670: 71 75 6f 74 65 3e 0a 09 3c 62 3e 43 69 70 68 65 quote>..<b>Ciphe
4680: 72 20 49 6e 66 6f 3c 2f 62 3e 0a 20 20 20 20 3c r Info</b>. <
4690: 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dl>..<dt><strong
46a0: 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e >cipher</strong>
46b0: 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f 65 6d 3e <em>cipher</em>
46c0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 63 </dt>..<dd>The c
46d0: 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 6e urrent cipher in
46e0: 20 75 73 65 20 66 6f 72 20 74 68 65 20 63 6f 6e use for the con
46f0: 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c nection.</dd>..<
4700: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 61 6e 64 dt><strong>stand
4710: 61 72 64 5f 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 ard_name</strong
4720: 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c > <em>name</em><
4730: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 73 74 /dt>..<dd>The st
4740: 61 6e 64 61 72 64 20 52 46 43 20 6e 61 6d 65 20 andard RFC name
4750: 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e 0a of cipher.</dd>.
4760: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 62 69 74 .<dt><strong>bit
4770: 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e s</strong> <em>n
4780: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
4790: 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 72 The number of pr
47a0: 6f 63 65 73 73 65 64 20 62 69 74 73 20 75 73 65 ocessed bits use
47b0: 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 d for cipher.</d
47c0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
47d0: 73 65 63 72 65 74 5f 62 69 74 73 3c 2f 73 74 72 secret_bits</str
47e0: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c ong> <em>n</em><
47f0: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 6e 75 /dt>..<dd>The nu
4800: 6d 62 65 72 20 6f 66 20 73 65 63 72 65 74 20 62 mber of secret b
4810: 69 74 73 20 75 73 65 64 20 66 6f 72 20 63 69 70 its used for cip
4820: 68 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c her.</dd>..<dt><
4830: 73 74 72 6f 6e 67 3e 6d 69 6e 5f 76 65 72 73 69 strong>min_versi
4840: 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e on</strong> <em>
4850: 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 version</em></dt
4860: 3e 0a 09 3c 64 64 3e 54 68 65 20 6d 69 6e 69 6d >..<dd>The minim
4870: 75 6d 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 um protocol vers
4880: 69 6f 6e 20 66 6f 72 20 63 69 70 68 65 72 2e 3c ion for cipher.<
4890: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
48a0: 67 3e 69 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 g>id</strong> <e
48b0: 6d 3e 69 64 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 m>id</em></dt>..
48c0: 3c 64 64 3e 54 68 65 20 4f 70 65 6e 53 53 4c 20 <dd>The OpenSSL
48d0: 63 69 70 68 65 72 20 69 64 2e 3c 2f 64 64 3e 0a cipher id.</dd>.
48e0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 64 65 73 .<dt><strong>des
48f0: 63 72 69 70 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 cription</strong
4900: 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d > <em>string</em
4910: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 41 20 74 65 ></dt>..<dd>A te
4920: 78 74 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f xt description o
4930: 66 20 74 68 65 20 63 69 70 68 65 72 2e 3c 2f 64 f the cipher.</d
4940: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 d>. </dl>.</b
4950: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 6c 6f 63 lockquote>.<bloc
4960: 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 53 65 73 73 kquote>..<b>Sess
4970: 69 6f 6e 20 49 6e 66 6f 3c 2f 62 3e 0a 20 20 20 ion Info</b>.
4980: 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f <dl>..<dt><stro
4990: 6e 67 3e 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e ng>alpn</strong>
49a0: 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 <em>protocol</e
49b0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
49c0: 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 protocol select
49d0: 65 64 20 61 66 74 65 72 20 41 70 70 6c 69 63 61 ed after Applica
49e0: 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f tion-Layer Proto
49f0: 63 6f 6c 0a 09 20 20 20 20 4e 65 67 6f 74 69 61 col.. Negotia
4a00: 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 3c 2f 64 64 tion (ALPN).</dd
4a10: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 72 >..<dt><strong>r
4a20: 65 73 75 6d 61 62 6c 65 3c 2f 73 74 72 6f 6e 67 esumable</strong
4a30: 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 > <em>boolean</e
4a40: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 61 6e m></dt>..<dd>Can
4a50: 20 74 68 65 20 73 65 73 73 69 6f 6e 20 62 65 20 the session be
4a60: 72 65 73 75 6d 65 64 20 6f 72 20 6e 6f 74 2e 3c resumed or not.<
4a70: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
4a80: 67 3e 73 74 61 72 74 5f 74 69 6d 65 3c 2f 73 74 g>start_time</st
4a90: 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f 6e 64 rong> <em>second
4aa0: 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 s</em></dt>..<dd
4ab0: 3e 54 69 6d 65 20 73 69 6e 63 65 20 73 65 73 73 >Time since sess
4ac0: 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e 20 73 ion started in s
4ad0: 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65 70 6f econds since epo
4ae0: 63 68 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 ch.</dd>..<dt><s
4af0: 74 72 6f 6e 67 3e 74 69 6d 65 6f 75 74 3c 2f 73 trong>timeout</s
4b00: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f 6e trong> <em>secon
4b10: 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ds</em></dt>..<d
4b20: 64 3e 4d 61 78 20 64 75 72 61 74 69 6f 6e 20 6f d>Max duration o
4b30: 66 20 73 65 73 73 69 6f 6e 20 69 6e 20 73 65 63 f session in sec
4b40: 6f 6e 64 73 20 62 65 66 6f 72 65 20 74 69 6d 65 onds before time
4b50: 2d 6f 75 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e -out.</dd>..<dt>
4b60: 3c 73 74 72 6f 6e 67 3e 6c 69 66 65 74 69 6d 65 <strong>lifetime
4b70: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 </strong> <em>se
4b80: 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a conds</em></dt>.
4b90: 09 3c 64 64 3e 53 65 73 73 69 6f 6e 20 74 69 63 .<dd>Session tic
4ba0: 6b 65 74 20 6c 69 66 65 74 69 6d 65 20 68 69 6e ket lifetime hin
4bb0: 74 20 69 6e 20 73 65 63 6f 6e 64 73 2e 3c 2f 64 t in seconds.</d
4bc0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4bd0: 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 72 6f session_id</stro
4be0: 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 ng> <em>binary_s
4bf0: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
4c00: 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 .<dd>Unique sess
4c10: 69 6f 6e 20 69 64 20 66 6f 72 20 75 73 65 20 69 ion id for use i
4c20: 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65 20 73 n resuming the s
4c30: 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 ession.</dd>..<d
4c40: 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f t><strong>sessio
4c50: 6e 5f 74 69 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 n_ticket</strong
4c60: 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 72 > <em>binary_str
4c70: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ing</em></dt>..<
4c80: 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 69 6f dd>Unique sessio
4c90: 6e 20 74 69 63 6b 65 74 20 66 6f 72 20 75 73 65 n ticket for use
4ca0: 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65 in resuming the
4cb0: 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 session.</dd>..
4cc0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 63 6b <dt><strong>tick
4cd0: 65 74 5f 61 70 70 5f 64 61 74 61 3c 2f 73 74 72 et_app_data</str
4ce0: 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f ong> <em>binary_
4cf0: 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e string</em></dt>
4d00: 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 ..<dd>Unique ses
4d10: 73 69 6f 6e 20 74 69 63 6b 65 74 20 61 70 70 6c sion ticket appl
4d20: 69 63 61 74 69 6f 6e 20 64 61 74 61 2e 3c 2f 64 ication data.</d
4d30: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4d40: 6d 61 73 74 65 72 5f 6b 65 79 3c 2f 73 74 72 6f master_key</stro
4d50: 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 ng> <em>binary_s
4d60: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
4d70: 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 .<dd>Unique sess
4d80: 69 6f 6e 20 6d 61 73 74 65 72 20 6b 65 79 2e 3c ion master key.<
4d90: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
4da0: 67 3e 73 65 73 73 69 6f 6e 5f 63 61 63 68 65 5f g>session_cache_
4db0: 6d 6f 64 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 mode</strong> <e
4dc0: 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e m>mode</em></dt>
4dd0: 0a 09 3c 64 64 3e 53 65 72 76 65 72 20 63 61 63 ..<dd>Server cac
4de0: 68 65 20 6d 6f 64 65 20 28 63 6c 69 65 6e 74 2c he mode (client,
4df0: 20 73 65 72 76 65 72 2c 20 6f 72 20 62 6f 74 68 server, or both
4e00: 29 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c ).</dd>. </dl
4e10: 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a >.</blockquote>.
4e20: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 . <dt><a name
4e30: 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 73 22 3e ="tls::ciphers">
4e40: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 <strong>tls::cip
4e50: 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20 hers</strong>.
4e60: 20 20 3c 65 6d 3e 3f 70 72 6f 74 6f 63 6f 6c 3f <em>?protocol?
4e70: 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 70 ?verbose? ?supp
4e80: 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c orted?</em></a><
4e90: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 57 69 74 /dt>. <dd>Wit
4ea0: 68 6f 75 74 20 61 6e 79 20 61 72 67 73 2c 20 72 hout any args, r
4eb0: 65 74 75 72 6e 73 20 61 20 6c 69 73 74 20 6f 66 eturns a list of
4ec0: 20 61 6c 6c 20 63 69 70 68 65 72 73 2e 20 57 69 all ciphers. Wi
4ed0: 74 68 0a 09 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c th..<em>protocol
4ee0: 3c 2f 65 6d 3e 2c 20 6f 6e 6c 79 20 74 68 65 20 </em>, only the
4ef0: 63 69 70 68 65 72 73 20 73 75 70 70 6f 72 74 65 ciphers supporte
4f00: 64 20 66 6f 72 20 74 68 61 74 20 70 72 6f 74 6f d for that proto
4f10: 63 6f 6c 0a 09 61 72 65 20 72 65 74 75 72 6e 65 col..are returne
4f20: 64 20 77 68 65 72 65 20 3c 65 6d 3e 70 72 6f 74 d where <em>prot
4f30: 6f 63 6f 6c 3c 2f 65 6d 3e 20 6d 75 73 74 20 62 ocol</em> must b
4f40: 65 20 6f 6e 65 20 6f 66 20 3c 62 3e 73 73 6c 32 e one of <b>ssl2
4f50: 2c 20 73 73 6c 33 2c 0a 09 74 6c 73 31 2c 20 74 , ssl3,..tls1, t
4f60: 6c 73 31 2e 31 2c 20 74 6c 73 31 2e 32 2c 3c 2f ls1.1, tls1.2,</
4f70: 62 3e 20 6f 72 20 3c 62 3e 74 6c 73 31 2e 33 3c b> or <b>tls1.3<
4f80: 2f 62 3e 2e 20 49 66 20 3c 65 6d 3e 76 65 72 62 /b>. If <em>verb
4f90: 6f 73 65 3c 2f 65 6d 3e 20 69 73 0a 09 73 70 65 ose</em> is..spe
4fa0: 63 69 66 69 65 64 20 61 73 20 74 72 75 65 20 74 cified as true t
4fb0: 68 65 6e 20 61 20 76 65 72 62 6f 73 65 2c 20 68 hen a verbose, h
4fc0: 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20 6c 69 uman readable li
4fd0: 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 0a 09 st is returned..
4fe0: 77 69 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20 with additional
4ff0: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 74 information on t
5000: 68 65 20 63 69 70 68 65 72 2e 20 49 66 20 3c 65 he cipher. If <e
5010: 6d 3e 73 75 70 70 6f 72 74 65 64 3c 2f 65 6d 3e m>supported</em>
5020: 0a 09 69 73 20 73 70 65 63 69 66 69 65 64 20 61 ..is specified a
5030: 73 20 74 72 75 65 2c 20 74 68 65 6e 20 6f 6e 6c s true, then onl
5040: 79 20 74 68 65 20 63 69 70 68 65 72 73 20 73 75 y the ciphers su
5050: 70 70 6f 72 74 65 64 20 66 6f 72 20 70 72 6f 74 pported for prot
5060: 6f 63 6f 6c 0a 09 77 69 6c 6c 20 62 65 20 6c 69 ocol..will be li
5070: 73 74 65 64 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20 sted.</dd>..
5080: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
5090: 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e 3c 73 74 ::protocols"><st
50a0: 72 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 rong>tls::protoc
50b0: 6f 6c 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e ols</strong></a>
50c0: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 </dt>. <dd>Re
50d0: 74 75 72 6e 73 20 61 20 6c 69 73 74 20 6f 66 20 turns a list of
50e0: 73 75 70 70 6f 72 74 65 64 20 70 72 6f 74 6f 63 supported protoc
50f0: 6f 6c 73 2e 20 56 61 6c 69 64 20 76 61 6c 75 65 ols. Valid value
5100: 73 20 61 72 65 3a 0a 09 3c 62 3e 73 73 6c 32 3c s are:..<b>ssl2<
5110: 2f 62 3e 2c 20 3c 62 3e 73 73 6c 33 3c 2f 62 3e /b>, <b>ssl3</b>
5120: 2c 20 3c 62 3e 74 6c 73 31 3c 2f 62 3e 2c 20 3c , <b>tls1</b>, <
5130: 62 3e 74 6c 73 31 2e 31 3c 2f 62 3e 2c 20 3c 62 b>tls1.1</b>, <b
5140: 3e 74 6c 73 31 2e 32 3c 2f 62 3e 2c 0a 09 61 6e >tls1.2</b>,..an
5150: 64 20 3c 62 3e 74 6c 73 31 2e 33 3c 2f 62 3e 2e d <b>tls1.3</b>.
5160: 20 45 78 61 63 74 20 6c 69 73 74 20 64 65 70 65 Exact list depe
5170: 6e 64 73 20 6f 6e 20 4f 70 65 6e 53 53 4c 20 76 nds on OpenSSL v
5180: 65 72 73 69 6f 6e 20 61 6e 64 0a 09 63 6f 6d 70 ersion and..comp
5190: 69 6c 65 20 74 69 6d 65 20 66 6c 61 67 73 2e 3c ile time flags.<
51a0: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 /dd>.. <dt><a
51b0: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 76 65 72 73 name="tls::vers
51c0: 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 ion"><strong>tls
51d0: 3a 3a 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e ::version</stron
51e0: 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 g></a></dt>.
51f0: 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20 <dd>Returns the
5200: 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 OpenSSL version
5210: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 0a 20 20 string.</dd>..
5220: 20 20 3c 62 72 3e 0a 20 20 20 20 3c 64 74 3e 3c <br>. <dt><
5230: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 64 69 67 a name="tls::dig
5240: 65 73 74 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 est"><strong>tls
5250: 3a 3a 64 69 67 65 73 74 3c 2f 73 74 72 6f 6e 67 ::digest</strong
5260: 3e 20 3c 65 6d 3e 74 79 70 65 20 3f 2d 62 69 6e > <em>type ?-bin
5270: 7c 2d 68 65 78 3f 0a 09 3f 2d 6b 65 79 20 68 6d |-hex?..?-key hm
5280: 61 63 5f 6b 65 79 3f 20 5b 2d 66 69 6c 65 20 66 ac_key? [-file f
5290: 69 6c 65 6e 61 6d 65 20 7c 20 2d 63 68 61 6e 20 ilename | -chan
52a0: 63 68 61 6e 6e 65 6c 20 7c 20 3f 2d 64 61 74 61 channel | ?-data
52b0: 3f 20 64 61 74 61 5d 3c 2f 65 6d 3e 3c 2f 61 3e ? data]</em></a>
52c0: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 43 61 </dt>. <dd>Ca
52d0: 6c 63 75 6c 61 74 65 20 74 68 65 20 6d 65 73 73 lculate the mess
52e0: 61 67 65 20 64 69 67 65 73 74 20 66 6f 72 20 3c age digest for <
52f0: 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 20 6f 72 20 em>data</em> or
5300: 66 69 6c 65 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d file <em>filenam
5310: 65 3c 2f 65 6d 3e 0a 09 75 73 69 6e 67 20 3c 65 e</em>..using <e
5320: 6d 3e 74 79 70 65 3c 2f 65 6d 3e 20 68 61 73 68 m>type</em> hash
5330: 20 61 6c 67 6f 72 69 74 68 6d 2e 20 52 65 74 75 algorithm. Retu
5340: 72 6e 73 20 76 61 6c 75 65 20 61 73 20 61 20 68 rns value as a h
5350: 65 78 20 73 74 72 69 6e 67 0a 09 28 64 65 66 61 ex string..(defa
5360: 75 6c 74 29 20 6f 72 20 61 73 20 61 20 62 69 6e ult) or as a bin
5370: 61 72 79 20 76 61 6c 75 65 20 77 69 74 68 20 3c ary value with <
5380: 65 6d 3e 2d 62 69 6e 3c 2f 65 6d 3e 20 6f 70 74 em>-bin</em> opt
5390: 69 6f 6e 2e 20 55 73 69 6e 67 0a 09 3c 65 6d 3e ion. Using..<em>
53a0: 2d 63 68 61 6e 3c 2f 65 6d 3e 20 6f 70 74 69 6f -chan</em> optio
53b0: 6e 2c 20 61 20 73 74 61 63 6b 65 64 20 63 68 61 n, a stacked cha
53c0: 6e 6e 65 6c 20 69 73 20 63 72 65 61 74 65 64 20 nnel is created
53d0: 61 6e 64 20 64 61 74 61 20 72 65 61 64 0a 09 66 and data read..f
53e0: 72 6f 6d 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 rom the channel
53f0: 69 73 20 75 73 65 64 20 74 6f 20 63 61 6c 63 75 is used to calcu
5400: 6c 61 74 65 20 61 20 6d 65 73 73 61 67 65 20 64 late a message d
5410: 69 67 65 73 74 20 77 69 74 68 20 74 68 65 20 72 igest with the r
5420: 65 73 75 6c 74 0a 09 72 65 74 75 72 6e 65 64 20 esult..returned
5430: 77 69 74 68 20 74 68 65 20 6c 61 73 74 20 72 65 with the last re
5440: 61 64 20 6f 70 65 72 61 74 69 6f 6e 20 62 65 66 ad operation bef
5450: 6f 72 65 20 45 4f 46 2e 20 55 73 65 20 3c 65 6d ore EOF. Use <em
5460: 3e 2d 6b 65 79 3c 2f 65 6d 3e 20 74 6f 0a 09 73 >-key</em> to..s
5470: 70 65 63 69 66 79 20 74 68 65 20 6b 65 79 20 61 pecify the key a
5480: 6e 64 20 72 65 74 75 72 6e 20 61 20 48 61 73 68 nd return a Hash
5490: 65 64 20 4d 65 73 73 61 67 65 20 41 75 74 68 65 ed Message Authe
54a0: 6e 74 69 63 61 74 69 6f 6e 20 43 6f 64 65 20 28 ntication Code (
54b0: 48 4d 41 43 29 2e 0a 09 54 79 70 65 20 63 61 6e HMAC)...Type can
54c0: 20 62 65 20 61 6e 79 20 4f 70 65 6e 53 53 4c 20 be any OpenSSL
54d0: 73 75 70 70 6f 72 74 65 64 20 68 61 73 68 20 61 supported hash a
54e0: 6c 67 6f 72 69 74 68 6d 20 69 6e 63 6c 75 64 69 lgorithm includi
54f0: 6e 67 3a 20 3c 62 3e 6d 64 34 3c 2f 62 3e 2c 0a ng: <b>md4</b>,.
5500: 09 3c 62 3e 6d 64 35 3c 2f 62 3e 2c 20 3c 62 3e .<b>md5</b>, <b>
5510: 73 68 61 31 3c 2f 62 3e 2c 20 3c 62 3e 73 68 61 sha1</b>, <b>sha
5520: 32 35 36 3c 2f 62 3e 2c 20 3c 62 3e 73 68 61 35 256</b>, <b>sha5
5530: 31 32 3c 2f 62 3e 2c 20 3c 62 3e 73 68 61 33 2d 12</b>, <b>sha3-
5540: 32 35 36 3c 2f 62 3e 2c 0a 09 65 74 63 2e 20 53 256</b>,..etc. S
5550: 65 65 20 3c 62 3e 74 6c 73 3a 3a 64 69 67 65 73 ee <b>tls::diges
5560: 74 73 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 20 66 ts</b> command f
5570: 6f 72 20 61 20 66 75 6c 6c 20 6c 69 73 74 2e 3c or a full list.<
5580: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 /dd>.. <dt><a
5590: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 64 69 67 65 name="tls::dige
55a0: 73 74 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 sts"><strong>tls
55b0: 3a 3a 64 69 67 65 73 74 73 3c 2f 73 74 72 6f 6e ::digests</stron
55c0: 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 g></a></dt>.
55d0: 3c 64 64 3e 52 65 74 75 72 6e 73 20 61 20 6c 69 <dd>Returns a li
55e0: 73 74 20 6f 66 20 74 68 65 20 68 61 73 68 20 61 st of the hash a
55f0: 6c 67 6f 72 69 74 68 6d 73 20 66 6f 72 20 3c 62 lgorithms for <b
5600: 3e 74 6c 73 3a 3a 64 69 67 65 73 74 3c 2f 62 3e >tls::digest</b>
5610: 20 63 6f 6d 6d 61 6e 64 2e 3c 2f 64 64 3e 0a 0a command.</dd>..
5620: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d <dt><a name=
5630: 22 74 6c 73 3a 3a 6d 64 34 22 3e 3c 73 74 72 6f "tls::md4"><stro
5640: 6e 67 3e 74 6c 73 3a 3a 6d 64 34 3c 2f 73 74 72 ng>tls::md4</str
5650: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 ong> <em>data</e
5660: 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 m></a></dt>.
5670: 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20 <dd>Returns the
5680: 4d 44 34 20 6d 65 73 73 61 67 65 2d 64 69 67 65 MD4 message-dige
5690: 73 74 20 66 6f 72 20 3c 65 6d 3e 64 61 74 61 3c st for <em>data<
56a0: 2f 65 6d 3e 20 61 73 20 61 20 68 65 78 20 73 74 /em> as a hex st
56b0: 72 69 6e 67 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20 ring.</dd>..
56c0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
56d0: 3a 3a 6d 64 35 22 3e 3c 73 74 72 6f 6e 67 3e 74 ::md5"><strong>t
56e0: 6c 73 3a 3a 6d 64 35 3c 2f 73 74 72 6f 6e 67 3e ls::md5</strong>
56f0: 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 3c 2f <em>data</em></
5700: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e a></dt>. <dd>
5710: 52 65 74 75 72 6e 73 20 74 68 65 20 4d 44 35 20 Returns the MD5
5720: 6d 65 73 73 61 67 65 2d 64 69 67 65 73 74 20 66 message-digest f
5730: 6f 72 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e or <em>data</em>
5740: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 as a hex string
5750: 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e .</dd>.. <dt>
5760: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 68 <a name="tls::sh
5770: 61 31 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a a1"><strong>tls:
5780: 3a 73 68 61 31 3c 2f 73 74 72 6f 6e 67 3e 20 3c :sha1</strong> <
5790: 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 3c 2f 61 3e em>data</em></a>
57a0: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 </dt>. <dd>Re
57b0: 74 75 72 6e 73 20 74 68 65 20 53 48 41 31 20 73 turns the SHA1 s
57c0: 65 63 75 72 65 20 68 61 73 68 20 61 6c 67 6f 72 ecure hash algor
57d0: 69 74 68 6d 20 64 69 67 65 73 74 20 66 6f 72 20 ithm digest for
57e0: 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 20 61 73 <em>data</em> as
57f0: 20 61 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f a hex string.</
5800: 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 dd>.. <dt><a
5810: 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 68 61 32 35 name="tls::sha25
5820: 36 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 6"><strong>tls::
5830: 73 68 61 32 35 36 3c 2f 73 74 72 6f 6e 67 3e 20 sha256</strong>
5840: 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e 3c 2f 61 <em>data</em></a
5850: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 ></dt>. <dd>R
5860: 65 74 75 72 6e 73 20 74 68 65 20 53 48 41 2d 32 eturns the SHA-2
5870: 20 53 48 41 32 35 36 20 73 65 63 75 72 65 20 68 SHA256 secure h
5880: 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 20 64 69 ash algorithm di
5890: 67 65 73 74 20 66 6f 72 20 3c 65 6d 3e 64 61 74 gest for <em>dat
58a0: 61 3c 2f 65 6d 3e 20 61 73 20 61 20 68 65 78 20 a</em> as a hex
58b0: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 3c 2f 64 string.</dd>.</d
58c0: 6c 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d l>..<h3><a name=
58d0: 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e "CALLBACK OPTION
58e0: 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 S">CALLBACK OPTI
58f0: 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 ONS</a></h3>..<p
5900: 3e 0a 41 73 20 69 6e 64 69 63 61 74 65 64 20 61 >.As indicated a
5910: 62 6f 76 65 2c 20 69 6e 64 69 76 69 64 75 61 6c bove, individual
5920: 20 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20 62 65 channels can be
5930: 20 67 69 76 65 6e 20 74 68 65 69 72 20 6f 77 6e given their own
5940: 20 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20 68 61 callbacks.to ha
5950: 6e 64 6c 65 20 69 6e 74 65 72 6d 65 64 69 61 74 ndle intermediat
5960: 65 20 70 72 6f 63 65 73 73 69 6e 67 20 62 79 20 e processing by
5970: 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 the OpenSSL libr
5980: 61 72 79 2c 20 75 73 69 6e 67 20 74 68 65 0a 3c ary, using the.<
5990: 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c strong>-command<
59a0: 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e /strong>, <stron
59b0: 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 g>-password</str
59c0: 6f 6e 67 3e 2c 20 61 6e 64 0a 3c 73 74 72 6f 6e ong>, and.<stron
59d0: 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d g>-validate_comm
59e0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 74 and</strong> opt
59f0: 69 6f 6e 73 20 70 61 73 73 65 64 20 74 6f 20 65 ions passed to e
5a00: 69 74 68 65 72 20 6f 66 0a 3c 73 74 72 6f 6e 67 ither of.<strong
5a10: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 >tls::socket</st
5a20: 72 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f 6e 67 rong> or <strong
5a30: 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 >tls::import</st
5a40: 72 6f 6e 67 3e 2e 0a 49 66 20 74 68 65 20 63 61 rong>..If the ca
5a50: 6c 6c 62 61 63 6b 20 67 65 6e 65 72 61 74 65 73 llback generates
5a60: 20 61 6e 20 65 72 72 6f 72 2c 20 74 68 65 20 3c an error, the <
5a70: 62 3e 62 67 65 72 72 6f 72 3c 2f 62 3e 20 63 6f b>bgerror</b> co
5a80: 6d 6d 61 6e 64 20 77 69 74 68 20 62 65 0a 69 6e mmand with be.in
5a90: 76 6f 6b 65 64 20 77 69 74 68 20 74 68 65 20 65 voked with the e
5aa0: 72 72 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e rror information
5ab0: 2e 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 ..</p>..<blockqu
5ac0: 6f 74 65 3e 0a 3c 64 6c 3e 0a 0a 20 20 20 20 3c ote>.<dl>.. <
5ad0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d dt><strong>-comm
5ae0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d and</strong> <em
5af0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f >callback</em></
5b00: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e dt>. <dd>..In
5b10: 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 66 vokes the specif
5b20: 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b ied <em>callback
5b30: 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 61 74 20 </em> script at
5b40: 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 0a 09 several points..
5b50: 64 75 72 69 6e 67 20 74 68 65 20 4f 70 65 6e 53 during the OpenS
5b60: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 61 6e 64 SL handshake and
5b70: 20 75 73 65 2e 20 53 65 65 20 62 65 6c 6f 77 20 use. See below
5b80: 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62 6c 65 for the possible
5b90: 0a 09 61 72 67 75 6d 65 6e 74 73 20 70 61 73 73 ..arguments pass
5ba0: 65 64 20 74 6f 20 74 68 65 20 63 61 6c 6c 62 61 ed to the callba
5bb0: 63 6b 20 73 63 72 69 70 74 2e 20 56 61 6c 75 65 ck script. Value
5bc0: 73 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 s returned from
5bd0: 74 68 65 0a 09 63 61 6c 6c 62 61 63 6b 20 61 72 the..callback ar
5be0: 65 20 69 67 6e 6f 72 65 64 2e 0a 0a 09 3c 62 72 e ignored....<br
5bf0: 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a >..<br>...<dl>..
5c00: 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 .<dt>.. <strong
5c10: 3e 65 72 72 6f 72 3c 2f 73 74 72 6f 6e 67 3e 20 >error</strong>
5c20: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d 65 73 73 <em>channel mess
5c30: 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a age</em>..</dt>.
5c40: 09 3c 64 64 3e 0a 09 20 20 54 68 65 20 3c 65 6d .<dd>.. The <em
5c50: 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72 >message</em> ar
5c60: 67 75 6d 65 6e 74 20 63 6f 6e 74 61 69 6e 73 20 gument contains
5c70: 61 6e 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 an error message
5c80: 20 67 65 6e 65 72 61 74 65 64 0a 09 20 20 62 79 generated.. by
5c90: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e the OpenSSL fun
5ca0: 63 74 69 6f 6e 20 3c 63 6f 64 65 3e 45 52 52 5f ction <code>ERR_
5cb0: 72 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 reason_error_str
5cc0: 69 6e 67 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 3c ing()</code>...<
5cd0: 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64 /dd>...<br>...<d
5ce0: 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 69 6e t>.. <strong>in
5cf0: 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e fo</strong> <em>
5d00: 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f 72 20 6d 69 channel major mi
5d10: 6e 6f 72 20 6d 65 73 73 61 67 65 20 74 79 70 65 nor message type
5d20: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 </em>..</dt>..<d
5d30: 64 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 d>.. This form
5d40: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 of callback is i
5d50: 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 nvoked by the Op
5d60: 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 enSSL function..
5d70: 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f <code>SSL_CTX_
5d80: 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62 61 63 set_info_callbac
5d90: 6b 28 29 3c 2f 63 6f 64 65 3e 20 64 75 72 69 6e k()</code> durin
5da0: 67 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 65 74 g connection set
5db0: 75 70 0a 09 20 20 61 6e 64 20 75 73 65 2e 0a 09 up.. and use...
5dc0: 20 20 3c 62 72 3e 0a 09 20 20 3c 75 6c 3e 0a 09 <br>.. <ul>..
5dd0: 20 20 3c 6c 69 3e 50 6f 73 73 69 62 6c 65 20 76 <li>Possible v
5de0: 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d 61 alues for <em>ma
5df0: 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 0a 09 20 jor</em> are:..
5e00: 20 3c 63 6f 64 65 3e 68 61 6e 64 73 68 61 6b 65 <code>handshake
5e10: 2c 20 61 6c 65 72 74 2c 20 63 6f 6e 6e 65 63 74 , alert, connect
5e20: 2c 20 61 63 63 65 70 74 3c 2f 63 6f 64 65 3e 2e , accept</code>.
5e30: 3c 2f 6c 69 3e 0a 09 20 20 3c 6c 69 3e 50 6f 73 </li>.. <li>Pos
5e40: 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 sible values for
5e50: 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e 20 <em>minor</em>
5e60: 61 72 65 3a 0a 09 20 20 3c 63 6f 64 65 3e 73 74 are:.. <code>st
5e70: 61 72 74 2c 20 64 6f 6e 65 2c 20 72 65 61 64 2c art, done, read,
5e80: 20 77 72 69 74 65 2c 20 6c 6f 6f 70 2c 20 65 78 write, loop, ex
5e90: 69 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a it</code>.</li>.
5ea0: 09 20 20 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e 6d . <li>The <em>m
5eb0: 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72 67 75 essage</em> argu
5ec0: 6d 65 6e 74 20 69 73 20 61 20 64 65 73 63 72 69 ment is a descri
5ed0: 70 74 69 76 65 20 73 74 72 69 6e 67 20 77 68 69 ptive string whi
5ee0: 63 68 20 6d 61 79 0a 09 20 20 62 65 20 67 65 6e ch may.. be gen
5ef0: 65 72 61 74 65 64 20 65 69 74 68 65 72 20 62 79 erated either by
5f00: 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 74 61 74 65 <code>SSL_state
5f10: 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f _string_long()</
5f20: 63 6f 64 65 3e 20 6f 72 20 62 79 0a 09 20 20 3c code> or by.. <
5f30: 63 6f 64 65 3e 53 53 4c 5f 61 6c 65 72 74 5f 64 code>SSL_alert_d
5f40: 65 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 esc_string_long(
5f50: 29 3c 2f 63 6f 64 65 3e 2c 20 64 65 70 65 6e 64 )</code>, depend
5f60: 69 6e 67 20 6f 6e 20 74 68 65 20 63 6f 6e 74 65 ing on the conte
5f70: 78 74 2e 3c 2f 6c 69 3e 0a 09 20 20 3c 6c 69 3e xt.</li>.. <li>
5f80: 46 6f 72 20 61 6c 65 72 74 73 2c 20 74 68 65 20 For alerts, the
5f90: 70 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 73 20 possible values
5fa0: 66 6f 72 20 3c 65 6d 3e 74 79 70 65 3c 2f 65 6d for <em>type</em
5fb0: 3e 20 61 72 65 3a 0a 09 20 20 3c 63 6f 64 65 3e > are:.. <code>
5fc0: 77 61 72 6e 69 6e 67 2c 20 66 61 74 61 6c 2c 20 warning, fatal,
5fd0: 61 6e 64 20 75 6e 6b 6e 6f 77 6e 3c 2f 63 6f 64 and unknown</cod
5fe0: 65 3e 2e 20 46 6f 72 20 6f 74 68 65 72 73 2c 0a e>. For others,.
5ff0: 09 20 20 3c 63 6f 64 65 3e 69 6e 66 6f 3c 2f 63 . <code>info</c
6000: 6f 64 65 3e 20 69 73 20 75 73 65 64 2e 3c 2f 6c ode> is used.</l
6010: 69 3e 0a 09 20 20 3c 2f 75 6c 3e 0a 09 3c 2f 64 i>.. </ul>..</d
6020: 64 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 d>...<dt>.. <st
6030: 72 6f 6e 67 3e 6d 65 73 73 61 67 65 3c 2f 73 74 rong>message</st
6040: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 rong> <em>channe
6050: 6c 20 64 69 72 65 63 74 69 6f 6e 20 76 65 72 73 l direction vers
6060: 69 6f 6e 20 63 6f 6e 74 65 6e 74 5f 74 79 70 65 ion content_type
6070: 20 64 61 74 61 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 data</em>..</dt
6080: 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 73 20 >..<dd>.. This
6090: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b form of callback
60a0: 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 is invoked by t
60b0: 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 he OpenSSL funct
60c0: 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c ion.. <code>SSL
60d0: 5f 73 65 74 5f 6d 73 67 5f 63 61 6c 6c 62 61 63 _set_msg_callbac
60e0: 6b 28 29 3c 2f 63 6f 64 65 3e 20 77 68 65 6e 65 k()</code> whene
60f0: 76 65 72 20 61 20 6d 65 73 73 61 67 65 20 69 73 ver a message is
6100: 20 73 65 6e 74 20 6f 72 0a 09 20 20 72 65 63 65 sent or.. rece
6110: 69 76 65 64 2e 20 49 74 20 69 73 20 6f 6e 6c 79 ived. It is only
6120: 20 61 76 61 69 6c 61 62 6c 65 20 77 68 65 6e 0a available when.
6130: 09 20 20 4f 70 65 6e 53 53 4c 20 69 73 20 63 6f . OpenSSL is co
6140: 6d 70 6c 69 65 64 20 77 69 74 68 20 74 68 65 20 mplied with the
6150: 3c 65 6d 3e 65 6e 61 62 6c 65 2d 73 73 6c 2d 74 <em>enable-ssl-t
6160: 72 61 63 65 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e race</em> option
6170: 2e 0a 09 20 20 57 68 65 72 65 20 3c 65 6d 3e 64 ... Where <em>d
6180: 69 72 65 63 74 69 6f 6e 3c 2f 65 6d 3e 20 69 73 irection</em> is
6190: 20 53 65 6e 74 20 6f 72 20 52 65 63 65 69 76 65 Sent or Receive
61a0: 64 2c 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f d, <em>version</
61b0: 65 6d 3e 20 69 73 20 74 68 65 0a 09 20 20 70 72 em> is the.. pr
61c0: 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 2c 20 otocol version,
61d0: 3c 65 6d 3e 63 6f 6e 74 65 6e 74 5f 74 79 70 65 <em>content_type
61e0: 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 6d 65 73 </em> is the mes
61f0: 73 61 67 65 20 63 6f 6e 74 65 6e 74 20 74 79 70 sage content typ
6200: 65 2c 0a 09 20 20 61 6e 64 20 3c 65 6d 3e 64 61 e,.. and <em>da
6210: 74 61 3c 2f 65 6d 3e 20 69 73 20 6d 6f 72 65 20 ta</em> is more
6220: 69 6e 66 6f 20 6f 6e 20 74 68 65 20 6d 65 73 73 info on the mess
6230: 61 67 65 20 66 72 6f 6d 20 74 68 65 20 3c 63 6f age from the <co
6240: 64 65 3e 53 53 4c 5f 74 72 61 63 65 3c 2f 63 6f de>SSL_trace</co
6250: 64 65 3e 20 41 50 49 2e 0a 09 3c 2f 64 64 3e 0a de> API...</dd>.
6260: 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 .<br>...<dt>..
6270: 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 3c <strong>session<
6280: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 /strong> <em>cha
6290: 6e 6e 65 6c 20 73 65 73 73 69 6f 6e 5f 69 64 20 nnel session_id
62a0: 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 3c ticket lifetime<
62b0: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 /em>..</dt>..<dd
62c0: 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d 20 6f >.. This form o
62d0: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e f callback is in
62e0: 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 voked by the Ope
62f0: 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 nSSL function..
6300: 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73 <code>SSL_CTX_s
6310: 65 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62 28 29 ess_set_new_cb()
6320: 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 57 68 65 72 </code>... Wher
6330: 65 20 3c 65 6d 3e 73 65 73 73 69 6f 6e 5f 69 64 e <em>session_id
6340: 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 63 75 72 </em> is the cur
6350: 72 65 6e 74 20 73 65 73 73 69 6f 6e 20 69 64 65 rent session ide
6360: 6e 74 69 66 69 65 72 2c 0a 09 20 20 3c 65 6d 3e ntifier,.. <em>
6370: 74 69 63 6b 65 74 3c 2f 65 6d 3e 20 69 73 20 74 ticket</em> is t
6380: 68 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 he session ticke
6390: 74 20 69 6e 66 6f 2c 20 61 6e 64 20 3c 65 6d 3e t info, and <em>
63a0: 6c 69 66 65 74 69 6d 65 3c 2f 65 6d 3e 0a 09 20 lifetime</em>..
63b0: 20 69 73 20 74 68 65 20 74 68 65 20 74 69 63 6b is the the tick
63c0: 65 74 20 6c 69 66 65 74 69 6d 65 20 69 6e 20 73 et lifetime in s
63d0: 65 63 6f 6e 64 73 2e 0a 09 3c 2f 64 64 3e 0a 09 econds...</dd>..
63e0: 3c 62 72 3e 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 <br>..</dl>.
63f0: 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 62 72 3e 0a </dd>.. <br>.
6400: 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 . <dt><strong
6410: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f >-password</stro
6420: 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b ng> <em>callback
6430: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c </em></dt>. <
6440: 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65 dd>..Invokes the
6450: 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 specified <em>c
6460: 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 allback</em> scr
6470: 69 70 74 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c ipt when OpenSSL
6480: 20 6e 65 65 64 73 20 74 6f 0a 09 6f 62 74 61 69 needs to..obtai
6490: 6e 20 61 20 70 61 73 73 77 6f 72 64 2e 20 53 65 n a password. Se
64a0: 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 20 e below for the
64b0: 70 6f 73 73 69 62 6c 65 20 61 72 67 75 6d 65 6e possible argumen
64c0: 74 73 20 70 61 73 73 65 64 20 74 6f 0a 09 74 68 ts passed to..th
64d0: 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 e callback scrip
64e0: 74 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 t. See below for
64f0: 20 76 61 6c 69 64 20 72 65 74 75 72 6e 20 76 61 valid return va
6500: 6c 75 65 73 2e 0a 0a 09 3c 62 72 3e 0a 09 3c 62 lues....<br>..<b
6510: 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 09 3c 64 74 3e r>...<dl>...<dt>
6520: 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 70 61 73 73 .. <strong>pass
6530: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 word</strong> <e
6540: 6d 3e 72 77 66 6c 61 67 20 73 69 7a 65 3c 2f 65 m>rwflag size</e
6550: 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a m>..</dt>..<dd>.
6560: 09 20 20 49 6e 76 6f 6b 65 64 20 77 68 65 6e 20 . Invoked when
6570: 6c 6f 61 64 69 6e 67 20 6f 72 20 73 74 6f 72 69 loading or stori
6580: 6e 67 20 61 20 50 45 4d 20 63 65 72 74 69 66 69 ng a PEM certifi
6590: 63 61 74 65 20 77 69 74 68 20 65 6e 63 72 79 70 cate with encryp
65a0: 74 69 6f 6e 2e 0a 09 20 20 57 68 65 72 65 20 3c tion... Where <
65b0: 65 6d 3e 72 77 66 6c 61 67 3c 2f 65 6d 3e 20 69 em>rwflag</em> i
65c0: 73 20 30 20 66 6f 72 20 72 65 61 64 69 6e 67 2f s 0 for reading/
65d0: 64 65 63 72 79 70 74 69 6f 6e 20 6f 72 20 31 20 decryption or 1
65e0: 66 6f 72 0a 09 20 20 77 72 69 74 69 6e 67 2f 65 for.. writing/e
65f0: 6e 63 72 79 70 74 69 6f 6e 20 28 63 61 6e 20 70 ncryption (can p
6600: 72 6f 6d 70 74 20 75 73 65 72 20 74 6f 20 63 6f rompt user to co
6610: 6e 66 69 72 6d 29 20 61 6e 64 0a 09 20 20 3c 65 nfirm) and.. <e
6620: 6d 3e 73 69 7a 65 3c 2f 65 6d 3e 20 69 73 20 74 m>size</em> is t
6630: 68 65 20 6d 61 78 20 70 61 73 73 77 6f 72 64 20 he max password
6640: 6c 65 6e 67 74 68 20 69 6e 20 62 79 74 65 73 2e length in bytes.
6650: 0a 09 20 20 54 68 65 20 63 61 6c 6c 62 61 63 6b .. The callback
6660: 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 74 should return t
6670: 68 65 20 70 61 73 73 77 6f 72 64 20 61 73 20 61 he password as a
6680: 20 73 74 72 69 6e 67 2e 0a 09 3c 2f 64 64 3e 0a string...</dd>.
6690: 20 20 20 20 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c </dd>.. <
66a0: 62 72 3e 0a 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 br>... <dt><s
66b0: 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 63 trong>-validatec
66c0: 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 ommand</strong>
66d0: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d <em>callback</em
66e0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a ></dt>. <dd>.
66f0: 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 .Invokes the spe
6700: 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 cified <em>callb
6710: 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 ack</em> script
6720: 64 75 72 69 6e 67 20 68 61 6e 64 73 68 61 6b 65 during handshake
6730: 20 69 6e 0a 09 6f 72 64 65 72 20 74 6f 20 76 61 in..order to va
6740: 6c 69 64 61 74 65 20 74 68 65 20 70 72 6f 76 69 lidate the provi
6750: 64 65 64 20 76 61 6c 75 65 28 73 29 2e 20 53 65 ded value(s). Se
6760: 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 20 e below for the
6770: 70 6f 73 73 69 62 6c 65 0a 09 61 72 67 75 6d 65 possible..argume
6780: 6e 74 73 20 70 61 73 73 65 64 20 74 6f 20 74 68 nts passed to th
6790: 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 e callback scrip
67a0: 74 2e 0a 09 54 6f 20 72 65 6a 65 63 74 20 74 68 t...To reject th
67b0: 65 20 76 61 6c 75 65 20 61 6e 64 20 61 62 6f 72 e value and abor
67c0: 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 74 68 t connection, th
67d0: 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c e callback shoul
67e0: 64 20 72 65 74 75 72 6e 20 30 2e 0a 09 54 6f 20 d return 0...To
67f0: 61 63 63 65 70 74 20 74 68 65 20 76 61 6c 75 65 accept the value
6800: 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20 74 68 and continue th
6810: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69 74 e connection, it
6820: 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 31 should return 1
6830: 2e 0a 09 54 6f 20 72 65 6a 65 63 74 20 74 68 65 ...To reject the
6840: 20 76 61 6c 75 65 2c 20 62 75 74 20 63 6f 6e 74 value, but cont
6850: 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65 63 74 inue the connect
6860: 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64 20 72 ion, it should r
6870: 65 74 75 72 6e 20 32 2e 0a 0a 09 3c 62 72 3e 0a eturn 2....<br>.
6880: 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 09 3c .<br>...<dl>...<
6890: 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 61 dt>.. <strong>a
68a0: 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d lpn</strong> <em
68b0: 3e 63 68 61 6e 6e 65 6c 20 70 72 6f 74 6f 63 6f >channel protoco
68c0: 6c 20 6d 61 74 63 68 3c 2f 65 6d 3e 0a 09 3c 2f l match</em>..</
68d0: 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 46 6f 72 dt>..<dd>.. For
68e0: 20 73 65 72 76 65 72 73 2c 20 74 68 69 73 20 66 servers, this f
68f0: 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 orm of callback
6900: 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 is invoked when
6910: 74 68 65 20 63 6c 69 65 6e 74 20 41 4c 50 4e 0a the client ALPN.
6920: 09 20 20 65 78 74 65 6e 73 69 6f 6e 20 69 73 20 . extension is
6930: 72 65 63 65 69 76 65 64 2e 20 49 66 20 3c 65 6d received. If <em
6940: 3e 6d 61 74 63 68 3c 2f 65 6d 3e 20 69 73 20 74 >match</em> is t
6950: 72 75 65 2c 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f rue, <em>protoco
6960: 6c 3c 2f 65 6d 3e 0a 09 20 20 69 73 20 74 68 65 l</em>.. is the
6970: 20 66 69 72 73 74 20 3c 62 3e 2d 61 6c 70 6e 3c first <b>-alpn<
6980: 2f 62 3e 20 73 70 65 63 69 66 69 65 64 20 70 72 /b> specified pr
6990: 6f 74 6f 63 6f 6c 20 63 6f 6d 6d 6f 6e 20 74 6f otocol common to
69a0: 20 74 68 65 20 62 6f 74 68 20 74 68 65 0a 09 20 the both the..
69b0: 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 client and serv
69c0: 65 72 2e 20 49 66 20 6e 6f 74 2c 20 74 68 65 20 er. If not, the
69d0: 66 69 72 73 74 20 63 6c 69 65 6e 74 20 73 70 65 first client spe
69e0: 63 69 66 69 65 64 20 70 72 6f 74 6f 63 6f 6c 20 cified protocol
69f0: 69 73 0a 09 20 20 75 73 65 64 2e 20 43 61 6c 6c is.. used. Call
6a00: 65 64 20 61 66 74 65 72 20 68 65 6c 6c 6f 20 61 ed after hello a
6a10: 6e 64 20 41 4c 50 4e 20 63 61 6c 6c 62 61 63 6b nd ALPN callback
6a20: 73 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e s...</dd>...<br>
6a30: 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f ...<dt>.. <stro
6a40: 6e 67 3e 68 65 6c 6c 6f 3c 2f 73 74 72 6f 6e 67 ng>hello</strong
6a50: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 73 65 > <em>channel se
6a60: 72 76 65 72 6e 61 6d 65 3c 2f 65 6d 3e 0a 09 3c rvername</em>..<
6a70: 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 46 6f /dt>..<dd>.. Fo
6a80: 72 20 73 65 72 76 65 72 73 2c 20 74 68 69 73 20 r servers, this
6a90: 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b form of callback
6aa0: 20 69 73 20 69 6e 76 6f 6b 65 64 20 64 75 72 69 is invoked duri
6ab0: 6e 67 20 63 6c 69 65 6e 74 20 68 65 6c 6c 6f 0a ng client hello.
6ac0: 09 20 20 6d 65 73 73 61 67 65 20 70 72 6f 63 65 . message proce
6ad0: 73 73 69 6e 67 2e 20 49 74 20 69 73 20 75 73 65 ssing. It is use
6ae0: 64 20 74 6f 20 73 65 6c 65 63 74 20 61 6e 20 61 d to select an a
6af0: 70 70 72 6f 70 72 69 61 74 65 20 63 65 72 74 69 ppropriate certi
6b00: 66 69 63 61 74 65 20 74 6f 0a 09 20 20 70 72 65 ficate to.. pre
6b10: 73 65 6e 74 2c 20 61 6e 64 20 6d 61 6b 65 20 6f sent, and make o
6b20: 74 68 65 72 20 63 6f 6e 66 69 67 75 72 61 74 69 ther configurati
6b30: 6f 6e 20 61 64 6a 75 73 74 6d 65 6e 74 73 20 72 on adjustments r
6b40: 65 6c 65 76 61 6e 74 20 74 6f 20 74 68 61 74 0a elevant to that.
6b50: 09 20 20 73 65 72 76 65 72 20 6e 61 6d 65 20 61 . server name a
6b60: 6e 64 20 69 74 73 20 63 6f 6e 66 69 67 75 72 61 nd its configura
6b70: 74 69 6f 6e 2e 20 43 61 6c 6c 65 64 20 62 65 66 tion. Called bef
6b80: 6f 72 65 20 53 4e 49 20 61 6e 64 20 41 4c 50 4e ore SNI and ALPN
6b90: 20 63 61 6c 6c 62 61 63 6b 73 2e 0a 09 3c 2f 64 callbacks...</d
6ba0: 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e d>...<br>...<dt>
6bb0: 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 73 6e 69 3c .. <strong>sni<
6bc0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 /strong> <em>cha
6bd0: 6e 6e 65 6c 20 73 65 72 76 65 72 6e 61 6d 65 3c nnel servername<
6be0: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 /em>..</dt>..<dd
6bf0: 3e 0a 09 20 20 46 6f 72 20 73 65 72 76 65 72 73 >.. For servers
6c00: 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 , this form of c
6c10: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b allback is invok
6c20: 65 64 20 77 68 65 6e 20 74 68 65 20 53 4e 49 20 ed when the SNI
6c30: 65 78 74 65 6e 73 69 6f 6e 0a 09 20 20 66 72 6f extension.. fro
6c40: 6d 20 74 68 65 20 63 6c 69 65 6e 74 20 69 73 20 m the client is
6c50: 72 65 63 65 69 76 65 64 2e 20 57 68 65 72 65 20 received. Where
6c60: 3c 65 6d 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f <em>servername</
6c70: 65 6d 3e 20 69 73 20 74 68 65 20 63 6c 69 65 6e em> is the clien
6c80: 74 0a 09 20 20 70 72 6f 76 69 64 65 64 20 73 65 t.. provided se
6c90: 72 76 65 72 20 6e 61 6d 65 20 66 72 6f 6d 20 74 rver name from t
6ca0: 68 65 20 3c 62 3e 2d 73 65 72 76 65 72 6e 61 6d he <b>-servernam
6cb0: 65 3c 2f 62 3e 20 6f 70 74 69 6f 6e 2e 20 54 68 e</b> option. Th
6cc0: 69 73 20 69 73 0a 09 20 20 75 73 65 64 20 77 68 is is.. used wh
6cd0: 65 6e 20 61 20 73 65 72 76 65 72 20 73 75 70 70 en a server supp
6ce0: 6f 72 74 73 20 6d 75 6c 74 69 70 6c 65 20 6e 61 orts multiple na
6cf0: 6d 65 73 2c 20 73 6f 20 74 68 65 20 72 69 67 68 mes, so the righ
6d00: 74 20 63 65 72 74 69 66 69 63 61 74 65 0a 09 20 t certificate..
6d10: 20 63 61 6e 20 62 65 20 75 73 65 64 2e 20 43 61 can be used. Ca
6d20: 6c 6c 65 64 20 61 66 74 65 72 20 68 65 6c 6c 6f lled after hello
6d30: 20 63 61 6c 6c 62 61 63 6b 20 62 75 74 20 62 65 callback but be
6d40: 66 6f 72 65 20 41 4c 50 4e 20 63 61 6c 6c 62 61 fore ALPN callba
6d50: 63 6b 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 ck...</dd>...<br
6d60: 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 >...<dt>.. <str
6d70: 6f 6e 67 3e 76 65 72 69 66 79 3c 2f 73 74 72 6f ong>verify</stro
6d80: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 ng> <em>channel
6d90: 64 65 70 74 68 20 63 65 72 74 20 73 74 61 74 75 depth cert statu
6da0: 73 20 65 72 72 6f 72 3c 2f 65 6d 3e 0a 09 3c 2f s error</em>..</
6db0: 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69 dt>..<dd>.. Thi
6dc0: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 s form of callba
6dd0: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 ck is invoked by
6de0: 20 4f 70 65 6e 53 53 4c 20 77 68 65 6e 20 61 20 OpenSSL when a
6df0: 6e 65 77 20 63 65 72 74 69 66 69 63 61 74 65 0a new certificate.
6e00: 09 20 20 69 73 20 72 65 63 65 69 76 65 64 20 66 . is received f
6e10: 72 6f 6d 20 74 68 65 20 70 65 65 72 2e 20 49 74 rom the peer. It
6e20: 20 61 6c 6c 6f 77 73 20 74 68 65 20 63 6c 69 65 allows the clie
6e30: 6e 74 20 74 6f 20 63 68 65 63 6b 20 74 68 65 0a nt to check the.
6e40: 09 20 20 63 65 72 74 69 66 69 63 61 74 65 20 76 . certificate v
6e50: 65 72 69 66 69 63 61 74 69 6f 6e 20 72 65 73 75 erification resu
6e60: 6c 74 73 20 61 6e 64 20 63 68 6f 6f 73 65 20 77 lts and choose w
6e70: 68 65 74 68 65 72 20 74 6f 20 63 6f 6e 74 69 6e hether to contin
6e80: 75 65 0a 09 20 20 6f 72 20 6e 6f 74 2e 20 49 74 ue.. or not. It
6e90: 20 69 73 20 63 61 6c 6c 65 64 20 66 6f 72 20 65 is called for e
6ea0: 61 63 68 20 63 65 72 74 69 66 69 63 61 74 65 20 ach certificate
6eb0: 69 6e 20 74 68 65 20 63 65 72 74 69 66 69 63 61 in the certifica
6ec0: 74 65 20 63 68 61 69 6e 2e 0a 09 20 20 3c 75 6c te chain... <ul
6ed0: 3e 0a 09 20 20 3c 6c 69 3e 54 68 65 20 3c 65 6d >.. <li>The <em
6ee0: 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 72 67 75 >depth</em> argu
6ef0: 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74 65 67 ment is an integ
6f00: 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e 67 20 er representing
6f10: 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74 20 64 the.. current d
6f20: 65 70 74 68 20 6f 6e 20 74 68 65 20 63 65 72 74 epth on the cert
6f30: 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c 20 77 ificate chain, w
6f40: 69 74 68 0a 09 20 20 3c 63 6f 64 65 3e 30 3c 2f ith.. <code>0</
6f50: 63 6f 64 65 3e 20 61 73 20 74 68 65 20 70 65 65 code> as the pee
6f60: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 61 6e r certificate an
6f70: 64 20 68 69 67 68 65 72 20 76 61 6c 75 65 73 20 d higher values
6f80: 67 6f 69 6e 67 0a 09 20 20 75 70 20 74 6f 20 74 going.. up to t
6f90: 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20 41 he Certificate A
6fa0: 75 74 68 6f 72 69 74 79 20 28 43 41 29 2e 3c 2f uthority (CA).</
6fb0: 6c 69 3e 0a 09 20 20 3c 6c 69 3e 54 68 65 20 3c li>.. <li>The <
6fc0: 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 61 72 67 em>cert</em> arg
6fd0: 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 73 74 20 ument is a list
6fe0: 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 of key-value pai
6ff0: 72 73 20 73 69 6d 69 6c 61 72 0a 09 20 20 74 6f rs similar.. to
7000: 20 74 68 6f 73 65 20 72 65 74 75 72 6e 65 64 20 those returned
7010: 62 79 0a 09 20 20 3c 61 20 68 72 65 66 3d 22 23 by.. <a href="#
7020: 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74 tls::status"><st
7030: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73 rong>tls::status
7040: 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e 3c 2f </strong></a>.</
7050: 6c 69 3e 0a 09 20 20 3c 6c 69 3e 54 68 65 20 3c li>.. <li>The <
7060: 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 61 em>status</em> a
7070: 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 62 6f rgument is an bo
7080: 6f 6c 65 61 6e 20 72 65 70 72 65 73 65 6e 74 69 olean representi
7090: 6e 67 20 74 68 65 0a 09 20 20 76 61 6c 69 64 69 ng the.. validi
70a0: 74 79 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e ty of the curren
70b0: 74 20 63 65 72 74 69 66 69 63 61 74 65 2e 0a 09 t certificate...
70c0: 20 20 41 20 76 61 6c 75 65 20 6f 66 20 3c 63 6f A value of <co
70d0: 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 6d 65 61 6e de>0</code> mean
70e0: 73 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 s the certificat
70f0: 65 20 69 73 20 64 65 65 6d 65 64 20 69 6e 76 61 e is deemed inva
7100: 6c 69 64 2e 0a 09 20 20 41 20 76 61 6c 75 65 20 lid... A value
7110: 6f 66 20 3c 63 6f 64 65 3e 31 3c 2f 63 6f 64 65 of <code>1</code
7120: 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65 72 74 > means the cert
7130: 69 66 69 63 61 74 65 20 69 73 20 64 65 65 6d 65 ificate is deeme
7140: 64 20 76 61 6c 69 64 2e 3c 2f 6c 69 3e 0a 09 20 d valid.</li>..
7150: 20 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e 65 72 72 <li>The <em>err
7160: 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 or</em> argument
7170: 20 73 75 70 70 6c 69 65 73 20 74 68 65 20 6d 65 supplies the me
7180: 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2c 20 67 ssage, if any, g
7190: 65 6e 65 72 61 74 65 64 0a 09 20 20 62 79 20 3c enerated.. by <
71a0: 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f 52 45 5f code>X509_STORE_
71b0: 43 54 58 5f 67 65 74 5f 65 72 72 6f 72 28 29 3c CTX_get_error()<
71c0: 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a 09 20 20 /code>.</li>..
71d0: 3c 2f 75 6c 3e 0a 09 3c 2f 64 64 3e 0a 09 3c 62 </ul>..</dd>..<b
71e0: 72 3e 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f r>..</dl>. </
71f0: 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 dd>.</dl>.</bloc
7200: 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 0a 52 65 66 kquote>..<p>.Ref
7210: 65 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 erence implement
7220: 61 74 69 6f 6e 73 20 6f 66 20 74 68 65 73 65 20 ations of these
7230: 63 61 6c 6c 62 61 63 6b 73 20 61 72 65 20 70 72 callbacks are pr
7240: 6f 76 69 64 65 64 20 69 6e 20 74 68 65 0a 64 69 ovided in the.di
7250: 73 74 72 69 62 75 74 69 6f 6e 20 61 73 20 3c 73 stribution as <s
7260: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 trong>tls::callb
7270: 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 ack</strong>, <s
7280: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 trong>tls::passw
7290: 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 0a 61 6e ord</strong>,.an
72a0: 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 d <strong>tls::v
72b0: 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c alidate_command<
72c0: 2f 73 74 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 /strong> respect
72d0: 69 76 65 6c 79 2e 20 20 4e 6f 74 65 20 74 68 61 ively. Note tha
72e0: 74 20 74 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e t these are.<em>
72f0: 73 61 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c sample</em> impl
7300: 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 ementations only
7310: 2e 20 20 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 . In a more rea
7320: 6c 69 73 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e listic deploymen
7330: 74 0a 79 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 t.you would spec
7340: 69 66 79 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c ify your own cal
7350: 6c 62 61 63 6b 20 73 63 72 69 70 74 73 20 6f 6e lback scripts on
7360: 20 65 61 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 each TLS channe
7370: 6c 20 75 73 69 6e 67 20 74 68 65 0a 3c 73 74 72 l using the.<str
7380: 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 ong>-command</st
7390: 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 2d rong>, <strong>-
73a0: 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 password</strong
73b0: 3e 2c 20 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 2d >, and <strong>-
73c0: 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 validate_command
73d0: 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 74 69 6f 6e </strong> option
73e0: 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 s..</p>..<p>.The
73f0: 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f default behavio
7400: 72 20 77 68 65 6e 20 74 68 65 20 3c 73 74 72 6f r when the <stro
7410: 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 ng>-command</str
7420: 6f 6e 67 3e 20 61 6e 64 20 3c 73 74 72 6f 6e 67 ong> and <strong
7430: 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 >-validate_comma
7440: 6e 64 3c 2f 73 74 72 6f 6e 67 3e 0a 6f 70 74 69 nd</strong>.opti
7450: 6f 6e 73 20 61 72 65 20 6e 6f 74 20 73 70 65 63 ons are not spec
7460: 69 66 69 65 64 20 69 73 20 66 6f 72 20 54 4c 53 ified is for TLS
7470: 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 to process the
7480: 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 associated libra
7490: 72 79 20 63 61 6c 6c 62 61 63 6b 73 0a 69 6e 74 ry callbacks.int
74a0: 65 72 6e 61 6c 6c 79 2e 20 54 68 65 20 64 65 66 ernally. The def
74b0: 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 ault behavior wh
74c0: 65 6e 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 2d en the <strong>-
74d0: 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 password</strong
74e0: 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f 74 0a > option is not.
74f0: 73 70 65 63 69 66 69 65 64 20 69 73 20 66 6f 72 specified is for
7500: 20 54 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 TLS to process
7510: 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c the associated l
7520: 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 ibrary callbacks
7530: 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67 0a 74 by attempting.t
7540: 6f 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74 o call <strong>t
7550: 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 ls::password</st
7560: 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66 66 65 rong>..The diffe
7570: 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20 74 68 rence between th
7580: 65 73 65 20 74 77 6f 20 62 65 68 61 76 69 6f 72 ese two behavior
7590: 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75 65 6e s is a consequen
75a0: 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e 69 6e ce of maintainin
75b0: 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 g.compatibility
75c0: 77 69 74 68 20 65 61 72 6c 69 65 72 20 69 6d 70 with earlier imp
75d0: 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a 3c 2f lementations..</
75e0: 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73 74 72 p>..<p>.The <str
75f0: 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f ong>tls::debug</
7600: 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 6c 65 strong> variable
7610: 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 61 provides some a
7620: 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72 6f dditional.contro
7630: 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72 65 66 l over these ref
7640: 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 erence callbacks
7650: 2e 20 20 49 74 73 20 76 61 6c 75 65 20 69 73 20 . Its value is
7660: 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c 74 2e zero by default.
7670: 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73 20 70 .Higher values p
7680: 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 61 67 roduce more diag
7690: 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 20 61 nostic output, a
76a0: 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 nd will also for
76b0: 63 65 20 74 68 65 0a 76 65 72 69 66 79 20 6d 65 ce the.verify me
76c0: 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e 67 3e thod in <strong>
76d0: 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 tls::callback</s
76e0: 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 70 74 trong> to accept
76f0: 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 74 65 the.certificate
7700: 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74 20 69 , even when it i
7710: 73 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70 3e 0a s invalid..</p>.
7720: 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 .<p>.<em>.The us
7730: 65 20 6f 66 20 74 68 65 20 72 65 66 65 72 65 6e e of the referen
7740: 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c 73 74 ce callbacks <st
7750: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 rong>tls::callba
7760: 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c 0a 3c 73 74 ck</strong>,.<st
7770: 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f rong>tls::passwo
7780: 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 61 6e 64 rd</strong>, and
7790: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 61 <strong>tls::va
77a0: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f lidate_command</
77b0: 73 74 72 6f 6e 67 3e 0a 69 73 20 6e 6f 74 20 72 strong>.is not r
77c0: 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 20 54 68 65 ecommended. The
77d0: 79 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64 y may be removed
77e0: 20 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c from future rel
77f0: 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 eases..</em>.</p
7800: 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 >..<p>.<em>.The
7810: 75 73 65 20 6f 66 20 74 68 65 20 76 61 72 69 61 use of the varia
7820: 62 6c 65 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a ble <strong>tls:
7830: 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67 3e 20 :debug</strong>
7840: 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 is not recommend
7850: 65 64 2e 0a 49 74 20 6d 61 79 20 62 65 20 72 65 ed..It may be re
7860: 6d 6f 76 65 64 20 66 72 6f 6d 20 66 75 74 75 72 moved from futur
7870: 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d e releases..</em
7880: 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e >.</p>..<h3><a n
7890: 61 6d 65 3d 22 44 45 42 55 47 22 3e 44 45 42 55 ame="DEBUG">DEBU
78a0: 47 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 54 4c 53 20 G</a></h3>..TLS
78b0: 6b 65 79 20 6c 6f 67 67 69 6e 67 20 63 61 6e 20 key logging can
78c0: 62 65 20 65 6e 61 62 6c 65 64 20 62 79 20 73 65 be enabled by se
78d0: 74 74 69 6e 67 20 74 68 65 20 65 6e 76 69 72 6f tting the enviro
78e0: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 0a 3c nment variable.<
78f0: 62 3e 53 53 4c 4b 45 59 4c 4f 47 46 49 4c 45 3c b>SSLKEYLOGFILE<
7900: 2f 62 3e 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 /b> to the name
7910: 6f 66 20 74 68 65 20 66 69 6c 65 20 74 6f 20 6c of the file to l
7920: 6f 67 20 74 6f 2e 20 54 68 65 6e 20 77 68 65 6e og to. Then when
7930: 65 76 65 72 20 54 4c 53 0a 6b 65 79 20 6d 61 74 ever TLS.key mat
7940: 65 72 69 61 6c 20 69 73 20 67 65 6e 65 72 61 74 erial is generat
7950: 65 64 20 6f 72 20 72 65 63 65 69 76 65 64 20 69 ed or received i
7960: 74 20 77 69 6c 6c 20 62 65 20 6c 6f 67 67 65 64 t will be logged
7970: 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20 54 68 to the file. Th
7980: 69 73 0a 69 73 20 75 73 65 66 75 6c 20 66 6f 72 is.is useful for
7990: 20 6c 6f 67 67 69 6e 67 20 6b 65 79 20 64 61 74 logging key dat
79a0: 61 20 66 6f 72 20 6e 65 74 77 6f 72 6b 20 6c 6f a for network lo
79b0: 67 67 69 6e 67 20 74 6f 6f 6c 73 20 74 6f 20 75 gging tools to u
79c0: 73 65 20 74 6f 0a 64 65 63 72 79 70 74 20 74 68 se to.decrypt th
79d0: 65 20 64 61 74 61 2e 0a 0a 3c 68 33 3e 3c 61 20 e data...<h3><a
79e0: 6e 61 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d name="HTTPS EXAM
79f0: 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 PLE">HTTPS EXAMP
7a00: 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e LE</a></h3>..<p>
7a10: 54 68 69 73 20 65 78 61 6d 70 6c 65 20 75 73 65 This example use
7a20: 73 20 61 20 73 61 6d 70 6c 65 20 73 65 72 76 65 s a sample serve
7a30: 72 2e 70 65 6d 20 70 72 6f 76 69 64 65 64 20 77 r.pem provided w
7a40: 69 74 68 20 74 68 65 20 54 4c 53 20 72 65 6c 65 ith the TLS rele
7a50: 61 73 65 2c 0a 63 6f 75 72 74 65 73 79 20 6f 66 ase,.courtesy of
7a60: 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 4f 70 65 the <strong>Ope
7a70: 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 70 72 nSSL</strong> pr
7a80: 6f 6a 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70 72 65 oject.</p>..<pre
7a90: 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 ><code>.package
7aa0: 72 65 71 75 69 72 65 20 68 74 74 70 0a 70 61 63 require http.pac
7ab0: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 kage require tls
7ac0: 0a 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 ..http::register
7ad0: 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 https 443 [list
7ae0: 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d ::tls::socket -
7af0: 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 autoservername t
7b00: 72 75 65 20 2d 72 65 71 75 69 72 65 20 74 72 75 rue -require tru
7b10: 65 20 2d 63 61 64 69 72 20 2f 65 74 63 2f 73 73 e -cadir /etc/ss
7b20: 6c 2f 63 65 72 74 73 5d 0a 0a 73 65 74 20 74 6f l/certs]..set to
7b30: 6b 20 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 k [http::geturl
7b40: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c 2e https://www.tcl.
7b50: 74 6b 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 tk/].</code></pr
7b60: 65 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d e>..<h3><a name=
7b70: 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 "SPECIAL CONSIDE
7b80: 52 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 4c RATIONS">SPECIAL
7b90: 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c CONSIDERATIONS<
7ba0: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 65 /a></h3>..<p>The
7bb0: 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f 66 capabilities of
7bc0: 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 61 this package ca
7bd0: 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 6c n vary enormousl
7be0: 79 20 62 61 73 65 64 20 75 70 6f 6e 20 68 6f 77 y based upon how
7bf0: 20 79 6f 75 72 0a 4f 70 65 6e 53 53 4c 20 6c 69 your.OpenSSL li
7c00: 62 72 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 brary was config
7c10: 75 72 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 ured and built.
7c20: 4e 65 77 20 76 65 72 73 69 6f 6e 73 20 6d 61 79 New versions may
7c30: 20 6f 62 73 6f 6c 65 74 65 20 6f 6c 64 65 72 0a obsolete older.
7c40: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e protocol version
7c50: 73 2c 20 61 64 64 20 6f 72 20 72 65 6d 6f 76 65 s, add or remove
7c60: 20 63 69 70 68 65 72 73 2c 20 63 68 61 6e 67 65 ciphers, change
7c70: 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 73 2c default values,
7c80: 20 65 74 63 2e 20 55 73 65 20 74 68 65 0a 3c 73 etc. Use the.<s
7c90: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70 68 65 trong>tls::ciphe
7ca0: 72 73 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 20 rs</strong> and
7cb0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f <strong>tls::pro
7cc0: 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 tocols</strong>
7cd0: 63 6f 6d 6d 61 6e 64 73 20 74 6f 0a 6f 62 74 61 commands to.obta
7ce0: 69 6e 20 74 68 65 20 73 75 70 70 6f 72 74 65 64 in the supported
7cf0: 20 76 65 72 73 69 6f 6e 73 2e 3c 2f 70 3e 0a 0a versions.</p>..
7d00: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 45 <h3><a name="SEE
7d10: 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c ALSO">SEE ALSO<
7d20: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 73 74 /a></h3>..<p><st
7d30: 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74 72 rong>socket</str
7d40: 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 66 69 ong>, <strong>fi
7d50: 6c 65 65 76 65 6e 74 2c 20 3c 2f 73 74 72 6f 6e leevent, </stron
7d60: 67 3e 3c 61 0a 68 72 65 66 3d 22 68 74 74 70 3a g><a.href="http:
7d70: 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 //www.openssl.or
7d80: 67 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e g/"><strong>Open
7d90: 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e SSL</strong></a>
7da0: 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 </p>..<hr>..<pre
7db0: 3e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 >.Copyright &cop
7dc0: 79 3b 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 y; 1999 Matt New
7dd0: 6d 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 man..Copyright &
7de0: 63 6f 70 79 3b 20 32 30 30 34 20 53 74 61 72 66 copy; 2004 Starf
7df0: 69 73 68 20 53 79 73 74 65 6d 73 2e 0a 3c 2f 70 ish Systems..</p
7e00: 72 65 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 re>.</body>.</ht
7e10: 6d 6c 3e 0a ml>.