0000: 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0a <!DOCTYPE html>.
0010: 3c 68 74 6d 6c 20 6c 61 6e 67 3d 22 65 6e 22 3e <html lang="en">
0020: 0a 3c 68 65 61 64 3e 0a 3c 6d 65 74 61 20 68 74 .<head>.<meta ht
0030: 74 70 2d 65 71 75 69 76 3d 22 43 6f 6e 74 65 6e tp-equiv="Conten
0040: 74 2d 54 79 70 65 22 20 63 6f 6e 74 65 6e 74 3d t-Type" content=
0050: 22 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 "text/html; char
0060: 73 65 74 3d 75 74 66 2d 38 22 3e 0a 3c 6d 65 74 set=utf-8">.<met
0070: 61 20 6e 61 6d 65 3d 22 43 6f 70 79 72 69 67 68 a name="Copyrigh
0080: 74 22 20 63 6f 6e 74 65 6e 74 3d 22 31 39 39 39 t" content="1999
0090: 20 4d 61 74 74 20 4e 65 77 6d 61 6e 20 2f 20 32 Matt Newman / 2
00a0: 30 30 34 20 53 74 61 72 66 69 73 68 20 53 79 73 004 Starfish Sys
00b0: 74 65 6d 73 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c tems">.<title>TL
00c0: 53 20 28 53 53 4c 29 20 54 43 4c 20 43 6f 6d 6d S (SSL) TCL Comm
00d0: 61 6e 64 73 3c 2f 74 69 74 6c 65 3e 0a 3c 6c 69 ands</title>.<li
00e0: 6e 6b 20 72 65 6c 3d 22 73 74 79 6c 65 73 68 65 nk rel="styleshe
00f0: 65 74 22 20 68 72 65 66 3d 22 64 6f 63 73 2e 63 et" href="docs.c
0100: 73 73 22 20 74 79 70 65 3d 22 74 65 78 74 2f 63 ss" type="text/c
0110: 73 73 22 20 6d 65 64 69 61 3d 22 61 6c 6c 22 3e ss" media="all">
0120: 0a 3c 2f 68 65 61 64 3e 0a 0a 3c 62 6f 64 79 20 .</head>..<body
0130: 63 6c 61 73 73 3d 22 76 73 63 2d 69 6e 69 74 69 class="vsc-initi
0140: 61 6c 69 7a 65 64 22 3e 0a 0a 3c 68 32 3e 54 43 alized">..<h2>TC
0150: 4c 20 54 6c 73 20 45 78 74 65 6e 73 69 6f 6e 20 L Tls Extension
0160: 44 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 3c 2f 68 Documentation</h
0170: 32 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 64 2>..<dl>. <dd
0180: 3e 3c 61 20 68 72 65 66 3d 22 23 4e 41 4d 45 22 ><a href="#NAME"
0190: 3e 4e 41 4d 45 3c 2f 61 3e 0a 20 20 20 20 3c 64 >NAME</a>. <d
01a0: 6c 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3c 2f l>..<dd><b>tls</
01b0: 62 3e 20 2d 20 62 69 6e 64 69 6e 67 20 74 6f 20 b> - binding to
01c0: 3c 62 3e 4f 70 65 6e 53 53 4c 3c 2f 62 3e 20 6c <b>OpenSSL</b> l
01d0: 69 62 72 61 72 79 0a 09 66 6f 72 20 65 6e 63 72 ibrary..for encr
01e0: 79 70 74 65 64 20 73 6f 63 6b 65 74 20 61 6e 64 ypted socket and
01f0: 20 49 2f 4f 20 63 68 61 6e 6e 65 6c 20 63 6f 6d I/O channel com
0200: 6d 75 6e 69 63 61 74 69 6f 6e 73 2e 3c 2f 64 64 munications.</dd
0210: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 >. </dl>.
0220: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 </dd>. <dd><a
0230: 20 68 72 65 66 3d 22 23 53 59 4e 4f 50 53 49 53 href="#SYNOPSIS
0240: 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 3e 20 3c ">SYNOPSIS</a> <
0250: 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 64 6c /dd>. <dd><dl
0260: 3e 0a 09 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 >..<dd><b>packag
0270: 65 20 72 65 71 75 69 72 65 20 54 63 6c 3c 2f 62 e require Tcl</b
0280: 3e 20 3c 65 6d 3e 3f 3c 62 3e 38 2e 35 2d 3c 2f > <em>?<b>8.5-</
0290: 62 3e 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c b>?</em></dd>..<
02a0: 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 65 dd><b>package re
02b0: 71 75 69 72 65 20 74 6c 73 3c 2f 62 3e 20 3c 65 quire tls</b> <e
02c0: 6d 3e 3f 3c 62 3e 31 2e 38 2d 3c 2f 62 3e 3f 3c m>?<b>1.8-</b>?<
02d0: 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 26 /em></dd>..<dt>&
02e0: 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 3c 64 64 3e nbsp;</dt>..<dd>
02f0: 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 3c 2f 62 3e <b>tls::init</b>
0300: 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f <em>?options?</
0310: 65 6d 3e 20 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c em> </dd>..<dd><
0320: 62 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 b>tls::socket</b
0330: 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e 73 3f 20 > <em>?options?
0340: 68 6f 73 74 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f host port</em></
0350: 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3a dd>..<dd><b>tls:
0360: 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e :socket</b> <em>
0370: 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 ?-server command
0380: 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 ? ?options? port
0390: 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64 64 3e </em></dd>..<dd>
03a0: 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b <b>tls::handshak
03b0: 65 3c 2f 62 3e 20 3c 65 6d 3e 20 63 68 61 6e 6e e</b> <em> chann
03c0: 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c 64 el</em></dd>..<d
03d0: 64 3e 3c 62 3e 74 6c 73 3a 3a 73 74 61 74 75 73 d><b>tls::status
03e0: 3c 2f 62 3e 20 3c 65 6d 3e 3f 2d 6c 6f 63 61 6c </b> <em>?-local
03f0: 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f ? channel</em></
0400: 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c 73 3a dd>..<dd><b>tls:
0410: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c 2f 62 3e 20 :connection</b>
0420: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e <em>channel</em>
0430: 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 6c </dd>..<dd><b>tl
0440: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 s::import</b> <e
0450: 6d 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f m>channel ?optio
0460: 6e 73 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c ns?</em></dd>..<
0470: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 dd><b>tls::unimp
0480: 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63 68 61 6e ort</b> <em>chan
0490: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 3c nel</em></dd>..<
04a0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 dt> </dt>..
04b0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 69 70 68 <dd><b>tls::ciph
04c0: 65 72 73 3c 2f 62 3e 20 3c 65 6d 3e 3f 70 72 6f ers</b> <em>?pro
04d0: 74 6f 63 6f 6c 3f 20 3f 76 65 72 62 6f 73 65 3f tocol? ?verbose?
04e0: 20 3f 73 75 70 70 6f 72 74 65 64 3f 3c 2f 65 6d ?supported?</em
04f0: 3e 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 ></dd>..<dd><b>t
0500: 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62 ls::protocols</b
0510: 3e 3c 2f 64 64 3e 0a 09 3c 64 64 3e 3c 62 3e 74 ></dd>..<dd><b>t
0520: 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 62 3e 3c ls::version</b><
0530: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 3c 2f /dd>. </dl></
0540: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 dd>. <dd><a h
0550: 72 65 66 3d 22 23 43 4f 4d 4d 41 4e 44 53 22 3e ref="#COMMANDS">
0560: 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e 3c 2f 64 64 COMMANDS</a></dd
0570: 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 >. <dd><a hre
0580: 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 f="#CALLBACK OPT
0590: 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f IONS">CALLBACK O
05a0: 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 64 64 3e 0a PTIONS</a></dd>.
05b0: 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66 3d <dd><a href=
05c0: 22 23 48 54 54 50 53 20 45 58 41 4d 50 4c 45 22 "#HTTPS EXAMPLE"
05d0: 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 3c 2f >HTTPS EXAMPLE</
05e0: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e a></dd>. <dd>
05f0: 3c 61 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c <a href="#SEE AL
0600: 53 4f 22 3e 53 50 45 43 49 41 4c 20 43 4f 4e 53 SO">SPECIAL CONS
0610: 49 44 45 52 41 54 49 4f 4e 53 3c 2f 61 3e 3c 2f IDERATIONS</a></
0620: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 dd>. <dd><a h
0630: 72 65 66 3d 22 23 53 45 45 20 41 4c 53 4f 22 3e ref="#SEE ALSO">
0640: 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 64 64 SEE ALSO</a></dd
0650: 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c >.</dl>..<hr>..<
0660: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 4e 41 4d 45 h3><a name="NAME
0670: 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f 68 33 3e 0a ">NAME</a></h3>.
0680: 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3c .<p><strong>tls<
0690: 2f 73 74 72 6f 6e 67 3e 20 2d 20 62 69 6e 64 69 /strong> - bindi
06a0: 6e 67 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 4f 70 ng to <strong>Op
06b0: 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20 6c enSSL</strong> l
06c0: 69 62 72 61 72 79 0a 66 6f 72 20 65 6e 63 72 79 ibrary.for encry
06d0: 70 74 65 64 20 73 6f 63 6b 65 74 20 61 6e 64 20 pted socket and
06e0: 49 2f 4f 20 63 68 61 6e 6e 65 6c 20 63 6f 6d 6d I/O channel comm
06f0: 75 6e 69 63 61 74 69 6f 6e 73 2e 3c 2f 70 3e 0a unications.</p>.
0700: 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 .<hr>..<h3><a na
0710: 6d 65 3d 22 53 59 4e 4f 50 53 49 53 22 3e 53 59 me="SYNOPSIS">SY
0720: 4e 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 33 3e 0a NOPSIS</a></h3>.
0730: 0a 3c 70 3e 3c 62 3e 70 61 63 6b 61 67 65 20 72 .<p><b>package r
0740: 65 71 75 69 72 65 20 54 63 6c 3c 2f 62 3e 20 3c equire Tcl</b> <
0750: 65 6d 3e 3f 3c 62 3e 38 2e 35 2d 3c 2f 62 3e 3f em>?<b>8.5-</b>?
0760: 3c 2f 65 6d 3e 3c 62 72 3e 0a 3c 62 3e 70 61 63 </em><br>.<b>pac
0770: 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c 73 kage require tls
0780: 3c 2f 62 3e 20 3c 65 6d 3e 3f 3c 62 3e 31 2e 38 </b> <em>?<b>1.8
0790: 2d 3c 2f 62 3e 3f 3c 2f 65 6d 3e 3c 62 72 3e 0a -</b>?</em><br>.
07a0: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 <br>.<a href="#t
07b0: 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73 ls::init"><b>tls
07c0: 3a 3a 69 6e 69 74 3c 2f 62 3e 20 3c 69 3e 3f 6f ::init</b> <i>?o
07d0: 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c ptions?</i></a><
07e0: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c br>.<a href="#tl
07f0: 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c s::socket"><b>tl
0800: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 69 s::socket</b> <i
0810: 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73 74 20 >?options? host
0820: 70 6f 72 74 3c 2f 69 3e 3c 62 72 3e 0a 3c 61 20 port</i><br>.<a
0830: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b href="#tls::sock
0840: 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b et"><b>tls::sock
0850: 65 74 3c 2f 62 3e 20 3c 69 3e 3f 2d 73 65 72 76 et</b> <i>?-serv
0860: 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74 er command? ?opt
0870: 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 69 3e 3c 2f ions? port</i></
0880: 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 a><br>.<a href="
0890: 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 62 #tls::status"><b
08a0: 3e 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f 62 3e >tls::status</b>
08b0: 20 3c 69 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61 <i>?-local? cha
08c0: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e nnel</i></a><br>
08d0: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a .<a href="#tls::
08e0: 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c 62 3e 74 connection"><b>t
08f0: 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c 2f ls::connection</
0900: 62 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69 b> <i>channel</i
0910: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 ></a><br>.<a hre
0920: 66 3d 22 23 74 6c 73 3a 3a 68 61 6e 64 73 68 61 f="#tls::handsha
0930: 6b 65 22 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 ke"><b>tls::hand
0940: 73 68 61 6b 65 3c 2f 62 3e 20 3c 69 3e 63 68 61 shake</b> <i>cha
0950: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e nnel</i></a><br>
0960: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a .<a href="#tls::
0970: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a import"><b>tls::
0980: 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 69 3e 63 68 import</b> <i>ch
0990: 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c annel ?options?<
09a0: 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 /i></a><br>.<a h
09b0: 72 65 66 3d 22 23 74 6c 73 3a 3a 75 6e 69 6d 70 ref="#tls::unimp
09c0: 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 ort"><b>tls::uni
09d0: 6d 70 6f 72 74 3c 2f 62 3e 20 3c 69 3e 63 68 61 mport</b> <i>cha
09e0: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e nnel</i></a><br>
09f0: 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 .<br>.<a href="#
0a00: 74 6c 73 3a 3a 63 69 70 68 65 72 73 22 3e 3c 62 tls::ciphers"><b
0a10: 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f 62 >tls::ciphers</b
0a20: 3e 20 3c 69 3e 3f 70 72 6f 74 6f 63 6f 6c 3f 20 > <i>?protocol?
0a30: 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 70 6f ?verbose? ?suppo
0a40: 72 74 65 64 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 rted?</i></a><br
0a50: 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a >.<a href="#tls:
0a60: 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e 3c 62 3e 74 :protocols"><b>t
0a70: 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62 ls::protocols</b
0a80: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 ></a><br>.<a hre
0a90: 66 3d 22 23 74 6c 73 3a 3a 76 65 72 73 69 6f 6e f="#tls::version
0aa0: 22 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f "><b>tls::versio
0ab0: 6e 3c 2f 62 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 2f n</b></a><br>.</
0ac0: 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 p>..<hr>..<h3><a
0ad0: 20 6e 61 6d 65 3d 22 44 45 53 43 52 49 50 54 49 name="DESCRIPTI
0ae0: 4f 4e 22 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c ON">DESCRIPTION<
0af0: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 /a></h3>..<p>Thi
0b00: 73 20 65 78 74 65 6e 73 69 6f 6e 20 70 72 6f 76 s extension prov
0b10: 69 64 65 73 20 54 43 4c 20 73 63 72 69 70 74 20 ides TCL script
0b20: 61 63 63 65 73 73 20 74 6f 20 73 65 63 75 72 65 access to secure
0b30: 20 73 6f 63 6b 65 74 20 63 6f 6d 6d 75 6e 69 63 socket communic
0b40: 61 74 69 6f 6e 73 0a 75 73 69 6e 67 20 74 68 65 ations.using the
0b50: 20 54 72 61 6e 73 70 6f 72 74 20 4c 61 79 65 72 Transport Layer
0b60: 20 53 65 63 75 72 69 74 79 20 28 54 4c 53 29 20 Security (TLS)
0b70: 70 72 6f 74 6f 63 6f 6c 2e 20 49 74 20 70 72 6f protocol. It pro
0b80: 76 69 64 65 73 20 61 20 67 65 6e 65 72 69 63 0a vides a generic.
0b90: 62 69 6e 64 69 6e 67 20 74 6f 20 3c 61 20 68 72 binding to <a hr
0ba0: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e ef="https://www.
0bb0: 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 22 3e 4f 70 openssl.org/">Op
0bc0: 65 6e 53 53 4c 3c 2f 61 3e 2c 20 75 74 69 6c 69 enSSL</a>, utili
0bd0: 7a 69 6e 67 20 74 68 65 0a 3c 73 74 72 6f 6e 67 zing the.<strong
0be0: 3e 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e 6e 65 >Tcl_StackChanne
0bf0: 6c 3c 2f 73 74 72 6f 6e 67 3e 20 41 50 49 20 69 l</strong> API i
0c00: 6e 20 54 43 4c 20 38 2e 34 20 61 6e 64 20 68 69 n TCL 8.4 and hi
0c10: 67 68 65 72 2e 0a 54 68 65 73 65 20 73 6f 63 6b gher..These sock
0c20: 65 74 73 20 62 65 68 61 76 65 20 65 78 61 63 74 ets behave exact
0c30: 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 20 63 ly the same as c
0c40: 68 61 6e 6e 65 6c 73 20 63 72 65 61 74 65 64 20 hannels created
0c50: 75 73 69 6e 67 20 74 68 65 20 62 75 69 6c 74 2d using the built-
0c60: 69 6e 0a 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 in.<strong>socke
0c70: 74 3c 2f 73 74 72 6f 6e 67 3e 20 63 6f 6d 6d 61 t</strong> comma
0c80: 6e 64 2c 20 61 6c 6f 6e 67 20 77 69 74 68 20 61 nd, along with a
0c90: 64 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e dditional option
0ca0: 73 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 6c 69 6e s for controllin
0cb0: 67 0a 74 68 65 20 53 53 4c 2f 54 4c 53 20 73 65 g.the SSL/TLS se
0cc0: 73 73 69 6f 6e 2e 0a 3c 2f 70 3e 0a 0a 3c 68 72 ssion..</p>..<hr
0cd0: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 >..<h3><a name="
0ce0: 43 4f 4d 4d 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e COMMANDS">COMMAN
0cf0: 44 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e DS</a></h3>..<p>
0d00: 54 79 70 69 63 61 6c 6c 79 20 6f 6e 65 20 77 6f Typically one wo
0d10: 75 6c 64 20 75 73 65 20 74 68 65 20 3c 73 74 72 uld use the <str
0d20: 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 ong>tls::socket
0d30: 3c 2f 73 74 72 6f 6e 67 3e 63 6f 6d 6d 61 6e 64 </strong>command
0d40: 0a 77 68 69 63 68 20 70 72 6f 76 69 64 65 73 20 .which provides
0d50: 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 77 69 compatibility wi
0d60: 74 68 20 74 68 65 20 6e 61 74 69 76 65 20 54 43 th the native TC
0d70: 4c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 L <strong>socket
0d80: 3c 2f 73 74 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e </strong>.comman
0d90: 64 2e 20 49 6e 20 73 75 63 68 20 63 61 73 65 73 d. In such cases
0da0: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d <strong>tls::im
0db0: 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 20 73 68 port</strong> sh
0dc0: 6f 75 6c 64 20 6e 6f 74 20 62 65 0a 75 73 65 64 ould not be.used
0dd0: 20 64 69 72 65 63 74 6c 79 2e 3c 2f 70 3e 0a 3c directly.</p>.<
0de0: 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e dl>. <dt><a n
0df0: 61 6d 65 3d 22 74 6c 73 3a 3a 69 6e 69 74 22 3e ame="tls::init">
0e00: 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 <b>tls::init </b
0e10: 3e 3c 69 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 ><i>?options?</i
0e20: 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c ></a></dt>. <
0e30: 64 64 3e 4f 70 74 69 6f 6e 61 6c 20 66 75 6e 63 dd>Optional func
0e40: 74 69 6f 6e 20 74 6f 20 73 65 74 20 74 68 65 20 tion to set the
0e50: 64 65 66 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20 default options
0e60: 75 73 65 64 20 62 79 0a 09 3c 73 74 72 6f 6e 67 used by..<strong
0e70: 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 >tls::socket</st
0e80: 72 6f 6e 67 3e 2e 20 49 66 20 79 6f 75 20 63 61 rong>. If you ca
0e90: 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a ll <strong>tls::
0ea0: 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a import</strong>.
0eb0: 09 64 69 72 65 63 74 6c 79 2c 20 74 68 69 73 20 .directly, this
0ec0: 63 6f 6d 6d 61 6e 64 20 68 61 73 20 6e 6f 20 65 command has no e
0ed0: 66 66 65 63 74 2e 20 54 68 69 73 20 63 6f 6d 6d ffect. This comm
0ee0: 61 6e 64 20 73 75 70 70 6f 72 74 73 20 61 6c 6c and supports all
0ef0: 20 6f 66 20 74 68 65 0a 09 73 61 6d 65 20 6f 70 of the..same op
0f00: 74 69 6f 6e 73 20 61 73 20 74 68 65 20 3c 73 74 tions as the <st
0f10: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 rong>tls::socket
0f20: 3c 2f 73 74 72 6f 6e 67 3e 20 63 6f 6d 6d 61 6e </strong> comman
0f30: 64 2c 20 74 68 6f 75 67 68 20 79 6f 75 0a 09 73 d, though you..s
0f40: 68 6f 75 6c 64 20 6c 69 6d 69 74 20 79 6f 75 72 hould limit your
0f50: 20 6f 70 74 69 6f 6e 73 20 74 6f 20 6f 6e 6c 79 options to only
0f60: 20 54 4c 53 20 72 65 6c 61 74 65 64 20 6f 6e 65 TLS related one
0f70: 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e s.</dd>. <dt>
0f80: 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 </dt>.
0f90: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
0fa0: 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 ::socket"><b>tls
0fb0: 3a 3a 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d ::socket </b><em
0fc0: 3e 3f 6f 70 74 69 6f 6e 73 3f 0a 09 68 6f 73 74 >?options?..host
0fd0: 20 70 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f port</em></a></
0fe0: 64 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 62 3e 74 dt>. <dt><b>t
0ff0: 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65 ls::socket</b><e
1000: 6d 3e 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d m> ?-server comm
1010: 61 6e 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 and? ?options? p
1020: 6f 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ort</em></dt>.
1030: 20 20 3c 64 64 3e 54 68 69 73 20 69 73 20 61 20 <dd>This is a
1040: 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e 20 helper function
1050: 74 68 61 74 20 75 74 69 6c 69 7a 65 73 20 74 68 that utilizes th
1060: 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 63 6f 6d e underlying com
1070: 6d 61 6e 64 73 0a 09 28 3c 73 74 72 6f 6e 67 3e mands..(<strong>
1080: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 socket</strong>
1090: 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a and <strong>tls:
10a0: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e :import</strong>
10b0: 29 20 74 6f 20 63 72 65 61 74 65 0a 09 74 68 65 ) to create..the
10c0: 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 20 49 74 20 connection. It
10d0: 62 65 68 61 76 65 73 20 74 68 65 20 73 61 6d 65 behaves the same
10e0: 20 61 73 20 74 68 65 20 6e 61 74 69 76 65 20 54 as the native T
10f0: 43 4c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 CL <strong>socke
1100: 74 3c 2f 73 74 72 6f 6e 67 3e 0a 09 63 6f 6d 6d t</strong>..comm
1110: 61 6e 64 2c 20 62 75 74 20 61 6c 73 6f 20 73 75 and, but also su
1120: 70 70 6f 72 74 73 20 74 68 65 20 3c 61 20 68 72 pports the <a hr
1130: 65 66 3d 22 23 74 6c 73 3a 3a 69 6d 70 6f 72 74 ef="#tls::import
1140: 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 69 6d "><strong>tls:im
1150: 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 port</strong></a
1160: 3e 0a 09 63 6f 6d 6d 61 6e 64 20 6f 70 74 69 6f >..command optio
1170: 6e 73 20 61 6e 64 20 6f 6e 65 20 61 64 64 69 74 ns and one addit
1180: 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 3a 3c 2f 64 ional option:</d
1190: 64 3e 0a 20 20 20 20 3c 64 6c 3e 3c 62 6c 6f 63 d>. <dl><bloc
11a0: 6b 71 75 6f 74 65 3e 0a 09 3c 64 74 3e 3c 73 74 kquote>..<dt><st
11b0: 72 6f 6e 67 3e 2d 61 75 74 6f 73 65 72 76 65 72 rong>-autoserver
11c0: 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 name</strong> <e
11d0: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e m>bool</em></dt>
11e0: 0a 09 3c 64 64 3e 41 75 74 6f 6d 61 74 69 63 61 ..<dd>Automatica
11f0: 6c 6c 79 20 73 65 74 20 74 68 65 20 2d 73 65 72 lly set the -ser
1200: 76 65 72 6e 61 6d 65 20 61 72 67 75 6d 65 6e 74 vername argument
1210: 20 74 6f 20 74 68 65 20 3c 65 6d 3e 68 6f 73 74 to the <em>host
1220: 3c 2f 65 6d 3e 0a 09 61 72 67 75 6d 65 6e 74 20 </em>..argument
1230: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e (default is <em>
1240: 66 61 6c 73 65 3c 2f 65 6d 3e 29 2e 3c 2f 64 64 false</em>).</dd
1250: 3e 0a 20 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f >. </blockquo
1260: 74 65 3e 3c 2f 64 6c 3e 0a 0a 20 20 20 20 3c 64 te></dl>.. <d
1270: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a t><a name="tls::
1280: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a import"><b>tls::
1290: 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 import </b><i>ch
12a0: 61 6e 6e 65 6c 0a 09 3f 6f 70 74 69 6f 6e 73 3f annel..?options?
12b0: 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 </i></a></dt>.
12c0: 20 20 3c 64 64 3e 41 64 64 20 53 53 4c 2f 54 4c <dd>Add SSL/TL
12d0: 53 20 65 6e 63 72 79 70 74 69 6f 6e 20 74 6f 20 S encryption to
12e0: 61 20 72 65 67 75 6c 61 72 20 54 43 4c 20 63 68 a regular TCL ch
12f0: 61 6e 6e 65 6c 2e 20 49 74 20 6e 65 65 64 0a 09 annel. It need..
1300: 6e 6f 74 20 62 65 20 61 20 73 6f 63 6b 65 74 2c not be a socket,
1310: 20 62 75 74 20 6d 75 73 74 20 70 72 6f 76 69 64 but must provid
1320: 65 20 62 69 2d 64 69 72 65 63 74 69 6f 6e 61 6c e bi-directional
1330: 20 66 6c 6f 77 2e 20 41 6c 73 6f 0a 09 73 65 74 flow. Also..set
1340: 20 73 65 73 73 69 6f 6e 20 70 61 72 61 6d 65 74 session paramet
1350: 65 72 73 20 66 6f 72 20 53 53 4c 20 68 61 6e 64 ers for SSL hand
1360: 73 68 61 6b 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 shake.</dd>.
1370: 3c 64 6c 3e 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e <dl><blockquote>
1380: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 ..<dt><strong>-a
1390: 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d lpn</strong> <em
13a0: 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >list</em></dt>.
13b0: 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 70 72 6f .<dd>List of pro
13c0: 74 6f 63 6f 6c 73 20 74 6f 20 6f 66 66 65 72 20 tocols to offer
13d0: 64 75 72 69 6e 67 20 41 70 70 6c 69 63 61 74 69 during Applicati
13e0: 6f 6e 2d 4c 61 79 65 72 0a 09 20 20 20 20 50 72 on-Layer.. Pr
13f0: 6f 74 6f 63 6f 6c 20 4e 65 67 6f 74 69 61 74 69 otocol Negotiati
1400: 6f 6e 20 28 41 4c 50 4e 29 2e 20 46 6f 72 20 65 on (ALPN). For e
1410: 78 61 6d 70 6c 65 3a 20 3c 65 6d 3e 68 32 3c 2f xample: <em>h2</
1420: 65 6d 3e 20 61 6e 64 0a 09 20 20 20 20 3c 65 6d em> and.. <em
1430: 3e 68 74 74 70 2f 31 2e 31 3c 2f 65 6d 3e 2c 20 >http/1.1</em>,
1440: 62 75 74 20 6e 6f 74 20 3c 65 6d 3e 68 33 3c 2f but not <em>h3</
1450: 65 6d 3e 20 6f 72 20 3c 65 6d 3e 71 75 69 63 3c em> or <em>quic<
1460: 2f 65 6d 3e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e /em>.</dd>..<dt>
1470: 3c 73 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f <strong>-cadir</
1480: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c strong> <em>dir<
1490: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 /em></dt>..<dd>S
14a0: 70 65 63 69 66 69 65 73 20 74 68 65 20 64 69 72 pecifies the dir
14b0: 65 63 74 6f 72 79 20 77 68 65 72 65 20 74 68 65 ectory where the
14c0: 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 Certificate Aut
14d0: 68 6f 72 69 74 79 20 28 43 41 29 0a 09 20 20 20 hority (CA)..
14e0: 20 63 65 72 74 69 66 69 63 61 74 65 73 20 61 72 certificates ar
14f0: 65 20 73 74 6f 72 65 64 2e 20 54 68 65 20 64 65 e stored. The de
1500: 66 61 75 6c 74 20 69 73 20 70 6c 61 74 66 6f 72 fault is platfor
1510: 6d 20 73 70 65 63 69 66 69 63 20 61 6e 64 20 63 m specific and c
1520: 61 6e 20 62 65 0a 09 20 20 20 20 73 65 74 20 61 an be.. set a
1530: 74 20 63 6f 6d 70 69 6c 65 20 74 69 6d 65 2e 20 t compile time.
1540: 54 68 69 73 20 63 61 6e 20 62 65 20 6f 76 65 72 This can be over
1550: 72 69 64 64 65 6e 20 76 69 61 20 74 68 65 20 3c ridden via the <
1560: 62 3e 53 53 4c 5f 43 45 52 54 5f 44 49 52 3c 2f b>SSL_CERT_DIR</
1570: 62 3e 0a 09 20 20 20 20 65 6e 76 69 72 6f 6e 6d b>.. environm
1580: 65 6e 74 20 76 61 72 69 61 62 6c 65 2e 3c 2f 64 ent variable.</d
1590: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
15a0: 2d 63 61 66 69 6c 65 20 3c 2f 73 74 72 6f 6e 67 -cafile </strong
15b0: 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 ><em>filename</e
15c0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 m></dt>..<dd>Spe
15d0: 63 69 66 69 65 73 20 74 68 65 20 66 69 6c 65 20 cifies the file
15e0: 77 69 74 68 20 74 68 65 20 43 65 72 74 69 66 69 with the Certifi
15f0: 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 28 cate Authority (
1600: 43 41 29 20 63 65 72 74 69 66 69 63 61 74 65 73 CA) certificates
1610: 0a 09 20 20 20 20 74 6f 20 75 73 65 2e 20 54 68 .. to use. Th
1620: 65 20 64 65 66 61 75 6c 74 20 69 73 20 3c 62 3e e default is <b>
1630: 63 65 72 74 2e 70 65 6d 3c 2f 62 3e 2c 20 69 6e cert.pem</b>, in
1640: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 64 69 72 the OpenSSL dir
1650: 65 63 74 6f 72 79 2e 20 54 68 69 73 20 63 61 6e ectory. This can
1660: 0a 09 20 20 20 20 61 6c 73 6f 20 62 65 20 6f 76 .. also be ov
1670: 65 72 72 69 64 64 65 6e 20 76 69 61 20 74 68 65 erridden via the
1680: 20 3c 62 3e 53 53 4c 5f 43 45 52 54 5f 46 49 4c <b>SSL_CERT_FIL
1690: 45 3c 2f 62 3e 20 65 6e 76 69 72 6f 6e 6d 65 6e E</b> environmen
16a0: 74 20 76 61 72 69 61 62 6c 65 2e 3c 2f 64 64 3e t variable.</dd>
16b0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 ..<dt><strong>-c
16c0: 61 73 74 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 astore</strong>
16d0: 3c 65 6d 3e 55 52 49 3c 2f 65 6d 3e 3c 2f 64 74 <em>URI</em></dt
16e0: 3e 0a 09 3c 64 64 3e 55 52 49 20 66 6f 72 20 61 >..<dd>URI for a
16f0: 20 73 74 6f 72 65 2c 20 77 68 69 63 68 20 6d 61 store, which ma
1700: 79 20 62 65 20 61 20 73 69 6e 67 6c 65 20 63 6f y be a single co
1710: 6e 74 61 69 6e 65 72 20 6f 72 20 61 20 63 61 74 ntainer or a cat
1720: 61 6c 6f 67 20 6f 66 0a 09 20 20 20 20 63 6f 6e alog of.. con
1730: 74 61 69 6e 65 72 73 2e 20 4f 6e 20 57 69 6e 64 tainers. On Wind
1740: 6f 77 73 2c 20 73 65 74 20 74 6f 20 22 6f 72 67 ows, set to "org
1750: 2e 6f 70 65 6e 73 73 6c 2e 77 69 6e 73 74 6f 72 .openssl.winstor
1760: 65 3a 2f 2f 22 20 74 6f 20 75 73 65 20 74 68 65 e://" to use the
1770: 0a 09 20 20 20 20 62 75 69 6c 74 2d 69 6e 20 57 .. built-in W
1780: 69 6e 64 6f 77 73 20 43 65 72 74 20 53 74 6f 72 indows Cert Stor
1790: 65 2e 20 54 68 65 20 57 69 6e 64 6f 77 73 20 63 e. The Windows c
17a0: 65 72 74 20 73 74 6f 72 65 20 6f 6e 6c 79 20 73 ert store only s
17b0: 75 70 70 6f 72 74 73 0a 09 20 20 20 20 72 6f 6f upports.. roo
17c0: 74 20 63 65 72 74 69 66 69 63 61 74 65 20 73 74 t certificate st
17d0: 6f 72 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e ores.</dd>..<dt>
17e0: 3c 73 74 72 6f 6e 67 3e 2d 63 65 72 74 66 69 6c <strong>-certfil
17f0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 e</strong> <em>f
1800: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 ilename</em></dt
1810: 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 65 73 >..<dd>Specifies
1820: 20 74 68 65 20 66 69 6c 65 20 77 69 74 68 20 74 the file with t
1830: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 74 he certificate t
1840: 6f 20 75 73 65 20 69 6e 20 50 45 4d 20 66 6f 72 o use in PEM for
1850: 6d 61 74 2e 0a 09 20 20 20 20 54 68 69 73 20 61 mat... This a
1860: 6c 73 6f 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 lso contains the
1870: 20 70 75 62 6c 69 63 20 6b 65 79 2e 3c 2f 64 64 public key.</dd
1880: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d >..<dt><strong>-
1890: 63 65 72 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 cert</strong> <e
18a0: 6d 3e 62 69 6e 61 72 79 5f 73 74 72 69 6e 67 3c m>binary_string<
18b0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 /em></dt>..<dd>S
18c0: 70 65 63 69 66 69 65 73 20 74 68 65 20 63 65 72 pecifies the cer
18d0: 74 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 20 tificate to use
18e0: 61 73 20 61 20 44 45 52 20 65 6e 63 6f 64 65 64 as a DER encoded
18f0: 20 73 74 72 69 6e 67 20 28 58 2e 35 30 39 20 44 string (X.509 D
1900: 45 52 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ER).</dd>..<dt><
1910: 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72 3c 2f strong>-cipher</
1920: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 strong> <em>stri
1930: 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ng</em></dt>..<d
1940: 64 3e 53 70 65 63 69 66 69 65 73 20 74 68 65 20 d>Specifies the
1950: 6c 69 73 74 20 6f 66 20 63 69 70 68 65 72 73 20 list of ciphers
1960: 74 6f 20 75 73 65 20 66 6f 72 20 54 4c 53 20 31 to use for TLS 1
1970: 2e 32 20 61 6e 64 20 65 61 72 6c 69 65 72 2e 20 .2 and earlier.
1980: 53 74 72 69 6e 67 20 69 73 20 61 0a 09 20 20 20 String is a..
1990: 20 63 6f 6c 6f 6e 20 28 22 3a 22 29 20 73 65 70 colon (":") sep
19a0: 61 72 61 74 65 64 20 6c 69 73 74 20 6f 66 20 63 arated list of c
19b0: 69 70 68 65 72 73 2e 20 43 69 70 68 65 72 73 20 iphers. Ciphers
19c0: 63 61 6e 20 62 65 20 63 6f 6d 62 69 6e 65 64 20 can be combined
19d0: 75 73 69 6e 67 20 74 68 65 0a 09 20 20 20 20 3c using the.. <
19e0: 62 3e 2b 3c 2f 62 3e 20 63 68 61 72 61 63 74 65 b>+</b> characte
19f0: 72 2e 20 50 72 65 66 69 78 65 73 20 63 61 6e 20 r. Prefixes can
1a00: 62 65 20 75 73 65 64 20 74 6f 20 70 65 72 6d 61 be used to perma
1a10: 6e 65 6e 74 6c 79 20 72 65 6d 6f 76 65 20 28 22 nently remove ("
1a20: 21 22 29 2c 0a 09 20 20 20 20 64 65 6c 65 74 65 !"),.. delete
1a30: 20 28 22 2d 22 29 2c 20 6f 72 20 6d 6f 76 65 20 ("-"), or move
1a40: 61 20 63 69 70 68 65 72 20 74 6f 20 74 68 65 20 a cipher to the
1a50: 65 6e 64 20 6f 66 20 74 68 65 20 6c 69 73 74 20 end of the list
1a60: 28 22 2b 22 29 2e 20 4b 65 79 77 6f 72 64 73 0a ("+"). Keywords.
1a70: 09 20 20 20 20 3c 62 3e 40 53 54 52 45 4e 47 54 . <b>@STRENGT
1a80: 48 3c 2f 62 3e 20 28 73 6f 72 74 20 62 79 20 61 H</b> (sort by a
1a90: 6c 67 6f 72 69 74 68 6d 20 6b 65 79 20 6c 65 6e lgorithm key len
1aa0: 67 74 68 29 2c 20 3c 62 3e 40 53 45 43 4c 45 56 gth), <b>@SECLEV
1ab0: 45 4c 3d 3c 2f 62 3e 3c 69 3e 6e 3c 2f 69 3e 0a EL=</b><i>n</i>.
1ac0: 09 20 20 20 20 28 73 65 74 20 73 65 63 75 72 69 . (set securi
1ad0: 74 79 20 6c 65 76 65 6c 20 74 6f 20 6e 29 2c 20 ty level to n),
1ae0: 61 6e 64 20 3c 62 3e 44 45 46 41 55 4c 54 3c 2f and <b>DEFAULT</
1af0: 62 3e 20 28 75 73 65 20 64 65 66 61 75 6c 74 20 b> (use default
1b00: 63 69 70 68 65 72 20 6c 69 73 74 2c 0a 09 20 20 cipher list,..
1b10: 20 20 61 74 20 73 74 61 72 74 20 6f 6e 6c 79 29 at start only)
1b20: 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 73 70 65 can also be spe
1b30: 63 69 66 69 65 64 2e 20 53 65 65 20 4f 70 65 6e cified. See Open
1b40: 53 53 4c 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f SSL documentatio
1b50: 6e 20 66 6f 72 20 74 68 65 0a 09 20 20 20 20 66 n for the.. f
1b60: 75 6c 6c 20 6c 69 73 74 20 6f 66 20 76 61 6c 69 ull list of vali
1b70: 64 20 76 61 6c 75 65 73 2e 3c 2f 64 64 3e 0a 09 d values.</dd>..
1b80: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 69 70 <dt><strong>-cip
1b90: 68 65 72 73 75 69 74 65 73 3c 2f 73 74 72 6f 6e hersuites</stron
1ba0: 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 g> <em>string</e
1bb0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 m></dt>..<dd>Spe
1bc0: 63 69 66 69 65 73 20 74 68 65 20 6c 69 73 74 20 cifies the list
1bd0: 6f 66 20 63 69 70 68 65 72 20 73 75 69 74 65 73 of cipher suites
1be0: 20 74 6f 20 75 73 65 20 66 6f 72 20 54 4c 53 20 to use for TLS
1bf0: 31 2e 33 2e 20 53 74 72 69 6e 67 20 69 73 20 61 1.3. String is a
1c00: 20 63 6f 6c 6f 6e 0a 09 20 20 20 20 28 22 3a 22 colon.. (":"
1c10: 29 20 73 65 70 61 72 61 74 65 64 20 6c 69 73 74 ) separated list
1c20: 20 6f 66 20 63 69 70 68 65 72 20 73 75 69 74 65 of cipher suite
1c30: 20 6e 61 6d 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 names.</dd>..<d
1c40: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 t><strong>-comma
1c50: 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e nd</strong> <em>
1c60: 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 callback</em></d
1c70: 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 65 t>..<dd>Specifie
1c80: 73 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 63 s the callback c
1c90: 6f 6d 6d 61 6e 64 20 74 6f 20 62 65 20 69 6e 76 ommand to be inv
1ca0: 6f 6b 65 64 20 61 74 20 73 65 76 65 72 61 6c 20 oked at several
1cb0: 70 6f 69 6e 74 73 20 64 75 72 69 6e 67 20 74 68 points during th
1cc0: 65 0a 09 20 20 20 20 68 61 6e 64 73 68 61 6b 65 e.. handshake
1cd0: 20 74 6f 20 70 61 73 73 20 65 72 72 6f 72 73 2c to pass errors,
1ce0: 20 74 72 61 63 69 6e 67 20 69 6e 66 6f 72 6d 61 tracing informa
1cf0: 74 69 6f 6e 2c 20 61 6e 64 20 70 72 6f 74 6f 63 tion, and protoc
1d00: 6f 6c 20 6d 65 73 73 61 67 65 73 2e 0a 09 20 20 ol messages...
1d10: 20 20 53 65 65 20 3c 61 20 68 72 65 66 3d 22 23 See <a href="#
1d20: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 CALLBACK OPTIONS
1d30: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f ">CALLBACK OPTIO
1d40: 4e 53 3c 2f 61 3e 20 66 6f 72 20 6d 6f 72 65 20 NS</a> for more
1d50: 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e info.</dd>..<dt>
1d60: 3c 73 74 72 6f 6e 67 3e 2d 64 68 70 61 72 61 6d <strong>-dhparam
1d70: 73 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 66 s </strong><em>f
1d80: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 ilename</em></dt
1d90: 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 65 73 >..<dd>Specifies
1da0: 20 74 68 65 20 44 69 66 66 69 65 2d 48 65 6c 6c the Diffie-Hell
1db0: 6d 61 6e 20 28 44 48 29 20 70 61 72 61 6d 65 74 man (DH) paramet
1dc0: 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64 3e 0a 09 ers file.</dd>..
1dd0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 79 <dt><strong>-key
1de0: 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 file</strong> <e
1df0: 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c m>filename</em><
1e00: 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 /dt>..<dd>Specif
1e10: 69 65 73 20 74 68 65 20 70 72 69 76 61 74 65 20 ies the private
1e20: 6b 65 79 20 66 69 6c 65 2e 20 28 64 65 66 61 75 key file. (defau
1e30: 6c 74 20 69 73 20 76 61 6c 75 65 20 6f 66 20 2d lt is value of -
1e40: 63 65 72 74 66 69 6c 65 29 2e 3c 2f 64 64 3e 0a certfile).</dd>.
1e50: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 6b 65 .<dt><strong>-ke
1e60: 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 y</strong> <em>f
1e70: 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 ilename</em></dt
1e80: 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 65 73 >..<dd>Specifies
1e90: 20 74 68 65 20 70 72 69 76 61 74 65 20 6b 65 79 the private key
1ea0: 20 74 6f 20 75 73 65 20 61 73 20 61 20 44 45 52 to use as a DER
1eb0: 20 65 6e 63 6f 64 65 64 20 73 74 72 69 6e 67 20 encoded string
1ec0: 28 50 4b 43 53 23 31 20 44 45 52 29 2e 3c 2f 64 (PKCS#1 DER).</d
1ed0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
1ee0: 2d 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 -model</strong>
1ef0: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e <em>channel</em>
1f00: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 46 6f 72 63 65 </dt>..<dd>Force
1f10: 20 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 74 6f this channel to
1f20: 20 73 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 share the same
1f30: 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c 5f <em><strong>SSL_
1f40: 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65 6d CTX</strong></em
1f50: 3e 0a 09 20 20 20 20 73 74 72 75 63 74 75 72 65 >.. structure
1f60: 20 61 73 20 74 68 65 20 73 70 65 63 69 66 69 65 as the specifie
1f70: 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 d <em>channel</e
1f80: 6d 3e 2c 20 61 6e 64 0a 09 20 20 20 20 74 68 65 m>, and.. the
1f90: 72 65 66 6f 72 65 20 73 68 61 72 65 20 63 61 6c refore share cal
1fa0: 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64 3e lbacks etc.</dd>
1fb0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 ..<dt><strong>-p
1fc0: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e assword</strong>
1fd0: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 <em>callback</e
1fe0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 m></dt>..<dd>Spe
1ff0: 63 69 66 69 65 73 20 74 68 65 20 63 61 6c 6c 62 cifies the callb
2000: 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 69 ack command to i
2010: 6e 76 6f 6b 65 20 77 68 65 6e 20 4f 70 65 6e 53 nvoke when OpenS
2020: 53 4c 20 6e 65 65 64 73 20 74 6f 0a 09 20 20 20 SL needs to..
2030: 20 6f 62 74 61 69 6e 20 61 20 70 61 73 73 77 6f obtain a passwo
2040: 72 64 2e 20 54 68 69 73 20 69 73 20 74 79 70 69 rd. This is typi
2050: 63 61 6c 6c 79 20 75 73 65 64 20 74 6f 20 75 6e cally used to un
2060: 6c 6f 63 6b 20 74 68 65 20 70 72 69 76 61 74 65 lock the private
2070: 20 6b 65 79 20 6f 66 0a 09 20 20 20 20 61 20 63 key of.. a c
2080: 65 72 74 69 66 69 63 61 74 65 2e 20 54 68 65 20 ertificate. The
2090: 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 callback should
20a0: 72 65 74 75 72 6e 20 61 20 70 61 73 73 77 6f 72 return a passwor
20b0: 64 20 73 74 72 69 6e 67 2e 0a 09 20 20 20 20 53 d string... S
20c0: 65 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c ee <a href="#CAL
20d0: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 LBACK OPTIONS">C
20e0: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c ALLBACK OPTIONS<
20f0: 2f 61 3e 20 66 6f 72 20 6d 6f 72 65 20 69 6e 66 /a> for more inf
2100: 6f 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 o.</dd>..<dt><st
2110: 72 6f 6e 67 3e 2d 70 6f 73 74 5f 68 61 6e 64 73 rong>-post_hands
2120: 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 hake</strong> <e
2130: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e m>bool</em></dt>
2140: 0a 09 3c 64 64 3e 41 6c 6c 6f 77 20 70 6f 73 74 ..<dd>Allow post
2150: 2d 68 61 6e 64 73 68 61 6b 65 20 73 65 73 73 69 -handshake sessi
2160: 6f 6e 20 74 69 63 6b 65 74 20 75 70 64 61 74 65 on ticket update
2170: 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 s.</dd>..<dt><st
2180: 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 20 3c 2f rong>-request </
2190: 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c 3c strong><em>bool<
21a0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 52 /em></dt>..<dd>R
21b0: 65 71 75 65 73 74 20 61 20 63 65 72 74 69 66 69 equest a certifi
21c0: 63 61 74 65 20 66 72 6f 6d 20 70 65 65 72 20 64 cate from peer d
21d0: 75 72 69 6e 67 20 74 68 65 20 53 53 4c 20 68 61 uring the SSL ha
21e0: 6e 64 73 68 61 6b 65 2e 20 54 68 69 73 20 69 73 ndshake. This is
21f0: 0a 09 20 20 20 20 6e 65 65 64 65 64 20 74 6f 20 .. needed to
2200: 64 6f 20 63 65 72 74 69 66 69 63 61 74 65 20 76 do certificate v
2210: 61 6c 69 64 61 74 69 6f 6e 2e 20 28 64 65 66 61 alidation. (defa
2220: 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c ult is <em>true<
2230: 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e /em>)</dd>..<dt>
2240: 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 69 72 65 <strong>-require
2250: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f </strong> <em>bo
2260: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ol</em></dt>..<d
2270: 64 3e 52 65 71 75 69 72 65 20 61 20 76 61 6c 69 d>Require a vali
2280: 64 20 63 65 72 74 69 66 69 63 61 74 65 20 66 72 d certificate fr
2290: 6f 6d 20 70 65 65 72 20 64 75 72 69 6e 67 20 53 om peer during S
22a0: 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e 20 49 66 SL handshake. If
22b0: 20 74 68 69 73 0a 09 20 20 20 20 69 73 20 73 65 this.. is se
22c0: 74 20 74 6f 20 74 72 75 65 2c 20 74 68 65 6e 20 t to true, then
22d0: 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73 74 <strong>-request
22e0: 3c 2f 73 74 72 6f 6e 67 3e 20 6d 75 73 74 20 61 </strong> must a
22f0: 6c 73 6f 20 62 65 20 73 65 74 20 74 6f 20 74 72 lso be set to tr
2300: 75 65 0a 09 20 20 20 20 61 6e 64 20 61 20 65 69 ue.. and a ei
2310: 74 68 65 72 20 61 20 2d 63 61 64 69 72 2c 20 2d ther a -cadir, -
2320: 63 61 66 69 6c 65 2c 20 6f 72 20 70 6c 61 74 66 cafile, or platf
2330: 6f 72 6d 20 64 65 66 61 75 6c 74 20 6d 75 73 74 orm default must
2340: 20 62 65 20 70 72 6f 76 69 64 65 64 20 69 6e 0a be provided in.
2350: 09 20 20 20 20 6f 72 64 65 72 20 74 6f 20 76 61 . order to va
2360: 6c 69 64 61 74 65 20 61 67 61 69 6e 73 74 2e 20 lidate against.
2370: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e (default is <em>
2380: 66 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e false</em>)</dd>
2390: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 ..<dt><strong>-s
23a0: 65 63 75 72 69 74 79 5f 6c 65 76 65 6c 3c 2f 73 ecurity_level</s
23b0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 69 6e 74 65 67 trong> <em>integ
23c0: 65 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 er</em></dt>..<d
23d0: 64 3e 53 70 65 63 69 66 69 65 73 20 74 68 65 20 d>Specifies the
23e0: 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 28 security level (
23f0: 76 61 6c 75 65 20 66 72 6f 6d 20 30 20 74 6f 20 value from 0 to
2400: 35 29 2e 20 54 68 65 20 73 65 63 75 72 69 74 79 5). The security
2410: 20 6c 65 76 65 6c 0a 09 20 20 20 20 61 66 66 65 level.. affe
2420: 63 74 73 20 74 68 65 20 63 69 70 68 65 72 20 73 cts the cipher s
2430: 75 69 74 65 20 65 6e 63 72 79 70 74 69 6f 6e 20 uite encryption
2440: 61 6c 67 6f 72 69 74 68 6d 73 2c 20 73 75 70 70 algorithms, supp
2450: 6f 72 74 65 64 20 45 43 43 20 63 75 72 76 65 73 orted ECC curves
2460: 2c 0a 09 20 20 20 20 73 75 70 70 6f 72 74 65 64 ,.. supported
2470: 20 73 69 67 6e 61 74 75 72 65 20 61 6c 67 6f 72 signature algor
2480: 69 74 68 6d 73 2c 20 44 48 20 70 61 72 61 6d 65 ithms, DH parame
2490: 74 65 72 20 73 69 7a 65 73 2c 20 63 65 72 74 69 ter sizes, certi
24a0: 66 69 63 61 74 65 20 6b 65 79 0a 09 20 20 20 20 ficate key..
24b0: 73 69 7a 65 73 20 61 6e 64 20 73 69 67 6e 61 74 sizes and signat
24c0: 75 72 65 20 61 6c 67 6f 72 69 74 68 6d 73 2e 20 ure algorithms.
24d0: 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 31 The default is 1
24e0: 2e 20 4c 65 76 65 6c 20 33 20 61 6e 64 20 68 69 . Level 3 and hi
24f0: 67 68 65 72 0a 09 20 20 20 20 64 69 73 61 62 6c gher.. disabl
2500: 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 73 65 e support for se
2510: 73 73 69 6f 6e 20 74 69 63 6b 65 74 73 20 61 6e ssion tickets an
2520: 64 20 6f 6e 6c 79 20 61 63 63 65 70 74 20 63 69 d only accept ci
2530: 70 68 65 72 20 73 75 69 74 65 73 20 74 68 61 74 pher suites that
2540: 0a 09 20 20 20 20 70 72 6f 76 69 64 65 20 66 6f .. provide fo
2550: 72 77 61 72 64 20 73 65 63 72 65 63 79 2e 3c 2f rward secrecy.</
2560: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
2570: 3e 2d 73 65 72 76 65 72 3c 2f 73 74 72 6f 6e 67 >-server</strong
2580: 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c > <em>bool</em><
2590: 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 /dt>..<dd>Specif
25a0: 69 65 73 20 77 68 65 74 68 65 72 20 74 6f 20 61 ies whether to a
25b0: 63 74 20 61 73 20 61 20 73 65 72 76 65 72 20 61 ct as a server a
25c0: 6e 64 20 72 65 73 70 6f 6e 64 20 77 69 74 68 20 nd respond with
25d0: 61 20 73 65 72 76 65 72 0a 09 20 20 20 20 68 61 a server.. ha
25e0: 6e 64 73 68 61 6b 65 20 77 68 65 6e 20 61 20 63 ndshake when a c
25f0: 6c 69 65 6e 74 20 63 6f 6e 6e 65 63 74 73 20 61 lient connects a
2600: 6e 64 20 70 72 6f 76 69 64 65 73 20 61 20 63 6c nd provides a cl
2610: 69 65 6e 74 20 68 61 6e 64 73 68 61 6b 65 2e 0a ient handshake..
2620: 09 20 20 20 20 28 64 65 66 61 75 6c 74 20 69 73 . (default is
2630: 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 <em>false</em>)
2640: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
2650: 6e 67 3e 2d 73 65 72 76 65 72 6e 61 6d 65 3c 2f ng>-servername</
2660: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 6f 73 74 strong> <em>host
2670: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
2680: 53 70 65 63 69 66 79 20 73 65 72 76 65 72 27 73 Specify server's
2690: 20 68 6f 73 74 6e 61 6d 65 2e 20 54 68 69 73 20 hostname. This
26a0: 69 73 20 75 73 65 64 20 74 6f 20 73 65 74 20 74 is used to set t
26b0: 68 65 20 54 4c 53 20 53 65 72 76 65 72 20 4e 61 he TLS Server Na
26c0: 6d 65 0a 09 20 20 20 20 49 6e 64 69 63 61 74 69 me.. Indicati
26d0: 6f 6e 20 28 53 4e 49 29 20 65 78 74 65 6e 73 69 on (SNI) extensi
26e0: 6f 6e 2e 20 53 65 74 20 74 68 69 73 20 74 6f 20 on. Set this to
26f0: 74 68 65 20 65 78 70 65 63 74 65 64 20 73 65 72 the expected ser
2700: 76 65 72 6e 61 6d 65 20 69 6e 20 74 68 65 0a 09 vername in the..
2710: 20 20 20 73 65 72 76 65 72 27 73 20 63 65 72 74 server's cert
2720: 69 66 69 63 61 74 65 20 6f 72 20 6f 6e 65 20 6f ificate or one o
2730: 66 20 74 68 65 20 73 75 62 6a 65 63 74 41 6c 74 f the subjectAlt
2740: 4e 61 6d 65 20 61 6c 74 65 72 6e 61 74 65 73 2e Name alternates.
2750: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
2760: 6e 67 3e 2d 73 65 73 73 69 6f 6e 5f 69 64 3c 2f ng>-session_id</
2770: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 strong> <em>stri
2780: 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ng</em></dt>..<d
2790: 64 3e 53 70 65 63 69 66 69 65 73 20 74 68 65 20 d>Specifies the
27a0: 73 65 73 73 69 6f 6e 20 69 64 20 74 6f 20 72 65 session id to re
27b0: 73 75 6d 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 sume session.</d
27c0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
27d0: 2d 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c -ssl2</strong> <
27e0: 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 em>bool</em></dt
27f0: 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 >..<dd>Enable us
2800: 65 20 6f 66 20 53 53 4c 20 76 32 2e 20 28 64 65 e of SSL v2. (de
2810: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c fault is <em>fal
2820: 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c se</em>)</dd>..<
2830: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 dt><strong>-ssl3
2840: 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f </strong><em>bo
2850: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ol</em></dt>..<d
2860: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 d>Enable use of
2870: 53 53 4c 20 76 33 2e 20 28 64 65 66 61 75 6c 74 SSL v3. (default
2880: 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 is <em>false</e
2890: 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c m>)</dd>..<dt>-<
28a0: 73 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 strong>tls1</str
28b0: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 ong> <em>bool</e
28c0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 m></dt>..<dd>Ena
28d0: 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 ble use of TLS v
28e0: 31 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 1. (default is <
28f0: 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 em>true</em>)</d
2900: 64 3e 0a 09 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 d>..<dt>-<strong
2910: 3e 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e >tls1.1</strong>
2920: 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f <em>bool</em></
2930: 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 dt>..<dd>Enable
2940: 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 31 20 use of TLS v1.1
2950: 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e (default is <em>
2960: 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a true</em>)</dd>.
2970: 09 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c .<dt>-<strong>tl
2980: 73 31 2e 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 s1.2</strong> <e
2990: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e m>bool</em></dt>
29a0: 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 ..<dd>Enable use
29b0: 20 6f 66 20 54 4c 53 20 76 31 2e 32 20 28 64 65 of TLS v1.2 (de
29c0: 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 fault is <em>tru
29d0: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 e</em>)</dd>..<d
29e0: 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e t>-<strong>tls1.
29f0: 33 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 3</strong> <em>b
2a00: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ool</em></dt>..<
2a10: 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 dd>Enable use of
2a20: 20 54 4c 53 20 76 31 2e 33 20 28 64 65 66 61 75 TLS v1.3 (defau
2a30: 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f lt is <em>true</
2a40: 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c em>)</dd>..<dt><
2a50: 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 strong>-validate
2a60: 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e command</strong>
2a70: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 <em>callback</e
2a80: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 m></dt>..<dd>Spe
2a90: 63 69 66 69 65 73 20 74 68 65 20 63 61 6c 6c 62 cifies the callb
2aa0: 61 63 6b 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 69 ack command to i
2ab0: 6e 76 6f 6b 65 20 74 6f 20 76 61 6c 69 64 61 74 nvoke to validat
2ac0: 65 20 70 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 e protocol..
2ad0: 63 6f 6e 66 69 67 20 70 61 72 61 6d 65 74 65 72 config parameter
2ae0: 73 20 64 75 72 69 6e 67 20 74 68 65 20 70 72 6f s during the pro
2af0: 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61 74 69 6f tocol negotiatio
2b00: 6e 20 70 68 61 73 65 2e 20 54 68 69 73 20 63 61 n phase. This ca
2b10: 6e 20 62 65 0a 09 20 20 20 20 75 73 65 64 20 62 n be.. used b
2b20: 79 20 54 43 4c 20 73 63 72 69 70 74 73 20 74 6f y TCL scripts to
2b30: 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72 20 6f perform their o
2b40: 77 6e 20 63 65 72 74 69 66 69 63 61 74 65 20 76 wn certificate v
2b50: 61 6c 69 64 61 74 69 6f 6e 20 74 6f 0a 09 20 20 alidation to..
2b60: 20 20 73 75 70 70 6c 65 6d 65 6e 74 20 74 68 65 supplement the
2b70: 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64 61 74 default validat
2b80: 69 6f 6e 20 70 72 6f 76 69 64 65 64 20 62 79 20 ion provided by
2b90: 4f 70 65 6e 53 53 4c 2e 20 54 68 65 20 73 63 72 OpenSSL. The scr
2ba0: 69 70 74 20 6d 75 73 74 0a 09 20 20 20 20 72 65 ipt must.. re
2bb0: 74 75 72 6e 20 61 20 62 6f 6f 6c 65 61 6e 20 74 turn a boolean t
2bc0: 72 75 65 20 74 6f 20 63 6f 6e 74 69 6e 75 65 20 rue to continue
2bd0: 74 68 65 20 6e 65 67 6f 74 69 61 74 69 6f 6e 2e the negotiation.
2be0: 20 53 65 65 0a 09 20 20 20 20 3c 61 20 68 72 65 See.. <a hre
2bf0: 66 3d 22 23 43 41 4c 4c 42 41 43 4b 20 4f 50 54 f="#CALLBACK OPT
2c00: 49 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f IONS">CALLBACK O
2c10: 50 54 49 4f 4e 53 3c 2f 61 3e 20 66 6f 72 20 6d PTIONS</a> for m
2c20: 6f 72 65 20 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 20 ore info.</dd>.
2c30: 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e </blockquote>
2c40: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 </dl>. <dt><a
2c50: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 75 6e 69 6d name="tls::unim
2c60: 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e port"><b>tls::un
2c70: 69 6d 70 6f 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 import </b><i>ch
2c80: 61 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 annel</i></a></d
2c90: 74 3e 0a 20 20 20 20 3c 64 64 3e 50 72 6f 76 69 t>. <dd>Provi
2ca0: 64 65 64 20 66 6f 72 20 73 79 6d 6d 65 74 72 79 ded for symmetry
2cb0: 20 74 6f 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a to <strong>tls:
2cc0: 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e :import</strong>
2cd0: 2c 20 74 68 69 73 0a 09 75 6e 73 74 61 63 6b 73 , this..unstacks
2ce0: 20 74 68 65 20 65 6e 63 72 79 70 74 69 6f 6e 20 the encryption
2cf0: 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54 43 4c of a regular TCL
2d00: 20 63 68 61 6e 6e 65 6c 2e 20 41 6e 20 65 72 72 channel. An err
2d10: 6f 72 0a 09 69 73 20 74 68 72 6f 77 6e 20 69 66 or..is thrown if
2d20: 20 54 4c 53 20 69 73 20 6e 6f 74 20 74 68 65 20 TLS is not the
2d30: 74 6f 70 20 73 74 61 63 6b 65 64 20 63 68 61 6e top stacked chan
2d40: 6e 65 6c 20 74 79 70 65 2e 3c 2f 64 64 3e 0a 20 nel type.</dd>.
2d50: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
2d60: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 t>. <dt><a na
2d70: 6d 65 3d 22 74 6c 73 3a 3a 68 61 6e 64 73 68 61 me="tls::handsha
2d80: 6b 65 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a ke"><strong>tls:
2d90: 3a 68 61 6e 64 73 68 61 6b 65 3c 2f 73 74 72 6f :handshake</stro
2da0: 6e 67 3e 0a 09 3c 65 6d 3e 63 68 61 6e 6e 65 6c ng>..<em>channel
2db0: 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 </em></a></dt>.
2dc0: 20 20 20 3c 64 64 3e 46 6f 72 63 65 73 20 68 61 <dd>Forces ha
2dd0: 6e 64 73 68 61 6b 65 20 74 6f 20 74 61 6b 65 20 ndshake to take
2de0: 70 6c 61 63 65 2c 20 61 6e 64 20 72 65 74 75 72 place, and retur
2df0: 6e 73 20 30 20 69 66 0a 09 68 61 6e 64 73 68 61 ns 0 if..handsha
2e00: 6b 65 20 69 73 20 73 74 69 6c 6c 20 69 6e 20 70 ke is still in p
2e10: 72 6f 67 72 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f rogress (non-blo
2e20: 63 6b 69 6e 67 29 2c 20 6f 72 20 31 20 69 66 0a cking), or 1 if.
2e30: 09 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77 .the handshake w
2e40: 61 73 20 73 75 63 63 65 73 73 66 75 6c 2e 20 49 as successful. I
2e50: 66 20 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 f the handshake
2e60: 66 61 69 6c 65 64 0a 09 74 68 69 73 20 72 6f 75 failed..this rou
2e70: 74 69 6e 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 tine will throw
2e80: 61 6e 20 65 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 an error.</dd>.
2e90: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
2ea0: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 t>. <dt><a na
2eb0: 6d 65 3d 22 74 6c 73 3a 3a 73 74 61 74 75 73 22 me="tls::status"
2ec0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 ><strong>tls::st
2ed0: 61 74 75 73 3c 2f 73 74 72 6f 6e 67 3e 0a 09 3c atus</strong>..<
2ee0: 65 6d 3e 3f 3c 2f 65 6d 3e 3c 62 3e 2d 6c 6f 63 em>?</em><b>-loc
2ef0: 61 6c 3c 2f 62 3e 3c 65 6d 3e 3f 20 63 68 61 6e al</b><em>? chan
2f00: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 nel</em></a></dt
2f10: 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e >. <dd>Return
2f20: 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 s the current st
2f30: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 atus of an SSL c
2f40: 68 61 6e 6e 65 6c 2e 20 54 68 65 20 72 65 73 75 hannel. The resu
2f50: 6c 74 20 69 73 20 61 20 6c 69 73 74 0a 09 6f 66 lt is a list..of
2f60: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 key-value pairs
2f70: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 describing the
2f80: 53 53 4c 2c 20 63 65 72 74 69 66 69 63 61 74 65 SSL, certificate
2f90: 2c 20 61 6e 64 20 63 65 72 74 69 66 69 63 61 74 , and certificat
2fa0: 65 0a 09 76 65 72 69 66 69 63 61 74 69 6f 6e 20 e..verification
2fb0: 73 74 61 74 75 73 2e 20 49 66 20 74 68 65 20 53 status. If the S
2fc0: 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 68 61 73 SL handshake has
2fd0: 20 6e 6f 74 20 79 65 74 20 63 6f 6d 70 6c 65 74 not yet complet
2fe0: 65 64 2c 0a 09 61 6e 20 65 6d 70 74 79 20 6c 69 ed,..an empty li
2ff0: 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 2e 20 st is returned.
3000: 49 66 20 3c 62 3e 2d 6c 6f 63 61 6c 3c 2f 62 3e If <b>-local</b>
3010: 20 69 73 20 73 70 65 63 69 66 69 65 64 2c 20 74 is specified, t
3020: 68 65 6e 20 74 68 65 0a 09 6c 6f 63 61 6c 20 63 hen the..local c
3030: 65 72 74 69 66 69 63 61 74 65 20 69 73 20 75 73 ertificate is us
3040: 65 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 62 6c ed.</dd>. <bl
3050: 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 62 ockquote>. <b
3060: 3e 53 53 4c 20 53 74 61 74 75 73 3c 2f 62 3e 0a >SSL Status</b>.
3070: 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 <dl>..<dt><s
3080: 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74 72 6f trong>alpn</stro
3090: 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c ng> <em>protocol
30a0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
30b0: 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c The protocol sel
30c0: 65 63 74 65 64 20 61 66 74 65 72 20 41 70 70 6c ected after Appl
30d0: 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 ication-Layer Pr
30e0: 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65 67 6f otocol.. Nego
30f0: 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 3c tiation (ALPN).<
3100: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
3110: 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 g>cipher</strong
3120: 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f 65 6d > <em>cipher</em
3130: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
3140: 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 69 current cipher i
3150: 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20 73 65 n use for the se
3160: 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 ssion.</dd>..<dt
3170: 3e 3c 73 74 72 6f 6e 67 3e 70 65 65 72 6e 61 6d ><strong>peernam
3180: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e e</strong> <em>n
3190: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ame</em></dt>..<
31a0: 64 64 3e 54 68 65 20 70 65 65 72 6e 61 6d 65 20 dd>The peername
31b0: 66 72 6f 6d 20 74 68 65 20 63 65 72 74 69 66 69 from the certifi
31c0: 63 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e cate.</dd>..<dt>
31d0: 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c <strong>protocol
31e0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 </strong> <em>ve
31f0: 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a rsion</em></dt>.
3200: 09 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f .<dd>The protoco
3210: 6c 20 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 l version used f
3220: 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f or the connectio
3230: 6e 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20 53 53 n:.. SSL2, SS
3240: 4c 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 2e 31 L3, TLS1, TLS1.1
3250: 2c 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31 2e 33 , TLS1.2, TLS1.3
3260: 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 , or unknown.</d
3270: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3280: 73 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c sbits</strong> <
3290: 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 em>n</em></dt>..
32a0: 3c 64 64 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f <dd>The number o
32b0: 66 20 62 69 74 73 20 75 73 65 64 20 66 6f 72 20 f bits used for
32c0: 74 68 65 20 73 65 73 73 69 6f 6e 20 6b 65 79 2e the session key.
32d0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
32e0: 6e 67 3e 73 69 67 6e 61 74 75 72 65 48 61 73 68 ng>signatureHash
32f0: 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72 6f 6e Algorithm</stron
3300: 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d g> <em>algorithm
3310: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
3320: 54 68 65 20 73 69 67 6e 61 74 75 72 65 20 68 61 The signature ha
3330: 73 68 20 61 6c 67 6f 72 69 74 68 6d 2e 3c 2f 64 sh algorithm.</d
3340: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3350: 73 69 67 6e 61 74 75 72 65 54 79 70 65 3c 2f 73 signatureType</s
3360: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 74 79 70 65 3c trong> <em>type<
3370: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
3380: 68 65 20 73 69 67 6e 61 74 75 72 65 20 74 79 70 he signature typ
3390: 65 20 76 61 6c 75 65 2e 3c 2f 64 64 3e 0a 09 3c e value.</dd>..<
33a0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 dt><strong>verif
33b0: 79 44 65 70 74 68 3c 2f 73 74 72 6f 6e 67 3e 20 yDepth</strong>
33c0: 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a <em>n</em></dt>.
33d0: 09 3c 64 64 3e 4d 61 78 69 6d 75 6d 20 64 65 70 .<dd>Maximum dep
33e0: 74 68 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 th for the certi
33f0: 66 69 63 61 74 65 20 63 68 61 69 6e 20 76 65 72 ficate chain ver
3400: 69 66 69 63 61 74 69 6f 6e 2e 0a 09 20 20 20 20 ification...
3410: 44 65 66 61 75 6c 74 20 69 73 20 2d 31 2c 20 74 Default is -1, t
3420: 6f 20 63 68 65 63 6b 20 61 6c 6c 2e 3c 2f 64 64 o check all.</dd
3430: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 >..<dt><strong>v
3440: 65 72 69 66 79 4d 6f 64 65 3c 2f 73 74 72 6f 6e erifyMode</stron
3450: 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e g> <em>list</em>
3460: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 </dt>..<dd>List
3470: 6f 66 20 63 65 72 74 69 66 69 63 61 74 65 20 76 of certificate v
3480: 65 72 69 66 69 63 61 74 69 6f 6e 20 6d 6f 64 65 erification mode
3490: 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 s.</dd>..<dt><st
34a0: 72 6f 6e 67 3e 76 65 72 69 66 79 52 65 73 75 6c rong>verifyResul
34b0: 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 72 t</strong> <em>r
34c0: 65 73 75 6c 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a esult</em></dt>.
34d0: 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 .<dd>Certificate
34e0: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 72 65 verification re
34f0: 73 75 6c 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e sult.</dd>..<dt>
3500: 3c 73 74 72 6f 6e 67 3e 63 61 5f 6e 61 6d 65 73 <strong>ca_names
3510: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 </strong> <em>li
3520: 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 st</em></dt>..<d
3530: 64 3e 4c 69 73 74 20 6f 66 20 74 68 65 20 43 65 d>List of the Ce
3540: 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 rtificate Author
3550: 69 74 69 65 73 20 75 73 65 64 20 74 6f 20 63 72 ities used to cr
3560: 65 61 74 65 20 74 68 65 20 63 65 72 74 69 66 69 eate the certifi
3570: 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c cate.</dd>. <
3580: 2f 64 6c 3e 0a 20 20 20 20 3c 62 3e 43 65 72 74 /dl>. <b>Cert
3590: 69 66 69 63 61 74 65 20 53 74 61 74 75 73 3c 2f ificate Status</
35a0: 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 b>. <dl>..<dt
35b0: 3e 3c 73 74 72 6f 6e 67 3e 61 6c 6c 3c 2f 73 74 ><strong>all</st
35c0: 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 rong> <em>string
35d0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
35e0: 44 75 6d 70 20 6f 66 20 61 6c 6c 20 63 65 72 74 Dump of all cert
35f0: 69 66 69 63 61 74 65 20 69 6e 66 6f 2e 3c 2f 64 ificate info.</d
3600: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3610: 76 65 72 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e version</strong>
3620: 20 3c 65 6d 3e 76 61 6c 75 65 3c 2f 65 6d 3e 3c <em>value</em><
3630: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 63 65 /dt>..<dd>The ce
3640: 72 74 69 66 69 63 61 74 65 20 76 65 72 73 69 6f rtificate versio
3650: 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 n.</dd>..<dt><st
3660: 72 6f 6e 67 3e 73 65 72 69 61 6c 4e 75 6d 62 65 rong>serialNumbe
3670: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e r</strong> <em>n
3680: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
3690: 54 68 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 65 The serial numbe
36a0: 72 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 r of the certifi
36b0: 63 61 74 65 20 61 73 20 61 20 68 65 78 20 73 74 cate as a hex st
36c0: 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e ring.</dd>..<dt>
36d0: 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 75 72 <strong>signatur
36e0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 e</strong> <em>a
36f0: 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 lgorithm</em></d
3700: 74 3e 0a 09 3c 64 64 3e 43 69 70 68 65 72 20 61 t>..<dd>Cipher a
3710: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f lgorithm used fo
3720: 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 69 r certificate si
3730: 67 6e 61 74 75 72 65 2e 3c 2f 64 64 3e 0a 09 3c gnature.</dd>..<
3740: 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 dt><strong>issue
3750: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 r</strong> <em>d
3760: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 n</em></dt>..<dd
3770: 3e 54 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 >The distinguish
3780: 65 64 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 ed name (DN) of
3790: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 the certificate
37a0: 69 73 73 75 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 issuer.</dd>..<d
37b0: 74 3e 3c 73 74 72 6f 6e 67 3e 6e 6f 74 42 65 66 t><strong>notBef
37c0: 6f 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ore</strong> <em
37d0: 3e 64 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >date</em></dt>.
37e0: 09 3c 64 64 3e 54 68 65 20 62 65 67 69 6e 6e 69 .<dd>The beginni
37f0: 6e 67 20 64 61 74 65 20 6f 66 20 74 68 65 20 63 ng date of the c
3800: 65 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 ertificate valid
3810: 69 74 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ity.</dd>..<dt><
3820: 73 74 72 6f 6e 67 3e 6e 6f 74 41 66 74 65 72 3c strong>notAfter<
3830: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 /strong> <em>dat
3840: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 e</em></dt>..<dd
3850: 3e 54 68 65 20 65 78 70 69 72 61 74 69 6f 6e 20 >The expiration
3860: 64 61 74 65 20 6f 66 20 74 68 65 20 63 65 72 74 date of the cert
3870: 69 66 69 63 61 74 65 20 76 61 6c 69 64 69 74 79 ificate validity
3880: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
3890: 6f 6e 67 3e 73 75 62 6a 65 63 74 3c 2f 73 74 72 ong>subject</str
38a0: 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e ong> <em>dn</em>
38b0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 64 </dt>..<dd>The d
38c0: 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d istinguished nam
38d0: 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 e (DN) of the ce
38e0: 72 74 69 66 69 63 61 74 65 20 73 75 62 6a 65 63 rtificate subjec
38f0: 74 2e 0a 09 20 20 20 20 46 69 65 6c 64 73 20 69 t... Fields i
3900: 6e 63 6c 75 64 65 3a 20 43 6f 6d 6d 6f 6e 20 4e nclude: Common N
3910: 61 6d 65 20 28 43 4e 29 2c 20 4f 72 67 61 6e 69 ame (CN), Organi
3920: 7a 61 74 69 6f 6e 20 28 4f 29 2c 20 4c 6f 63 61 zation (O), Loca
3930: 6c 69 74 79 0a 09 20 20 20 20 6f 72 20 43 69 74 lity.. or Cit
3940: 79 20 28 4c 29 2c 20 53 74 61 74 65 20 6f 72 20 y (L), State or
3950: 50 72 6f 76 69 6e 63 65 20 28 53 29 2c 20 61 6e Province (S), an
3960: 64 20 43 6f 75 6e 74 72 79 20 4e 61 6d 65 20 28 d Country Name (
3970: 43 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 C).</dd>..<dt><s
3980: 74 72 6f 6e 67 3e 69 73 73 75 65 72 55 6e 69 71 trong>issuerUniq
3990: 75 65 49 44 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 ueID</strong> <e
39a0: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 m>string</em></d
39b0: 74 3e 0a 09 3c 64 64 3e 54 68 65 20 69 73 73 75 t>..<dd>The issu
39c0: 65 72 20 75 6e 69 71 75 65 20 69 64 2e 3c 2f 64 er unique id.</d
39d0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
39e0: 73 75 62 6a 65 63 74 55 6e 69 71 75 65 49 44 3c subjectUniqueID<
39f0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 /strong> <em>str
3a00: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ing</em></dt>..<
3a10: 64 64 3e 54 68 65 20 73 75 62 6a 65 63 74 20 75 dd>The subject u
3a20: 6e 69 71 75 65 20 69 64 2e 3c 2f 64 64 3e 0a 09 nique id.</dd>..
3a30: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6e 75 6d 5f <dt><strong>num_
3a40: 65 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 74 72 6f extensions</stro
3a50: 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f ng> <em>n</em></
3a60: 64 74 3e 0a 09 3c 64 64 3e 4e 75 6d 62 65 72 20 dt>..<dd>Number
3a70: 6f 66 20 63 65 72 74 69 66 69 63 61 74 65 20 65 of certificate e
3a80: 78 74 65 6e 73 69 6f 6e 73 2e 3c 2f 64 64 3e 0a xtensions.</dd>.
3a90: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 65 78 74 .<dt><strong>ext
3aa0: 65 6e 73 69 6f 6e 73 3c 2f 73 74 72 6f 6e 67 3e ensions</strong>
3ab0: 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f <em>list</em></
3ac0: 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 dt>..<dd>List of
3ad0: 20 63 65 72 74 69 66 69 63 61 74 65 20 65 78 74 certificate ext
3ae0: 65 6e 73 69 6f 6e 20 6e 61 6d 65 73 2e 3c 2f 64 ension names.</d
3af0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3b00: 61 75 74 68 6f 72 69 74 79 4b 65 79 49 64 65 6e authorityKeyIden
3b10: 74 69 66 69 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 tifier</strong>
3b20: 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c <em>string</em><
3b30: 2f 64 74 3e 0a 09 3c 64 64 3e 28 41 4b 49 29 20 /dt>..<dd>(AKI)
3b40: 4b 65 79 20 69 64 65 6e 74 69 66 69 65 72 20 6f Key identifier o
3b50: 66 20 74 68 65 20 49 73 73 75 69 6e 67 20 43 41 f the Issuing CA
3b60: 20 63 65 72 74 69 66 69 63 61 74 65 20 74 68 61 certificate tha
3b70: 74 20 73 69 67 6e 65 64 0a 09 20 20 20 20 74 68 t signed.. th
3b80: 65 20 53 53 4c 20 63 65 72 74 69 66 69 63 61 74 e SSL certificat
3b90: 65 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e e as a hex strin
3ba0: 67 2e 20 54 68 69 73 20 76 61 6c 75 65 20 6d 61 g. This value ma
3bb0: 74 63 68 65 73 20 74 68 65 20 53 4b 49 0a 09 20 tches the SKI..
3bc0: 20 20 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 value of the
3bd0: 49 6e 74 65 72 6d 65 64 69 61 74 65 20 43 41 20 Intermediate CA
3be0: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 certificate.</dd
3bf0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
3c00: 75 62 6a 65 63 74 4b 65 79 49 64 65 6e 74 69 66 ubjectKeyIdentif
3c10: 69 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ier</strong> <em
3c20: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 >string</em></dt
3c30: 3e 0a 09 3c 64 64 3e 28 53 4b 49 29 20 48 61 73 >..<dd>(SKI) Has
3c40: 68 20 6f 66 20 74 68 65 20 70 75 62 6c 69 63 20 h of the public
3c50: 6b 65 79 20 69 6e 73 69 64 65 20 74 68 65 20 63 key inside the c
3c60: 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61 20 ertificate as a
3c70: 68 65 78 0a 09 20 20 20 20 73 74 72 69 6e 67 2e hex.. string.
3c80: 20 55 73 65 64 20 74 6f 20 69 64 65 6e 74 69 66 Used to identif
3c90: 79 20 63 65 72 74 69 66 69 63 61 74 65 73 20 74 y certificates t
3ca0: 68 61 74 20 63 6f 6e 74 61 69 6e 20 61 20 70 61 hat contain a pa
3cb0: 72 74 69 63 75 6c 61 72 0a 09 20 20 20 20 70 75 rticular.. pu
3cc0: 62 6c 69 63 20 6b 65 79 2e 3c 2f 64 64 3e 0a 09 blic key.</dd>..
3cd0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a <dt><strong>subj
3ce0: 65 63 74 41 6c 74 4e 61 6d 65 3c 2f 73 74 72 6f ectAltName</stro
3cf0: 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d ng> <em>list</em
3d00: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 ></dt>..<dd>List
3d10: 20 6f 66 20 61 6c 6c 20 6f 66 20 74 68 65 20 61 of all of the a
3d20: 6c 74 65 72 6e 61 74 69 76 65 20 64 6f 6d 61 69 lternative domai
3d30: 6e 20 6e 61 6d 65 73 2c 20 73 75 62 20 64 6f 6d n names, sub dom
3d40: 61 69 6e 73 2c 0a 09 20 20 20 20 61 6e 64 20 49 ains,.. and I
3d50: 50 20 61 64 64 72 65 73 73 65 73 20 74 68 61 74 P addresses that
3d60: 20 61 72 65 20 73 65 63 75 72 65 64 20 62 79 20 are secured by
3d70: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e the certificate.
3d80: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3d90: 6e 67 3e 6f 63 73 70 3c 2f 73 74 72 6f 6e 67 3e ng>ocsp</strong>
3da0: 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f <em>list</em></
3db0: 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 dt>..<dd>List of
3dc0: 20 61 6c 6c 20 4f 6e 6c 69 6e 65 20 43 65 72 74 all Online Cert
3dd0: 69 66 69 63 61 74 65 20 53 74 61 74 75 73 20 50 ificate Status P
3de0: 72 6f 74 6f 63 6f 6c 20 28 4f 43 53 50 29 20 55 rotocol (OCSP) U
3df0: 52 4c 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c RLs.</dd>..<dt><
3e00: 73 74 72 6f 6e 67 3e 63 65 72 74 69 66 69 63 61 strong>certifica
3e10: 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e te</strong> <em>
3e20: 63 65 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 cert</em></dt>..
3e30: 3c 64 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f <dd>The PEM enco
3e40: 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65 2e ded certificate.
3e50: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3e60: 6e 67 3e 73 69 67 6e 61 74 75 72 65 41 6c 67 6f ng>signatureAlgo
3e70: 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c rithm</strong> <
3e80: 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d em>algorithm</em
3e90: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 69 70 68 ></dt>..<dd>Ciph
3ea0: 65 72 20 61 6c 67 6f 72 69 74 68 6d 20 75 73 65 er algorithm use
3eb0: 64 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 66 d for the certif
3ec0: 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 2e icate signature.
3ed0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3ee0: 6e 67 3e 73 69 67 6e 61 74 75 72 65 56 61 6c 75 ng>signatureValu
3ef0: 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 e</strong> <em>s
3f00: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
3f10: 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 .<dd>Certificate
3f20: 20 73 69 67 6e 61 74 75 72 65 20 61 73 20 61 20 signature as a
3f30: 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e hex string.</dd>
3f40: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 ..<dt><strong>si
3f50: 67 6e 61 74 75 72 65 44 69 67 65 73 74 3c 2f 73 gnatureDigest</s
3f60: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 69 trong> <em>versi
3f70: 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 on</em></dt>..<d
3f80: 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 73 69 d>Certificate si
3f90: 67 6e 69 6e 67 20 64 69 67 65 73 74 20 61 73 20 gning digest as
3fa0: 61 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 a hex string.</d
3fb0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3fc0: 70 75 62 6c 69 63 4b 65 79 41 6c 67 6f 72 69 74 publicKeyAlgorit
3fd0: 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e hm</strong> <em>
3fe0: 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e 3c 2f algorithm</em></
3ff0: 64 74 3e 0a 09 3c 64 64 3e 43 65 72 74 69 66 69 dt>..<dd>Certifi
4000: 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 70 cate signature p
4010: 75 62 6c 69 63 20 6b 65 79 20 61 6c 67 6f 72 69 ublic key algori
4020: 74 68 6d 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c thm.</dd>..<dt><
4030: 73 74 72 6f 6e 67 3e 70 75 62 6c 69 63 4b 65 79 strong>publicKey
4040: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 </strong> <em>st
4050: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 ring</em></dt>..
4060: 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 <dd>Certificate
4070: 73 69 67 6e 61 74 75 72 65 20 70 75 62 6c 69 63 signature public
4080: 20 6b 65 79 20 61 73 20 61 20 68 65 78 20 73 74 key as a hex st
4090: 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e ring.</dd>..<dt>
40a0: 3c 73 74 72 6f 6e 67 3e 62 69 74 73 3c 2f 73 74 <strong>bits</st
40b0: 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e rong> <em>n</em>
40c0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4e 75 6d 62 65 </dt>..<dd>Numbe
40d0: 72 20 6f 66 20 62 69 74 73 20 75 73 65 64 20 66 r of bits used f
40e0: 6f 72 20 63 65 72 74 69 66 69 63 61 74 65 20 73 or certificate s
40f0: 69 67 6e 61 74 75 72 65 20 6b 65 79 2e 3c 2f 64 ignature key.</d
4100: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4110: 73 65 6c 66 5f 73 69 67 6e 65 64 3c 2f 73 74 72 self_signed</str
4120: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e ong> <em>boolean
4130: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
4140: 57 68 65 74 68 65 72 20 74 68 65 20 63 65 72 74 Whether the cert
4150: 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 ificate signatur
4160: 65 20 69 73 20 73 65 6c 66 20 73 69 67 6e 65 64 e is self signed
4170: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4180: 6f 6e 67 3e 73 68 61 31 5f 68 61 73 68 3c 2f 73 ong>sha1_hash</s
4190: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61 73 68 3c trong> <em>hash<
41a0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
41b0: 68 65 20 53 48 41 31 20 68 61 73 68 20 6f 66 20 he SHA1 hash of
41c0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 the certificate
41d0: 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 2e as a hex string.
41e0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
41f0: 6e 67 3e 73 68 61 32 35 36 5f 68 61 73 68 3c 2f ng>sha256_hash</
4200: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 68 61 73 68 strong> <em>hash
4210: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
4220: 54 68 65 20 53 48 41 32 35 36 20 68 61 73 68 20 The SHA256 hash
4230: 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 of the certifica
4240: 74 65 20 61 73 20 61 20 68 65 78 20 73 74 72 69 te as a hex stri
4250: 6e 67 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 ng.</dd>. </d
4260: 6c 3e 0a 20 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 l>. </blockqu
4270: 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 ote>.. <dt><a
4280: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 6f 6e 6e name="tls::conn
4290: 65 63 74 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e ection"><strong>
42a0: 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c tls::connection<
42b0: 2f 73 74 72 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d /strong>. <em
42c0: 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 >channel</em></a
42d0: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 52 ></dt>. <dd>R
42e0: 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 eturns the curre
42f0: 6e 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 nt connection st
4300: 61 74 75 73 20 6f 66 20 61 6e 20 53 53 4c 20 63 atus of an SSL c
4310: 68 61 6e 6e 65 6c 2e 20 54 68 65 0a 09 72 65 73 hannel. The..res
4320: 75 6c 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 ult is a list of
4330: 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 key-value pairs
4340: 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 describing the
4350: 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e connection.</dd>
4360: 0a 20 20 20 20 3c 62 6c 6f 63 6b 71 75 6f 74 65 . <blockquote
4370: 3e 0a 20 20 20 20 3c 62 3e 53 53 4c 20 53 74 61 >. <b>SSL Sta
4380: 74 75 73 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e tus</b>. <dl>
4390: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 ..<dt><strong>st
43a0: 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ate</strong> <em
43b0: 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e >state</em></dt>
43c0: 0a 09 3c 64 64 3e 53 74 61 74 65 20 6f 66 20 74 ..<dd>State of t
43d0: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f he connection.</
43e0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
43f0: 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f 73 74 72 >servername</str
4400: 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f 65 ong> <em>name</e
4410: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
4420: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 63 6f 6e name of the con
4430: 6e 65 63 74 65 64 20 74 6f 20 73 65 72 76 65 72 nected to server
4440: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4450: 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 73 74 ong>protocol</st
4460: 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 69 6f rong> <em>versio
4470: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 n</em></dt>..<dd
4480: 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 >The protocol ve
4490: 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 74 rsion used for t
44a0: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 0a 09 he connection:..
44b0: 20 20 20 20 53 53 4c 32 2c 20 53 53 4c 33 2c 20 SSL2, SSL3,
44c0: 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c 20 54 4c TLS1, TLS1.1, TL
44d0: 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c 20 6f 72 S1.2, TLS1.3, or
44e0: 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64 3e 0a 09 unknown.</dd>..
44f0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 72 65 6e 65 <dt><strong>rene
4500: 67 6f 74 69 61 74 69 6f 6e 5f 61 6c 6c 6f 77 65 gotiation_allowe
4510: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 d</strong> <em>b
4520: 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e oolean</em></dt>
4530: 0a 09 3c 64 64 3e 57 68 65 74 68 65 72 20 70 72 ..<dd>Whether pr
4540: 6f 74 6f 63 6f 6c 20 72 65 6e 65 67 6f 74 69 61 otocol renegotia
4550: 74 69 6f 6e 20 69 73 20 73 75 70 70 6f 72 74 65 tion is supporte
4560: 64 20 6f 72 20 6e 6f 74 2e 3c 2f 64 64 3e 0a 09 d or not.</dd>..
4570: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 63 75 <dt><strong>secu
4580: 72 69 74 79 5f 6c 65 76 65 6c 3c 2f 73 74 72 6f rity_level</stro
4590: 6e 67 3e 20 3c 65 6d 3e 6c 65 76 65 6c 3c 2f 65 ng> <em>level</e
45a0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
45b0: 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 security level
45c0: 75 73 65 64 20 66 6f 72 20 73 65 6c 65 63 74 69 used for selecti
45d0: 6f 6e 20 6f 66 20 63 69 70 68 65 72 73 2c 20 6b on of ciphers, k
45e0: 65 79 20 73 69 7a 65 2c 20 65 74 63 2e 3c 2f 64 ey size, etc.</d
45f0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4600: 73 65 73 73 69 6f 6e 5f 72 65 75 73 65 64 3c 2f session_reused</
4610: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c strong> <em>bool
4620: 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ean</em></dt>..<
4630: 64 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 73 dd>Whether the s
4640: 65 73 73 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 ession has been
4650: 72 65 75 73 65 64 20 6f 72 20 6e 6f 74 2e 3c 2f reused or not.</
4660: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
4670: 3e 69 73 5f 73 65 72 76 65 72 3c 2f 73 74 72 6f >is_server</stro
4680: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c ng> <em>boolean<
4690: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 /em></dt>..<dd>W
46a0: 68 65 74 68 65 72 20 74 68 65 20 63 6f 6e 6e 65 hether the conne
46b0: 63 74 69 6f 6e 20 69 73 20 63 6f 6e 66 69 67 75 ction is configu
46c0: 72 65 64 20 61 73 20 61 20 73 65 72 76 65 72 20 red as a server
46d0: 28 31 29 20 6f 72 20 63 6c 69 65 6e 74 20 28 30 (1) or client (0
46e0: 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 ).</dd>..<dt><st
46f0: 72 6f 6e 67 3e 63 6f 6d 70 72 65 73 73 69 6f 6e rong>compression
4700: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6d 6f </strong> <em>mo
4710: 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 de</em></dt>..<d
4720: 64 3e 43 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 d>Compression me
4730: 74 68 6f 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e thod.</dd>..<dt>
4740: 3c 73 74 72 6f 6e 67 3e 65 78 70 61 6e 73 69 6f <strong>expansio
4750: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6d n</strong> <em>m
4760: 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ode</em></dt>..<
4770: 64 64 3e 45 78 70 61 6e 73 69 6f 6e 20 6d 65 74 dd>Expansion met
4780: 68 6f 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c hod.</dd>..<dt><
4790: 73 74 72 6f 6e 67 3e 63 61 4c 69 73 74 3c 2f 73 strong>caList</s
47a0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c trong> <em>list<
47b0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c /em></dt>..<dd>L
47c0: 69 73 74 20 6f 66 20 43 65 72 74 69 66 69 63 61 ist of Certifica
47d0: 74 65 20 41 75 74 68 6f 72 69 74 69 65 73 20 28 te Authorities (
47e0: 43 41 29 20 66 6f 72 20 58 2e 35 30 39 20 63 65 CA) for X.509 ce
47f0: 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a rtificate.</dd>.
4800: 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 62 </dl>. <b
4810: 3e 43 69 70 68 65 72 20 49 6e 66 6f 3c 2f 62 3e >Cipher Info</b>
4820: 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c . <dl>..<dt><
4830: 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73 strong>cipher</s
4840: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65 trong> <em>ciphe
4850: 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 r</em></dt>..<dd
4860: 3e 54 68 65 20 63 75 72 72 65 6e 74 20 63 69 70 >The current cip
4870: 68 65 72 20 69 6e 20 75 73 65 20 66 6f 72 20 74 her in use for t
4880: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f he connection.</
4890: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
48a0: 3e 73 74 61 6e 64 61 72 64 5f 6e 61 6d 65 3c 2f >standard_name</
48b0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 strong> <em>name
48c0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
48d0: 54 68 65 20 73 74 61 6e 64 61 72 64 20 52 46 43 The standard RFC
48e0: 20 6e 61 6d 65 20 6f 66 20 63 69 70 68 65 72 2e name of cipher.
48f0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
4900: 6e 67 3e 61 6c 67 6f 72 69 74 68 6d 5f 62 69 74 ng>algorithm_bit
4910: 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e s</strong> <em>n
4920: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
4930: 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 72 The number of pr
4940: 6f 63 65 73 73 65 64 20 62 69 74 73 20 75 73 65 ocessed bits use
4950: 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 d for cipher.</d
4960: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4970: 73 65 63 72 65 74 5f 62 69 74 73 3c 2f 73 74 72 secret_bits</str
4980: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c ong> <em>n</em><
4990: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 6e 75 /dt>..<dd>The nu
49a0: 6d 62 65 72 20 6f 66 20 73 65 63 72 65 74 20 62 mber of secret b
49b0: 69 74 73 20 75 73 65 64 20 66 6f 72 20 63 69 70 its used for cip
49c0: 68 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c her.</dd>..<dt><
49d0: 73 74 72 6f 6e 67 3e 6d 69 6e 5f 76 65 72 73 69 strong>min_versi
49e0: 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e on</strong> <em>
49f0: 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 version</em></dt
4a00: 3e 0a 09 3c 64 64 3e 54 68 65 20 6d 69 6e 69 6d >..<dd>The minim
4a10: 75 6d 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 um protocol vers
4a20: 69 6f 6e 20 66 6f 72 20 63 69 70 68 65 72 2e 3c ion for cipher.<
4a30: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
4a40: 67 3e 63 69 70 68 65 72 5f 69 73 5f 61 65 61 64 g>cipher_is_aead
4a50: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f </strong> <em>bo
4a60: 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a olean</em></dt>.
4a70: 09 3c 64 64 3e 57 68 65 74 68 65 72 20 74 68 65 .<dd>Whether the
4a80: 20 63 69 70 68 65 72 20 69 73 20 41 75 74 68 65 cipher is Authe
4a90: 6e 74 69 63 61 74 65 64 20 45 6e 63 72 79 70 74 nticated Encrypt
4aa0: 69 6f 6e 20 77 69 74 68 0a 09 20 20 20 20 41 73 ion with.. As
4ab0: 73 6f 63 69 61 74 65 64 20 44 61 74 61 20 28 41 sociated Data (A
4ac0: 45 41 44 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e EAD).</dd>..<dt>
4ad0: 3c 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 5f 69 <strong>cipher_i
4ae0: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 69 d</strong> <em>i
4af0: 64 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 d</em></dt>..<dd
4b00: 3e 54 68 65 20 4f 70 65 6e 53 53 4c 20 63 69 70 >The OpenSSL cip
4b10: 68 65 72 20 69 64 2e 3c 2f 64 64 3e 0a 09 3c 64 her id.</dd>..<d
4b20: 74 3e 3c 73 74 72 6f 6e 67 3e 64 65 73 63 72 69 t><strong>descri
4b30: 70 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c ption</strong> <
4b40: 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f em>string</em></
4b50: 64 74 3e 0a 09 3c 64 64 3e 41 20 74 65 78 74 20 dt>..<dd>A text
4b60: 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 66 20 74 description of t
4b70: 68 65 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e 0a he cipher.</dd>.
4b80: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 68 61 6e .<dt><strong>han
4b90: 64 73 68 61 6b 65 5f 64 69 67 65 73 74 3c 2f 73 dshake_digest</s
4ba0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 trong> <em>boole
4bb0: 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 an</em></dt>..<d
4bc0: 64 3e 44 69 67 65 73 74 20 75 73 65 64 20 64 75 d>Digest used du
4bd0: 72 69 6e 67 20 68 61 6e 64 73 68 61 6b 65 2e 3c ring handshake.<
4be0: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 /dd>. </dl>.
4bf0: 20 20 20 3c 62 3e 53 65 73 73 69 6f 6e 20 49 6e <b>Session In
4c00: 66 6f 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a fo</b>. <dl>.
4c10: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 6c 70 .<dt><strong>alp
4c20: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 n</strong> <em>p
4c30: 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 rotocol</em></dt
4c40: 3e 0a 09 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f >..<dd>The proto
4c50: 63 6f 6c 20 73 65 6c 65 63 74 65 64 20 61 66 74 col selected aft
4c60: 65 72 20 41 70 70 6c 69 63 61 74 69 6f 6e 2d 4c er Application-L
4c70: 61 79 65 72 20 50 72 6f 74 6f 63 6f 6c 0a 09 20 ayer Protocol..
4c80: 20 20 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 Negotiation (
4c90: 41 4c 50 4e 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 ALPN).</dd>..<dt
4ca0: 3e 3c 73 74 72 6f 6e 67 3e 72 65 73 75 6d 61 62 ><strong>resumab
4cb0: 6c 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e le</strong> <em>
4cc0: 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 boolean</em></dt
4cd0: 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72 20 74 >..<dd>Whether t
4ce0: 68 65 20 73 65 73 73 69 6f 6e 20 63 61 6e 20 62 he session can b
4cf0: 65 20 72 65 73 75 6d 65 64 20 6f 72 20 6e 6f 74 e resumed or not
4d00: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4d10: 6f 6e 67 3e 73 74 61 72 74 5f 74 69 6d 65 3c 2f ong>start_time</
4d20: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f strong> <em>seco
4d30: 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c nds</em></dt>..<
4d40: 64 64 3e 54 69 6d 65 20 73 69 6e 63 65 20 73 65 dd>Time since se
4d50: 73 73 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e ssion started in
4d60: 20 73 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65 seconds since e
4d70: 70 6f 63 68 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e poch.</dd>..<dt>
4d80: 3c 73 74 72 6f 6e 67 3e 74 69 6d 65 6f 75 74 3c <strong>timeout<
4d90: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 /strong> <em>sec
4da0: 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 onds</em></dt>..
4db0: 3c 64 64 3e 4d 61 78 20 64 75 72 61 74 69 6f 6e <dd>Max duration
4dc0: 20 6f 66 20 73 65 73 73 69 6f 6e 20 69 6e 20 73 of session in s
4dd0: 65 63 6f 6e 64 73 20 62 65 66 6f 72 65 20 74 69 econds before ti
4de0: 6d 65 2d 6f 75 74 2e 3c 2f 64 64 3e 0a 09 3c 64 me-out.</dd>..<d
4df0: 74 3e 3c 73 74 72 6f 6e 67 3e 6c 69 66 65 74 69 t><strong>lifeti
4e00: 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e me</strong> <em>
4e10: 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 seconds</em></dt
4e20: 3e 0a 09 3c 64 64 3e 53 65 73 73 69 6f 6e 20 74 >..<dd>Session t
4e30: 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 20 68 icket lifetime h
4e40: 69 6e 74 20 69 6e 20 73 65 63 6f 6e 64 73 2e 3c int in seconds.<
4e50: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
4e60: 67 3e 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 g>session_id</st
4e70: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 rong> <em>binary
4e80: 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 _string</em></dt
4e90: 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 >..<dd>Unique se
4ea0: 73 73 69 6f 6e 20 69 64 20 66 6f 72 20 75 73 65 ssion id for use
4eb0: 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65 in resuming the
4ec0: 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 session.</dd>..
4ed0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 <dt><strong>sess
4ee0: 69 6f 6e 5f 74 69 63 6b 65 74 3c 2f 73 74 72 6f ion_ticket</stro
4ef0: 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 ng> <em>binary_s
4f00: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
4f10: 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 .<dd>Unique sess
4f20: 69 6f 6e 20 74 69 63 6b 65 74 20 66 6f 72 20 75 ion ticket for u
4f30: 73 65 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 se in resuming t
4f40: 68 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e he session.</dd>
4f50: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 ..<dt><strong>ti
4f60: 63 6b 65 74 5f 61 70 70 5f 64 61 74 61 3c 2f 73 cket_app_data</s
4f70: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 trong> <em>binar
4f80: 79 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 y_string</em></d
4f90: 74 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 t>..<dd>Unique s
4fa0: 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 61 70 ession ticket ap
4fb0: 70 6c 69 63 61 74 69 6f 6e 20 64 61 74 61 2e 3c plication data.<
4fc0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
4fd0: 67 3e 6d 61 73 74 65 72 5f 6b 65 79 3c 2f 73 74 g>master_key</st
4fe0: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 rong> <em>binary
4ff0: 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 _string</em></dt
5000: 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 >..<dd>Unique se
5010: 73 73 69 6f 6e 20 6d 61 73 74 65 72 20 6b 65 79 ssion master key
5020: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
5030: 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f 63 61 63 68 ong>session_cach
5040: 65 5f 6d 6f 64 65 3c 2f 73 74 72 6f 6e 67 3e 20 e_mode</strong>
5050: 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 <em>mode</em></d
5060: 74 3e 0a 09 3c 64 64 3e 53 65 72 76 65 72 20 63 t>..<dd>Server c
5070: 61 63 68 65 20 6d 6f 64 65 20 28 63 6c 69 65 6e ache mode (clien
5080: 74 2c 20 73 65 72 76 65 72 2c 20 6f 72 20 62 6f t, server, or bo
5090: 74 68 29 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f th).</dd>. </
50a0: 64 6c 3e 0a 20 20 20 20 3c 2f 62 6c 6f 63 6b 71 dl>. </blockq
50b0: 75 6f 74 65 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c uote>.. <dt><
50c0: 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 a name="tls::cip
50d0: 68 65 72 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c hers"><strong>tl
50e0: 73 3a 3a 63 69 70 68 65 72 73 3c 2f 73 74 72 6f s::ciphers</stro
50f0: 6e 67 3e 0a 09 3c 65 6d 3e 3f 70 72 6f 74 6f 63 ng>..<em>?protoc
5100: 6f 6c 3f 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 ol? ?verbose? ?s
5110: 75 70 70 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f upported?</em></
5120: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e a></dt>. <dd>
5130: 57 69 74 68 6f 75 74 20 61 6e 79 20 61 72 67 73 Without any args
5140: 2c 20 72 65 74 75 72 6e 73 20 61 20 6c 69 73 74 , returns a list
5150: 20 6f 66 20 61 6c 6c 20 73 79 6d 6d 65 74 72 69 of all symmetri
5160: 63 20 63 69 70 68 65 72 73 20 66 6f 72 20 75 73 c ciphers for us
5170: 65 0a 09 77 69 74 68 20 74 68 65 20 3c 73 74 72 e..with the <str
5180: 6f 6e 67 3e 2d 63 69 70 68 65 72 3c 2f 73 74 72 ong>-cipher</str
5190: 6f 6e 67 3e 20 6f 70 74 69 6f 6e 2e 20 57 69 74 ong> option. Wit
51a0: 68 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f h <em>protocol</
51b0: 65 6d 3e 2c 0a 09 6f 6e 6c 79 20 74 68 65 20 63 em>,..only the c
51c0: 69 70 68 65 72 73 20 73 75 70 70 6f 72 74 65 64 iphers supported
51d0: 20 66 6f 72 20 74 68 61 74 20 70 72 6f 74 6f 63 for that protoc
51e0: 6f 6c 20 61 72 65 20 72 65 74 75 72 6e 65 64 2e ol are returned.
51f0: 20 53 65 65 0a 09 3c 61 20 68 72 65 66 3d 22 23 See..<a href="#
5200: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e tls::protocols">
5210: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f <strong>tls::pro
5220: 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67 3e 3c tocols</strong><
5230: 2f 61 3e 20 63 6f 6d 6d 61 6e 64 0a 09 66 6f 72 /a> command..for
5240: 20 74 68 65 20 73 75 70 70 6f 72 74 65 64 20 70 the supported p
5250: 72 6f 74 6f 63 6f 6c 73 2e 20 49 66 20 3c 65 6d rotocols. If <em
5260: 3e 76 65 72 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 >verbose</em> is
5270: 20 73 70 65 63 69 66 69 65 64 20 61 73 20 74 72 specified as tr
5280: 75 65 0a 09 74 68 65 6e 20 61 20 76 65 72 62 6f ue..then a verbo
5290: 73 65 2c 20 68 75 6d 61 6e 20 72 65 61 64 61 62 se, human readab
52a0: 6c 65 20 6c 69 73 74 20 69 73 20 72 65 74 75 72 le list is retur
52b0: 6e 65 64 20 77 69 74 68 20 61 64 64 69 74 69 6f ned with additio
52c0: 6e 61 6c 0a 09 69 6e 66 6f 72 6d 61 74 69 6f 6e nal..information
52d0: 20 6f 6e 20 74 68 65 20 63 69 70 68 65 72 2e 20 on the cipher.
52e0: 49 66 20 3c 65 6d 3e 73 75 70 70 6f 72 74 65 64 If <em>supported
52f0: 3c 2f 65 6d 3e 20 69 73 20 73 70 65 63 69 66 69 </em> is specifi
5300: 65 64 20 61 73 20 74 72 75 65 2c 0a 09 74 68 65 ed as true,..the
5310: 6e 20 6f 6e 6c 79 20 74 68 65 20 63 69 70 68 65 n only the ciphe
5320: 72 73 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 rs supported for
5330: 20 70 72 6f 74 6f 63 6f 6c 20 77 69 6c 6c 20 62 protocol will b
5340: 65 20 6c 69 73 74 65 64 2e 3c 2f 64 64 3e 0a 20 e listed.</dd>.
5350: 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 <dt> </d
5360: 74 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 t>. <dt><a na
5370: 6d 65 3d 22 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f me="tls::protoco
5380: 6c 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a ls"><strong>tls:
5390: 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f :protocols</stro
53a0: 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 ng></a></dt>.
53b0: 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 61 20 6c <dd>Returns a l
53c0: 69 73 74 20 6f 66 20 74 68 65 20 73 75 70 70 6f ist of the suppo
53d0: 72 74 65 64 20 53 53 4c 2f 54 4c 53 20 70 72 6f rted SSL/TLS pro
53e0: 74 6f 63 6f 6c 73 2e 20 56 61 6c 69 64 20 76 61 tocols. Valid va
53f0: 6c 75 65 73 20 61 72 65 3a 0a 09 3c 62 3e 73 73 lues are:..<b>ss
5400: 6c 32 3c 2f 62 3e 2c 20 3c 62 3e 73 73 6c 33 3c l2</b>, <b>ssl3<
5410: 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 3c 2f 62 3e /b>, <b>tls1</b>
5420: 2c 20 3c 62 3e 74 6c 73 31 2e 31 3c 2f 62 3e 2c , <b>tls1.1</b>,
5430: 20 3c 62 3e 74 6c 73 31 2e 32 3c 2f 62 3e 2c 0a <b>tls1.2</b>,.
5440: 09 61 6e 64 20 3c 62 3e 74 6c 73 31 2e 33 3c 2f .and <b>tls1.3</
5450: 62 3e 2e 20 45 78 61 63 74 20 6c 69 73 74 20 64 b>. Exact list d
5460: 65 70 65 6e 64 73 20 6f 6e 20 4f 70 65 6e 53 53 epends on OpenSS
5470: 4c 20 76 65 72 73 69 6f 6e 20 61 6e 64 0a 09 63 L version and..c
5480: 6f 6d 70 69 6c 65 20 74 69 6d 65 20 66 6c 61 67 ompile time flag
5490: 73 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e s.</dd>. <dt>
54a0: 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 </dt>.
54b0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 <dt><a name="tls
54c0: 3a 3a 76 65 72 73 69 6f 6e 22 3e 3c 73 74 72 6f ::version"><stro
54d0: 6e 67 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c ng>tls::version<
54e0: 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 /strong></a></dt
54f0: 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e >. <dd>Return
5500: 73 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 76 65 s the OpenSSL ve
5510: 72 73 69 6f 6e 20 73 74 72 69 6e 67 2e 3c 2f 64 rsion string.</d
5520: 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a d>.</dl>..<hr>..
5530: 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 41 4c <h3><a name="CAL
5540: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 LBACK OPTIONS">C
5550: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c ALLBACK OPTIONS<
5560: 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 /a></h3>..<p>.As
5570: 20 69 6e 64 69 63 61 74 65 64 20 61 62 6f 76 65 indicated above
5580: 2c 20 69 6e 64 69 76 69 64 75 61 6c 20 63 68 61 , individual cha
5590: 6e 6e 65 6c 73 20 63 61 6e 20 62 65 20 67 69 76 nnels can be giv
55a0: 65 6e 20 74 68 65 69 72 20 6f 77 6e 20 63 61 6c en their own cal
55b0: 6c 62 61 63 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 lbacks.to handle
55c0: 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20 70 72 intermediate pr
55d0: 6f 63 65 73 73 69 6e 67 20 62 79 20 74 68 65 20 ocessing by the
55e0: 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 2c OpenSSL library,
55f0: 20 75 73 69 6e 67 20 74 68 65 0a 3c 73 74 72 6f using the.<stro
5600: 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 ng>-command</str
5610: 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 2d 70 ong>, <strong>-p
5620: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e assword</strong>
5630: 2c 20 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e 2d 76 , and.<strong>-v
5640: 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c alidate_command<
5650: 2f 73 74 72 6f 6e 67 3e 20 6f 70 74 69 6f 6e 73 /strong> options
5660: 20 70 61 73 73 65 64 20 74 6f 20 65 69 74 68 65 passed to eithe
5670: 72 20 6f 66 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 r of.<strong>tls
5680: 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 ::socket</strong
5690: 3e 20 6f 72 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 > or <strong>tls
56a0: 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 ::import</strong
56b0: 3e 2e 0a 49 66 20 74 68 65 20 63 61 6c 6c 62 61 >..If the callba
56c0: 63 6b 20 67 65 6e 65 72 61 74 65 73 20 61 6e 20 ck generates an
56d0: 65 72 72 6f 72 2c 20 74 68 65 20 3c 62 3e 62 67 error, the <b>bg
56e0: 65 72 72 6f 72 3c 2f 62 3e 20 63 6f 6d 6d 61 6e error</b> comman
56f0: 64 20 77 69 6c 6c 20 62 65 0a 69 6e 76 6f 6b 65 d will be.invoke
5700: 64 20 77 69 74 68 20 74 68 65 20 65 72 72 6f 72 d with the error
5710: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 0a 3c 2f information..</
5720: 70 3e 0a 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 p>..<dl>. <dt
5730: 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e ><strong>-comman
5740: 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 d</strong> <em>c
5750: 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 allback</em></dt
5760: 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f >. <dd>..Invo
5770: 6b 65 73 20 74 68 65 20 73 70 65 63 69 66 69 65 kes the specifie
5780: 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f d <em>callback</
5790: 65 6d 3e 20 73 63 72 69 70 74 20 61 74 20 73 65 em> script at se
57a0: 76 65 72 61 6c 20 70 6f 69 6e 74 73 0a 09 64 75 veral points..du
57b0: 72 69 6e 67 20 74 68 65 20 4f 70 65 6e 53 53 4c ring the OpenSSL
57c0: 20 68 61 6e 64 73 68 61 6b 65 20 61 6e 64 20 75 handshake and u
57d0: 73 65 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f se. See below fo
57e0: 72 20 74 68 65 20 70 6f 73 73 69 62 6c 65 0a 09 r the possible..
57f0: 61 72 67 75 6d 65 6e 74 73 20 70 61 73 73 65 64 arguments passed
5800: 20 74 6f 20 74 68 65 20 63 61 6c 6c 62 61 63 6b to the callback
5810: 20 73 63 72 69 70 74 2e 20 56 61 6c 75 65 73 20 script. Values
5820: 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 74 68 returned from th
5830: 65 0a 09 63 61 6c 6c 62 61 63 6b 20 61 72 65 20 e..callback are
5840: 69 67 6e 6f 72 65 64 2e 0a 20 20 20 20 3c 62 72 ignored.. <br
5850: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e >. <dl>..<dt>
5860: 0a 09 3c 73 74 72 6f 6e 67 3e 65 72 72 6f 72 3c ..<strong>error<
5870: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 /strong> <em>cha
5880: 6e 6e 65 6c 49 64 20 6d 65 73 73 61 67 65 3c 2f nnelId message</
5890: 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e em>..</dt>..<dd>
58a0: 0a 09 20 20 20 20 54 68 69 73 20 66 6f 72 6d 20 .. This form
58b0: 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 of callback is i
58c0: 6e 76 6f 6b 65 64 20 77 68 65 6e 65 76 65 72 20 nvoked whenever
58d0: 61 6e 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 an error occurs
58e0: 64 75 72 69 6e 67 20 74 68 65 0a 09 20 20 20 20 during the..
58f0: 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 initial connecti
5900: 6f 6e 2c 20 68 61 6e 64 73 68 61 6b 65 2c 20 6f on, handshake, o
5910: 72 20 49 2f 4f 20 6f 70 65 72 61 74 69 6f 6e 73 r I/O operations
5920: 2e 20 54 68 65 20 3c 65 6d 3e 6d 65 73 73 61 67 . The <em>messag
5930: 65 3c 2f 65 6d 3e 0a 09 20 20 20 20 61 72 67 75 e</em>.. argu
5940: 6d 65 6e 74 20 63 61 6e 20 62 65 20 66 72 6f 6d ment can be from
5950: 20 74 68 65 20 54 63 6c 5f 45 72 72 6e 6f 4d 73 the Tcl_ErrnoMs
5960: 67 2c 20 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 g, OpenSSL funct
5970: 69 6f 6e 0a 09 20 20 20 20 3c 63 6f 64 65 3e 45 ion.. <code>E
5980: 52 52 5f 72 65 61 73 6f 6e 5f 65 72 72 6f 72 5f RR_reason_error_
5990: 73 74 72 69 6e 67 28 29 3c 2f 63 6f 64 65 3e 2c string()</code>,
59a0: 20 6f 72 20 61 20 63 75 73 74 6f 6d 20 6d 65 73 or a custom mes
59b0: 73 61 67 65 2e 0a 09 3c 2f 64 64 3e 0a 09 3c 62 sage...</dd>..<b
59c0: 72 3e 0a 09 3c 64 74 3e 0a 09 20 20 20 20 3c 73 r>..<dt>.. <s
59d0: 74 72 6f 6e 67 3e 69 6e 66 6f 3c 2f 73 74 72 6f trong>info</stro
59e0: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 ng> <em>channelI
59f0: 64 20 6d 61 6a 6f 72 20 6d 69 6e 6f 72 20 6d 65 d major minor me
5a00: 73 73 61 67 65 20 74 79 70 65 3c 2f 65 6d 3e 0a ssage type</em>.
5a10: 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 .</dt>..<dd>..
5a20: 20 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 This form of
5a30: 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f callback is invo
5a40: 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 ked by the OpenS
5a50: 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 20 SL function..
5a60: 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 65 74 5f 69 <code>SSL_set_i
5a70: 6e 66 6f 5f 63 61 6c 6c 62 61 63 6b 28 29 3c 2f nfo_callback()</
5a80: 63 6f 64 65 3e 20 64 75 72 69 6e 67 20 74 68 65 code> during the
5a90: 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 initial connect
5aa0: 69 6f 6e 0a 09 20 20 20 20 61 6e 64 20 68 61 6e ion.. and han
5ab0: 64 73 68 61 6b 65 20 6f 70 65 72 61 74 69 6f 6e dshake operation
5ac0: 73 2e 20 54 68 65 20 3c 65 6d 3e 74 79 70 65 3c s. The <em>type<
5ad0: 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 /em> argument is
5ae0: 20 6e 65 77 20 66 6f 72 0a 09 20 20 20 20 54 4c new for.. TL
5af0: 53 20 31 2e 38 2e 20 54 68 65 20 61 72 67 75 6d S 1.8. The argum
5b00: 65 6e 74 73 20 61 72 65 3a 0a 09 3c 62 72 3e 0a ents are:..<br>.
5b10: 09 3c 75 6c 3e 0a 09 3c 6c 69 3e 50 6f 73 73 69 .<ul>..<li>Possi
5b20: 62 6c 65 20 76 61 6c 75 65 73 20 66 6f 72 20 3c ble values for <
5b30: 65 6d 3e 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 72 em>major</em> ar
5b40: 65 3a 0a 09 20 20 20 20 3c 63 6f 64 65 3e 68 61 e:.. <code>ha
5b50: 6e 64 73 68 61 6b 65 2c 20 61 6c 65 72 74 2c 20 ndshake, alert,
5b60: 63 6f 6e 6e 65 63 74 2c 20 61 63 63 65 70 74 3c connect, accept<
5b70: 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a 09 3c 6c /code>.</li>..<l
5b80: 69 3e 50 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 i>Possible value
5b90: 73 20 66 6f 72 20 3c 65 6d 3e 6d 69 6e 6f 72 3c s for <em>minor<
5ba0: 2f 65 6d 3e 20 61 72 65 3a 0a 09 20 20 20 20 3c /em> are:.. <
5bb0: 63 6f 64 65 3e 73 74 61 72 74 2c 20 64 6f 6e 65 code>start, done
5bc0: 2c 20 72 65 61 64 2c 20 77 72 69 74 65 2c 20 6c , read, write, l
5bd0: 6f 6f 70 2c 20 65 78 69 74 3c 2f 63 6f 64 65 3e oop, exit</code>
5be0: 2e 3c 2f 6c 69 3e 0a 09 3c 6c 69 3e 54 68 65 20 .</li>..<li>The
5bf0: 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e <em>message</em>
5c00: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20 64 argument is a d
5c10: 65 73 63 72 69 70 74 69 76 65 20 73 74 72 69 6e escriptive strin
5c20: 67 20 77 68 69 63 68 20 6d 61 79 0a 09 20 20 20 g which may..
5c30: 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 65 69 be generated ei
5c40: 74 68 65 72 20 62 79 20 3c 63 6f 64 65 3e 53 53 ther by <code>SS
5c50: 4c 5f 73 74 61 74 65 5f 73 74 72 69 6e 67 5f 6c L_state_string_l
5c60: 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 20 6f 72 20 ong()</code> or
5c70: 62 79 0a 09 20 20 20 20 3c 63 6f 64 65 3e 53 53 by.. <code>SS
5c80: 4c 5f 61 6c 65 72 74 5f 64 65 73 63 5f 73 74 72 L_alert_desc_str
5c90: 69 6e 67 5f 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 ing_long()</code
5ca0: 3e 2c 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 >, depending on
5cb0: 74 68 65 20 63 6f 6e 74 65 78 74 2e 3c 2f 6c 69 the context.</li
5cc0: 3e 0a 09 3c 6c 69 3e 46 6f 72 20 61 6c 65 72 74 >..<li>For alert
5cd0: 73 2c 20 74 68 65 20 70 6f 73 73 69 62 6c 65 20 s, the possible
5ce0: 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 74 values for <em>t
5cf0: 79 70 65 3c 2f 65 6d 3e 20 61 72 65 3a 0a 09 20 ype</em> are:..
5d00: 20 20 20 3c 63 6f 64 65 3e 77 61 72 6e 69 6e 67 <code>warning
5d10: 2c 20 66 61 74 61 6c 2c 20 61 6e 64 20 75 6e 6b , fatal, and unk
5d20: 6e 6f 77 6e 3c 2f 63 6f 64 65 3e 2e 20 46 6f 72 nown</code>. For
5d30: 20 6f 74 68 65 72 73 2c 0a 09 20 20 20 20 3c 63 others,.. <c
5d40: 6f 64 65 3e 69 6e 66 6f 3c 2f 63 6f 64 65 3e 20 ode>info</code>
5d50: 69 73 20 75 73 65 64 2e 3c 2f 6c 69 3e 0a 09 3c is used.</li>..<
5d60: 2f 75 6c 3e 0a 09 3c 2f 64 64 3e 0a 09 3c 64 74 /ul>..</dd>..<dt
5d70: 3e 0a 09 3c 73 74 72 6f 6e 67 3e 6d 65 73 73 61 >..<strong>messa
5d80: 67 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e ge</strong> <em>
5d90: 63 68 61 6e 6e 65 6c 49 64 20 64 69 72 65 63 74 channelId direct
5da0: 69 6f 6e 20 76 65 72 73 69 6f 6e 20 63 6f 6e 74 ion version cont
5db0: 65 6e 74 5f 74 79 70 65 20 6d 65 73 73 61 67 65 ent_type message
5dc0: 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 </em>..</dt>..<d
5dd0: 64 3e 0a 09 20 20 20 20 54 68 69 73 20 66 6f 72 d>.. This for
5de0: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 m of callback is
5df0: 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 invoked by the
5e00: 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e OpenSSL function
5e10: 0a 09 20 20 20 20 3c 63 6f 64 65 3e 53 53 4c 5f .. <code>SSL_
5e20: 73 65 74 5f 6d 73 67 5f 63 61 6c 6c 62 61 63 6b set_msg_callback
5e30: 28 29 3c 2f 63 6f 64 65 3e 20 77 68 65 6e 65 76 ()</code> whenev
5e40: 65 72 20 61 20 6d 65 73 73 61 67 65 20 69 73 20 er a message is
5e50: 73 65 6e 74 20 6f 72 0a 09 20 20 20 20 72 65 63 sent or.. rec
5e60: 65 69 76 65 64 20 64 75 72 69 6e 67 20 74 68 65 eived during the
5e70: 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 63 74 initial connect
5e80: 69 6f 6e 2c 20 68 61 6e 64 73 68 61 6b 65 2c 20 ion, handshake,
5e90: 6f 72 20 49 2f 4f 20 6f 70 65 72 61 74 69 6f 6e or I/O operation
5ea0: 73 2e 0a 09 20 20 20 20 49 74 20 69 73 20 6f 6e s... It is on
5eb0: 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 77 68 65 ly available whe
5ec0: 6e 20 4f 70 65 6e 53 53 4c 20 69 73 20 63 6f 6d n OpenSSL is com
5ed0: 70 6c 69 65 64 20 77 69 74 68 20 74 68 65 0a 09 plied with the..
5ee0: 20 20 20 20 3c 65 6d 3e 65 6e 61 62 6c 65 2d 73 <em>enable-s
5ef0: 73 6c 2d 74 72 61 63 65 3c 2f 65 6d 3e 20 6f 70 sl-trace</em> op
5f00: 74 69 6f 6e 2e 20 41 72 67 75 6d 65 6e 74 73 20 tion. Arguments
5f10: 61 72 65 3a 20 3c 65 6d 3e 64 69 72 65 63 74 69 are: <em>directi
5f20: 6f 6e 3c 2f 65 6d 3e 0a 09 20 20 20 20 69 73 20 on</em>.. is
5f30: 3c 62 3e 53 65 6e 74 3c 2f 62 3e 20 6f 72 20 3c <b>Sent</b> or <
5f40: 62 3e 52 65 63 65 69 76 65 64 3c 2f 62 3e 2c 20 b>Received</b>,
5f50: 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e <em>version</em>
5f60: 20 69 73 20 74 68 65 20 70 72 6f 74 6f 63 6f 6c is the protocol
5f70: 0a 09 20 20 20 20 76 65 72 73 69 6f 6e 2c 20 3c .. version, <
5f80: 65 6d 3e 63 6f 6e 74 65 6e 74 5f 74 79 70 65 3c em>content_type<
5f90: 2f 65 6d 3e 20 69 73 20 74 68 65 20 6d 65 73 73 /em> is the mess
5fa0: 61 67 65 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 age content type
5fb0: 2c 20 61 6e 64 0a 09 20 20 20 20 3c 65 6d 3e 6d , and.. <em>m
5fc0: 65 73 73 61 67 65 3c 2f 65 6d 3e 20 69 73 20 6d essage</em> is m
5fd0: 6f 72 65 20 69 6e 66 6f 20 66 72 6f 6d 20 74 68 ore info from th
5fe0: 65 20 3c 63 6f 64 65 3e 53 53 4c 5f 74 72 61 63 e <code>SSL_trac
5ff0: 65 3c 2f 63 6f 64 65 3e 20 41 50 49 2e 0a 09 20 e</code> API...
6000: 20 20 20 54 68 69 73 20 63 61 6c 6c 62 61 63 6b This callback
6010: 20 69 73 20 6e 65 77 20 66 6f 72 20 54 4c 53 20 is new for TLS
6020: 31 2e 38 2e 0a 09 3c 2f 64 64 3e 0a 09 3c 62 72 1.8...</dd>..<br
6030: 3e 0a 09 3c 64 74 3e 0a 09 3c 73 74 72 6f 6e 67 >..<dt>..<strong
6040: 3e 73 65 73 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 >session</strong
6050: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 > <em>channelId
6060: 73 65 73 73 69 6f 6e 5f 69 64 20 74 69 63 6b 65 session_id ticke
6070: 74 20 6c 69 66 65 74 69 6d 65 3c 2f 65 6d 3e 0a t lifetime</em>.
6080: 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 .</dt>..<dd>..
6090: 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 This form of c
60a0: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b allback is invok
60b0: 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e 53 53 ed by the OpenSS
60c0: 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 20 20 L function..
60d0: 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58 5f 73 65 <code>SSL_CTX_se
60e0: 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62 28 29 3c ss_set_new_cb()<
60f0: 2f 63 6f 64 65 3e 20 77 68 65 6e 65 76 65 72 20 /code> whenever
6100: 61 20 6e 65 77 20 73 65 73 73 69 6f 6e 20 69 64 a new session id
6110: 20 69 73 0a 09 20 20 20 20 73 65 6e 74 20 62 79 is.. sent by
6120: 20 74 68 65 20 73 65 72 76 65 72 20 64 75 72 69 the server duri
6130: 6e 67 20 74 68 65 20 69 6e 69 74 69 61 6c 20 63 ng the initial c
6140: 6f 6e 6e 65 63 74 69 6f 6e 20 61 6e 64 20 68 61 onnection and ha
6150: 6e 64 73 68 61 6b 65 2c 20 62 75 74 0a 09 20 20 ndshake, but..
6160: 20 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 72 65 can also be re
6170: 63 65 69 76 65 64 20 6c 61 74 65 72 20 69 66 20 ceived later if
6180: 74 68 65 20 3c 62 3e 2d 70 6f 73 74 5f 68 61 6e the <b>-post_han
6190: 64 73 68 61 6b 65 3c 2f 62 3e 20 6f 70 74 69 6f dshake</b> optio
61a0: 6e 20 69 73 0a 09 20 20 20 20 75 73 65 64 2e 20 n is.. used.
61b0: 41 72 67 75 6d 65 6e 74 73 20 61 72 65 3a 20 3c Arguments are: <
61c0: 65 6d 3e 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 65 em>session_id</e
61d0: 6d 3e 20 69 73 20 74 68 65 20 63 75 72 72 65 6e m> is the curren
61e0: 74 0a 09 20 20 20 20 73 65 73 73 69 6f 6e 20 69 t.. session i
61f0: 64 65 6e 74 69 66 69 65 72 2c 20 3c 65 6d 3e 74 dentifier, <em>t
6200: 69 63 6b 65 74 3c 2f 65 6d 3e 20 69 73 20 74 68 icket</em> is th
6210: 65 20 73 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 e session ticket
6220: 20 69 6e 66 6f 2c 20 61 6e 64 0a 09 20 20 20 20 info, and..
6230: 3c 65 6d 3e 6c 69 66 65 74 69 6d 65 3c 2f 65 6d <em>lifetime</em
6240: 3e 20 69 73 20 74 68 65 20 74 68 65 20 74 69 63 > is the the tic
6250: 6b 65 74 20 6c 69 66 65 74 69 6d 65 20 69 6e 20 ket lifetime in
6260: 73 65 63 6f 6e 64 73 2e 0a 09 20 20 20 20 54 68 seconds... Th
6270: 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e is callback is n
6280: 65 77 20 66 6f 72 20 54 4c 53 20 31 2e 38 2e 0a ew for TLS 1.8..
6290: 09 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e .</dd>. </dl>
62a0: 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e . </dd>.</dl>
62b0: 0a 3c 62 72 3e 0a 3c 64 6c 3e 0a 20 20 20 20 3c .<br>.<dl>. <
62c0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 dt><strong>-pass
62d0: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 word</strong> <e
62e0: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c m>callback</em><
62f0: 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 /dt>. <dd>..I
6300: 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 nvokes the speci
6310: 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 fied <em>callbac
6320: 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 77 68 k</em> script wh
6330: 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65 65 64 73 en OpenSSL needs
6340: 20 74 6f 0a 09 6f 62 74 61 69 6e 20 61 20 70 61 to..obtain a pa
6350: 73 73 77 6f 72 64 2e 20 53 65 65 20 62 65 6c 6f ssword. See belo
6360: 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62 w for the possib
6370: 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 70 61 73 le arguments pas
6380: 73 65 64 20 74 6f 0a 09 74 68 65 20 63 61 6c 6c sed to..the call
6390: 62 61 63 6b 20 73 63 72 69 70 74 2e 20 53 65 65 back script. See
63a0: 20 62 65 6c 6f 77 20 66 6f 72 20 76 61 6c 69 64 below for valid
63b0: 20 72 65 74 75 72 6e 20 76 61 6c 75 65 73 2e 0a return values..
63c0: 09 3c 62 72 3e 0a 09 3c 64 6c 3e 0a 09 20 20 20 .<br>..<dl>..
63d0: 20 3c 64 74 3e 0a 09 20 20 20 20 3c 73 74 72 6f <dt>.. <stro
63e0: 6e 67 3e 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 ng>password</str
63f0: 6f 6e 67 3e 20 3c 65 6d 3e 72 77 66 6c 61 67 20 ong> <em>rwflag
6400: 73 69 7a 65 3c 2f 65 6d 3e 0a 09 20 20 20 20 3c size</em>.. <
6410: 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 3e 0a 09 /dt>.. <dd>..
6420: 09 49 6e 76 6f 6b 65 64 20 77 68 65 6e 20 6c 6f .Invoked when lo
6430: 61 64 69 6e 67 20 6f 72 20 73 74 6f 72 69 6e 67 ading or storing
6440: 20 61 20 50 45 4d 20 63 65 72 74 69 66 69 63 61 a PEM certifica
6450: 74 65 20 77 69 74 68 20 65 6e 63 72 79 70 74 69 te with encrypti
6460: 6f 6e 2e 0a 09 09 57 68 65 72 65 20 3c 65 6d 3e on....Where <em>
6470: 72 77 66 6c 61 67 3c 2f 65 6d 3e 20 69 73 20 30 rwflag</em> is 0
6480: 20 66 6f 72 20 72 65 61 64 69 6e 67 2f 64 65 63 for reading/dec
6490: 72 79 70 74 69 6f 6e 20 6f 72 20 31 20 66 6f 72 ryption or 1 for
64a0: 0a 09 09 77 72 69 74 69 6e 67 2f 65 6e 63 72 79 ...writing/encry
64b0: 70 74 69 6f 6e 20 28 63 61 6e 20 70 72 6f 6d 70 ption (can promp
64c0: 74 20 75 73 65 72 20 74 6f 20 63 6f 6e 66 69 72 t user to confir
64d0: 6d 29 20 61 6e 64 20 3c 65 6d 3e 73 69 7a 65 3c m) and <em>size<
64e0: 2f 65 6d 3e 20 69 73 0a 09 09 74 68 65 20 6d 61 /em> is...the ma
64f0: 78 20 70 61 73 73 77 6f 72 64 20 6c 65 6e 67 74 x password lengt
6500: 68 20 69 6e 20 62 79 74 65 73 2e 20 54 68 65 20 h in bytes. The
6510: 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 callback should
6520: 72 65 74 75 72 6e 20 74 68 65 0a 09 09 70 61 73 return the...pas
6530: 73 77 6f 72 64 20 61 73 20 61 20 73 74 72 69 6e sword as a strin
6540: 67 2e 20 42 6f 74 68 20 61 72 67 75 6d 65 6e 74 g. Both argument
6550: 73 20 61 72 65 20 6e 65 77 20 66 6f 72 20 54 4c s are new for TL
6560: 53 20 31 2e 38 2e 0a 09 20 20 20 20 3c 2f 64 64 S 1.8... </dd
6570: 3e 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 >..</dl>. </d
6580: 64 3e 0a 3c 2f 64 6c 3e 0a 3c 62 72 3e 0a 3c 64 d>.</dl>.<br>.<d
6590: 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f l>. <dt><stro
65a0: 6e 67 3e 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d ng>-validatecomm
65b0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d and</strong> <em
65c0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f >callback</em></
65d0: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e dt>. <dd>..In
65e0: 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63 69 66 vokes the specif
65f0: 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b ied <em>callback
6600: 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 64 75 72 </em> script dur
6610: 69 6e 67 20 68 61 6e 64 73 68 61 6b 65 20 69 6e ing handshake in
6620: 0a 09 6f 72 64 65 72 20 74 6f 20 76 61 6c 69 64 ..order to valid
6630: 61 74 65 20 74 68 65 20 70 72 6f 76 69 64 65 64 ate the provided
6640: 20 76 61 6c 75 65 28 73 29 2e 20 53 65 65 20 62 value(s). See b
6650: 65 6c 6f 77 20 66 6f 72 20 74 68 65 20 70 6f 73 elow for the pos
6660: 73 69 62 6c 65 0a 09 61 72 67 75 6d 65 6e 74 73 sible..arguments
6670: 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 63 passed to the c
6680: 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 2e 20 allback script.
6690: 49 66 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 If not specified
66a0: 2c 20 4f 70 65 6e 53 53 4c 0a 09 77 69 6c 6c 20 , OpenSSL..will
66b0: 61 63 63 65 70 74 20 76 61 6c 69 64 20 63 65 72 accept valid cer
66c0: 74 69 66 69 63 61 74 65 73 20 61 6e 64 20 65 78 tificates and ex
66d0: 74 65 6e 73 69 6f 6e 73 2e 0a 09 54 6f 20 72 65 tensions...To re
66e0: 6a 65 63 74 20 74 68 65 20 76 61 6c 75 65 20 61 ject the value a
66f0: 6e 64 20 61 62 6f 72 74 20 74 68 65 20 63 6f 6e nd abort the con
6700: 6e 65 63 74 69 6f 6e 2c 20 74 68 65 20 63 61 6c nection, the cal
6710: 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 lback should ret
6720: 75 72 6e 20 30 2e 0a 09 54 6f 20 61 63 63 65 70 urn 0...To accep
6730: 74 20 74 68 65 20 76 61 6c 75 65 20 61 6e 64 20 t the value and
6740: 63 6f 6e 74 69 6e 75 65 20 74 68 65 20 63 6f 6e continue the con
6750: 6e 65 63 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 nection, it shou
6760: 6c 64 20 72 65 74 75 72 6e 20 31 2e 0a 09 54 6f ld return 1...To
6770: 20 72 65 6a 65 63 74 20 74 68 65 20 76 61 6c 75 reject the valu
6780: 65 2c 20 62 75 74 20 63 6f 6e 74 69 6e 75 65 20 e, but continue
6790: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 the connection,
67a0: 69 74 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e it should return
67b0: 20 32 2e 0a 09 3c 62 72 3e 0a 09 3c 64 6c 3e 0a 2...<br>..<dl>.
67c0: 09 20 20 20 20 3c 64 74 3e 0a 09 09 3c 73 74 72 . <dt>...<str
67d0: 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 ong>alpn</strong
67e0: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 > <em>channelId
67f0: 70 72 6f 74 6f 63 6f 6c 20 6d 61 74 63 68 3c 2f protocol match</
6800: 65 6d 3e 0a 09 09 3c 2f 64 74 3e 0a 09 20 20 20 em>...</dt>..
6810: 20 3c 64 64 3e 0a 09 09 46 6f 72 20 73 65 72 76 <dd>...For serv
6820: 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f ers, this form o
6830: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e f callback is in
6840: 76 6f 6b 65 64 20 77 68 65 6e 20 74 68 65 20 63 voked when the c
6850: 6c 69 65 6e 74 20 41 4c 50 4e 0a 09 09 65 78 74 lient ALPN...ext
6860: 65 6e 73 69 6f 6e 20 69 73 20 72 65 63 65 69 76 ension is receiv
6870: 65 64 2e 20 49 66 20 3c 65 6d 3e 6d 61 74 63 68 ed. If <em>match
6880: 3c 2f 65 6d 3e 20 69 73 20 74 72 75 65 2c 20 3c </em> is true, <
6890: 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e em>protocol</em>
68a0: 0a 09 09 69 73 20 74 68 65 20 66 69 72 73 74 20 ...is the first
68b0: 3c 62 3e 2d 61 6c 70 6e 3c 2f 62 3e 20 6f 70 74 <b>-alpn</b> opt
68c0: 69 6f 6e 20 73 70 65 63 69 66 69 65 64 20 70 72 ion specified pr
68d0: 6f 74 6f 63 6f 6c 20 63 6f 6d 6d 6f 6e 20 74 6f otocol common to
68e0: 20 62 6f 74 68 0a 09 09 74 68 65 20 63 6c 69 65 both...the clie
68f0: 6e 74 20 61 6e 64 20 73 65 72 76 65 72 2e 20 49 nt and server. I
6900: 66 20 6e 6f 74 2c 20 74 68 65 20 66 69 72 73 74 f not, the first
6910: 20 63 6c 69 65 6e 74 20 73 70 65 63 69 66 69 65 client specifie
6920: 64 20 70 72 6f 74 6f 63 6f 6c 20 69 73 0a 09 09 d protocol is...
6930: 75 73 65 64 2e 20 49 74 20 69 73 20 63 61 6c 6c used. It is call
6940: 65 64 20 61 66 74 65 72 20 74 68 65 20 68 65 6c ed after the hel
6950: 6c 6f 20 61 6e 64 20 41 4c 50 4e 20 63 61 6c 6c lo and ALPN call
6960: 62 61 63 6b 73 2e 0a 09 09 54 68 69 73 20 63 61 backs....This ca
6970: 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 20 66 6f llback is new fo
6980: 72 20 54 4c 53 20 31 2e 38 2e 0a 09 20 20 20 20 r TLS 1.8...
6990: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 62 72 3e 0a </dd>.. <br>.
69a0: 09 20 20 20 20 3c 64 74 3e 0a 09 09 3c 73 74 72 . <dt>...<str
69b0: 6f 6e 67 3e 68 65 6c 6c 6f 3c 2f 73 74 72 6f 6e ong>hello</stron
69c0: 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 g> <em>channelId
69d0: 20 73 65 72 76 65 72 6e 61 6d 65 3c 2f 65 6d 3e servername</em>
69e0: 0a 09 20 20 20 20 3c 2f 64 74 3e 0a 09 20 20 20 .. </dt>..
69f0: 20 3c 64 64 3e 0a 09 09 46 6f 72 20 73 65 72 76 <dd>...For serv
6a00: 65 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f ers, this form o
6a10: 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e f callback is in
6a20: 76 6f 6b 65 64 20 64 75 72 69 6e 67 20 63 6c 69 voked during cli
6a30: 65 6e 74 20 68 65 6c 6c 6f 0a 09 09 6d 65 73 73 ent hello...mess
6a40: 61 67 65 20 70 72 6f 63 65 73 73 69 6e 67 2e 20 age processing.
6a50: 54 68 65 20 70 75 72 70 6f 73 65 20 69 73 20 73 The purpose is s
6a60: 6f 20 74 68 65 20 73 65 72 76 65 72 20 63 61 6e o the server can
6a70: 20 73 65 6c 65 63 74 20 74 68 65 0a 09 09 61 70 select the...ap
6a80: 70 72 6f 70 72 69 61 74 65 20 63 65 72 74 69 66 propriate certif
6a90: 69 63 61 74 65 20 74 6f 20 70 72 65 73 65 6e 74 icate to present
6aa0: 20 74 6f 20 74 68 65 20 63 6c 69 65 6e 74 2c 20 to the client,
6ab0: 61 6e 64 20 74 6f 20 6d 61 6b 65 20 6f 74 68 65 and to make othe
6ac0: 72 0a 09 09 63 6f 6e 66 69 67 75 72 61 74 69 6f r...configuratio
6ad0: 6e 20 61 64 6a 75 73 74 6d 65 6e 74 73 20 72 65 n adjustments re
6ae0: 6c 65 76 61 6e 74 20 74 6f 20 74 68 61 74 20 73 levant to that s
6af0: 65 72 76 65 72 20 6e 61 6d 65 20 61 6e 64 20 69 erver name and i
6b00: 74 73 0a 09 09 63 6f 6e 66 69 67 75 72 61 74 69 ts...configurati
6b10: 6f 6e 2e 20 49 74 20 69 73 20 63 61 6c 6c 65 64 on. It is called
6b20: 20 62 65 66 6f 72 65 20 74 68 65 20 53 4e 49 20 before the SNI
6b30: 61 6e 64 20 41 4c 50 4e 20 63 61 6c 6c 62 61 63 and ALPN callbac
6b40: 6b 73 2e 0a 09 09 54 68 69 73 20 63 61 6c 6c 62 ks....This callb
6b50: 61 63 6b 20 69 73 20 6e 65 77 20 66 6f 72 20 54 ack is new for T
6b60: 4c 53 20 31 2e 38 2e 0a 09 20 20 20 20 3c 2f 64 LS 1.8... </d
6b70: 64 3e 0a 09 20 20 20 20 3c 62 72 3e 0a 09 20 20 d>.. <br>..
6b80: 20 20 3c 64 74 3e 0a 09 09 3c 73 74 72 6f 6e 67 <dt>...<strong
6b90: 3e 73 6e 69 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 >sni</strong> <e
6ba0: 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 73 65 72 76 m>channelId serv
6bb0: 65 72 6e 61 6d 65 3c 2f 65 6d 3e 0a 09 20 20 20 ername</em>..
6bc0: 20 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 3e </dt>.. <dd>
6bd0: 0a 09 09 46 6f 72 20 73 65 72 76 65 72 73 2c 20 ...For servers,
6be0: 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c this form of cal
6bf0: 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 lback is invoked
6c00: 20 77 68 65 6e 20 74 68 65 20 53 65 72 76 65 72 when the Server
6c10: 20 4e 61 6d 65 0a 09 09 49 6e 64 69 63 61 74 69 Name...Indicati
6c20: 6f 6e 20 28 53 4e 49 29 20 65 78 74 65 6e 73 69 on (SNI) extensi
6c30: 6f 6e 20 69 73 20 72 65 63 65 69 76 65 64 2e 20 on is received.
6c40: 54 68 65 20 3c 65 6d 3e 73 65 72 76 65 72 6e 61 The <em>serverna
6c50: 6d 65 3c 2f 65 6d 3e 0a 09 09 61 72 67 75 6d 65 me</em>...argume
6c60: 6e 74 20 69 73 20 74 68 65 20 63 6c 69 65 6e 74 nt is the client
6c70: 20 70 72 6f 76 69 64 65 64 20 73 65 72 76 65 72 provided server
6c80: 20 6e 61 6d 65 20 69 6e 20 74 68 65 20 3c 62 3e name in the <b>
6c90: 2d 73 65 72 76 65 72 6e 61 6d 65 3c 2f 62 3e 0a -servername</b>.
6ca0: 09 09 6f 70 74 69 6f 6e 2e 20 54 68 65 20 70 75 ..option. The pu
6cb0: 72 70 6f 73 65 20 69 73 20 73 6f 20 77 68 65 6e rpose is so when
6cc0: 20 61 20 73 65 72 76 65 72 20 73 75 70 70 6f 72 a server suppor
6cd0: 74 73 20 6d 75 6c 74 69 70 6c 65 20 6e 61 6d 65 ts multiple name
6ce0: 73 2c 20 74 68 65 0a 09 09 72 69 67 68 74 20 63 s, the...right c
6cf0: 65 72 74 69 66 69 63 61 74 65 20 63 61 6e 20 62 ertificate can b
6d00: 65 20 75 73 65 64 2e 20 49 74 20 69 73 20 63 61 e used. It is ca
6d10: 6c 6c 65 64 20 61 66 74 65 72 20 74 68 65 20 68 lled after the h
6d20: 65 6c 6c 6f 20 63 61 6c 6c 62 61 63 6b 0a 09 09 ello callback...
6d30: 62 75 74 20 62 65 66 6f 72 65 20 74 68 65 20 41 but before the A
6d40: 4c 50 4e 20 63 61 6c 6c 62 61 63 6b 2e 0a 09 09 LPN callback....
6d50: 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 This callback is
6d60: 20 6e 65 77 20 66 6f 72 20 54 4c 53 20 31 2e 38 new for TLS 1.8
6d70: 2e 0a 09 20 20 20 20 3c 2f 64 64 3e 0a 09 20 20 ... </dd>..
6d80: 20 20 3c 62 72 3e 0a 09 20 20 20 20 3c 64 74 3e <br>.. <dt>
6d90: 0a 09 09 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 ...<strong>verif
6da0: 79 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 y</strong> <em>c
6db0: 68 61 6e 6e 65 6c 49 64 20 64 65 70 74 68 20 63 hannelId depth c
6dc0: 65 72 74 20 73 74 61 74 75 73 20 65 72 72 6f 72 ert status error
6dd0: 3c 2f 65 6d 3e 0a 09 20 20 20 20 3c 2f 64 74 3e </em>.. </dt>
6de0: 0a 09 20 20 20 20 3c 64 64 3e 0a 09 09 54 68 69 .. <dd>...Thi
6df0: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 s form of callba
6e00: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79 ck is invoked by
6e10: 20 4f 70 65 6e 53 53 4c 20 77 68 65 6e 20 61 20 OpenSSL when a
6e20: 6e 65 77 20 63 65 72 74 69 66 69 63 61 74 65 0a new certificate.
6e30: 09 09 69 73 20 72 65 63 65 69 76 65 64 20 66 72 ..is received fr
6e40: 6f 6d 20 74 68 65 20 70 65 65 72 2e 20 49 74 20 om the peer. It
6e50: 61 6c 6c 6f 77 73 20 74 68 65 20 63 6c 69 65 6e allows the clien
6e60: 74 20 74 6f 20 63 68 65 63 6b 20 74 68 65 0a 09 t to check the..
6e70: 09 63 65 72 74 69 66 69 63 61 74 65 20 76 65 72 .certificate ver
6e80: 69 66 69 63 61 74 69 6f 6e 20 72 65 73 75 6c 74 ification result
6e90: 73 20 61 6e 64 20 63 68 6f 6f 73 65 20 77 68 65 s and choose whe
6ea0: 74 68 65 72 20 74 6f 20 63 6f 6e 74 69 6e 75 65 ther to continue
6eb0: 0a 09 09 6f 72 20 6e 6f 74 2e 20 49 74 20 69 73 ...or not. It is
6ec0: 20 63 61 6c 6c 65 64 20 66 6f 72 20 65 61 63 68 called for each
6ed0: 20 63 65 72 74 69 66 69 63 61 74 65 20 69 6e 20 certificate in
6ee0: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 the certificate
6ef0: 63 68 61 69 6e 2e 0a 09 09 3c 75 6c 3e 0a 09 09 chain....<ul>...
6f00: 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e 64 65 70 74 <li>The <em>dept
6f10: 68 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74 20 h</em> argument
6f20: 69 73 20 74 68 65 20 69 6e 74 65 67 65 72 20 64 is the integer d
6f30: 65 70 74 68 20 6f 66 20 74 68 65 0a 09 09 63 65 epth of the...ce
6f40: 72 74 69 66 69 63 61 74 65 20 69 6e 20 74 68 65 rtificate in the
6f50: 20 63 65 72 74 69 66 69 63 61 74 65 20 63 68 61 certificate cha
6f60: 69 6e 2c 20 77 68 65 72 65 20 30 20 69 73 20 74 in, where 0 is t
6f70: 68 65 20 70 65 65 72 20 63 65 72 74 69 66 69 63 he peer certific
6f80: 61 74 65 0a 09 09 61 6e 64 20 68 69 67 68 65 72 ate...and higher
6f90: 20 76 61 6c 75 65 73 20 67 6f 69 6e 67 20 75 70 values going up
6fa0: 20 74 6f 20 74 68 65 20 43 65 72 74 69 66 69 63 to the Certific
6fb0: 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 28 43 ate Authority (C
6fc0: 41 29 2e 3c 2f 6c 69 3e 0a 09 09 3c 6c 69 3e 54 A).</li>...<li>T
6fd0: 68 65 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e he <em>cert</em>
6fe0: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 20 6c argument is a l
6ff0: 69 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 ist of key-value
7000: 20 70 61 69 72 73 20 73 69 6d 69 6c 61 72 0a 09 pairs similar..
7010: 09 74 6f 20 74 68 6f 73 65 20 72 65 74 75 72 6e .to those return
7020: 65 64 20 62 79 0a 09 09 3c 61 20 68 72 65 66 3d ed by...<a href=
7030: 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c "#tls::status"><
7040: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 strong>tls::stat
7050: 75 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e us</strong></a>.
7060: 3c 2f 6c 69 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 </li>...<li>The
7070: 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e 20 <em>status</em>
7080: 61 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 argument is the
7090: 62 6f 6f 6c 65 61 6e 20 76 61 6c 69 64 69 74 79 boolean validity
70a0: 20 6f 66 20 74 68 65 0a 09 09 63 75 72 72 65 6e of the...curren
70b0: 74 20 63 65 72 74 69 66 69 63 61 74 65 20 77 68 t certificate wh
70c0: 65 72 65 20 30 20 69 73 20 69 6e 76 61 6c 69 64 ere 0 is invalid
70d0: 20 61 6e 64 20 31 20 69 73 20 76 61 6c 69 64 2e and 1 is valid.
70e0: 3c 2f 6c 69 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 </li>...<li>The
70f0: 3c 65 6d 3e 65 72 72 6f 72 3c 2f 65 6d 3e 20 61 <em>error</em> a
7100: 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 65 rgument is the e
7110: 72 72 6f 72 20 6d 65 73 73 61 67 65 2c 20 69 66 rror message, if
7120: 20 61 6e 79 2c 20 67 65 6e 65 72 61 74 65 64 0a any, generated.
7130: 09 09 62 79 20 3c 63 6f 64 65 3e 58 35 30 39 5f ..by <code>X509_
7140: 53 54 4f 52 45 5f 43 54 58 5f 67 65 74 5f 65 72 STORE_CTX_get_er
7150: 72 6f 72 28 29 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c ror()</code>.</l
7160: 69 3e 0a 09 09 3c 2f 75 6c 3e 0a 09 20 20 20 20 i>...</ul>..
7170: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 62 72 3e 0a </dd>.. <br>.
7180: 09 3c 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e .</dl>. </dd>
7190: 0a 3c 2f 64 6c 3e 0a 0a 3c 70 3e 0a 52 65 66 65 .</dl>..<p>.Refe
71a0: 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 61 rence implementa
71b0: 74 69 6f 6e 73 20 6f 66 20 74 68 65 73 65 20 63 tions of these c
71c0: 61 6c 6c 62 61 63 6b 73 20 61 72 65 20 70 72 6f allbacks are pro
71d0: 76 69 64 65 64 20 69 6e 20 74 68 65 0a 64 69 73 vided in the.dis
71e0: 74 72 69 62 75 74 69 6f 6e 20 61 73 20 3c 73 74 tribution as <st
71f0: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 rong>tls::callba
7200: 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 ck</strong>, <st
7210: 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f rong>tls::passwo
7220: 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 0a 61 6e 64 rd</strong>,.and
7230: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 61 <strong>tls::va
7240: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f lidate_command</
7250: 73 74 72 6f 6e 67 3e 20 72 65 73 70 65 63 74 69 strong> respecti
7260: 76 65 6c 79 2e 20 4e 6f 74 65 20 74 68 61 74 20 vely. Note that
7270: 74 68 65 73 65 20 61 72 65 0a 3c 65 6d 3e 73 61 these are.<em>sa
7280: 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d 70 6c 65 6d mple</em> implem
7290: 65 6e 74 61 74 69 6f 6e 73 20 6f 6e 6c 79 2e 20 entations only.
72a0: 49 6e 20 61 20 6d 6f 72 65 20 72 65 61 6c 69 73 In a more realis
72b0: 74 69 63 20 64 65 70 6c 6f 79 6d 65 6e 74 0a 79 tic deployment.y
72c0: 6f 75 20 77 6f 75 6c 64 20 73 70 65 63 69 66 79 ou would specify
72d0: 20 79 6f 75 72 20 6f 77 6e 20 63 61 6c 6c 62 61 your own callba
72e0: 63 6b 20 73 63 72 69 70 74 73 20 6f 6e 20 65 61 ck scripts on ea
72f0: 63 68 20 54 4c 53 20 63 68 61 6e 6e 65 6c 20 75 ch TLS channel u
7300: 73 69 6e 67 20 74 68 65 0a 3c 73 74 72 6f 6e 67 sing the.<strong
7310: 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e >-command</stron
7320: 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 g>, <strong>-pas
7330: 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 sword</strong>,
7340: 61 6e 64 0a 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c and.<strong>-val
7350: 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 idate_command</s
7360: 74 72 6f 6e 67 3e 20 6f 70 74 69 6f 6e 73 2e 0a trong> options..
7370: 3c 2f 70 3e 0a 3c 70 3e 0a 54 68 65 20 64 65 66 </p>.<p>.The def
7380: 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 77 68 ault behavior wh
7390: 65 6e 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 2d en the <strong>-
73a0: 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e command</strong>
73b0: 20 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 2d 76 61 and <strong>-va
73c0: 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f lidate_command</
73d0: 73 74 72 6f 6e 67 3e 0a 6f 70 74 69 6f 6e 73 20 strong>.options
73e0: 61 72 65 20 6e 6f 74 20 73 70 65 63 69 66 69 65 are not specifie
73f0: 64 20 69 73 20 66 6f 72 20 54 4c 53 20 74 6f 20 d is for TLS to
7400: 70 72 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f process the asso
7410: 63 69 61 74 65 64 20 6c 69 62 72 61 72 79 20 63 ciated library c
7420: 61 6c 6c 62 61 63 6b 73 0a 69 6e 74 65 72 6e 61 allbacks.interna
7430: 6c 6c 79 2e 20 54 68 65 20 64 65 66 61 75 6c 74 lly. The default
7440: 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74 behavior when t
7450: 68 65 20 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 he <strong>-pass
7460: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 word</strong> op
7470: 74 69 6f 6e 20 69 73 20 6e 6f 74 0a 73 70 65 63 tion is not.spec
7480: 69 66 69 65 64 20 69 73 20 66 6f 72 20 54 4c 53 ified is for TLS
7490: 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 to process the
74a0: 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62 72 61 associated libra
74b0: 72 79 20 63 61 6c 6c 62 61 63 6b 73 20 62 79 20 ry callbacks by
74c0: 61 74 74 65 6d 70 74 69 6e 67 0a 74 6f 20 63 61 attempting.to ca
74d0: 6c 6c 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a ll <strong>tls::
74e0: 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 password</strong
74f0: 3e 2e 0a 54 68 65 20 64 69 66 66 65 72 65 6e 63 >..The differenc
7500: 65 20 62 65 74 77 65 65 6e 20 74 68 65 73 65 20 e between these
7510: 74 77 6f 20 62 65 68 61 76 69 6f 72 73 20 69 73 two behaviors is
7520: 20 61 20 63 6f 6e 73 65 71 75 65 6e 63 65 20 6f a consequence o
7530: 66 20 6d 61 69 6e 74 61 69 6e 69 6e 67 0a 63 6f f maintaining.co
7540: 6d 70 61 74 69 62 69 6c 69 74 79 20 77 69 74 68 mpatibility with
7550: 20 65 61 72 6c 69 65 72 20 69 6d 70 6c 65 6d 65 earlier impleme
7560: 6e 74 61 74 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 3c ntations..</p>.<
7570: 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 65 20 p>.<em>.The use
7580: 6f 66 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 of the reference
7590: 20 63 61 6c 6c 62 61 63 6b 73 20 3c 73 74 72 6f callbacks <stro
75a0: 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b ng>tls::callback
75b0: 3c 2f 73 74 72 6f 6e 67 3e 2c 0a 3c 73 74 72 6f </strong>,.<stro
75c0: 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 ng>tls::password
75d0: 3c 2f 73 74 72 6f 6e 67 3e 2c 20 61 6e 64 20 3c </strong>, and <
75e0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 76 61 6c 69 strong>tls::vali
75f0: 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 date_command</st
7600: 72 6f 6e 67 3e 0a 69 73 20 6e 6f 74 20 72 65 63 rong>.is not rec
7610: 6f 6d 6d 65 6e 64 65 64 2e 20 54 68 65 79 20 6d ommended. They m
7620: 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 ay be removed fr
7630: 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 61 73 om future releas
7640: 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a es..</em>.</p>..
7650: 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d <hr>..<h3><a nam
7660: 65 3d 22 44 45 42 55 47 22 3e 44 45 42 55 47 3c e="DEBUG">DEBUG<
7670: 2f 61 3e 3c 2f 68 33 3e 0a 0a 54 4c 53 20 6b 65 /a></h3>..TLS ke
7680: 79 20 6c 6f 67 67 69 6e 67 20 63 61 6e 20 62 65 y logging can be
7690: 20 65 6e 61 62 6c 65 64 20 62 79 20 73 65 74 74 enabled by sett
76a0: 69 6e 67 20 74 68 65 20 65 6e 76 69 72 6f 6e 6d ing the environm
76b0: 65 6e 74 20 76 61 72 69 61 62 6c 65 0a 3c 62 3e ent variable.<b>
76c0: 53 53 4c 4b 45 59 4c 4f 47 46 49 4c 45 3c 2f 62 SSLKEYLOGFILE</b
76d0: 3e 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f 66 > to the name of
76e0: 20 74 68 65 20 66 69 6c 65 20 74 6f 20 6c 6f 67 the file to log
76f0: 20 74 6f 2e 20 54 68 65 6e 20 77 68 65 6e 65 76 to. Then whenev
7700: 65 72 20 54 4c 53 0a 6b 65 79 20 6d 61 74 65 72 er TLS.key mater
7710: 69 61 6c 20 69 73 20 67 65 6e 65 72 61 74 65 64 ial is generated
7720: 20 6f 72 20 72 65 63 65 69 76 65 64 20 69 74 20 or received it
7730: 77 69 6c 6c 20 62 65 20 6c 6f 67 67 65 64 20 74 will be logged t
7740: 6f 20 74 68 65 20 66 69 6c 65 2e 20 54 68 69 73 o the file. This
7750: 0a 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 6c .is useful for l
7760: 6f 67 67 69 6e 67 20 6b 65 79 20 64 61 74 61 20 ogging key data
7770: 66 6f 72 20 6e 65 74 77 6f 72 6b 20 6c 6f 67 67 for network logg
7780: 69 6e 67 20 74 6f 6f 6c 73 20 74 6f 20 75 73 65 ing tools to use
7790: 20 74 6f 0a 64 65 63 72 79 70 74 20 74 68 65 20 to.decrypt the
77a0: 64 61 74 61 2e 0a 3c 70 3e 0a 54 68 65 20 3c 73 data..<p>.The <s
77b0: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 trong>tls::debug
77c0: 3c 2f 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62 </strong> variab
77d0: 6c 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65 le provides some
77e0: 20 61 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 additional.cont
77f0: 72 6f 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72 rol over these r
7800: 65 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63 eference callbac
7810: 6b 73 2e 20 49 74 73 20 76 61 6c 75 65 20 69 73 ks. Its value is
7820: 20 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c 74 zero by default
7830: 2e 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73 20 ..Higher values
7840: 70 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69 61 produce more dia
7850: 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c 20 gnostic output,
7860: 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66 6f and will also fo
7870: 72 63 65 20 74 68 65 0a 76 65 72 69 66 79 20 6d rce the.verify m
7880: 65 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e 67 ethod in <strong
7890: 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f >tls::callback</
78a0: 73 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65 70 strong> to accep
78b0: 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61 74 t the.certificat
78c0: 65 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74 20 e, even when it
78d0: 69 73 20 69 6e 76 61 6c 69 64 20 69 66 20 74 68 is invalid if th
78e0: 65 20 3c 62 3e 74 6c 73 3a 3a 76 61 6c 69 64 61 e <b>tls::valida
78f0: 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 0a 63 te_command</b>.c
7900: 61 6c 6c 62 61 63 6b 20 69 73 20 75 73 65 64 20 allback is used
7910: 66 6f 72 20 74 68 65 20 3c 62 3e 2d 76 61 6c 69 for the <b>-vali
7920: 64 61 74 65 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 datecommand</b>
7930: 6f 70 74 69 6f 6e 2e 0a 3c 2f 70 3e 0a 3c 70 3e option..</p>.<p>
7940: 0a 3c 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 .<em>.The use of
7950: 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 3c 73 the variable <s
7960: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67 trong>tls::debug
7970: 3c 2f 73 74 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 </strong> is not
7980: 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 recommended..It
7990: 20 6d 61 79 20 62 65 20 72 65 6d 6f 76 65 64 20 may be removed
79a0: 66 72 6f 6d 20 66 75 74 75 72 65 20 72 65 6c 65 from future rele
79b0: 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e ases..</em>.</p>
79c0: 0a 0a 3c 68 34 3e 3c 61 20 6e 61 6d 65 3d 22 44 ..<h4><a name="D
79d0: 45 42 55 47 5f 45 58 41 4d 50 4c 45 53 22 3e 44 EBUG_EXAMPLES">D
79e0: 65 62 75 67 20 45 78 61 6d 70 6c 65 73 3c 2f 61 ebug Examples</a
79f0: 3e 3c 2f 68 34 3e 0a 0a 3c 70 3e 54 68 65 73 65 ></h4>..<p>These
7a00: 20 65 78 61 6d 70 6c 65 73 20 75 73 65 20 74 68 examples use th
7a10: 65 20 64 65 66 61 75 6c 74 20 55 6e 69 78 20 70 e default Unix p
7a20: 6c 61 74 66 6f 72 6d 20 53 53 4c 20 63 65 72 74 latform SSL cert
7a30: 69 66 69 63 61 74 65 73 2e 20 46 6f 72 20 73 74 ificates. For st
7a40: 61 6e 64 61 72 64 0a 69 6e 73 74 61 6c 6c 61 74 andard.installat
7a50: 69 6f 6e 73 2c 20 2d 63 61 64 69 72 20 61 6e 64 ions, -cadir and
7a60: 20 2d 63 61 66 69 6c 65 20 73 68 6f 75 6c 64 20 -cafile should
7a70: 6e 6f 74 20 62 65 20 6e 65 65 64 65 64 2e 20 49 not be needed. I
7a80: 66 20 79 6f 75 72 20 63 65 72 74 69 66 69 63 61 f your certifica
7a90: 74 65 73 0a 61 72 65 20 69 6e 20 6e 6f 6e 2d 73 tes.are in non-s
7aa0: 74 61 6e 64 61 72 64 20 6c 6f 63 61 74 69 6f 6e tandard location
7ab0: 73 2c 20 75 70 64 61 74 65 20 2d 63 61 64 69 72 s, update -cadir
7ac0: 20 6f 72 20 75 73 65 20 2d 63 61 66 69 6c 65 20 or use -cafile
7ad0: 61 73 20 6e 65 65 64 65 64 2e 3c 2f 70 3e 0a 3c as needed.</p>.<
7ae0: 62 72 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 20 br>..<p>Example
7af0: 23 31 3a 20 55 73 65 20 48 54 54 50 20 70 61 63 #1: Use HTTP pac
7b00: 6b 61 67 65 3c 2f 70 3e 0a 3c 70 72 65 3e 3c 63 kage</p>.<pre><c
7b10: 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71 ode>.package req
7b20: 75 69 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67 uire http.packag
7b30: 65 20 72 65 71 75 69 72 65 20 74 6c 73 0a 73 65 e require tls.se
7b40: 74 20 75 72 6c 20 22 68 74 74 70 73 3a 2f 2f 77 t url "https://w
7b50: 77 77 2e 74 63 6c 2e 74 6b 2f 22 0a 0a 68 74 74 ww.tcl.tk/"..htt
7b60: 70 3a 3a 72 65 67 69 73 74 65 72 20 68 74 74 70 p::register http
7b70: 73 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74 6c s 443 [list ::tl
7b80: 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 s::socket -autos
7b90: 65 72 76 65 72 6e 61 6d 65 20 74 72 75 65 20 2d ervername true -
7ba0: 72 65 71 75 69 72 65 20 74 72 75 65 20 2d 63 61 require true -ca
7bb0: 64 69 72 20 2f 65 74 63 2f 73 73 6c 2f 63 65 72 dir /etc/ssl/cer
7bc0: 74 73 20 5c 0a 20 20 20 20 2d 63 6f 6d 6d 61 6e ts \. -comman
7bd0: 64 20 3a 3a 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 d ::tls::callbac
7be0: 6b 20 2d 70 61 73 73 77 6f 72 64 20 3a 3a 74 6c k -password ::tl
7bf0: 73 3a 3a 70 61 73 73 77 6f 72 64 20 2d 76 61 6c s::password -val
7c00: 69 64 61 74 65 63 6f 6d 6d 61 6e 64 20 3a 3a 74 idatecommand ::t
7c10: 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d ls::validate_com
7c20: 6d 61 6e 64 5d 0a 0a 23 20 43 68 65 63 6b 20 66 mand]..# Check f
7c30: 6f 72 20 65 72 72 6f 72 0a 73 65 74 20 74 6f 6b or error.set tok
7c40: 65 6e 20 5b 68 74 74 70 3a 3a 67 65 74 75 72 6c en [http::geturl
7c50: 20 24 75 72 6c 5d 0a 69 66 20 7b 5b 68 74 74 70 $url].if {[http
7c60: 3a 3a 73 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d ::status $token]
7c70: 20 6e 65 20 22 6f 6b 22 7d 20 7b 0a 20 20 20 20 ne "ok"} {.
7c80: 70 75 74 73 20 5b 66 6f 72 6d 61 74 20 22 45 72 puts [format "Er
7c90: 72 6f 72 20 25 73 22 20 5b 68 74 74 70 3a 3a 73 ror %s" [http::s
7ca0: 74 61 74 75 73 20 24 74 6f 6b 65 6e 5d 5d 0a 7d tatus $token]].}
7cb0: 0a 0a 23 20 47 65 74 20 77 65 62 20 70 61 67 65 ..# Get web page
7cc0: 0a 73 65 74 20 64 61 74 61 20 5b 68 74 74 70 3a .set data [http:
7cd0: 3a 64 61 74 61 20 24 74 6f 6b 65 6e 5d 0a 70 75 :data $token].pu
7ce0: 74 73 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 ts [string lengt
7cf0: 68 20 24 64 61 74 61 5d 0a 0a 23 20 43 6c 65 61 h $data]..# Clea
7d00: 6e 75 70 0a 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 nup.::http::clea
7d10: 6e 75 70 20 24 74 6f 6b 65 6e 0a 3c 2f 63 6f 64 nup $token.</cod
7d20: 65 3e 3c 2f 70 72 65 3e 0a 0a 3c 70 3e 45 78 61 e></pre>..<p>Exa
7d30: 6d 70 6c 65 20 23 32 3a 20 55 73 65 20 72 61 77 mple #2: Use raw
7d40: 20 73 6f 63 6b 65 74 3c 2f 70 3e 0a 3c 70 72 65 socket</p>.<pre
7d50: 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67 65 20 ><code>.package
7d60: 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 73 65 74 require tls..set
7d70: 20 75 72 6c 20 22 77 77 77 2e 74 63 6c 2d 6c 61 url "www.tcl-la
7d80: 6e 67 2e 6f 72 67 22 0a 73 65 74 20 70 6f 72 74 ng.org".set port
7d90: 20 34 34 33 0a 0a 73 65 74 20 63 68 20 5b 74 6c 443..set ch [tl
7da0: 73 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 s::socket -autos
7db0: 65 72 76 65 72 6e 61 6d 65 20 31 20 2d 73 65 72 ervername 1 -ser
7dc0: 76 65 72 6e 61 6d 65 20 24 75 72 6c 20 2d 72 65 vername $url -re
7dd0: 71 75 65 73 74 20 31 20 2d 72 65 71 75 69 72 65 quest 1 -require
7de0: 20 31 20 5c 0a 20 20 20 20 2d 61 6c 70 6e 20 7b 1 \. -alpn {
7df0: 68 74 74 70 2f 31 2e 31 7d 20 2d 63 61 64 69 72 http/1.1} -cadir
7e00: 20 2f 65 74 63 2f 73 73 6c 2f 63 65 72 74 73 20 /etc/ssl/certs
7e10: 2d 63 6f 6d 6d 61 6e 64 20 3a 3a 74 6c 73 3a 3a -command ::tls::
7e20: 63 61 6c 6c 62 61 63 6b 20 5c 0a 20 20 20 20 2d callback \. -
7e30: 70 61 73 73 77 6f 72 64 20 3a 3a 74 6c 73 3a 3a password ::tls::
7e40: 70 61 73 73 77 6f 72 64 20 2d 76 61 6c 69 64 61 password -valida
7e50: 74 65 63 6f 6d 6d 61 6e 64 20 3a 3a 74 6c 73 3a tecommand ::tls:
7e60: 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e :validate_comman
7e70: 64 20 24 75 72 6c 20 24 70 6f 72 74 5d 0a 63 68 d $url $port].ch
7e80: 61 6e 20 63 6f 6e 66 69 67 75 72 65 20 24 63 68 an configure $ch
7e90: 20 2d 62 75 66 66 65 72 73 69 7a 65 20 36 35 35 -buffersize 655
7ea0: 33 36 0a 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 36.tls::handshak
7eb0: 65 20 24 63 68 0a 0a 70 75 74 73 20 24 63 68 20 e $ch..puts $ch
7ec0: 22 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 22 "GET / HTTP/1.1"
7ed0: 0a 66 6c 75 73 68 20 24 63 68 0a 61 66 74 65 72 .flush $ch.after
7ee0: 20 35 30 30 0a 73 65 74 20 64 61 74 61 20 5b 72 500.set data [r
7ef0: 65 61 64 20 24 63 68 5d 0a 0a 61 72 72 61 79 20 ead $ch]..array
7f00: 73 65 74 20 73 74 61 74 75 73 20 5b 74 6c 73 3a set status [tls:
7f10: 3a 73 74 61 74 75 73 20 24 63 68 5d 0a 61 72 72 :status $ch].arr
7f20: 61 79 20 73 65 74 20 63 6f 6e 6e 20 5b 74 6c 73 ay set conn [tls
7f30: 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 20 24 63 68 ::connection $ch
7f40: 5d 0a 61 72 72 61 79 20 73 65 74 20 63 68 61 6e ].array set chan
7f50: 20 5b 63 68 61 6e 20 63 6f 6e 66 69 67 75 72 65 [chan configure
7f60: 20 24 63 68 5d 0a 63 6c 6f 73 65 20 24 63 68 0a $ch].close $ch.
7f70: 70 61 72 72 61 79 20 73 74 61 74 75 73 0a 70 61 parray status.pa
7f80: 72 72 61 79 20 63 6f 6e 6e 0a 70 61 72 72 61 79 rray conn.parray
7f90: 20 63 68 61 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 chan.</code></p
7fa0: 72 65 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c re>..<hr>..<h3><
7fb0: 61 20 6e 61 6d 65 3d 22 48 54 54 50 53 20 45 58 a name="HTTPS EX
7fc0: 41 4d 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41 AMPLE">HTTPS EXA
7fd0: 4d 50 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c MPLE</a></h3>..<
7fe0: 70 3e 54 68 65 73 65 20 65 78 61 6d 70 6c 65 73 p>These examples
7ff0: 20 75 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 use the default
8000: 20 55 6e 69 78 20 70 6c 61 74 66 6f 72 6d 20 53 Unix platform S
8010: 53 4c 20 63 65 72 74 69 66 69 63 61 74 65 73 2e SL certificates.
8020: 20 46 6f 72 20 73 74 61 6e 64 61 72 64 0a 69 6e For standard.in
8030: 73 74 61 6c 6c 61 74 69 6f 6e 73 2c 20 2d 63 61 stallations, -ca
8040: 64 69 72 20 61 6e 64 20 2d 63 61 66 69 6c 65 20 dir and -cafile
8050: 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20 6e 65 should not be ne
8060: 65 64 65 64 2e 20 49 66 20 79 6f 75 72 20 63 65 eded. If your ce
8070: 72 74 69 66 69 63 61 74 65 73 0a 61 72 65 20 69 rtificates.are i
8080: 6e 20 6e 6f 6e 2d 73 74 61 6e 64 61 72 64 20 6c n non-standard l
8090: 6f 63 61 74 69 6f 6e 73 2c 20 75 70 64 61 74 65 ocations, update
80a0: 20 2d 63 61 64 69 72 20 6f 72 20 75 73 65 20 2d -cadir or use -
80b0: 63 61 66 69 6c 65 20 61 73 20 6e 65 65 64 65 64 cafile as needed
80c0: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c .</p>..<p>Exampl
80d0: 65 20 23 31 3a 20 47 65 74 20 77 65 62 20 70 61 e #1: Get web pa
80e0: 67 65 3c 2f 70 3e 0a 3c 70 72 65 3e 3c 63 6f 64 ge</p>.<pre><cod
80f0: 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 e>.package requi
8100: 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67 65 20 re http.package
8110: 72 65 71 75 69 72 65 20 74 6c 73 0a 73 65 74 20 require tls.set
8120: 75 72 6c 20 22 68 74 74 70 73 3a 2f 2f 77 77 77 url "https://www
8130: 2e 74 63 6c 2e 74 6b 2f 22 0a 0a 68 74 74 70 3a .tcl.tk/"..http:
8140: 3a 72 65 67 69 73 74 65 72 20 68 74 74 70 73 20 :register https
8150: 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74 6c 73 3a 443 [list ::tls:
8160: 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65 72 :socket -autoser
8170: 76 65 72 6e 61 6d 65 20 74 72 75 65 20 2d 72 65 vername true -re
8180: 71 75 69 72 65 20 74 72 75 65 20 2d 63 61 64 69 quire true -cadi
8190: 72 20 2f 65 74 63 2f 73 73 6c 2f 63 65 72 74 73 r /etc/ssl/certs
81a0: 5d 0a 0a 23 20 43 68 65 63 6b 20 66 6f 72 20 65 ]..# Check for e
81b0: 72 72 6f 72 0a 73 65 74 20 74 6f 6b 65 6e 20 5b rror.set token [
81c0: 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 24 75 72 http::geturl $ur
81d0: 6c 5d 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73 74 l].if {[http::st
81e0: 61 74 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65 20 atus $token] ne
81f0: 22 6f 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74 73 "ok"} {. puts
8200: 20 5b 66 6f 72 6d 61 74 20 22 45 72 72 6f 72 20 [format "Error
8210: 25 73 22 20 5b 68 74 74 70 3a 3a 73 74 61 74 75 %s" [http::statu
8220: 73 20 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20 s $token]].}..#
8230: 47 65 74 20 77 65 62 20 70 61 67 65 0a 73 65 74 Get web page.set
8240: 20 64 61 74 61 20 5b 68 74 74 70 3a 3a 64 61 74 data [http::dat
8250: 61 20 24 74 6f 6b 65 6e 5d 0a 70 75 74 73 20 24 a $token].puts $
8260: 64 61 74 61 0a 0a 23 20 43 6c 65 61 6e 75 70 0a data..# Cleanup.
8270: 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20 ::http::cleanup
8280: 24 74 6f 6b 65 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f $token.</code></
8290: 70 72 65 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 pre>..<p>Example
82a0: 20 23 32 3a 20 44 6f 77 6e 6c 6f 61 64 20 66 69 #2: Download fi
82b0: 6c 65 3c 2f 70 3e 0a 3c 70 72 65 3e 3c 63 6f 64 le</p>.<pre><cod
82c0: 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 e>.package requi
82d0: 72 65 20 68 74 74 70 0a 70 61 63 6b 61 67 65 20 re http.package
82e0: 72 65 71 75 69 72 65 20 74 6c 73 0a 0a 73 65 74 require tls..set
82f0: 20 75 72 6c 20 22 68 74 74 70 73 3a 2f 2f 77 69 url "https://wi
8300: 6b 69 2e 74 63 6c 2d 6c 61 6e 67 2e 6f 72 67 2f ki.tcl-lang.org/
8310: 73 69 74 65 6d 61 70 2e 78 6d 6c 22 0a 73 65 74 sitemap.xml".set
8320: 20 66 69 6c 65 6e 61 6d 65 20 5b 66 69 6c 65 20 filename [file
8330: 74 61 69 6c 20 24 75 72 6c 5d 0a 0a 68 74 74 70 tail $url]..http
8340: 3a 3a 72 65 67 69 73 74 65 72 20 68 74 74 70 73 ::register https
8350: 20 34 34 33 20 5b 6c 69 73 74 20 3a 3a 74 6c 73 443 [list ::tls
8360: 3a 3a 73 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65 ::socket -autose
8370: 72 76 65 72 6e 61 6d 65 20 74 72 75 65 20 2d 72 rvername true -r
8380: 65 71 75 69 72 65 20 74 72 75 65 20 2d 63 61 64 equire true -cad
8390: 69 72 20 2f 65 74 63 2f 73 73 6c 2f 63 65 72 74 ir /etc/ssl/cert
83a0: 73 5d 0a 0a 23 20 47 65 74 20 66 69 6c 65 0a 73 s]..# Get file.s
83b0: 65 74 20 63 68 20 5b 6f 70 65 6e 20 24 66 69 6c et ch [open $fil
83c0: 65 6e 61 6d 65 20 77 62 5d 0a 73 65 74 20 74 6f ename wb].set to
83d0: 6b 65 6e 20 5b 3a 3a 68 74 74 70 3a 3a 67 65 74 ken [::http::get
83e0: 75 72 6c 20 24 75 72 6c 20 2d 62 6c 6f 63 6b 73 url $url -blocks
83f0: 69 7a 65 20 36 35 35 33 36 20 2d 63 68 61 6e 6e ize 65536 -chann
8400: 65 6c 20 24 63 68 5d 0a 0a 23 20 43 6c 65 61 6e el $ch]..# Clean
8410: 75 70 0a 63 6c 6f 73 65 20 24 63 68 0a 3a 3a 68 up.close $ch.::h
8420: 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20 24 74 6f ttp::cleanup $to
8430: 6b 65 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 ken.</code></pre
8440: 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 >..<hr>..<h3><a
8450: 6e 61 6d 65 3d 22 53 50 45 43 49 41 4c 20 43 4f name="SPECIAL CO
8460: 4e 53 49 44 45 52 41 54 49 4f 4e 53 22 3e 53 50 NSIDERATIONS">SP
8470: 45 43 49 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 ECIAL CONSIDERAT
8480: 49 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c IONS</a></h3>..<
8490: 70 3e 54 68 65 20 63 61 70 61 62 69 6c 69 74 69 p>The capabiliti
84a0: 65 73 20 6f 66 20 74 68 69 73 20 70 61 63 6b 61 es of this packa
84b0: 67 65 20 63 61 6e 20 76 61 72 79 20 65 6e 6f 72 ge can vary enor
84c0: 6d 6f 75 73 6c 79 20 62 61 73 65 64 20 75 70 6f mously based upo
84d0: 6e 20 68 6f 77 20 74 68 65 0a 6c 69 6e 6b 65 64 n how the.linked
84e0: 20 74 6f 20 4f 70 65 6e 53 53 4c 20 6c 69 62 72 to OpenSSL libr
84f0: 61 72 79 20 77 61 73 20 63 6f 6e 66 69 67 75 72 ary was configur
8500: 65 64 20 61 6e 64 20 62 75 69 6c 74 2e 20 4e 65 ed and built. Ne
8510: 77 20 76 65 72 73 69 6f 6e 73 20 6d 61 79 20 6f w versions may o
8520: 62 73 6f 6c 65 74 65 0a 6f 6c 64 65 72 20 70 72 bsolete.older pr
8530: 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 73 2c otocol versions,
8540: 20 61 64 64 20 6f 72 20 72 65 6d 6f 76 65 20 63 add or remove c
8550: 69 70 68 65 72 73 2c 20 63 68 61 6e 67 65 20 64 iphers, change d
8560: 65 66 61 75 6c 74 20 76 61 6c 75 65 73 2c 20 65 efault values, e
8570: 74 63 2e 0a 55 73 65 20 74 68 65 20 3c 73 74 72 tc..Use the <str
8580: 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f ong>tls::protoco
8590: 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 63 6f 6d 6d ls</strong> comm
85a0: 61 6e 64 73 20 74 6f 20 6f 62 74 61 69 6e 20 74 ands to obtain t
85b0: 68 65 20 73 75 70 70 6f 72 74 65 64 0a 70 72 6f he supported.pro
85c0: 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 73 2e 3c tocol versions.<
85d0: 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c /p>..<hr>..<h3><
85e0: 61 20 6e 61 6d 65 3d 22 53 45 45 20 41 4c 53 4f a name="SEE ALSO
85f0: 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f ">SEE ALSO</a></
8600: 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e h3>..<p><strong>
8610: 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 2c socket</strong>,
8620: 20 3c 73 74 72 6f 6e 67 3e 66 69 6c 65 65 76 65 <strong>fileeve
8630: 6e 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 nt</strong>, <st
8640: 72 6f 6e 67 3e 68 74 74 70 3c 2f 73 74 72 6f 6e rong>http</stron
8650: 67 3e 2c 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 g>,.<a href="htt
8660: 70 73 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c ps://www.openssl
8670: 2e 6f 72 67 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f .org/"><strong>O
8680: 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c penSSL</strong><
8690: 2f 61 3e 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c /a></p>..<hr>..<
86a0: 70 72 65 3e 0a 43 6f 70 79 72 69 67 68 74 20 26 pre>.Copyright &
86b0: 63 6f 70 79 3b 20 31 39 39 39 20 4d 61 74 74 20 copy; 1999 Matt
86c0: 4e 65 77 6d 61 6e 2e 0a 43 6f 70 79 72 69 67 68 Newman..Copyrigh
86d0: 74 20 26 63 6f 70 79 3b 20 32 30 30 34 20 53 74 t © 2004 St
86e0: 61 72 66 69 73 68 20 53 79 73 74 65 6d 73 2e 0a arfish Systems..
86f0: 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 3b Copyright ©
8700: 20 32 30 32 33 20 42 72 69 61 6e 20 4f 27 48 61 2023 Brian O'Ha
8710: 67 61 6e 2e 0a 3c 2f 70 72 65 3e 0a 3c 2f 62 6f gan..</pre>.</bo
8720: 64 79 3e 0a 3c 2f 68 74 6d 6c 3e 0a dy>.</html>.