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: 20 70 72 69 6f 72 20 74 6f 20 4f 70 65 6e 53 53 prior to OpenSS
24f0: 4c 20 33 2e 32 0a 09 20 20 20 20 61 6e 64 20 32 L 3.2.. and 2
2500: 20 74 68 65 72 65 61 66 74 65 72 2e 20 4c 65 76 thereafter. Lev
2510: 65 6c 20 33 20 61 6e 64 20 68 69 67 68 65 72 20 el 3 and higher
2520: 64 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20 disable support
2530: 66 6f 72 20 73 65 73 73 69 6f 6e 0a 09 20 20 20 for session..
2540: 20 74 69 63 6b 65 74 73 20 61 6e 64 20 6f 6e 6c tickets and onl
2550: 79 20 61 63 63 65 70 74 20 63 69 70 68 65 72 20 y accept cipher
2560: 73 75 69 74 65 73 20 74 68 61 74 20 70 72 6f 76 suites that prov
2570: 69 64 65 20 66 6f 72 77 61 72 64 20 73 65 63 72 ide forward secr
2580: 65 63 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ecy.</dd>..<dt><
2590: 73 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72 3c 2f strong>-server</
25a0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c strong> <em>bool
25b0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
25c0: 53 70 65 63 69 66 69 65 73 20 77 68 65 74 68 65 Specifies whethe
25d0: 72 20 74 6f 20 61 63 74 20 61 73 20 61 20 73 65 r to act as a se
25e0: 72 76 65 72 20 61 6e 64 20 72 65 73 70 6f 6e 64 rver and respond
25f0: 20 77 69 74 68 20 61 20 73 65 72 76 65 72 0a 09 with a server..
2600: 20 20 20 20 68 61 6e 64 73 68 61 6b 65 20 77 68 handshake wh
2610: 65 6e 20 61 20 63 6c 69 65 6e 74 20 63 6f 6e 6e en a client conn
2620: 65 63 74 73 20 61 6e 64 20 70 72 6f 76 69 64 65 ects and provide
2630: 73 20 61 20 63 6c 69 65 6e 74 20 68 61 6e 64 73 s a client hands
2640: 68 61 6b 65 2e 0a 09 20 20 20 20 28 64 65 66 61 hake... (defa
2650: 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73 65 ult is <em>false
2660: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 </em>)</dd>..<dt
2670: 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 65 72 ><strong>-server
2680: 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 name</strong> <e
2690: 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e m>host</em></dt>
26a0: 0a 09 3c 64 64 3e 53 70 65 63 69 66 79 20 73 65 ..<dd>Specify se
26b0: 72 76 65 72 27 73 20 68 6f 73 74 6e 61 6d 65 2e rver's hostname.
26c0: 20 54 68 69 73 20 69 73 20 75 73 65 64 20 74 6f This is used to
26d0: 20 73 65 74 20 74 68 65 20 54 4c 53 20 53 65 72 set the TLS Ser
26e0: 76 65 72 20 4e 61 6d 65 0a 09 20 20 20 20 49 6e ver Name.. In
26f0: 64 69 63 61 74 69 6f 6e 20 28 53 4e 49 29 20 65 dication (SNI) e
2700: 78 74 65 6e 73 69 6f 6e 2e 20 53 65 74 20 74 68 xtension. Set th
2710: 69 73 20 74 6f 20 74 68 65 20 65 78 70 65 63 74 is to the expect
2720: 65 64 20 73 65 72 76 65 72 6e 61 6d 65 20 69 6e ed servername in
2730: 20 74 68 65 0a 09 20 20 20 73 65 72 76 65 72 27 the.. server'
2740: 73 20 63 65 72 74 69 66 69 63 61 74 65 20 6f 72 s certificate or
2750: 20 6f 6e 65 20 6f 66 20 74 68 65 20 73 75 62 6a one of the subj
2760: 65 63 74 41 6c 74 4e 61 6d 65 20 61 6c 74 65 72 ectAltName alter
2770: 6e 61 74 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 nates.</dd>..<dt
2780: 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 73 73 69 6f ><strong>-sessio
2790: 6e 5f 69 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 n_id</strong> <e
27a0: 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 m>string</em></d
27b0: 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 65 t>..<dd>Specifie
27c0: 73 20 74 68 65 20 73 65 73 73 69 6f 6e 20 69 64 s the session id
27d0: 20 74 6f 20 72 65 73 75 6d 65 20 73 65 73 73 69 to resume sessi
27e0: 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 on.</dd>..<dt><s
27f0: 74 72 6f 6e 67 3e 2d 73 73 6c 32 3c 2f 73 74 72 trong>-ssl2</str
2800: 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 ong> <em>bool</e
2810: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 m></dt>..<dd>Ena
2820: 62 6c 65 20 75 73 65 20 6f 66 20 53 53 4c 20 76 ble use of SSL v
2830: 32 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 2. (default is <
2840: 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e 29 2e 0a em>false</em>)..
2850: 09 4e 6f 74 65 3a 20 52 65 63 65 6e 74 20 76 65 .Note: Recent ve
2860: 72 73 69 6f 6e 73 20 6f 66 20 4f 70 65 6e 53 53 rsions of OpenSS
2870: 4c 20 64 6f 6e 27 74 20 73 75 70 70 6f 72 74 20 L don't support
2880: 53 53 4c 76 32 2e 3c 2f 64 64 3e 0a 09 3c 64 74 SSLv2.</dd>..<dt
2890: 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 20 3c ><strong>-ssl3 <
28a0: 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f 6c /strong><em>bool
28b0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
28c0: 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53 53 Enable use of SS
28d0: 4c 20 76 33 2e 20 28 64 65 66 61 75 6c 74 20 69 L v3. (default i
28e0: 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e s <em>false</em>
28f0: 29 2e 0a 09 4e 6f 74 65 3a 20 53 53 4c 20 76 33 )...Note: SSL v3
2900: 20 6d 75 73 74 20 61 6c 73 6f 20 62 65 20 65 6e must also be en
2910: 61 62 6c 65 64 20 77 69 74 68 20 61 20 63 6f 6d abled with a com
2920: 70 69 6c 65 20 74 69 6d 65 20 6f 70 74 69 6f 6e pile time option
2930: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c 73 74 .</dd>..<dt>-<st
2940: 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 6f 6e rong>tls1</stron
2950: 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e g> <em>bool</em>
2960: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c </dt>..<dd>Enabl
2970: 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31 2e e use of TLS v1.
2980: 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d (default is <em
2990: 3e 74 72 75 65 3c 2f 65 6d 3e 29 2e 0a 09 4e 6f >true</em>)...No
29a0: 74 65 3a 20 54 4c 53 20 31 2e 30 20 6e 65 65 64 te: TLS 1.0 need
29b0: 73 20 53 48 41 31 20 74 6f 20 6f 70 65 72 61 74 s SHA1 to operat
29c0: 65 2c 20 77 68 69 63 68 20 69 73 20 6f 6e 6c 79 e, which is only
29d0: 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 0a 09 73 available in..s
29e0: 65 63 75 72 69 74 79 20 6c 65 76 65 6c 20 30 20 ecurity level 0
29f0: 66 6f 72 20 4f 70 65 6e 20 53 53 4c 20 33 2e 30 for Open SSL 3.0
2a00: 2b 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c 73 +.</dd>..<dt>-<s
2a10: 74 72 6f 6e 67 3e 74 6c 73 31 2e 31 3c 2f 73 74 trong>tls1.1</st
2a20: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f rong> <em>bool</
2a30: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e em></dt>..<dd>En
2a40: 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 able use of TLS
2a50: 76 31 2e 31 20 28 64 65 66 61 75 6c 74 20 69 73 v1.1 (default is
2a60: 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 2e <em>true</em>).
2a70: 0a 09 4e 6f 74 65 3a 20 54 4c 53 20 31 2e 31 20 ..Note: TLS 1.1
2a80: 6e 65 65 64 73 20 53 48 41 31 20 74 6f 20 6f 70 needs SHA1 to op
2a90: 65 72 61 74 65 2c 20 77 68 69 63 68 20 69 73 20 erate, which is
2aa0: 6f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 69 only available i
2ab0: 6e 0a 09 73 65 63 75 72 69 74 79 20 6c 65 76 65 n..security leve
2ac0: 6c 20 30 20 66 6f 72 20 4f 70 65 6e 20 53 53 4c l 0 for Open SSL
2ad0: 20 33 2e 30 2b 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3.0+.</dd>..<dt
2ae0: 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 32 >-<strong>tls1.2
2af0: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f </strong> <em>bo
2b00: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 ol</em></dt>..<d
2b10: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 d>Enable use of
2b20: 54 4c 53 20 76 31 2e 32 20 28 64 65 66 61 75 6c TLS v1.2 (defaul
2b30: 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 t is <em>true</e
2b40: 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c m>)</dd>..<dt>-<
2b50: 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 33 3c 2f 73 strong>tls1.3</s
2b60: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c trong> <em>bool<
2b70: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 /em></dt>..<dd>E
2b80: 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 nable use of TLS
2b90: 20 76 31 2e 33 20 28 64 65 66 61 75 6c 74 20 69 v1.3 (default i
2ba0: 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 s <em>true</em>)
2bb0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
2bc0: 6e 67 3e 2d 76 61 6c 69 64 61 74 65 63 6f 6d 6d ng>-validatecomm
2bd0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d and</strong> <em
2be0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f >callback</em></
2bf0: 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66 69 dt>..<dd>Specifi
2c00: 65 73 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 es the callback
2c10: 63 6f 6d 6d 61 6e 64 20 74 6f 20 69 6e 76 6f 6b command to invok
2c20: 65 20 74 6f 20 76 61 6c 69 64 61 74 65 20 70 72 e to validate pr
2c30: 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 63 6f 6e 66 otocol.. conf
2c40: 69 67 20 70 61 72 61 6d 65 74 65 72 73 20 64 75 ig parameters du
2c50: 72 69 6e 67 20 74 68 65 20 70 72 6f 74 6f 63 6f ring the protoco
2c60: 6c 20 6e 65 67 6f 74 69 61 74 69 6f 6e 20 70 68 l negotiation ph
2c70: 61 73 65 2e 20 54 68 69 73 20 63 61 6e 20 62 65 ase. This can be
2c80: 0a 09 20 20 20 20 75 73 65 64 20 62 79 20 54 43 .. used by TC
2c90: 4c 20 73 63 72 69 70 74 73 20 74 6f 20 70 65 72 L scripts to per
2ca0: 66 6f 72 6d 20 74 68 65 69 72 20 6f 77 6e 20 63 form their own c
2cb0: 65 72 74 69 66 69 63 61 74 65 20 76 61 6c 69 64 ertificate valid
2cc0: 61 74 69 6f 6e 20 74 6f 0a 09 20 20 20 20 73 75 ation to.. su
2cd0: 70 70 6c 65 6d 65 6e 74 20 74 68 65 20 64 65 66 pplement the def
2ce0: 61 75 6c 74 20 76 61 6c 69 64 61 74 69 6f 6e 20 ault validation
2cf0: 70 72 6f 76 69 64 65 64 20 62 79 20 4f 70 65 6e provided by Open
2d00: 53 53 4c 2e 20 54 68 65 20 73 63 72 69 70 74 20 SSL. The script
2d10: 6d 75 73 74 0a 09 20 20 20 20 72 65 74 75 72 6e must.. return
2d20: 20 61 20 62 6f 6f 6c 65 61 6e 20 74 72 75 65 20 a boolean true
2d30: 74 6f 20 63 6f 6e 74 69 6e 75 65 20 74 68 65 20 to continue the
2d40: 6e 65 67 6f 74 69 61 74 69 6f 6e 2e 20 53 65 65 negotiation. See
2d50: 0a 09 20 20 20 20 3c 61 20 68 72 65 66 3d 22 23 .. <a href="#
2d60: 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 CALLBACK OPTIONS
2d70: 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f ">CALLBACK OPTIO
2d80: 4e 53 3c 2f 61 3e 20 66 6f 72 20 6d 6f 72 65 20 NS</a> for more
2d90: 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c info.</dd>. <
2da0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c 2f 64 6c /blockquote></dl
2db0: 3e 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d >. <dt><a nam
2dc0: 65 3d 22 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 e="tls::unimport
2dd0: 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f "><b>tls::unimpo
2de0: 72 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 rt </b><i>channe
2df0: 6c 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 l</i></a></dt>.
2e00: 20 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 <dd>Provided
2e10: 66 6f 72 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 for symmetry to
2e20: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 <strong>tls::imp
2e30: 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 ort</strong>, th
2e40: 69 73 0a 09 75 6e 73 74 61 63 6b 73 20 74 68 65 is..unstacks the
2e50: 20 65 6e 63 72 79 70 74 69 6f 6e 20 6f 66 20 61 encryption of a
2e60: 20 72 65 67 75 6c 61 72 20 54 43 4c 20 63 68 61 regular TCL cha
2e70: 6e 6e 65 6c 2e 20 41 6e 20 65 72 72 6f 72 0a 09 nnel. An error..
2e80: 69 73 20 74 68 72 6f 77 6e 20 69 66 20 54 4c 53 is thrown if TLS
2e90: 20 69 73 20 6e 6f 74 20 74 68 65 20 74 6f 70 20 is not the top
2ea0: 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 20 stacked channel
2eb0: 74 79 70 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c type.</dd>. <
2ec0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 dt> </dt>.
2ed0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
2ee0: 74 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 22 3e tls::handshake">
2ef0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e <strong>tls::han
2f00: 64 73 68 61 6b 65 3c 2f 73 74 72 6f 6e 67 3e 0a dshake</strong>.
2f10: 09 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d .<em>channel</em
2f20: 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c ></a></dt>. <
2f30: 64 64 3e 46 6f 72 63 65 73 20 68 61 6e 64 73 68 dd>Forces handsh
2f40: 61 6b 65 20 74 6f 20 74 61 6b 65 20 70 6c 61 63 ake to take plac
2f50: 65 2c 20 61 6e 64 20 72 65 74 75 72 6e 73 20 30 e, and returns 0
2f60: 20 69 66 0a 09 68 61 6e 64 73 68 61 6b 65 20 69 if..handshake i
2f70: 73 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f 67 72 s still in progr
2f80: 65 73 73 20 28 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e ess (non-blockin
2f90: 67 29 2c 20 6f 72 20 31 20 69 66 0a 09 74 68 65 g), or 1 if..the
2fa0: 20 68 61 6e 64 73 68 61 6b 65 20 77 61 73 20 73 handshake was s
2fb0: 75 63 63 65 73 73 66 75 6c 2e 20 49 66 20 74 68 uccessful. If th
2fc0: 65 20 68 61 6e 64 73 68 61 6b 65 20 66 61 69 6c e handshake fail
2fd0: 65 64 0a 09 74 68 69 73 20 72 6f 75 74 69 6e 65 ed..this routine
2fe0: 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20 65 will throw an e
2ff0: 72 72 6f 72 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c rror.</dd>. <
3000: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 dt> </dt>.
3010: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
3020: 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74 tls::status"><st
3030: 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73 rong>tls::status
3040: 3c 2f 73 74 72 6f 6e 67 3e 0a 09 3c 65 6d 3e 3f </strong>..<em>?
3050: 3c 2f 65 6d 3e 3c 62 3e 2d 6c 6f 63 61 6c 3c 2f </em><b>-local</
3060: 62 3e 3c 65 6d 3e 3f 20 63 68 61 6e 6e 65 6c 3c b><em>? channel<
3070: 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 /em></a></dt>.
3080: 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 <dd>Returns th
3090: 65 20 63 75 72 72 65 6e 74 20 73 74 61 74 75 73 e current status
30a0: 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e 6e of an SSL chann
30b0: 65 6c 2e 20 54 68 65 20 72 65 73 75 6c 74 20 69 el. The result i
30c0: 73 20 61 20 6c 69 73 74 0a 09 6f 66 20 6b 65 79 s a list..of key
30d0: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 65 73 -value pairs des
30e0: 63 72 69 62 69 6e 67 20 74 68 65 20 53 53 4c 2c cribing the SSL,
30f0: 20 63 65 72 74 69 66 69 63 61 74 65 2c 20 61 6e certificate, an
3100: 64 20 63 65 72 74 69 66 69 63 61 74 65 0a 09 76 d certificate..v
3110: 65 72 69 66 69 63 61 74 69 6f 6e 20 73 74 61 74 erification stat
3120: 75 73 2e 20 49 66 20 74 68 65 20 53 53 4c 20 68 us. If the SSL h
3130: 61 6e 64 73 68 61 6b 65 20 68 61 73 20 6e 6f 74 andshake has not
3140: 20 79 65 74 20 63 6f 6d 70 6c 65 74 65 64 2c 0a yet completed,.
3150: 09 61 6e 20 65 6d 70 74 79 20 6c 69 73 74 20 69 .an empty list i
3160: 73 20 72 65 74 75 72 6e 65 64 2e 20 49 66 20 3c s returned. If <
3170: 62 3e 2d 6c 6f 63 61 6c 3c 2f 62 3e 20 69 73 20 b>-local</b> is
3180: 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 specified, then
3190: 74 68 65 0a 09 6c 6f 63 61 6c 20 63 65 72 74 69 the..local certi
31a0: 66 69 63 61 74 65 20 69 73 20 75 73 65 64 2e 3c ficate is used.<
31b0: 2f 64 64 3e 0a 20 20 20 20 3c 62 6c 6f 63 6b 71 /dd>. <blockq
31c0: 75 6f 74 65 3e 0a 20 20 20 20 3c 62 3e 53 53 4c uote>. <b>SSL
31d0: 20 53 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20 Status</b>.
31e0: 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e <dl>..<dt><stron
31f0: 67 3e 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 g>alpn</strong>
3200: 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d <em>protocol</em
3210: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
3220: 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65 63 74 65 protocol selecte
3230: 64 20 61 66 74 65 72 20 41 70 70 6c 69 63 61 74 d after Applicat
3240: 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f 74 6f 63 ion-Layer Protoc
3250: 6f 6c 0a 09 20 20 20 20 4e 65 67 6f 74 69 61 74 ol.. Negotiat
3260: 69 6f 6e 20 28 41 4c 50 4e 29 2e 3c 2f 64 64 3e ion (ALPN).</dd>
3270: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 ..<dt><strong>ci
3280: 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 pher</strong> <e
3290: 6d 3e 63 69 70 68 65 72 3c 2f 65 6d 3e 3c 2f 64 m>cipher</em></d
32a0: 74 3e 0a 09 3c 64 64 3e 54 68 65 20 63 75 72 72 t>..<dd>The curr
32b0: 65 6e 74 20 63 69 70 68 65 72 20 69 6e 20 75 73 ent cipher in us
32c0: 65 20 66 6f 72 20 74 68 65 20 73 65 73 73 69 6f e for the sessio
32d0: 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 n.</dd>..<dt><st
32e0: 72 6f 6e 67 3e 70 65 65 72 6e 61 6d 65 3c 2f 73 rong>peername</s
32f0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c trong> <em>name<
3300: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
3310: 68 65 20 70 65 65 72 6e 61 6d 65 20 66 72 6f 6d he peername from
3320: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 the certificate
3330: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
3340: 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 73 74 ong>protocol</st
3350: 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 69 6f rong> <em>versio
3360: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 n</em></dt>..<dd
3370: 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 76 65 >The protocol ve
3380: 72 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 74 rsion used for t
3390: 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 3a 0a 09 he connection:..
33a0: 20 20 20 20 53 53 4c 32 2c 20 53 53 4c 33 2c 20 SSL2, SSL3,
33b0: 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c 20 54 4c TLS1, TLS1.1, TL
33c0: 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c 20 6f 72 S1.2, TLS1.3, or
33d0: 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64 3e 0a 09 unknown.</dd>..
33e0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 62 69 74 <dt><strong>sbit
33f0: 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e s</strong> <em>n
3400: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
3410: 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 69 The number of bi
3420: 74 73 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 ts used for the
3430: 73 65 73 73 69 6f 6e 20 6b 65 79 2e 3c 2f 64 64 session key.</dd
3440: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
3450: 69 67 6e 61 74 75 72 65 48 61 73 68 41 6c 67 6f ignatureHashAlgo
3460: 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c rithm</strong> <
3470: 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d em>algorithm</em
3480: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
3490: 73 69 67 6e 61 74 75 72 65 20 68 61 73 68 20 61 signature hash a
34a0: 6c 67 6f 72 69 74 68 6d 2e 3c 2f 64 64 3e 0a 09 lgorithm.</dd>..
34b0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e <dt><strong>sign
34c0: 61 74 75 72 65 54 79 70 65 3c 2f 73 74 72 6f 6e atureType</stron
34d0: 67 3e 20 3c 65 6d 3e 74 79 70 65 3c 2f 65 6d 3e g> <em>type</em>
34e0: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 73 </dt>..<dd>The s
34f0: 69 67 6e 61 74 75 72 65 20 74 79 70 65 20 76 61 ignature type va
3500: 6c 75 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c lue.</dd>..<dt><
3510: 73 74 72 6f 6e 67 3e 76 65 72 69 66 79 44 65 70 strong>verifyDep
3520: 74 68 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e th</strong> <em>
3530: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 n</em></dt>..<dd
3540: 3e 4d 61 78 69 6d 75 6d 20 64 65 70 74 68 20 66 >Maximum depth f
3550: 6f 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 or the certifica
3560: 74 65 20 63 68 61 69 6e 20 76 65 72 69 66 69 63 te chain verific
3570: 61 74 69 6f 6e 2e 0a 09 20 20 20 20 44 65 66 61 ation... Defa
3580: 75 6c 74 20 69 73 20 2d 31 2c 20 74 6f 20 63 68 ult is -1, to ch
3590: 65 63 6b 20 61 6c 6c 2e 3c 2f 64 64 3e 0a 09 3c eck all.</dd>..<
35a0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 69 66 dt><strong>verif
35b0: 79 4d 6f 64 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c yMode</strong> <
35c0: 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 em>list</em></dt
35d0: 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 63 >..<dd>List of c
35e0: 65 72 74 69 66 69 63 61 74 65 20 76 65 72 69 66 ertificate verif
35f0: 69 63 61 74 69 6f 6e 20 6d 6f 64 65 73 2e 3c 2f ication modes.</
3600: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
3610: 3e 76 65 72 69 66 79 52 65 73 75 6c 74 3c 2f 73 >verifyResult</s
3620: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 72 65 73 75 6c trong> <em>resul
3630: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 t</em></dt>..<dd
3640: 3e 43 65 72 74 69 66 69 63 61 74 65 20 76 65 72 >Certificate ver
3650: 69 66 69 63 61 74 69 6f 6e 20 72 65 73 75 6c 74 ification result
3660: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
3670: 6f 6e 67 3e 63 61 5f 6e 61 6d 65 73 3c 2f 73 74 ong>ca_names</st
3680: 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f rong> <em>list</
3690: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 em></dt>..<dd>Li
36a0: 73 74 20 6f 66 20 74 68 65 20 43 65 72 74 69 66 st of the Certif
36b0: 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 69 65 icate Authoritie
36c0: 73 20 75 73 65 64 20 74 6f 20 63 72 65 61 74 65 s used to create
36d0: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 the certificate
36e0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e .</dd>. </dl>
36f0: 0a 20 20 20 20 3c 62 3e 43 65 72 74 69 66 69 63 . <b>Certific
3700: 61 74 65 20 53 74 61 74 75 73 3c 2f 62 3e 0a 20 ate Status</b>.
3710: 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 <dl>..<dt><st
3720: 72 6f 6e 67 3e 61 6c 6c 3c 2f 73 74 72 6f 6e 67 rong>all</strong
3730: 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d > <em>string</em
3740: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 44 75 6d 70 ></dt>..<dd>Dump
3750: 20 6f 66 20 61 6c 6c 20 63 65 72 74 69 66 69 63 of all certific
3760: 61 74 65 20 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 09 ate info.</dd>..
3770: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 73 <dt><strong>vers
3780: 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ion</strong> <em
3790: 3e 76 61 6c 75 65 3c 2f 65 6d 3e 3c 2f 64 74 3e >value</em></dt>
37a0: 0a 09 3c 64 64 3e 54 68 65 20 63 65 72 74 69 66 ..<dd>The certif
37b0: 69 63 61 74 65 20 76 65 72 73 69 6f 6e 2e 3c 2f icate version.</
37c0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
37d0: 3e 73 65 72 69 61 6c 4e 75 6d 62 65 72 3c 2f 73 >serialNumber</s
37e0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d trong> <em>n</em
37f0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
3800: 73 65 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66 serial number of
3810: 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 the certificate
3820: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 as a hex string
3830: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
3840: 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 3c 2f 73 ong>signature</s
3850: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 trong> <em>algor
3860: 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 ithm</em></dt>..
3870: 3c 64 64 3e 43 69 70 68 65 72 20 61 6c 67 6f 72 <dd>Cipher algor
3880: 69 74 68 6d 20 75 73 65 64 20 66 6f 72 20 63 65 ithm used for ce
3890: 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 rtificate signat
38a0: 75 72 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c ure.</dd>..<dt><
38b0: 73 74 72 6f 6e 67 3e 69 73 73 75 65 72 3c 2f 73 strong>issuer</s
38c0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 trong> <em>dn</e
38d0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
38e0: 20 64 69 73 74 69 6e 67 75 69 73 68 65 64 20 6e distinguished n
38f0: 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68 65 20 ame (DN) of the
3900: 63 65 72 74 69 66 69 63 61 74 65 20 69 73 73 75 certificate issu
3910: 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 er.</dd>..<dt><s
3920: 74 72 6f 6e 67 3e 6e 6f 74 42 65 66 6f 72 65 3c trong>notBefore<
3930: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 /strong> <em>dat
3940: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 e</em></dt>..<dd
3950: 3e 54 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 64 >The beginning d
3960: 61 74 65 20 6f 66 20 74 68 65 20 63 65 72 74 69 ate of the certi
3970: 66 69 63 61 74 65 20 76 61 6c 69 64 69 74 79 2e ficate validity.
3980: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3990: 6e 67 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72 ng>notAfter</str
39a0: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65 ong> <em>date</e
39b0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
39c0: 20 65 78 70 69 72 61 74 69 6f 6e 20 64 61 74 65 expiration date
39d0: 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 69 63 of the certific
39e0: 61 74 65 20 76 61 6c 69 64 69 74 79 2e 3c 2f 64 ate validity.</d
39f0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
3a00: 73 75 62 6a 65 63 74 3c 2f 73 74 72 6f 6e 67 3e subject</strong>
3a10: 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f 64 74 <em>dn</em></dt
3a20: 3e 0a 09 3c 64 64 3e 54 68 65 20 64 69 73 74 69 >..<dd>The disti
3a30: 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20 28 44 nguished name (D
3a40: 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74 69 66 N) of the certif
3a50: 69 63 61 74 65 20 73 75 62 6a 65 63 74 2e 0a 09 icate subject...
3a60: 20 20 20 20 46 69 65 6c 64 73 20 69 6e 63 6c 75 Fields inclu
3a70: 64 65 3a 20 43 6f 6d 6d 6f 6e 20 4e 61 6d 65 20 de: Common Name
3a80: 28 43 4e 29 2c 20 4f 72 67 61 6e 69 7a 61 74 69 (CN), Organizati
3a90: 6f 6e 20 28 4f 29 2c 20 4c 6f 63 61 6c 69 74 79 on (O), Locality
3aa0: 0a 09 20 20 20 20 6f 72 20 43 69 74 79 20 28 4c .. or City (L
3ab0: 29 2c 20 53 74 61 74 65 20 6f 72 20 50 72 6f 76 ), State or Prov
3ac0: 69 6e 63 65 20 28 53 29 2c 20 61 6e 64 20 43 6f ince (S), and Co
3ad0: 75 6e 74 72 79 20 4e 61 6d 65 20 28 43 29 2e 3c untry Name (C).<
3ae0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e /dd>..<dt><stron
3af0: 67 3e 69 73 73 75 65 72 55 6e 69 71 75 65 49 44 g>issuerUniqueID
3b00: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 </strong> <em>st
3b10: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 ring</em></dt>..
3b20: 3c 64 64 3e 54 68 65 20 69 73 73 75 65 72 20 75 <dd>The issuer u
3b30: 6e 69 71 75 65 20 69 64 2e 3c 2f 64 64 3e 0a 09 nique id.</dd>..
3b40: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a <dt><strong>subj
3b50: 65 63 74 55 6e 69 71 75 65 49 44 3c 2f 73 74 72 ectUniqueID</str
3b60: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c ong> <em>string<
3b70: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
3b80: 68 65 20 73 75 62 6a 65 63 74 20 75 6e 69 71 75 he subject uniqu
3b90: 65 20 69 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e e id.</dd>..<dt>
3ba0: 3c 73 74 72 6f 6e 67 3e 6e 75 6d 5f 65 78 74 65 <strong>num_exte
3bb0: 6e 73 69 6f 6e 73 3c 2f 73 74 72 6f 6e 67 3e 20 nsions</strong>
3bc0: 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a <em>n</em></dt>.
3bd0: 09 3c 64 64 3e 4e 75 6d 62 65 72 20 6f 66 20 63 .<dd>Number of c
3be0: 65 72 74 69 66 69 63 61 74 65 20 65 78 74 65 6e ertificate exten
3bf0: 73 69 6f 6e 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 sions.</dd>..<dt
3c00: 3e 3c 73 74 72 6f 6e 67 3e 65 78 74 65 6e 73 69 ><strong>extensi
3c10: 6f 6e 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d ons</strong> <em
3c20: 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >list</em></dt>.
3c30: 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 63 65 72 .<dd>List of cer
3c40: 74 69 66 69 63 61 74 65 20 65 78 74 65 6e 73 69 tificate extensi
3c50: 6f 6e 20 6e 61 6d 65 73 2e 3c 2f 64 64 3e 0a 09 on names.</dd>..
3c60: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 75 74 68 <dt><strong>auth
3c70: 6f 72 69 74 79 4b 65 79 49 64 65 6e 74 69 66 69 orityKeyIdentifi
3c80: 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e er</strong> <em>
3c90: 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e string</em></dt>
3ca0: 0a 09 3c 64 64 3e 28 41 4b 49 29 20 4b 65 79 20 ..<dd>(AKI) Key
3cb0: 69 64 65 6e 74 69 66 69 65 72 20 6f 66 20 74 68 identifier of th
3cc0: 65 20 49 73 73 75 69 6e 67 20 43 41 20 63 65 72 e Issuing CA cer
3cd0: 74 69 66 69 63 61 74 65 20 74 68 61 74 20 73 69 tificate that si
3ce0: 67 6e 65 64 0a 09 20 20 20 20 74 68 65 20 53 53 gned.. the SS
3cf0: 4c 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73 L certificate as
3d00: 20 61 20 68 65 78 20 73 74 72 69 6e 67 2e 20 54 a hex string. T
3d10: 68 69 73 20 76 61 6c 75 65 20 6d 61 74 63 68 65 his value matche
3d20: 73 20 74 68 65 20 53 4b 49 0a 09 20 20 20 20 76 s the SKI.. v
3d30: 61 6c 75 65 20 6f 66 20 74 68 65 20 49 6e 74 65 alue of the Inte
3d40: 72 6d 65 64 69 61 74 65 20 43 41 20 63 65 72 74 rmediate CA cert
3d50: 69 66 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c ificate.</dd>..<
3d60: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65 dt><strong>subje
3d70: 63 74 4b 65 79 49 64 65 6e 74 69 66 69 65 72 3c ctKeyIdentifier<
3d80: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 /strong> <em>str
3d90: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ing</em></dt>..<
3da0: 64 64 3e 28 53 4b 49 29 20 48 61 73 68 20 6f 66 dd>(SKI) Hash of
3db0: 20 74 68 65 20 70 75 62 6c 69 63 20 6b 65 79 20 the public key
3dc0: 69 6e 73 69 64 65 20 74 68 65 20 63 65 72 74 69 inside the certi
3dd0: 66 69 63 61 74 65 20 61 73 20 61 20 68 65 78 0a ficate as a hex.
3de0: 09 20 20 20 20 73 74 72 69 6e 67 2e 20 55 73 65 . string. Use
3df0: 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20 63 65 d to identify ce
3e00: 72 74 69 66 69 63 61 74 65 73 20 74 68 61 74 20 rtificates that
3e10: 63 6f 6e 74 61 69 6e 20 61 20 70 61 72 74 69 63 contain a partic
3e20: 75 6c 61 72 0a 09 20 20 20 20 70 75 62 6c 69 63 ular.. public
3e30: 20 6b 65 79 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e key.</dd>..<dt>
3e40: 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 41 <strong>subjectA
3e50: 6c 74 4e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 ltName</strong>
3e60: 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 <em>list</em></d
3e70: 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 t>..<dd>List of
3e80: 61 6c 6c 20 6f 66 20 74 68 65 20 61 6c 74 65 72 all of the alter
3e90: 6e 61 74 69 76 65 20 64 6f 6d 61 69 6e 20 6e 61 native domain na
3ea0: 6d 65 73 2c 20 73 75 62 20 64 6f 6d 61 69 6e 73 mes, sub domains
3eb0: 2c 0a 09 20 20 20 20 61 6e 64 20 49 50 20 61 64 ,.. and IP ad
3ec0: 64 72 65 73 73 65 73 20 74 68 61 74 20 61 72 65 dresses that are
3ed0: 20 73 65 63 75 72 65 64 20 62 79 20 74 68 65 20 secured by the
3ee0: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 certificate.</dd
3ef0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6f >..<dt><strong>o
3f00: 63 73 70 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d csp</strong> <em
3f10: 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a >list</em></dt>.
3f20: 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20 61 6c 6c .<dd>List of all
3f30: 20 4f 6e 6c 69 6e 65 20 43 65 72 74 69 66 69 63 Online Certific
3f40: 61 74 65 20 53 74 61 74 75 73 20 50 72 6f 74 6f ate Status Proto
3f50: 63 6f 6c 20 28 4f 43 53 50 29 20 55 52 4c 73 2e col (OCSP) URLs.
3f60: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
3f70: 6e 67 3e 63 65 72 74 69 66 69 63 61 74 65 3c 2f ng>certificate</
3f80: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 65 72 74 strong> <em>cert
3f90: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
3fa0: 54 68 65 20 50 45 4d 20 65 6e 63 6f 64 65 64 20 The PEM encoded
3fb0: 63 65 72 74 69 66 69 63 61 74 65 2e 3c 2f 64 64 certificate.</dd
3fc0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
3fd0: 69 67 6e 61 74 75 72 65 41 6c 67 6f 72 69 74 68 ignatureAlgorith
3fe0: 6d 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 m</strong> <em>a
3ff0: 6c 67 6f 72 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 lgorithm</em></d
4000: 74 3e 0a 09 3c 64 64 3e 43 69 70 68 65 72 20 61 t>..<dd>Cipher a
4010: 6c 67 6f 72 69 74 68 6d 20 75 73 65 64 20 66 6f lgorithm used fo
4020: 72 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74 r the certificat
4030: 65 20 73 69 67 6e 61 74 75 72 65 2e 3c 2f 64 64 e signature.</dd
4040: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
4050: 69 67 6e 61 74 75 72 65 56 61 6c 75 65 3c 2f 73 ignatureValue</s
4060: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e trong> <em>strin
4070: 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 g</em></dt>..<dd
4080: 3e 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67 >Certificate sig
4090: 6e 61 74 75 72 65 20 61 73 20 61 20 68 65 78 20 nature as a hex
40a0: 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64 string.</dd>..<d
40b0: 74 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 t><strong>signat
40c0: 75 72 65 44 69 67 65 73 74 3c 2f 73 74 72 6f 6e ureDigest</stron
40d0: 67 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f g> <em>version</
40e0: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 65 em></dt>..<dd>Ce
40f0: 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 69 6e rtificate signin
4100: 67 20 64 69 67 65 73 74 20 61 73 20 61 20 68 65 g digest as a he
4110: 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 x string.</dd>..
4120: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 70 75 62 6c <dt><strong>publ
4130: 69 63 4b 65 79 41 6c 67 6f 72 69 74 68 6d 3c 2f icKeyAlgorithm</
4140: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f strong> <em>algo
4150: 72 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a rithm</em></dt>.
4160: 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 .<dd>Certificate
4170: 20 73 69 67 6e 61 74 75 72 65 20 70 75 62 6c 69 signature publi
4180: 63 20 6b 65 79 20 61 6c 67 6f 72 69 74 68 6d 2e c key algorithm.
4190: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
41a0: 6e 67 3e 70 75 62 6c 69 63 4b 65 79 3c 2f 73 74 ng>publicKey</st
41b0: 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 rong> <em>string
41c0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
41d0: 43 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e Certificate sign
41e0: 61 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65 79 ature public key
41f0: 20 61 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 as a hex string
4200: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4210: 6f 6e 67 3e 62 69 74 73 3c 2f 73 74 72 6f 6e 67 ong>bits</strong
4220: 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 > <em>n</em></dt
4230: 3e 0a 09 3c 64 64 3e 4e 75 6d 62 65 72 20 6f 66 >..<dd>Number of
4240: 20 62 69 74 73 20 75 73 65 64 20 66 6f 72 20 63 bits used for c
4250: 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61 ertificate signa
4260: 74 75 72 65 20 6b 65 79 2e 3c 2f 64 64 3e 0a 09 ture key.</dd>..
4270: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 6c 66 <dt><strong>self
4280: 5f 73 69 67 6e 65 64 3c 2f 73 74 72 6f 6e 67 3e _signed</strong>
4290: 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d <em>boolean</em
42a0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 68 65 74 ></dt>..<dd>Whet
42b0: 68 65 72 20 74 68 65 20 63 65 72 74 69 66 69 63 her the certific
42c0: 61 74 65 20 73 69 67 6e 61 74 75 72 65 20 69 73 ate signature is
42d0: 20 73 65 6c 66 20 73 69 67 6e 65 64 2e 3c 2f 64 self signed.</d
42e0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
42f0: 73 68 61 31 5f 68 61 73 68 3c 2f 73 74 72 6f 6e sha1_hash</stron
4300: 67 3e 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d 3e g> <em>hash</em>
4310: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 53 </dt>..<dd>The S
4320: 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 HA1 hash of the
4330: 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20 61 certificate as a
4340: 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 hex string.</dd
4350: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 >..<dt><strong>s
4360: 68 61 32 35 36 5f 68 61 73 68 3c 2f 73 74 72 6f ha256_hash</stro
4370: 6e 67 3e 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d ng> <em>hash</em
4380: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
4390: 53 48 41 32 35 36 20 68 61 73 68 20 6f 66 20 74 SHA256 hash of t
43a0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 61 he certificate a
43b0: 73 20 61 20 68 65 78 20 73 74 72 69 6e 67 2e 3c s a hex string.<
43c0: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 /dd>. </dl>.
43d0: 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e </blockquote>
43e0: 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d .. <dt><a nam
43f0: 65 3d 22 74 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 e="tls::connecti
4400: 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a on"><strong>tls:
4410: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c 2f 73 74 72 :connection</str
4420: 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d 3e 63 68 61 ong>. <em>cha
4430: 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 nnel</em></a></d
4440: 74 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 t>. <dd>Retur
4450: 6e 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 ns the current c
4460: 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 61 74 75 73 onnection status
4470: 20 6f 66 20 61 6e 20 53 53 4c 20 63 68 61 6e 6e of an SSL chann
4480: 65 6c 2e 20 54 68 65 0a 09 72 65 73 75 6c 74 20 el. The..result
4490: 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b 65 79 is a list of key
44a0: 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64 65 73 -value pairs des
44b0: 63 72 69 62 69 6e 67 20 74 68 65 20 63 6f 6e 6e cribing the conn
44c0: 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a 20 20 20 ection.</dd>.
44d0: 20 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 <blockquote>.
44e0: 20 20 3c 62 3e 53 53 4c 20 53 74 61 74 75 73 3c <b>SSL Status<
44f0: 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 /b>. <dl>..<d
4500: 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 61 74 65 3c t><strong>state<
4510: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 61 /strong> <em>sta
4520: 74 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 te</em></dt>..<d
4530: 64 3e 53 74 61 74 65 20 6f 66 20 74 68 65 20 63 d>State of the c
4540: 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a onnection.</dd>.
4550: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 72 .<dt><strong>ser
4560: 76 65 72 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67 3e vername</strong>
4570: 20 3c 65 6d 3e 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f <em>name</em></
4580: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 6e 61 6d dt>..<dd>The nam
4590: 65 20 6f 66 20 74 68 65 20 63 6f 6e 6e 65 63 74 e of the connect
45a0: 65 64 20 74 6f 20 73 65 72 76 65 72 2e 3c 2f 64 ed to server.</d
45b0: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
45c0: 70 72 6f 74 6f 63 6f 6c 3c 2f 73 74 72 6f 6e 67 protocol</strong
45d0: 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 > <em>version</e
45e0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
45f0: 20 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f protocol versio
4600: 6e 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 63 n used for the c
4610: 6f 6e 6e 65 63 74 69 6f 6e 3a 0a 09 20 20 20 20 onnection:..
4620: 53 53 4c 32 2c 20 53 53 4c 33 2c 20 54 4c 53 31 SSL2, SSL3, TLS1
4630: 2c 20 54 4c 53 31 2e 31 2c 20 54 4c 53 31 2e 32 , TLS1.1, TLS1.2
4640: 2c 20 54 4c 53 31 2e 33 2c 20 6f 72 20 75 6e 6b , TLS1.3, or unk
4650: 6e 6f 77 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e nown.</dd>..<dt>
4660: 3c 73 74 72 6f 6e 67 3e 72 65 6e 65 67 6f 74 69 <strong>renegoti
4670: 61 74 69 6f 6e 5f 61 6c 6c 6f 77 65 64 3c 2f 73 ation_allowed</s
4680: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 trong> <em>boole
4690: 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 an</em></dt>..<d
46a0: 64 3e 57 68 65 74 68 65 72 20 70 72 6f 74 6f 63 d>Whether protoc
46b0: 6f 6c 20 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e ol renegotiation
46c0: 20 69 73 20 73 75 70 70 6f 72 74 65 64 20 6f 72 is supported or
46d0: 20 6e 6f 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e not.</dd>..<dt>
46e0: 3c 73 74 72 6f 6e 67 3e 73 65 63 75 72 69 74 79 <strong>security
46f0: 5f 6c 65 76 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 _level</strong>
4700: 3c 65 6d 3e 6c 65 76 65 6c 3c 2f 65 6d 3e 3c 2f <em>level</em></
4710: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 73 65 63 dt>..<dd>The sec
4720: 75 72 69 74 79 20 6c 65 76 65 6c 20 75 73 65 64 urity level used
4730: 20 66 6f 72 20 73 65 6c 65 63 74 69 6f 6e 20 6f for selection o
4740: 66 20 63 69 70 68 65 72 73 2c 20 6b 65 79 20 73 f ciphers, key s
4750: 69 7a 65 2c 20 65 74 63 2e 3c 2f 64 64 3e 0a 09 ize, etc.</dd>..
4760: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 <dt><strong>sess
4770: 69 6f 6e 5f 72 65 75 73 65 64 3c 2f 73 74 72 6f ion_reused</stro
4780: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c ng> <em>boolean<
4790: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 /em></dt>..<dd>W
47a0: 68 65 74 68 65 72 20 74 68 65 20 73 65 73 73 69 hether the sessi
47b0: 6f 6e 20 68 61 73 20 62 65 65 6e 20 72 65 75 73 on has been reus
47c0: 65 64 20 6f 72 20 6e 6f 74 2e 3c 2f 64 64 3e 0a ed or not.</dd>.
47d0: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 5f .<dt><strong>is_
47e0: 73 65 72 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 server</strong>
47f0: 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e <em>boolean</em>
4800: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 68 65 74 68 </dt>..<dd>Wheth
4810: 65 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f er the connectio
4820: 6e 20 69 73 20 63 6f 6e 66 69 67 75 72 65 64 20 n is configured
4830: 61 73 20 61 20 73 65 72 76 65 72 20 28 31 29 20 as a server (1)
4840: 6f 72 20 63 6c 69 65 6e 74 20 28 30 29 2e 3c 2f or client (0).</
4850: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 dd>..<dt><strong
4860: 3e 63 6f 6d 70 72 65 73 73 69 6f 6e 3c 2f 73 74 >compression</st
4870: 72 6f 6e 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f rong> <em>mode</
4880: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 6f em></dt>..<dd>Co
4890: 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68 6f 64 mpression method
48a0: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
48b0: 6f 6e 67 3e 65 78 70 61 6e 73 69 6f 6e 3c 2f 73 ong>expansion</s
48c0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c trong> <em>mode<
48d0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 /em></dt>..<dd>E
48e0: 78 70 61 6e 73 69 6f 6e 20 6d 65 74 68 6f 64 2e xpansion method.
48f0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
4900: 6e 67 3e 63 61 4c 69 73 74 3c 2f 73 74 72 6f 6e ng>caList</stron
4910: 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e g> <em>list</em>
4920: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 </dt>..<dd>List
4930: 6f 66 20 43 65 72 74 69 66 69 63 61 74 65 20 41 of Certificate A
4940: 75 74 68 6f 72 69 74 69 65 73 20 28 43 41 29 20 uthorities (CA)
4950: 66 6f 72 20 58 2e 35 30 39 20 63 65 72 74 69 66 for X.509 certif
4960: 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20 icate.</dd>.
4970: 3c 2f 64 6c 3e 0a 20 20 20 20 3c 62 3e 43 69 70 </dl>. <b>Cip
4980: 68 65 72 20 49 6e 66 6f 3c 2f 62 3e 0a 20 20 20 her Info</b>.
4990: 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f <dl>..<dt><stro
49a0: 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e ng>cipher</stron
49b0: 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f 65 g> <em>cipher</e
49c0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
49d0: 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20 current cipher
49e0: 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20 63 in use for the c
49f0: 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a onnection.</dd>.
4a00: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 61 .<dt><strong>sta
4a10: 6e 64 61 72 64 5f 6e 61 6d 65 3c 2f 73 74 72 6f ndard_name</stro
4a20: 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f 65 6d ng> <em>name</em
4a30: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
4a40: 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e 61 6d standard RFC nam
4a50: 65 20 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 64 e of cipher.</dd
4a60: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 >..<dt><strong>a
4a70: 6c 67 6f 72 69 74 68 6d 5f 62 69 74 73 3c 2f 73 lgorithm_bits</s
4a80: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d trong> <em>n</em
4a90: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 ></dt>..<dd>The
4aa0: 6e 75 6d 62 65 72 20 6f 66 20 70 72 6f 63 65 73 number of proces
4ab0: 73 65 64 20 62 69 74 73 20 75 73 65 64 20 66 6f sed bits used fo
4ac0: 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e 0a 09 r cipher.</dd>..
4ad0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 63 72 <dt><strong>secr
4ae0: 65 74 5f 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e et_bits</strong>
4af0: 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e <em>n</em></dt>
4b00: 0a 09 3c 64 64 3e 54 68 65 20 6e 75 6d 62 65 72 ..<dd>The number
4b10: 20 6f 66 20 73 65 63 72 65 74 20 62 69 74 73 20 of secret bits
4b20: 75 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 2e used for cipher.
4b30: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f </dd>..<dt><stro
4b40: 6e 67 3e 6d 69 6e 5f 76 65 72 73 69 6f 6e 3c 2f ng>min_version</
4b50: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72 73 strong> <em>vers
4b60: 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ion</em></dt>..<
4b70: 64 64 3e 54 68 65 20 6d 69 6e 69 6d 75 6d 20 70 dd>The minimum p
4b80: 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e 20 rotocol version
4b90: 66 6f 72 20 63 69 70 68 65 72 2e 3c 2f 64 64 3e for cipher.</dd>
4ba0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63 69 ..<dt><strong>ci
4bb0: 70 68 65 72 5f 69 73 5f 61 65 61 64 3c 2f 73 74 pher_is_aead</st
4bc0: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 rong> <em>boolea
4bd0: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 n</em></dt>..<dd
4be0: 3e 57 68 65 74 68 65 72 20 74 68 65 20 63 69 70 >Whether the cip
4bf0: 68 65 72 20 69 73 20 41 75 74 68 65 6e 74 69 63 her is Authentic
4c00: 61 74 65 64 20 45 6e 63 72 79 70 74 69 6f 6e 20 ated Encryption
4c10: 77 69 74 68 0a 09 20 20 20 20 41 73 73 6f 63 69 with.. Associ
4c20: 61 74 65 64 20 44 61 74 61 20 28 41 45 41 44 29 ated Data (AEAD)
4c30: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4c40: 6f 6e 67 3e 63 69 70 68 65 72 5f 69 64 3c 2f 73 ong>cipher_id</s
4c50: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 69 64 3c 2f 65 trong> <em>id</e
4c60: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 m></dt>..<dd>The
4c70: 20 4f 70 65 6e 53 53 4c 20 63 69 70 68 65 72 20 OpenSSL cipher
4c80: 69 64 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 id.</dd>..<dt><s
4c90: 74 72 6f 6e 67 3e 64 65 73 63 72 69 70 74 69 6f trong>descriptio
4ca0: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 n</strong> <em>s
4cb0: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a tring</em></dt>.
4cc0: 09 3c 64 64 3e 41 20 74 65 78 74 20 64 65 73 63 .<dd>A text desc
4cd0: 72 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 ription of the c
4ce0: 69 70 68 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 ipher.</dd>..<dt
4cf0: 3e 3c 73 74 72 6f 6e 67 3e 68 61 6e 64 73 68 61 ><strong>handsha
4d00: 6b 65 5f 64 69 67 65 73 74 3c 2f 73 74 72 6f 6e ke_digest</stron
4d10: 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f g> <em>boolean</
4d20: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 44 69 em></dt>..<dd>Di
4d30: 67 65 73 74 20 75 73 65 64 20 64 75 72 69 6e 67 gest used during
4d40: 20 68 61 6e 64 73 68 61 6b 65 2e 3c 2f 64 64 3e handshake.</dd>
4d50: 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c . </dl>. <
4d60: 62 3e 53 65 73 73 69 6f 6e 20 49 6e 66 6f 3c 2f b>Session Info</
4d70: 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 b>. <dl>..<dt
4d80: 3e 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 ><strong>alpn</s
4d90: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f trong> <em>proto
4da0: 63 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c col</em></dt>..<
4db0: 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 dd>The protocol
4dc0: 73 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 41 selected after A
4dd0: 70 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79 65 72 pplication-Layer
4de0: 20 50 72 6f 74 6f 63 6f 6c 0a 09 20 20 20 20 4e Protocol.. N
4df0: 65 67 6f 74 69 61 74 69 6f 6e 20 28 41 4c 50 4e egotiation (ALPN
4e00: 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 ).</dd>..<dt><st
4e10: 72 6f 6e 67 3e 72 65 73 75 6d 61 62 6c 65 3c 2f rong>resumable</
4e20: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c strong> <em>bool
4e30: 65 61 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ean</em></dt>..<
4e40: 64 64 3e 57 68 65 74 68 65 72 20 74 68 65 20 73 dd>Whether the s
4e50: 65 73 73 69 6f 6e 20 63 61 6e 20 62 65 20 72 65 ession can be re
4e60: 73 75 6d 65 64 20 6f 72 20 6e 6f 74 2e 3c 2f 64 sumed or not.</d
4e70: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
4e80: 73 74 61 72 74 5f 74 69 6d 65 3c 2f 73 74 72 6f start_time</stro
4e90: 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f 6e 64 73 3c ng> <em>seconds<
4ea0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 /em></dt>..<dd>T
4eb0: 69 6d 65 20 73 69 6e 63 65 20 73 65 73 73 69 6f ime since sessio
4ec0: 6e 20 73 74 61 72 74 65 64 20 69 6e 20 73 65 63 n started in sec
4ed0: 6f 6e 64 73 20 73 69 6e 63 65 20 65 70 6f 63 68 onds since epoch
4ee0: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 .</dd>..<dt><str
4ef0: 6f 6e 67 3e 74 69 6d 65 6f 75 74 3c 2f 73 74 72 ong>timeout</str
4f00: 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f 6e 64 73 ong> <em>seconds
4f10: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e </em></dt>..<dd>
4f20: 4d 61 78 20 64 75 72 61 74 69 6f 6e 20 6f 66 20 Max duration of
4f30: 73 65 73 73 69 6f 6e 20 69 6e 20 73 65 63 6f 6e session in secon
4f40: 64 73 20 62 65 66 6f 72 65 20 74 69 6d 65 2d 6f ds before time-o
4f50: 75 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 ut.</dd>..<dt><s
4f60: 74 72 6f 6e 67 3e 6c 69 66 65 74 69 6d 65 3c 2f trong>lifetime</
4f70: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f strong> <em>seco
4f80: 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c nds</em></dt>..<
4f90: 64 64 3e 53 65 73 73 69 6f 6e 20 74 69 63 6b 65 dd>Session ticke
4fa0: 74 20 6c 69 66 65 74 69 6d 65 20 68 69 6e 74 20 t lifetime hint
4fb0: 69 6e 20 73 65 63 6f 6e 64 73 2e 3c 2f 64 64 3e in seconds.</dd>
4fc0: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 ..<dt><strong>se
4fd0: 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 72 6f 6e 67 ssion_id</strong
4fe0: 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 72 > <em>binary_str
4ff0: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ing</em></dt>..<
5000: 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 69 6f dd>Unique sessio
5010: 6e 20 69 64 20 66 6f 72 20 75 73 65 20 69 6e 20 n id for use in
5020: 72 65 73 75 6d 69 6e 67 20 74 68 65 20 73 65 73 resuming the ses
5030: 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e sion.</dd>..<dt>
5040: 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f <strong>session_
5050: 74 69 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 ticket</strong>
5060: 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 72 69 6e <em>binary_strin
5070: 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 g</em></dt>..<dd
5080: 3e 55 6e 69 71 75 65 20 73 65 73 73 69 6f 6e 20 >Unique session
5090: 74 69 63 6b 65 74 20 66 6f 72 20 75 73 65 20 69 ticket for use i
50a0: 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65 20 73 n resuming the s
50b0: 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09 3c 64 ession.</dd>..<d
50c0: 74 3e 3c 73 74 72 6f 6e 67 3e 74 69 63 6b 65 74 t><strong>ticket
50d0: 5f 61 70 70 5f 64 61 74 61 3c 2f 73 74 72 6f 6e _app_data</stron
50e0: 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 g> <em>binary_st
50f0: 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 ring</em></dt>..
5100: 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 69 <dd>Unique sessi
5110: 6f 6e 20 74 69 63 6b 65 74 20 61 70 70 6c 69 63 on ticket applic
5120: 61 74 69 6f 6e 20 64 61 74 61 2e 3c 2f 64 64 3e ation data.</dd>
5130: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 6d 61 ..<dt><strong>ma
5140: 73 74 65 72 5f 6b 65 79 3c 2f 73 74 72 6f 6e 67 ster_key</strong
5150: 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73 74 72 > <em>binary_str
5160: 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c ing</em></dt>..<
5170: 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73 69 6f dd>Unique sessio
5180: 6e 20 6d 61 73 74 65 72 20 6b 65 79 2e 3c 2f 64 n master key.</d
5190: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e d>..<dt><strong>
51a0: 73 65 73 73 69 6f 6e 5f 63 61 63 68 65 5f 6d 6f session_cache_mo
51b0: 64 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e de</strong> <em>
51c0: 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 mode</em></dt>..
51d0: 3c 64 64 3e 53 65 72 76 65 72 20 63 61 63 68 65 <dd>Server cache
51e0: 20 6d 6f 64 65 20 28 63 6c 69 65 6e 74 2c 20 73 mode (client, s
51f0: 65 72 76 65 72 2c 20 6f 72 20 62 6f 74 68 29 2e erver, or both).
5200: 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a </dd>. </dl>.
5210: 20 20 20 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 </blockquote
5220: 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 >.. <dt><a na
5230: 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 73 me="tls::ciphers
5240: 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 "><strong>tls::c
5250: 69 70 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 0a iphers</strong>.
5260: 09 3c 65 6d 3e 3f 70 72 6f 74 6f 63 6f 6c 3f 20 .<em>?protocol?
5270: 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 70 6f ?verbose? ?suppo
5280: 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f rted?</em></a></
5290: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 57 69 74 68 dt>. <dd>With
52a0: 6f 75 74 20 61 6e 79 20 61 72 67 73 2c 20 72 65 out any args, re
52b0: 74 75 72 6e 73 20 61 20 6c 69 73 74 20 6f 66 20 turns a list of
52c0: 61 6c 6c 20 73 79 6d 6d 65 74 72 69 63 20 63 69 all symmetric ci
52d0: 70 68 65 72 73 20 66 6f 72 20 75 73 65 0a 09 77 phers for use..w
52e0: 69 74 68 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e ith the <strong>
52f0: 2d 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e 67 3e -cipher</strong>
5300: 20 6f 70 74 69 6f 6e 2e 20 57 69 74 68 20 3c 65 option. With <e
5310: 6d 3e 70 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 2c m>protocol</em>,
5320: 0a 09 6f 6e 6c 79 20 74 68 65 20 63 69 70 68 65 ..only the ciphe
5330: 72 73 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 rs supported for
5340: 20 74 68 61 74 20 70 72 6f 74 6f 63 6f 6c 20 61 that protocol a
5350: 72 65 20 72 65 74 75 72 6e 65 64 2e 20 53 65 65 re returned. See
5360: 0a 09 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a ..<a href="#tls:
5370: 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e 3c 73 74 72 :protocols"><str
5380: 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f ong>tls::protoco
5390: 6c 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 20 ls</strong></a>
53a0: 63 6f 6d 6d 61 6e 64 0a 09 66 6f 72 20 74 68 65 command..for the
53b0: 20 73 75 70 70 6f 72 74 65 64 20 70 72 6f 74 6f supported proto
53c0: 63 6f 6c 73 2e 20 49 66 20 3c 65 6d 3e 76 65 72 cols. If <em>ver
53d0: 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 20 73 70 65 bose</em> is spe
53e0: 63 69 66 69 65 64 20 61 73 20 74 72 75 65 0a 09 cified as true..
53f0: 74 68 65 6e 20 61 20 76 65 72 62 6f 73 65 2c 20 then a verbose,
5400: 68 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20 6c human readable l
5410: 69 73 74 20 69 73 20 72 65 74 75 72 6e 65 64 20 ist is returned
5420: 77 69 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 0a with additional.
5430: 09 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 .information on
5440: 74 68 65 20 63 69 70 68 65 72 2e 20 49 66 20 3c the cipher. If <
5450: 65 6d 3e 73 75 70 70 6f 72 74 65 64 3c 2f 65 6d em>supported</em
5460: 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20 61 > is specified a
5470: 73 20 74 72 75 65 2c 0a 09 74 68 65 6e 20 6f 6e s true,..then on
5480: 6c 79 20 74 68 65 20 63 69 70 68 65 72 73 20 73 ly the ciphers s
5490: 75 70 70 6f 72 74 65 64 20 66 6f 72 20 70 72 6f upported for pro
54a0: 74 6f 63 6f 6c 20 77 69 6c 6c 20 62 65 20 6c 69 tocol will be li
54b0: 73 74 65 64 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c sted.</dd>. <
54c0: 64 74 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 dt> </dt>.
54d0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 <dt><a name="
54e0: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e tls::protocols">
54f0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f <strong>tls::pro
5500: 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67 3e 3c tocols</strong><
5510: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 /a></dt>. <dd
5520: 3e 52 65 74 75 72 6e 73 20 61 20 6c 69 73 74 20 >Returns a list
5530: 6f 66 20 74 68 65 20 73 75 70 70 6f 72 74 65 64 of the supported
5540: 20 53 53 4c 2f 54 4c 53 20 70 72 6f 74 6f 63 6f SSL/TLS protoco
5550: 6c 73 2e 20 56 61 6c 69 64 20 76 61 6c 75 65 73 ls. Valid values
5560: 20 61 72 65 3a 0a 09 3c 62 3e 73 73 6c 32 3c 2f are:..<b>ssl2</
5570: 62 3e 2c 20 3c 62 3e 73 73 6c 33 3c 2f 62 3e 2c b>, <b>ssl3</b>,
5580: 20 3c 62 3e 74 6c 73 31 3c 2f 62 3e 2c 20 3c 62 <b>tls1</b>, <b
5590: 3e 74 6c 73 31 2e 31 3c 2f 62 3e 2c 20 3c 62 3e >tls1.1</b>, <b>
55a0: 74 6c 73 31 2e 32 3c 2f 62 3e 2c 0a 09 61 6e 64 tls1.2</b>,..and
55b0: 20 3c 62 3e 74 6c 73 31 2e 33 3c 2f 62 3e 2e 20 <b>tls1.3</b>.
55c0: 45 78 61 63 74 20 6c 69 73 74 20 64 65 70 65 6e Exact list depen
55d0: 64 73 20 6f 6e 20 4f 70 65 6e 53 53 4c 20 76 65 ds on OpenSSL ve
55e0: 72 73 69 6f 6e 20 61 6e 64 0a 09 63 6f 6d 70 69 rsion and..compi
55f0: 6c 65 20 74 69 6d 65 20 66 6c 61 67 73 2e 3c 2f le time flags.</
5600: 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e 62 73 dd>. <dt>&nbs
5610: 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 74 3e p;</dt>. <dt>
5620: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 76 65 <a name="tls::ve
5630: 72 73 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e 74 rsion"><strong>t
5640: 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 73 74 72 ls::version</str
5650: 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 ong></a></dt>.
5660: 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 <dd>Returns th
5670: 65 20 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f e OpenSSL versio
5680: 6e 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 3c n string.</dd>.<
5690: 2f 64 6c 3e 0a 0a 3c 68 72 3e 0a 0a 3c 68 33 3e /dl>..<hr>..<h3>
56a0: 3c 61 20 6e 61 6d 65 3d 22 43 41 4c 4c 42 41 43 <a name="CALLBAC
56b0: 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 K OPTIONS">CALLB
56c0: 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c ACK OPTIONS</a><
56d0: 2f 68 33 3e 0a 0a 3c 70 3e 0a 41 73 20 69 6e 64 /h3>..<p>.As ind
56e0: 69 63 61 74 65 64 20 61 62 6f 76 65 2c 20 69 6e icated above, in
56f0: 64 69 76 69 64 75 61 6c 20 63 68 61 6e 6e 65 6c dividual channel
5700: 73 20 63 61 6e 20 62 65 20 67 69 76 65 6e 20 74 s can be given t
5710: 68 65 69 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 heir own callbac
5720: 6b 73 0a 74 6f 20 68 61 6e 64 6c 65 20 69 6e 74 ks.to handle int
5730: 65 72 6d 65 64 69 61 74 65 20 70 72 6f 63 65 73 ermediate proces
5740: 73 69 6e 67 20 62 79 20 74 68 65 20 4f 70 65 6e sing by the Open
5750: 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 75 73 69 SSL library, usi
5760: 6e 67 20 74 68 65 0a 3c 73 74 72 6f 6e 67 3e 2d ng the.<strong>-
5770: 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e command</strong>
5780: 2c 20 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 , <strong>-passw
5790: 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 61 6e ord</strong>, an
57a0: 64 0a 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 d.<strong>-valid
57b0: 61 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 ate_command</str
57c0: 6f 6e 67 3e 20 6f 70 74 69 6f 6e 73 20 70 61 73 ong> options pas
57d0: 73 65 64 20 74 6f 20 65 69 74 68 65 72 20 6f 66 sed to either of
57e0: 0a 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 6f .<strong>tls::so
57f0: 63 6b 65 74 3c 2f 73 74 72 6f 6e 67 3e 20 6f 72 cket</strong> or
5800: 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d <strong>tls::im
5810: 70 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 49 port</strong>..I
5820: 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 67 f the callback g
5830: 65 6e 65 72 61 74 65 73 20 61 6e 20 65 72 72 6f enerates an erro
5840: 72 2c 20 74 68 65 20 3c 62 3e 62 67 65 72 72 6f r, the <b>bgerro
5850: 72 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 20 77 69 r</b> command wi
5860: 6c 6c 20 62 65 0a 69 6e 76 6f 6b 65 64 20 77 69 ll be.invoked wi
5870: 74 68 20 74 68 65 20 65 72 72 6f 72 20 69 6e 66 th the error inf
5880: 6f 72 6d 61 74 69 6f 6e 2e 0a 3c 2f 70 3e 0a 0a ormation..</p>..
5890: 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c 73 74 <dl>. <dt><st
58a0: 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73 rong>-command</s
58b0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 trong> <em>callb
58c0: 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 ack</em></dt>.
58d0: 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 <dd>..Invokes
58e0: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 the specified <e
58f0: 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 m>callback</em>
5900: 73 63 72 69 70 74 20 61 74 20 73 65 76 65 72 61 script at severa
5910: 6c 20 70 6f 69 6e 74 73 0a 09 64 75 72 69 6e 67 l points..during
5920: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 68 61 6e the OpenSSL han
5930: 64 73 68 61 6b 65 20 61 6e 64 20 75 73 65 2e 20 dshake and use.
5940: 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 See below for th
5950: 65 20 70 6f 73 73 69 62 6c 65 0a 09 61 72 67 75 e possible..argu
5960: 6d 65 6e 74 73 20 70 61 73 73 65 64 20 74 6f 20 ments passed to
5970: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72 the callback scr
5980: 69 70 74 2e 20 56 61 6c 75 65 73 20 72 65 74 75 ipt. Values retu
5990: 72 6e 65 64 20 66 72 6f 6d 20 74 68 65 0a 09 63 rned from the..c
59a0: 61 6c 6c 62 61 63 6b 20 61 72 65 20 69 67 6e 6f allback are igno
59b0: 72 65 64 2e 0a 20 20 20 20 3c 62 72 3e 0a 20 20 red.. <br>.
59c0: 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e 0a 09 3c 73 <dl>..<dt>..<s
59d0: 74 72 6f 6e 67 3e 65 72 72 6f 72 3c 2f 73 74 72 trong>error</str
59e0: 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c ong> <em>channel
59f0: 49 64 20 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 0a Id message</em>.
5a00: 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 .</dt>..<dd>..
5a10: 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 This form of c
5a20: 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b allback is invok
5a30: 65 64 20 77 68 65 6e 65 76 65 72 20 61 6e 20 65 ed whenever an e
5a40: 72 72 6f 72 20 6f 63 63 75 72 73 20 64 75 72 69 rror occurs duri
5a50: 6e 67 20 74 68 65 0a 09 20 20 20 20 69 6e 69 74 ng the.. init
5a60: 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 ial connection,
5a70: 68 61 6e 64 73 68 61 6b 65 2c 20 6f 72 20 49 2f handshake, or I/
5a80: 4f 20 6f 70 65 72 61 74 69 6f 6e 73 2e 20 54 68 O operations. Th
5a90: 65 20 3c 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 e <em>message</e
5aa0: 6d 3e 0a 09 20 20 20 20 61 72 67 75 6d 65 6e 74 m>.. argument
5ab0: 20 63 61 6e 20 62 65 20 66 72 6f 6d 20 74 68 65 can be from the
5ac0: 20 54 63 6c 5f 45 72 72 6e 6f 4d 73 67 2c 20 4f Tcl_ErrnoMsg, O
5ad0: 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a penSSL function.
5ae0: 09 20 20 20 20 3c 63 6f 64 65 3e 45 52 52 5f 72 . <code>ERR_r
5af0: 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73 74 72 69 eason_error_stri
5b00: 6e 67 28 29 3c 2f 63 6f 64 65 3e 2c 20 6f 72 20 ng()</code>, or
5b10: 61 20 63 75 73 74 6f 6d 20 6d 65 73 73 61 67 65 a custom message
5b20: 2e 0a 09 3c 2f 64 64 3e 0a 09 3c 62 72 3e 0a 09 ...</dd>..<br>..
5b30: 3c 64 74 3e 0a 09 20 20 20 20 3c 73 74 72 6f 6e <dt>.. <stron
5b40: 67 3e 69 6e 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 g>info</strong>
5b50: 3c 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 6d 61 <em>channelId ma
5b60: 6a 6f 72 20 6d 69 6e 6f 72 20 6d 65 73 73 61 67 jor minor messag
5b70: 65 20 74 79 70 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 e type</em>..</d
5b80: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 20 20 20 54 t>..<dd>.. T
5b90: 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c his form of call
5ba0: 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 back is invoked
5bb0: 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 by the OpenSSL f
5bc0: 75 6e 63 74 69 6f 6e 0a 09 20 20 20 20 3c 63 6f unction.. <co
5bd0: 64 65 3e 53 53 4c 5f 73 65 74 5f 69 6e 66 6f 5f de>SSL_set_info_
5be0: 63 61 6c 6c 62 61 63 6b 28 29 3c 2f 63 6f 64 65 callback()</code
5bf0: 3e 20 64 75 72 69 6e 67 20 74 68 65 20 69 6e 69 > during the ini
5c00: 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 0a tial connection.
5c10: 09 20 20 20 20 61 6e 64 20 68 61 6e 64 73 68 61 . and handsha
5c20: 6b 65 20 6f 70 65 72 61 74 69 6f 6e 73 2e 20 54 ke operations. T
5c30: 68 65 20 3c 65 6d 3e 74 79 70 65 3c 2f 65 6d 3e he <em>type</em>
5c40: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 6e 65 77 argument is new
5c50: 20 66 6f 72 0a 09 20 20 20 20 54 4c 53 20 31 2e for.. TLS 1.
5c60: 38 2e 20 54 68 65 20 61 72 67 75 6d 65 6e 74 73 8. The arguments
5c70: 20 61 72 65 3a 0a 09 3c 62 72 3e 0a 09 3c 75 6c are:..<br>..<ul
5c80: 3e 0a 09 3c 6c 69 3e 50 6f 73 73 69 62 6c 65 20 >..<li>Possible
5c90: 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e 6d values for <em>m
5ca0: 61 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 0a 09 ajor</em> are:..
5cb0: 20 20 20 20 3c 63 6f 64 65 3e 68 61 6e 64 73 68 <code>handsh
5cc0: 61 6b 65 2c 20 61 6c 65 72 74 2c 20 63 6f 6e 6e ake, alert, conn
5cd0: 65 63 74 2c 20 61 63 63 65 70 74 3c 2f 63 6f 64 ect, accept</cod
5ce0: 65 3e 2e 3c 2f 6c 69 3e 0a 09 3c 6c 69 3e 50 6f e>.</li>..<li>Po
5cf0: 73 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66 6f ssible values fo
5d00: 72 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d 3e r <em>minor</em>
5d10: 20 61 72 65 3a 0a 09 20 20 20 20 3c 63 6f 64 65 are:.. <code
5d20: 3e 73 74 61 72 74 2c 20 64 6f 6e 65 2c 20 72 65 >start, done, re
5d30: 61 64 2c 20 77 72 69 74 65 2c 20 6c 6f 6f 70 2c ad, write, loop,
5d40: 20 65 78 69 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c exit</code>.</l
5d50: 69 3e 0a 09 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e i>..<li>The <em>
5d60: 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72 67 message</em> arg
5d70: 75 6d 65 6e 74 20 69 73 20 61 20 64 65 73 63 72 ument is a descr
5d80: 69 70 74 69 76 65 20 73 74 72 69 6e 67 20 77 68 iptive string wh
5d90: 69 63 68 20 6d 61 79 0a 09 20 20 20 20 62 65 20 ich may.. be
5da0: 67 65 6e 65 72 61 74 65 64 20 65 69 74 68 65 72 generated either
5db0: 20 62 79 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 74 by <code>SSL_st
5dc0: 61 74 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 ate_string_long(
5dd0: 29 3c 2f 63 6f 64 65 3e 20 6f 72 20 62 79 0a 09 )</code> or by..
5de0: 20 20 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 61 6c <code>SSL_al
5df0: 65 72 74 5f 64 65 73 63 5f 73 74 72 69 6e 67 5f ert_desc_string_
5e00: 6c 6f 6e 67 28 29 3c 2f 63 6f 64 65 3e 2c 20 64 long()</code>, d
5e10: 65 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 epending on the
5e20: 63 6f 6e 74 65 78 74 2e 3c 2f 6c 69 3e 0a 09 3c context.</li>..<
5e30: 6c 69 3e 46 6f 72 20 61 6c 65 72 74 73 2c 20 74 li>For alerts, t
5e40: 68 65 20 70 6f 73 73 69 62 6c 65 20 76 61 6c 75 he possible valu
5e50: 65 73 20 66 6f 72 20 3c 65 6d 3e 74 79 70 65 3c es for <em>type<
5e60: 2f 65 6d 3e 20 61 72 65 3a 0a 09 20 20 20 20 3c /em> are:.. <
5e70: 63 6f 64 65 3e 77 61 72 6e 69 6e 67 2c 20 66 61 code>warning, fa
5e80: 74 61 6c 2c 20 61 6e 64 20 75 6e 6b 6e 6f 77 6e tal, and unknown
5e90: 3c 2f 63 6f 64 65 3e 2e 20 46 6f 72 20 6f 74 68 </code>. For oth
5ea0: 65 72 73 2c 0a 09 20 20 20 20 3c 63 6f 64 65 3e ers,.. <code>
5eb0: 69 6e 66 6f 3c 2f 63 6f 64 65 3e 20 69 73 20 75 info</code> is u
5ec0: 73 65 64 2e 3c 2f 6c 69 3e 0a 09 3c 2f 75 6c 3e sed.</li>..</ul>
5ed0: 0a 09 3c 2f 64 64 3e 0a 09 3c 64 74 3e 0a 09 3c ..</dd>..<dt>..<
5ee0: 73 74 72 6f 6e 67 3e 6d 65 73 73 61 67 65 3c 2f strong>message</
5ef0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e strong> <em>chan
5f00: 6e 65 6c 49 64 20 64 69 72 65 63 74 69 6f 6e 20 nelId direction
5f10: 76 65 72 73 69 6f 6e 20 63 6f 6e 74 65 6e 74 5f version content_
5f20: 74 79 70 65 20 6d 65 73 73 61 67 65 3c 2f 65 6d type message</em
5f30: 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 >..</dt>..<dd>..
5f40: 20 20 20 20 54 68 69 73 20 66 6f 72 6d 20 6f 66 This form of
5f50: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 callback is inv
5f60: 6f 6b 65 64 20 62 79 20 74 68 65 20 4f 70 65 6e oked by the Open
5f70: 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a 09 20 20 SSL function..
5f80: 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 65 74 5f <code>SSL_set_
5f90: 6d 73 67 5f 63 61 6c 6c 62 61 63 6b 28 29 3c 2f msg_callback()</
5fa0: 63 6f 64 65 3e 20 77 68 65 6e 65 76 65 72 20 61 code> whenever a
5fb0: 20 6d 65 73 73 61 67 65 20 69 73 20 73 65 6e 74 message is sent
5fc0: 20 6f 72 0a 09 20 20 20 20 72 65 63 65 69 76 65 or.. receive
5fd0: 64 20 64 75 72 69 6e 67 20 74 68 65 20 69 6e 69 d during the ini
5fe0: 74 69 61 6c 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c tial connection,
5ff0: 20 68 61 6e 64 73 68 61 6b 65 2c 20 6f 72 20 49 handshake, or I
6000: 2f 4f 20 6f 70 65 72 61 74 69 6f 6e 73 2e 0a 09 /O operations...
6010: 20 20 20 20 49 74 20 69 73 20 6f 6e 6c 79 20 61 It is only a
6020: 76 61 69 6c 61 62 6c 65 20 77 68 65 6e 20 4f 70 vailable when Op
6030: 65 6e 53 53 4c 20 69 73 20 63 6f 6d 70 6c 69 65 enSSL is complie
6040: 64 20 77 69 74 68 20 74 68 65 0a 09 20 20 20 20 d with the..
6050: 3c 65 6d 3e 65 6e 61 62 6c 65 2d 73 73 6c 2d 74 <em>enable-ssl-t
6060: 72 61 63 65 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e race</em> option
6070: 2e 20 41 72 67 75 6d 65 6e 74 73 20 61 72 65 3a . Arguments are:
6080: 20 3c 65 6d 3e 64 69 72 65 63 74 69 6f 6e 3c 2f <em>direction</
6090: 65 6d 3e 0a 09 20 20 20 20 69 73 20 3c 62 3e 53 em>.. is <b>S
60a0: 65 6e 74 3c 2f 62 3e 20 6f 72 20 3c 62 3e 52 65 ent</b> or <b>Re
60b0: 63 65 69 76 65 64 3c 2f 62 3e 2c 20 3c 65 6d 3e ceived</b>, <em>
60c0: 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 20 69 73 20 version</em> is
60d0: 74 68 65 20 70 72 6f 74 6f 63 6f 6c 0a 09 20 20 the protocol..
60e0: 20 20 76 65 72 73 69 6f 6e 2c 20 3c 65 6d 3e 63 version, <em>c
60f0: 6f 6e 74 65 6e 74 5f 74 79 70 65 3c 2f 65 6d 3e ontent_type</em>
6100: 20 69 73 20 74 68 65 20 6d 65 73 73 61 67 65 20 is the message
6110: 63 6f 6e 74 65 6e 74 20 74 79 70 65 2c 20 61 6e content type, an
6120: 64 0a 09 20 20 20 20 3c 65 6d 3e 6d 65 73 73 61 d.. <em>messa
6130: 67 65 3c 2f 65 6d 3e 20 69 73 20 6d 6f 72 65 20 ge</em> is more
6140: 69 6e 66 6f 20 66 72 6f 6d 20 74 68 65 20 3c 63 info from the <c
6150: 6f 64 65 3e 53 53 4c 5f 74 72 61 63 65 3c 2f 63 ode>SSL_trace</c
6160: 6f 64 65 3e 20 41 50 49 2e 0a 09 20 20 20 20 54 ode> API... T
6170: 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 his callback is
6180: 6e 65 77 20 66 6f 72 20 54 4c 53 20 31 2e 38 2e new for TLS 1.8.
6190: 0a 09 3c 2f 64 64 3e 0a 09 3c 62 72 3e 0a 09 3c ..</dd>..<br>..<
61a0: 64 74 3e 0a 09 3c 73 74 72 6f 6e 67 3e 73 65 73 dt>..<strong>ses
61b0: 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 sion</strong> <e
61c0: 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 73 65 73 73 m>channelId sess
61d0: 69 6f 6e 5f 69 64 20 74 69 63 6b 65 74 20 6c 69 ion_id ticket li
61e0: 66 65 74 69 6d 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 fetime</em>..</d
61f0: 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 20 20 54 68 t>..<dd>.. Th
6200: 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 is form of callb
6210: 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 ack is invoked b
6220: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 y the OpenSSL fu
6230: 6e 63 74 69 6f 6e 0a 09 20 20 20 20 3c 63 6f 64 nction.. <cod
6240: 65 3e 53 53 4c 5f 43 54 58 5f 73 65 73 73 5f 73 e>SSL_CTX_sess_s
6250: 65 74 5f 6e 65 77 5f 63 62 28 29 3c 2f 63 6f 64 et_new_cb()</cod
6260: 65 3e 20 77 68 65 6e 65 76 65 72 20 61 20 6e 65 e> whenever a ne
6270: 77 20 73 65 73 73 69 6f 6e 20 69 64 20 69 73 0a w session id is.
6280: 09 20 20 20 20 73 65 6e 74 20 62 79 20 74 68 65 . sent by the
6290: 20 73 65 72 76 65 72 20 64 75 72 69 6e 67 20 74 server during t
62a0: 68 65 20 69 6e 69 74 69 61 6c 20 63 6f 6e 6e 65 he initial conne
62b0: 63 74 69 6f 6e 20 61 6e 64 20 68 61 6e 64 73 68 ction and handsh
62c0: 61 6b 65 2c 20 62 75 74 0a 09 20 20 20 20 63 61 ake, but.. ca
62d0: 6e 20 61 6c 73 6f 20 62 65 20 72 65 63 65 69 76 n also be receiv
62e0: 65 64 20 6c 61 74 65 72 20 69 66 20 74 68 65 20 ed later if the
62f0: 3c 62 3e 2d 70 6f 73 74 5f 68 61 6e 64 73 68 61 <b>-post_handsha
6300: 6b 65 3c 2f 62 3e 20 6f 70 74 69 6f 6e 20 69 73 ke</b> option is
6310: 0a 09 20 20 20 20 75 73 65 64 2e 20 41 72 67 75 .. used. Argu
6320: 6d 65 6e 74 73 20 61 72 65 3a 20 3c 65 6d 3e 73 ments are: <em>s
6330: 65 73 73 69 6f 6e 5f 69 64 3c 2f 65 6d 3e 20 69 ession_id</em> i
6340: 73 20 74 68 65 20 63 75 72 72 65 6e 74 0a 09 20 s the current..
6350: 20 20 20 73 65 73 73 69 6f 6e 20 69 64 65 6e 74 session ident
6360: 69 66 69 65 72 2c 20 3c 65 6d 3e 74 69 63 6b 65 ifier, <em>ticke
6370: 74 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 73 65 t</em> is the se
6380: 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 69 6e 66 ssion ticket inf
6390: 6f 2c 20 61 6e 64 0a 09 20 20 20 20 3c 65 6d 3e o, and.. <em>
63a0: 6c 69 66 65 74 69 6d 65 3c 2f 65 6d 3e 20 69 73 lifetime</em> is
63b0: 20 74 68 65 20 74 68 65 20 74 69 63 6b 65 74 20 the the ticket
63c0: 6c 69 66 65 74 69 6d 65 20 69 6e 20 73 65 63 6f lifetime in seco
63d0: 6e 64 73 2e 0a 09 20 20 20 20 54 68 69 73 20 63 nds... This c
63e0: 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 20 66 allback is new f
63f0: 6f 72 20 54 4c 53 20 31 2e 38 2e 0a 09 3c 2f 64 or TLS 1.8...</d
6400: 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 d>. </dl>.
6410: 20 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c 62 72 </dd>.</dl>.<br
6420: 3e 0a 3c 64 6c 3e 0a 20 20 20 20 3c 64 74 3e 3c >.<dl>. <dt><
6430: 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 strong>-password
6440: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 </strong> <em>ca
6450: 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e llback</em></dt>
6460: 0a 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b . <dd>..Invok
6470: 65 73 20 74 68 65 20 73 70 65 63 69 66 69 65 64 es the specified
6480: 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 <em>callback</e
6490: 6d 3e 20 73 63 72 69 70 74 20 77 68 65 6e 20 4f m> script when O
64a0: 70 65 6e 53 53 4c 20 6e 65 65 64 73 20 74 6f 0a penSSL needs to.
64b0: 09 6f 62 74 61 69 6e 20 61 20 70 61 73 73 77 6f .obtain a passwo
64c0: 72 64 2e 20 53 65 65 20 62 65 6c 6f 77 20 66 6f rd. See below fo
64d0: 72 20 74 68 65 20 70 6f 73 73 69 62 6c 65 20 61 r the possible a
64e0: 72 67 75 6d 65 6e 74 73 20 70 61 73 73 65 64 20 rguments passed
64f0: 74 6f 0a 09 74 68 65 20 63 61 6c 6c 62 61 63 6b to..the callback
6500: 20 73 63 72 69 70 74 2e 20 53 65 65 20 62 65 6c script. See bel
6510: 6f 77 20 66 6f 72 20 76 61 6c 69 64 20 72 65 74 ow for valid ret
6520: 75 72 6e 20 76 61 6c 75 65 73 2e 0a 09 3c 62 72 urn values...<br
6530: 3e 0a 09 3c 64 6c 3e 0a 09 20 20 20 20 3c 64 74 >..<dl>.. <dt
6540: 3e 0a 09 20 20 20 20 3c 73 74 72 6f 6e 67 3e 70 >.. <strong>p
6550: 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e assword</strong>
6560: 20 3c 65 6d 3e 72 77 66 6c 61 67 20 73 69 7a 65 <em>rwflag size
6570: 3c 2f 65 6d 3e 0a 09 20 20 20 20 3c 2f 64 74 3e </em>.. </dt>
6580: 0a 09 20 20 20 20 3c 64 64 3e 0a 09 09 49 6e 76 .. <dd>...Inv
6590: 6f 6b 65 64 20 77 68 65 6e 20 6c 6f 61 64 69 6e oked when loadin
65a0: 67 20 6f 72 20 73 74 6f 72 69 6e 67 20 61 20 50 g or storing a P
65b0: 45 4d 20 63 65 72 74 69 66 69 63 61 74 65 20 77 EM certificate w
65c0: 69 74 68 20 65 6e 63 72 79 70 74 69 6f 6e 2e 0a ith encryption..
65d0: 09 09 57 68 65 72 65 20 3c 65 6d 3e 72 77 66 6c ..Where <em>rwfl
65e0: 61 67 3c 2f 65 6d 3e 20 69 73 20 30 20 66 6f 72 ag</em> is 0 for
65f0: 20 72 65 61 64 69 6e 67 2f 64 65 63 72 79 70 74 reading/decrypt
6600: 69 6f 6e 20 6f 72 20 31 20 66 6f 72 0a 09 09 77 ion or 1 for...w
6610: 72 69 74 69 6e 67 2f 65 6e 63 72 79 70 74 69 6f riting/encryptio
6620: 6e 20 28 63 61 6e 20 70 72 6f 6d 70 74 20 75 73 n (can prompt us
6630: 65 72 20 74 6f 20 63 6f 6e 66 69 72 6d 29 20 61 er to confirm) a
6640: 6e 64 20 3c 65 6d 3e 73 69 7a 65 3c 2f 65 6d 3e nd <em>size</em>
6650: 20 69 73 0a 09 09 74 68 65 20 6d 61 78 20 70 61 is...the max pa
6660: 73 73 77 6f 72 64 20 6c 65 6e 67 74 68 20 69 6e ssword length in
6670: 20 62 79 74 65 73 2e 20 54 68 65 20 63 61 6c 6c bytes. The call
6680: 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 back should retu
6690: 72 6e 20 74 68 65 0a 09 09 70 61 73 73 77 6f 72 rn the...passwor
66a0: 64 20 61 73 20 61 20 73 74 72 69 6e 67 2e 20 42 d as a string. B
66b0: 6f 74 68 20 61 72 67 75 6d 65 6e 74 73 20 61 72 oth arguments ar
66c0: 65 20 6e 65 77 20 66 6f 72 20 54 4c 53 20 31 2e e new for TLS 1.
66d0: 38 2e 0a 09 20 20 20 20 3c 2f 64 64 3e 0a 09 3c 8... </dd>..<
66e0: 2f 64 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c /dl>. </dd>.<
66f0: 2f 64 6c 3e 0a 3c 62 72 3e 0a 3c 64 6c 3e 0a 20 /dl>.<br>.<dl>.
6700: 20 20 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d <dt><strong>-
6710: 76 61 6c 69 64 61 74 65 63 6f 6d 6d 61 6e 64 3c validatecommand<
6720: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c /strong> <em>cal
6730: 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a lback</em></dt>.
6740: 20 20 20 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 <dd>..Invoke
6750: 73 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 s the specified
6760: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d <em>callback</em
6770: 3e 20 73 63 72 69 70 74 20 64 75 72 69 6e 67 20 > script during
6780: 68 61 6e 64 73 68 61 6b 65 20 69 6e 0a 09 6f 72 handshake in..or
6790: 64 65 72 20 74 6f 20 76 61 6c 69 64 61 74 65 20 der to validate
67a0: 74 68 65 20 70 72 6f 76 69 64 65 64 20 76 61 6c the provided val
67b0: 75 65 28 73 29 2e 20 53 65 65 20 62 65 6c 6f 77 ue(s). See below
67c0: 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62 6c for the possibl
67d0: 65 0a 09 61 72 67 75 6d 65 6e 74 73 20 70 61 73 e..arguments pas
67e0: 73 65 64 20 74 6f 20 74 68 65 20 63 61 6c 6c 62 sed to the callb
67f0: 61 63 6b 20 73 63 72 69 70 74 2e 20 49 66 20 6e ack script. If n
6800: 6f 74 20 73 70 65 63 69 66 69 65 64 2c 20 4f 70 ot specified, Op
6810: 65 6e 53 53 4c 0a 09 77 69 6c 6c 20 61 63 63 65 enSSL..will acce
6820: 70 74 20 76 61 6c 69 64 20 63 65 72 74 69 66 69 pt valid certifi
6830: 63 61 74 65 73 20 61 6e 64 20 65 78 74 65 6e 73 cates and extens
6840: 69 6f 6e 73 2e 0a 09 54 6f 20 72 65 6a 65 63 74 ions...To reject
6850: 20 74 68 65 20 76 61 6c 75 65 20 61 6e 64 20 61 the value and a
6860: 62 6f 72 74 20 74 68 65 20 63 6f 6e 6e 65 63 74 bort the connect
6870: 69 6f 6e 2c 20 74 68 65 20 63 61 6c 6c 62 61 63 ion, the callbac
6880: 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 k should return
6890: 30 2e 0a 09 54 6f 20 61 63 63 65 70 74 20 74 68 0...To accept th
68a0: 65 20 76 61 6c 75 65 20 61 6e 64 20 63 6f 6e 74 e value and cont
68b0: 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65 63 74 inue the connect
68c0: 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64 20 72 ion, it should r
68d0: 65 74 75 72 6e 20 31 2e 0a 09 54 6f 20 72 65 6a eturn 1...To rej
68e0: 65 63 74 20 74 68 65 20 76 61 6c 75 65 2c 20 62 ect the value, b
68f0: 75 74 20 63 6f 6e 74 69 6e 75 65 20 74 68 65 20 ut continue the
6900: 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 69 74 20 73 connection, it s
6910: 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 32 2e 0a hould return 2..
6920: 09 3c 62 72 3e 0a 09 3c 64 6c 3e 0a 09 20 20 20 .<br>..<dl>..
6930: 20 3c 64 74 3e 0a 09 09 3c 73 74 72 6f 6e 67 3e <dt>...<strong>
6940: 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 alpn</strong> <e
6950: 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 70 72 6f 74 m>channelId prot
6960: 6f 63 6f 6c 20 6d 61 74 63 68 3c 2f 65 6d 3e 0a ocol match</em>.
6970: 09 09 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 ..</dt>.. <dd
6980: 3e 0a 09 09 46 6f 72 20 73 65 72 76 65 72 73 2c >...For servers,
6990: 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 this form of ca
69a0: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 llback is invoke
69b0: 64 20 77 68 65 6e 20 74 68 65 20 63 6c 69 65 6e d when the clien
69c0: 74 20 41 4c 50 4e 0a 09 09 65 78 74 65 6e 73 69 t ALPN...extensi
69d0: 6f 6e 20 69 73 20 72 65 63 65 69 76 65 64 2e 20 on is received.
69e0: 49 66 20 3c 65 6d 3e 6d 61 74 63 68 3c 2f 65 6d If <em>match</em
69f0: 3e 20 69 73 20 74 72 75 65 2c 20 3c 65 6d 3e 70 > is true, <em>p
6a00: 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 0a 09 09 69 rotocol</em>...i
6a10: 73 20 74 68 65 20 66 69 72 73 74 20 3c 62 3e 2d s the first <b>-
6a20: 61 6c 70 6e 3c 2f 62 3e 20 6f 70 74 69 6f 6e 20 alpn</b> option
6a30: 73 70 65 63 69 66 69 65 64 20 70 72 6f 74 6f 63 specified protoc
6a40: 6f 6c 20 63 6f 6d 6d 6f 6e 20 74 6f 20 62 6f 74 ol common to bot
6a50: 68 0a 09 09 74 68 65 20 63 6c 69 65 6e 74 20 61 h...the client a
6a60: 6e 64 20 73 65 72 76 65 72 2e 20 49 66 20 6e 6f nd server. If no
6a70: 74 2c 20 74 68 65 20 66 69 72 73 74 20 63 6c 69 t, the first cli
6a80: 65 6e 74 20 73 70 65 63 69 66 69 65 64 20 70 72 ent specified pr
6a90: 6f 74 6f 63 6f 6c 20 69 73 0a 09 09 75 73 65 64 otocol is...used
6aa0: 2e 20 49 74 20 69 73 20 63 61 6c 6c 65 64 20 61 . It is called a
6ab0: 66 74 65 72 20 74 68 65 20 68 65 6c 6c 6f 20 61 fter the hello a
6ac0: 6e 64 20 41 4c 50 4e 20 63 61 6c 6c 62 61 63 6b nd ALPN callback
6ad0: 73 2e 0a 09 09 54 68 69 73 20 63 61 6c 6c 62 61 s....This callba
6ae0: 63 6b 20 69 73 20 6e 65 77 20 66 6f 72 20 54 4c ck is new for TL
6af0: 53 20 31 2e 38 2e 0a 09 20 20 20 20 3c 2f 64 64 S 1.8... </dd
6b00: 3e 0a 09 20 20 20 20 3c 62 72 3e 0a 09 20 20 20 >.. <br>..
6b10: 20 3c 64 74 3e 0a 09 09 3c 73 74 72 6f 6e 67 3e <dt>...<strong>
6b20: 68 65 6c 6c 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c hello</strong> <
6b30: 65 6d 3e 63 68 61 6e 6e 65 6c 49 64 20 73 65 72 em>channelId ser
6b40: 76 65 72 6e 61 6d 65 3c 2f 65 6d 3e 0a 09 20 20 vername</em>..
6b50: 20 20 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 </dt>.. <dd
6b60: 3e 0a 09 09 46 6f 72 20 73 65 72 76 65 72 73 2c >...For servers,
6b70: 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 this form of ca
6b80: 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 llback is invoke
6b90: 64 20 64 75 72 69 6e 67 20 63 6c 69 65 6e 74 20 d during client
6ba0: 68 65 6c 6c 6f 0a 09 09 6d 65 73 73 61 67 65 20 hello...message
6bb0: 70 72 6f 63 65 73 73 69 6e 67 2e 20 54 68 65 20 processing. The
6bc0: 70 75 72 70 6f 73 65 20 69 73 20 73 6f 20 74 68 purpose is so th
6bd0: 65 20 73 65 72 76 65 72 20 63 61 6e 20 73 65 6c e server can sel
6be0: 65 63 74 20 74 68 65 0a 09 09 61 70 70 72 6f 70 ect the...approp
6bf0: 72 69 61 74 65 20 63 65 72 74 69 66 69 63 61 74 riate certificat
6c00: 65 20 74 6f 20 70 72 65 73 65 6e 74 20 74 6f 20 e to present to
6c10: 74 68 65 20 63 6c 69 65 6e 74 2c 20 61 6e 64 20 the client, and
6c20: 74 6f 20 6d 61 6b 65 20 6f 74 68 65 72 0a 09 09 to make other...
6c30: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 64 configuration ad
6c40: 6a 75 73 74 6d 65 6e 74 73 20 72 65 6c 65 76 61 justments releva
6c50: 6e 74 20 74 6f 20 74 68 61 74 20 73 65 72 76 65 nt to that serve
6c60: 72 20 6e 61 6d 65 20 61 6e 64 20 69 74 73 0a 09 r name and its..
6c70: 09 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e 20 .configuration.
6c80: 49 74 20 69 73 20 63 61 6c 6c 65 64 20 62 65 66 It is called bef
6c90: 6f 72 65 20 74 68 65 20 53 4e 49 20 61 6e 64 20 ore the SNI and
6ca0: 41 4c 50 4e 20 63 61 6c 6c 62 61 63 6b 73 2e 0a ALPN callbacks..
6cb0: 09 09 54 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 ..This callback
6cc0: 69 73 20 6e 65 77 20 66 6f 72 20 54 4c 53 20 31 is new for TLS 1
6cd0: 2e 38 2e 0a 09 20 20 20 20 3c 2f 64 64 3e 0a 09 .8... </dd>..
6ce0: 20 20 20 20 3c 62 72 3e 0a 09 20 20 20 20 3c 64 <br>.. <d
6cf0: 74 3e 0a 09 09 3c 73 74 72 6f 6e 67 3e 73 6e 69 t>...<strong>sni
6d00: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 </strong> <em>ch
6d10: 61 6e 6e 65 6c 49 64 20 73 65 72 76 65 72 6e 61 annelId serverna
6d20: 6d 65 3c 2f 65 6d 3e 0a 09 20 20 20 20 3c 2f 64 me</em>.. </d
6d30: 74 3e 0a 09 20 20 20 20 3c 64 64 3e 0a 09 09 46 t>.. <dd>...F
6d40: 6f 72 20 73 65 72 76 65 72 73 2c 20 74 68 69 73 or servers, this
6d50: 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 form of callbac
6d60: 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 k is invoked whe
6d70: 6e 20 74 68 65 20 53 65 72 76 65 72 20 4e 61 6d n the Server Nam
6d80: 65 0a 09 09 49 6e 64 69 63 61 74 69 6f 6e 20 28 e...Indication (
6d90: 53 4e 49 29 20 65 78 74 65 6e 73 69 6f 6e 20 69 SNI) extension i
6da0: 73 20 72 65 63 65 69 76 65 64 2e 20 54 68 65 20 s received. The
6db0: 3c 65 6d 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f <em>servername</
6dc0: 65 6d 3e 0a 09 09 61 72 67 75 6d 65 6e 74 20 69 em>...argument i
6dd0: 73 20 74 68 65 20 63 6c 69 65 6e 74 20 70 72 6f s the client pro
6de0: 76 69 64 65 64 20 73 65 72 76 65 72 20 6e 61 6d vided server nam
6df0: 65 20 69 6e 20 74 68 65 20 3c 62 3e 2d 73 65 72 e in the <b>-ser
6e00: 76 65 72 6e 61 6d 65 3c 2f 62 3e 0a 09 09 6f 70 vername</b>...op
6e10: 74 69 6f 6e 2e 20 54 68 65 20 70 75 72 70 6f 73 tion. The purpos
6e20: 65 20 69 73 20 73 6f 20 77 68 65 6e 20 61 20 73 e is so when a s
6e30: 65 72 76 65 72 20 73 75 70 70 6f 72 74 73 20 6d erver supports m
6e40: 75 6c 74 69 70 6c 65 20 6e 61 6d 65 73 2c 20 74 ultiple names, t
6e50: 68 65 0a 09 09 72 69 67 68 74 20 63 65 72 74 69 he...right certi
6e60: 66 69 63 61 74 65 20 63 61 6e 20 62 65 20 75 73 ficate can be us
6e70: 65 64 2e 20 49 74 20 69 73 20 63 61 6c 6c 65 64 ed. It is called
6e80: 20 61 66 74 65 72 20 74 68 65 20 68 65 6c 6c 6f after the hello
6e90: 20 63 61 6c 6c 62 61 63 6b 0a 09 09 62 75 74 20 callback...but
6ea0: 62 65 66 6f 72 65 20 74 68 65 20 41 4c 50 4e 20 before the ALPN
6eb0: 63 61 6c 6c 62 61 63 6b 2e 0a 09 09 54 68 69 73 callback....This
6ec0: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 6e 65 77 callback is new
6ed0: 20 66 6f 72 20 54 4c 53 20 31 2e 38 2e 0a 09 20 for TLS 1.8...
6ee0: 20 20 20 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 62 </dd>.. <b
6ef0: 72 3e 0a 09 20 20 20 20 3c 64 74 3e 0a 09 09 3c r>.. <dt>...<
6f00: 73 74 72 6f 6e 67 3e 76 65 72 69 66 79 3c 2f 73 strong>verify</s
6f10: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e trong> <em>chann
6f20: 65 6c 49 64 20 64 65 70 74 68 20 63 65 72 74 20 elId depth cert
6f30: 73 74 61 74 75 73 20 65 72 72 6f 72 3c 2f 65 6d status error</em
6f40: 3e 0a 09 20 20 20 20 3c 2f 64 74 3e 0a 09 20 20 >.. </dt>..
6f50: 20 20 3c 64 64 3e 0a 09 09 54 68 69 73 20 66 6f <dd>...This fo
6f60: 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 rm of callback i
6f70: 73 20 69 6e 76 6f 6b 65 64 20 62 79 20 4f 70 65 s invoked by Ope
6f80: 6e 53 53 4c 20 77 68 65 6e 20 61 20 6e 65 77 20 nSSL when a new
6f90: 63 65 72 74 69 66 69 63 61 74 65 0a 09 09 69 73 certificate...is
6fa0: 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 74 received from t
6fb0: 68 65 20 70 65 65 72 2e 20 49 74 20 61 6c 6c 6f he peer. It allo
6fc0: 77 73 20 74 68 65 20 63 6c 69 65 6e 74 20 74 6f ws the client to
6fd0: 20 63 68 65 63 6b 20 74 68 65 0a 09 09 63 65 72 check the...cer
6fe0: 74 69 66 69 63 61 74 65 20 76 65 72 69 66 69 63 tificate verific
6ff0: 61 74 69 6f 6e 20 72 65 73 75 6c 74 73 20 61 6e ation results an
7000: 64 20 63 68 6f 6f 73 65 20 77 68 65 74 68 65 72 d choose whether
7010: 20 74 6f 20 63 6f 6e 74 69 6e 75 65 0a 09 09 6f to continue...o
7020: 72 20 6e 6f 74 2e 20 49 74 20 69 73 20 63 61 6c r not. It is cal
7030: 6c 65 64 20 66 6f 72 20 65 61 63 68 20 63 65 72 led for each cer
7040: 74 69 66 69 63 61 74 65 20 69 6e 20 74 68 65 20 tificate in the
7050: 63 65 72 74 69 66 69 63 61 74 65 20 63 68 61 69 certificate chai
7060: 6e 2e 0a 09 09 3c 75 6c 3e 0a 09 09 3c 6c 69 3e n....<ul>...<li>
7070: 54 68 65 20 3c 65 6d 3e 64 65 70 74 68 3c 2f 65 The <em>depth</e
7080: 6d 3e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 74 m> argument is t
7090: 68 65 20 69 6e 74 65 67 65 72 20 64 65 70 74 68 he integer depth
70a0: 20 6f 66 20 74 68 65 0a 09 09 63 65 72 74 69 66 of the...certif
70b0: 69 63 61 74 65 20 69 6e 20 74 68 65 20 63 65 72 icate in the cer
70c0: 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c 20 tificate chain,
70d0: 77 68 65 72 65 20 30 20 69 73 20 74 68 65 20 70 where 0 is the p
70e0: 65 65 72 20 63 65 72 74 69 66 69 63 61 74 65 0a eer certificate.
70f0: 09 09 61 6e 64 20 68 69 67 68 65 72 20 76 61 6c ..and higher val
7100: 75 65 73 20 67 6f 69 6e 67 20 75 70 20 74 6f 20 ues going up to
7110: 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65 20 the Certificate
7120: 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 2e 3c Authority (CA).<
7130: 2f 6c 69 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 3c /li>...<li>The <
7140: 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 61 72 67 em>cert</em> arg
7150: 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 73 74 20 ument is a list
7160: 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70 61 69 of key-value pai
7170: 72 73 20 73 69 6d 69 6c 61 72 0a 09 09 74 6f 20 rs similar...to
7180: 74 68 6f 73 65 20 72 65 74 75 72 6e 65 64 20 62 those returned b
7190: 79 0a 09 09 3c 61 20 68 72 65 66 3d 22 23 74 6c y...<a href="#tl
71a0: 73 3a 3a 73 74 61 74 75 73 22 3e 3c 73 74 72 6f s::status"><stro
71b0: 6e 67 3e 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f ng>tls::status</
71c0: 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e 3c 2f 6c 69 strong></a>.</li
71d0: 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e >...<li>The <em>
71e0: 73 74 61 74 75 73 3c 2f 65 6d 3e 20 61 72 67 75 status</em> argu
71f0: 6d 65 6e 74 20 69 73 20 74 68 65 20 62 6f 6f 6c ment is the bool
7200: 65 61 6e 20 76 61 6c 69 64 69 74 79 20 6f 66 20 ean validity of
7210: 74 68 65 0a 09 09 63 75 72 72 65 6e 74 20 63 65 the...current ce
7220: 72 74 69 66 69 63 61 74 65 20 77 68 65 72 65 20 rtificate where
7230: 30 20 69 73 20 69 6e 76 61 6c 69 64 20 61 6e 64 0 is invalid and
7240: 20 31 20 69 73 20 76 61 6c 69 64 2e 3c 2f 6c 69 1 is valid.</li
7250: 3e 0a 09 09 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e >...<li>The <em>
7260: 65 72 72 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d error</em> argum
7270: 65 6e 74 20 69 73 20 74 68 65 20 65 72 72 6f 72 ent is the error
7280: 20 6d 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79 message, if any
7290: 2c 20 67 65 6e 65 72 61 74 65 64 0a 09 09 62 79 , generated...by
72a0: 20 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f 52 <code>X509_STOR
72b0: 45 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f 72 28 E_CTX_get_error(
72c0: 29 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a 09 )</code>.</li>..
72d0: 09 3c 2f 75 6c 3e 0a 09 20 20 20 20 3c 2f 64 64 .</ul>.. </dd
72e0: 3e 0a 09 20 20 20 20 3c 62 72 3e 0a 09 3c 2f 64 >.. <br>..</d
72f0: 6c 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 3c 2f 64 l>. </dd>.</d
7300: 6c 3e 0a 0a 3c 70 3e 0a 52 65 66 65 72 65 6e 63 l>..<p>.Referenc
7310: 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e e implementation
7320: 73 20 6f 66 20 74 68 65 73 65 20 63 61 6c 6c 62 s of these callb
7330: 61 63 6b 73 20 61 72 65 20 70 72 6f 76 69 64 65 acks are provide
7340: 64 20 69 6e 20 74 68 65 0a 64 69 73 74 72 69 62 d in the.distrib
7350: 75 74 69 6f 6e 20 61 73 20 3c 73 74 72 6f 6e 67 ution as <strong
7360: 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f >tls::callback</
7370: 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 strong>, <strong
7380: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f >tls::password</
7390: 73 74 72 6f 6e 67 3e 2c 0a 61 6e 64 20 3c 73 74 strong>,.and <st
73a0: 72 6f 6e 67 3e 74 6c 73 3a 3a 76 61 6c 69 64 61 rong>tls::valida
73b0: 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f te_command</stro
73c0: 6e 67 3e 20 72 65 73 70 65 63 74 69 76 65 6c 79 ng> respectively
73d0: 2e 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73 . Note that thes
73e0: 65 20 61 72 65 0a 3c 65 6d 3e 73 61 6d 70 6c 65 e are.<em>sample
73f0: 3c 2f 65 6d 3e 20 69 6d 70 6c 65 6d 65 6e 74 61 </em> implementa
7400: 74 69 6f 6e 73 20 6f 6e 6c 79 2e 20 49 6e 20 61 tions only. In a
7410: 20 6d 6f 72 65 20 72 65 61 6c 69 73 74 69 63 20 more realistic
7420: 64 65 70 6c 6f 79 6d 65 6e 74 0a 79 6f 75 20 77 deployment.you w
7430: 6f 75 6c 64 20 73 70 65 63 69 66 79 20 79 6f 75 ould specify you
7440: 72 20 6f 77 6e 20 63 61 6c 6c 62 61 63 6b 20 73 r own callback s
7450: 63 72 69 70 74 73 20 6f 6e 20 65 61 63 68 20 54 cripts on each T
7460: 4c 53 20 63 68 61 6e 6e 65 6c 20 75 73 69 6e 67 LS channel using
7470: 20 74 68 65 0a 3c 73 74 72 6f 6e 67 3e 2d 63 6f the.<strong>-co
7480: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 mmand</strong>,
7490: 3c 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 <strong>-passwor
74a0: 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 61 6e 64 0a d</strong>, and.
74b0: 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 <strong>-validat
74c0: 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e e_command</stron
74d0: 67 3e 20 6f 70 74 69 6f 6e 73 2e 0a 3c 2f 70 3e g> options..</p>
74e0: 0a 3c 70 3e 0a 54 68 65 20 64 65 66 61 75 6c 74 .<p>.The default
74f0: 20 62 65 68 61 76 69 6f 72 20 77 68 65 6e 20 74 behavior when t
7500: 68 65 20 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d he <strong>-comm
7510: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e 64 and</strong> and
7520: 20 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 <strong>-valida
7530: 74 65 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f te_command</stro
7540: 6e 67 3e 0a 6f 70 74 69 6f 6e 73 20 61 72 65 20 ng>.options are
7550: 6e 6f 74 20 73 70 65 63 69 66 69 65 64 20 69 73 not specified is
7560: 20 66 6f 72 20 54 4c 53 20 74 6f 20 70 72 6f 63 for TLS to proc
7570: 65 73 73 20 74 68 65 20 61 73 73 6f 63 69 61 74 ess the associat
7580: 65 64 20 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 ed library callb
7590: 61 63 6b 73 0a 69 6e 74 65 72 6e 61 6c 6c 79 2e acks.internally.
75a0: 20 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 The default beh
75b0: 61 76 69 6f 72 20 77 68 65 6e 20 74 68 65 20 3c avior when the <
75c0: 73 74 72 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 strong>-password
75d0: 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 74 69 6f 6e </strong> option
75e0: 20 69 73 20 6e 6f 74 0a 73 70 65 63 69 66 69 65 is not.specifie
75f0: 64 20 69 73 20 66 6f 72 20 54 4c 53 20 74 6f 20 d is for TLS to
7600: 70 72 6f 63 65 73 73 20 74 68 65 20 61 73 73 6f process the asso
7610: 63 69 61 74 65 64 20 6c 69 62 72 61 72 79 20 63 ciated library c
7620: 61 6c 6c 62 61 63 6b 73 20 62 79 20 61 74 74 65 allbacks by atte
7630: 6d 70 74 69 6e 67 0a 74 6f 20 63 61 6c 6c 20 3c mpting.to call <
7640: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73 strong>tls::pass
7650: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2e 0a 54 word</strong>..T
7660: 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 62 65 he difference be
7670: 74 77 65 65 6e 20 74 68 65 73 65 20 74 77 6f 20 tween these two
7680: 62 65 68 61 76 69 6f 72 73 20 69 73 20 61 20 63 behaviors is a c
7690: 6f 6e 73 65 71 75 65 6e 63 65 20 6f 66 20 6d 61 onsequence of ma
76a0: 69 6e 74 61 69 6e 69 6e 67 0a 63 6f 6d 70 61 74 intaining.compat
76b0: 69 62 69 6c 69 74 79 20 77 69 74 68 20 65 61 72 ibility with ear
76c0: 6c 69 65 72 20 69 6d 70 6c 65 6d 65 6e 74 61 74 lier implementat
76d0: 69 6f 6e 73 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 3c ions..</p>.<p>.<
76e0: 65 6d 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 em>.The use of t
76f0: 68 65 20 72 65 66 65 72 65 6e 63 65 20 63 61 6c he reference cal
7700: 6c 62 61 63 6b 73 20 3c 73 74 72 6f 6e 67 3e 74 lbacks <strong>t
7710: 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 ls::callback</st
7720: 72 6f 6e 67 3e 2c 0a 3c 73 74 72 6f 6e 67 3e 74 rong>,.<strong>t
7730: 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f 73 74 ls::password</st
7740: 72 6f 6e 67 3e 2c 20 61 6e 64 20 3c 73 74 72 6f rong>, and <stro
7750: 6e 67 3e 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 ng>tls::validate
7760: 5f 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 _command</strong
7770: 3e 0a 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65 >.is not recomme
7780: 6e 64 65 64 2e 20 54 68 65 79 20 6d 61 79 20 62 nded. They may b
7790: 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 66 e removed from f
77a0: 75 74 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a uture releases..
77b0: 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 68 72 3e </em>.</p>..<hr>
77c0: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 44 ..<h3><a name="D
77d0: 45 42 55 47 22 3e 44 45 42 55 47 3c 2f 61 3e 3c EBUG">DEBUG</a><
77e0: 2f 68 33 3e 0a 0a 54 4c 53 20 6b 65 79 20 6c 6f /h3>..TLS key lo
77f0: 67 67 69 6e 67 20 63 61 6e 20 62 65 20 65 6e 61 gging can be ena
7800: 62 6c 65 64 20 62 79 20 73 65 74 74 69 6e 67 20 bled by setting
7810: 74 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 the environment
7820: 76 61 72 69 61 62 6c 65 0a 3c 62 3e 53 53 4c 4b variable.<b>SSLK
7830: 45 59 4c 4f 47 46 49 4c 45 3c 2f 62 3e 20 74 6f EYLOGFILE</b> to
7840: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 the name of the
7850: 20 66 69 6c 65 20 74 6f 20 6c 6f 67 20 74 6f 2e file to log to.
7860: 20 54 68 65 6e 20 77 68 65 6e 65 76 65 72 20 54 Then whenever T
7870: 4c 53 0a 6b 65 79 20 6d 61 74 65 72 69 61 6c 20 LS.key material
7880: 69 73 20 67 65 6e 65 72 61 74 65 64 20 6f 72 20 is generated or
7890: 72 65 63 65 69 76 65 64 20 69 74 20 77 69 6c 6c received it will
78a0: 20 62 65 20 6c 6f 67 67 65 64 20 74 6f 20 74 68 be logged to th
78b0: 65 20 66 69 6c 65 2e 20 54 68 69 73 0a 69 73 20 e file. This.is
78c0: 75 73 65 66 75 6c 20 66 6f 72 20 6c 6f 67 67 69 useful for loggi
78d0: 6e 67 20 6b 65 79 20 64 61 74 61 20 66 6f 72 20 ng key data for
78e0: 6e 65 74 77 6f 72 6b 20 6c 6f 67 67 69 6e 67 20 network logging
78f0: 74 6f 6f 6c 73 20 74 6f 20 75 73 65 20 74 6f 0a tools to use to.
7900: 64 65 63 72 79 70 74 20 74 68 65 20 64 61 74 61 decrypt the data
7910: 2e 0a 3c 70 3e 0a 54 68 65 20 3c 73 74 72 6f 6e ..<p>.The <stron
7920: 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73 74 g>tls::debug</st
7930: 72 6f 6e 67 3e 20 76 61 72 69 61 62 6c 65 20 70 rong> variable p
7940: 72 6f 76 69 64 65 73 20 73 6f 6d 65 20 61 64 64 rovides some add
7950: 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74 72 6f 6c 20 itional.control
7960: 6f 76 65 72 20 74 68 65 73 65 20 72 65 66 65 72 over these refer
7970: 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 2e 20 ence callbacks.
7980: 49 74 73 20 76 61 6c 75 65 20 69 73 20 7a 65 72 Its value is zer
7990: 6f 20 62 79 20 64 65 66 61 75 6c 74 2e 0a 48 69 o by default..Hi
79a0: 67 68 65 72 20 76 61 6c 75 65 73 20 70 72 6f 64 gher values prod
79b0: 75 63 65 20 6d 6f 72 65 20 64 69 61 67 6e 6f 73 uce more diagnos
79c0: 74 69 63 20 6f 75 74 70 75 74 2c 20 61 6e 64 20 tic output, and
79d0: 77 69 6c 6c 20 61 6c 73 6f 20 66 6f 72 63 65 20 will also force
79e0: 74 68 65 0a 76 65 72 69 66 79 20 6d 65 74 68 6f the.verify metho
79f0: 64 20 69 6e 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 d in <strong>tls
7a00: 3a 3a 63 61 6c 6c 62 61 63 6b 3c 2f 73 74 72 6f ::callback</stro
7a10: 6e 67 3e 20 74 6f 20 61 63 63 65 70 74 20 74 68 ng> to accept th
7a20: 65 0a 63 65 72 74 69 66 69 63 61 74 65 2c 20 65 e.certificate, e
7a30: 76 65 6e 20 77 68 65 6e 20 69 74 20 69 73 20 69 ven when it is i
7a40: 6e 76 61 6c 69 64 20 69 66 20 74 68 65 20 3c 62 nvalid if the <b
7a50: 3e 74 6c 73 3a 3a 76 61 6c 69 64 61 74 65 5f 63 >tls::validate_c
7a60: 6f 6d 6d 61 6e 64 3c 2f 62 3e 0a 63 61 6c 6c 62 ommand</b>.callb
7a70: 61 63 6b 20 69 73 20 75 73 65 64 20 66 6f 72 20 ack is used for
7a80: 74 68 65 20 3c 62 3e 2d 76 61 6c 69 64 61 74 65 the <b>-validate
7a90: 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 6f 70 74 69 command</b> opti
7aa0: 6f 6e 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 3c 65 6d on..</p>.<p>.<em
7ab0: 3e 0a 54 68 65 20 75 73 65 20 6f 66 20 74 68 65 >.The use of the
7ac0: 20 76 61 72 69 61 62 6c 65 20 3c 73 74 72 6f 6e variable <stron
7ad0: 67 3e 74 6c 73 3a 3a 64 65 62 75 67 3c 2f 73 74 g>tls::debug</st
7ae0: 72 6f 6e 67 3e 20 69 73 20 6e 6f 74 20 72 65 63 rong> is not rec
7af0: 6f 6d 6d 65 6e 64 65 64 2e 0a 49 74 20 6d 61 79 ommended..It may
7b00: 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d be removed from
7b10: 20 66 75 74 75 72 65 20 72 65 6c 65 61 73 65 73 future releases
7b20: 2e 0a 3c 2f 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 68 ..</em>.</p>..<h
7b30: 34 3e 3c 61 20 6e 61 6d 65 3d 22 44 45 42 55 47 4><a name="DEBUG
7b40: 5f 45 58 41 4d 50 4c 45 53 22 3e 44 65 62 75 67 _EXAMPLES">Debug
7b50: 20 45 78 61 6d 70 6c 65 73 3c 2f 61 3e 3c 2f 68 Examples</a></h
7b60: 34 3e 0a 0a 3c 70 3e 54 68 65 73 65 20 65 78 61 4>..<p>These exa
7b70: 6d 70 6c 65 73 20 75 73 65 20 74 68 65 20 64 65 mples use the de
7b80: 66 61 75 6c 74 20 55 6e 69 78 20 70 6c 61 74 66 fault Unix platf
7b90: 6f 72 6d 20 53 53 4c 20 63 65 72 74 69 66 69 63 orm SSL certific
7ba0: 61 74 65 73 2e 20 46 6f 72 20 73 74 61 6e 64 61 ates. For standa
7bb0: 72 64 0a 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 73 rd.installations
7bc0: 2c 20 2d 63 61 64 69 72 20 61 6e 64 20 2d 63 61 , -cadir and -ca
7bd0: 66 69 6c 65 20 73 68 6f 75 6c 64 20 6e 6f 74 20 file should not
7be0: 62 65 20 6e 65 65 64 65 64 2e 20 49 66 20 79 6f be needed. If yo
7bf0: 75 72 20 63 65 72 74 69 66 69 63 61 74 65 73 0a ur certificates.
7c00: 61 72 65 20 69 6e 20 6e 6f 6e 2d 73 74 61 6e 64 are in non-stand
7c10: 61 72 64 20 6c 6f 63 61 74 69 6f 6e 73 2c 20 75 ard locations, u
7c20: 70 64 61 74 65 20 2d 63 61 64 69 72 20 6f 72 20 pdate -cadir or
7c30: 75 73 65 20 2d 63 61 66 69 6c 65 20 61 73 20 6e use -cafile as n
7c40: 65 65 64 65 64 2e 3c 2f 70 3e 0a 3c 62 72 3e 0a eeded.</p>.<br>.
7c50: 0a 3c 70 3e 45 78 61 6d 70 6c 65 20 23 31 3a 20 .<p>Example #1:
7c60: 55 73 65 20 48 54 54 50 20 70 61 63 6b 61 67 65 Use HTTP package
7c70: 3c 2f 70 3e 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e </p>.<pre><code>
7c80: 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 .package require
7c90: 20 68 74 74 70 0a 70 61 63 6b 61 67 65 20 72 65 http.package re
7ca0: 71 75 69 72 65 20 74 6c 73 0a 73 65 74 20 75 72 quire tls.set ur
7cb0: 6c 20 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74 l "https://www.t
7cc0: 63 6c 2e 74 6b 2f 22 0a 0a 68 74 74 70 3a 3a 72 cl.tk/"..http::r
7cd0: 65 67 69 73 74 65 72 20 68 74 74 70 73 20 34 34 egister https 44
7ce0: 33 20 5b 6c 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 3 [list ::tls::s
7cf0: 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65 72 76 65 ocket -autoserve
7d00: 72 6e 61 6d 65 20 74 72 75 65 20 2d 72 65 71 75 rname true -requ
7d10: 69 72 65 20 74 72 75 65 20 2d 63 61 64 69 72 20 ire true -cadir
7d20: 2f 65 74 63 2f 73 73 6c 2f 63 65 72 74 73 20 5c /etc/ssl/certs \
7d30: 0a 20 20 20 20 2d 63 6f 6d 6d 61 6e 64 20 3a 3a . -command ::
7d40: 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 20 2d 70 tls::callback -p
7d50: 61 73 73 77 6f 72 64 20 3a 3a 74 6c 73 3a 3a 70 assword ::tls::p
7d60: 61 73 73 77 6f 72 64 20 2d 76 61 6c 69 64 61 74 assword -validat
7d70: 65 63 6f 6d 6d 61 6e 64 20 3a 3a 74 6c 73 3a 3a ecommand ::tls::
7d80: 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 validate_command
7d90: 5d 0a 0a 23 20 43 68 65 63 6b 20 66 6f 72 20 65 ]..# Check for e
7da0: 72 72 6f 72 0a 73 65 74 20 74 6f 6b 65 6e 20 5b rror.set token [
7db0: 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 24 75 72 http::geturl $ur
7dc0: 6c 5d 0a 69 66 20 7b 5b 68 74 74 70 3a 3a 73 74 l].if {[http::st
7dd0: 61 74 75 73 20 24 74 6f 6b 65 6e 5d 20 6e 65 20 atus $token] ne
7de0: 22 6f 6b 22 7d 20 7b 0a 20 20 20 20 70 75 74 73 "ok"} {. puts
7df0: 20 5b 66 6f 72 6d 61 74 20 22 45 72 72 6f 72 20 [format "Error
7e00: 25 73 22 20 5b 68 74 74 70 3a 3a 73 74 61 74 75 %s" [http::statu
7e10: 73 20 24 74 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20 s $token]].}..#
7e20: 47 65 74 20 77 65 62 20 70 61 67 65 0a 73 65 74 Get web page.set
7e30: 20 64 61 74 61 20 5b 68 74 74 70 3a 3a 64 61 74 data [http::dat
7e40: 61 20 24 74 6f 6b 65 6e 5d 0a 70 75 74 73 20 5b a $token].puts [
7e50: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 64 string length $d
7e60: 61 74 61 5d 0a 0a 23 20 43 6c 65 61 6e 75 70 0a ata]..# Cleanup.
7e70: 3a 3a 68 74 74 70 3a 3a 63 6c 65 61 6e 75 70 20 ::http::cleanup
7e80: 24 74 6f 6b 65 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f $token.</code></
7e90: 70 72 65 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 pre>..<p>Example
7ea0: 20 23 32 3a 20 55 73 65 20 72 61 77 20 73 6f 63 #2: Use raw soc
7eb0: 6b 65 74 3c 2f 70 3e 0a 3c 70 72 65 3e 3c 63 6f ket</p>.<pre><co
7ec0: 64 65 3e 0a 70 61 63 6b 61 67 65 20 72 65 71 75 de>.package requ
7ed0: 69 72 65 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c ire tls..set url
7ee0: 20 22 77 77 77 2e 74 63 6c 2d 6c 61 6e 67 2e 6f "www.tcl-lang.o
7ef0: 72 67 22 0a 73 65 74 20 70 6f 72 74 20 34 34 33 rg".set port 443
7f00: 0a 0a 73 65 74 20 63 68 20 5b 74 6c 73 3a 3a 73 ..set ch [tls::s
7f10: 6f 63 6b 65 74 20 2d 61 75 74 6f 73 65 72 76 65 ocket -autoserve
7f20: 72 6e 61 6d 65 20 31 20 2d 73 65 72 76 65 72 6e rname 1 -servern
7f30: 61 6d 65 20 24 75 72 6c 20 2d 72 65 71 75 65 73 ame $url -reques
7f40: 74 20 31 20 2d 72 65 71 75 69 72 65 20 31 20 5c t 1 -require 1 \
7f50: 0a 20 20 20 20 2d 61 6c 70 6e 20 7b 68 74 74 70 . -alpn {http
7f60: 2f 31 2e 31 7d 20 2d 63 61 64 69 72 20 2f 65 74 /1.1} -cadir /et
7f70: 63 2f 73 73 6c 2f 63 65 72 74 73 20 2d 63 6f 6d c/ssl/certs -com
7f80: 6d 61 6e 64 20 3a 3a 74 6c 73 3a 3a 63 61 6c 6c mand ::tls::call
7f90: 62 61 63 6b 20 5c 0a 20 20 20 20 2d 70 61 73 73 back \. -pass
7fa0: 77 6f 72 64 20 3a 3a 74 6c 73 3a 3a 70 61 73 73 word ::tls::pass
7fb0: 77 6f 72 64 20 2d 76 61 6c 69 64 61 74 65 63 6f word -validateco
7fc0: 6d 6d 61 6e 64 20 3a 3a 74 6c 73 3a 3a 76 61 6c mmand ::tls::val
7fd0: 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64 20 24 75 idate_command $u
7fe0: 72 6c 20 24 70 6f 72 74 5d 0a 63 68 61 6e 20 63 rl $port].chan c
7ff0: 6f 6e 66 69 67 75 72 65 20 24 63 68 20 2d 62 75 onfigure $ch -bu
8000: 66 66 65 72 73 69 7a 65 20 36 35 35 33 36 0a 74 ffersize 65536.t
8010: 6c 73 3a 3a 68 61 6e 64 73 68 61 6b 65 20 24 63 ls::handshake $c
8020: 68 0a 0a 70 75 74 73 20 24 63 68 20 22 47 45 54 h..puts $ch "GET
8030: 20 2f 20 48 54 54 50 2f 31 2e 31 22 0a 66 6c 75 / HTTP/1.1".flu
8040: 73 68 20 24 63 68 0a 61 66 74 65 72 20 35 30 30 sh $ch.after 500
8050: 0a 73 65 74 20 64 61 74 61 20 5b 72 65 61 64 20 .set data [read
8060: 24 63 68 5d 0a 0a 61 72 72 61 79 20 73 65 74 20 $ch]..array set
8070: 73 74 61 74 75 73 20 5b 74 6c 73 3a 3a 73 74 61 status [tls::sta
8080: 74 75 73 20 24 63 68 5d 0a 61 72 72 61 79 20 73 tus $ch].array s
8090: 65 74 20 63 6f 6e 6e 20 5b 74 6c 73 3a 3a 63 6f et conn [tls::co
80a0: 6e 6e 65 63 74 69 6f 6e 20 24 63 68 5d 0a 61 72 nnection $ch].ar
80b0: 72 61 79 20 73 65 74 20 63 68 61 6e 20 5b 63 68 ray set chan [ch
80c0: 61 6e 20 63 6f 6e 66 69 67 75 72 65 20 24 63 68 an configure $ch
80d0: 5d 0a 63 6c 6f 73 65 20 24 63 68 0a 70 61 72 72 ].close $ch.parr
80e0: 61 79 20 73 74 61 74 75 73 0a 70 61 72 72 61 79 ay status.parray
80f0: 20 63 6f 6e 6e 0a 70 61 72 72 61 79 20 63 68 61 conn.parray cha
8100: 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a n.</code></pre>.
8110: 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 .<hr>..<h3><a na
8120: 6d 65 3d 22 48 54 54 50 53 20 45 58 41 4d 50 4c me="HTTPS EXAMPL
8130: 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50 4c 45 E">HTTPS EXAMPLE
8140: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 </a></h3>..<p>Th
8150: 65 73 65 20 65 78 61 6d 70 6c 65 73 20 75 73 65 ese examples use
8160: 20 74 68 65 20 64 65 66 61 75 6c 74 20 55 6e 69 the default Uni
8170: 78 20 70 6c 61 74 66 6f 72 6d 20 53 53 4c 20 63 x platform SSL c
8180: 65 72 74 69 66 69 63 61 74 65 73 2e 20 46 6f 72 ertificates. For
8190: 20 73 74 61 6e 64 61 72 64 0a 69 6e 73 74 61 6c standard.instal
81a0: 6c 61 74 69 6f 6e 73 2c 20 2d 63 61 64 69 72 20 lations, -cadir
81b0: 61 6e 64 20 2d 63 61 66 69 6c 65 20 73 68 6f 75 and -cafile shou
81c0: 6c 64 20 6e 6f 74 20 62 65 20 6e 65 65 64 65 64 ld not be needed
81d0: 2e 20 49 66 20 79 6f 75 72 20 63 65 72 74 69 66 . If your certif
81e0: 69 63 61 74 65 73 0a 61 72 65 20 69 6e 20 6e 6f icates.are in no
81f0: 6e 2d 73 74 61 6e 64 61 72 64 20 6c 6f 63 61 74 n-standard locat
8200: 69 6f 6e 73 2c 20 75 70 64 61 74 65 20 2d 63 61 ions, update -ca
8210: 64 69 72 20 6f 72 20 75 73 65 20 2d 63 61 66 69 dir or use -cafi
8220: 6c 65 20 61 73 20 6e 65 65 64 65 64 2e 3c 2f 70 le as needed.</p
8230: 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 20 23 31 >..<p>Example #1
8240: 3a 20 47 65 74 20 77 65 62 20 70 61 67 65 3c 2f : Get web page</
8250: 70 3e 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 0a 70 p>.<pre><code>.p
8260: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 68 ackage require h
8270: 74 74 70 0a 70 61 63 6b 61 67 65 20 72 65 71 75 ttp.package requ
8280: 69 72 65 20 74 6c 73 0a 73 65 74 20 75 72 6c 20 ire tls.set url
8290: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74 63 6c "https://www.tcl
82a0: 2e 74 6b 2f 22 0a 0a 68 74 74 70 3a 3a 72 65 67 .tk/"..http::reg
82b0: 69 73 74 65 72 20 68 74 74 70 73 20 34 34 33 20 ister https 443
82c0: 5b 6c 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 [list ::tls::soc
82d0: 6b 65 74 20 2d 61 75 74 6f 73 65 72 76 65 72 6e ket -autoservern
82e0: 61 6d 65 20 74 72 75 65 20 2d 72 65 71 75 69 72 ame true -requir
82f0: 65 20 74 72 75 65 20 2d 63 61 64 69 72 20 2f 65 e true -cadir /e
8300: 74 63 2f 73 73 6c 2f 63 65 72 74 73 5d 0a 0a 23 tc/ssl/certs]..#
8310: 20 43 68 65 63 6b 20 66 6f 72 20 65 72 72 6f 72 Check for error
8320: 0a 73 65 74 20 74 6f 6b 65 6e 20 5b 68 74 74 70 .set token [http
8330: 3a 3a 67 65 74 75 72 6c 20 24 75 72 6c 5d 0a 69 ::geturl $url].i
8340: 66 20 7b 5b 68 74 74 70 3a 3a 73 74 61 74 75 73 f {[http::status
8350: 20 24 74 6f 6b 65 6e 5d 20 6e 65 20 22 6f 6b 22 $token] ne "ok"
8360: 7d 20 7b 0a 20 20 20 20 70 75 74 73 20 5b 66 6f } {. puts [fo
8370: 72 6d 61 74 20 22 45 72 72 6f 72 20 25 73 22 20 rmat "Error %s"
8380: 5b 68 74 74 70 3a 3a 73 74 61 74 75 73 20 24 74 [http::status $t
8390: 6f 6b 65 6e 5d 5d 0a 7d 0a 0a 23 20 47 65 74 20 oken]].}..# Get
83a0: 77 65 62 20 70 61 67 65 0a 73 65 74 20 64 61 74 web page.set dat
83b0: 61 20 5b 68 74 74 70 3a 3a 64 61 74 61 20 24 74 a [http::data $t
83c0: 6f 6b 65 6e 5d 0a 70 75 74 73 20 24 64 61 74 61 oken].puts $data
83d0: 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 3a 3a 68 74 ..# Cleanup.::ht
83e0: 74 70 3a 3a 63 6c 65 61 6e 75 70 20 24 74 6f 6b tp::cleanup $tok
83f0: 65 6e 0a 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e en.</code></pre>
8400: 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 20 23 32 3a ..<p>Example #2:
8410: 20 44 6f 77 6e 6c 6f 61 64 20 66 69 6c 65 3c 2f Download file</
8420: 70 3e 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 0a 70 p>.<pre><code>.p
8430: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 68 ackage require h
8440: 74 74 70 0a 70 61 63 6b 61 67 65 20 72 65 71 75 ttp.package requ
8450: 69 72 65 20 74 6c 73 0a 0a 73 65 74 20 75 72 6c ire tls..set url
8460: 20 22 68 74 74 70 73 3a 2f 2f 77 69 6b 69 2e 74 "https://wiki.t
8470: 63 6c 2d 6c 61 6e 67 2e 6f 72 67 2f 73 69 74 65 cl-lang.org/site
8480: 6d 61 70 2e 78 6d 6c 22 0a 73 65 74 20 66 69 6c map.xml".set fil
8490: 65 6e 61 6d 65 20 5b 66 69 6c 65 20 74 61 69 6c ename [file tail
84a0: 20 24 75 72 6c 5d 0a 0a 68 74 74 70 3a 3a 72 65 $url]..http::re
84b0: 67 69 73 74 65 72 20 68 74 74 70 73 20 34 34 33 gister https 443
84c0: 20 5b 6c 69 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f [list ::tls::so
84d0: 63 6b 65 74 20 2d 61 75 74 6f 73 65 72 76 65 72 cket -autoserver
84e0: 6e 61 6d 65 20 74 72 75 65 20 2d 72 65 71 75 69 name true -requi
84f0: 72 65 20 74 72 75 65 20 2d 63 61 64 69 72 20 2f re true -cadir /
8500: 65 74 63 2f 73 73 6c 2f 63 65 72 74 73 5d 0a 0a etc/ssl/certs]..
8510: 23 20 47 65 74 20 66 69 6c 65 0a 73 65 74 20 63 # Get file.set c
8520: 68 20 5b 6f 70 65 6e 20 24 66 69 6c 65 6e 61 6d h [open $filenam
8530: 65 20 77 62 5d 0a 73 65 74 20 74 6f 6b 65 6e 20 e wb].set token
8540: 5b 3a 3a 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 [::http::geturl
8550: 24 75 72 6c 20 2d 62 6c 6f 63 6b 73 69 7a 65 20 $url -blocksize
8560: 36 35 35 33 36 20 2d 63 68 61 6e 6e 65 6c 20 24 65536 -channel $
8570: 63 68 5d 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 63 ch]..# Cleanup.c
8580: 6c 6f 73 65 20 24 63 68 0a 3a 3a 68 74 74 70 3a lose $ch.::http:
8590: 3a 63 6c 65 61 6e 75 70 20 24 74 6f 6b 65 6e 0a :cleanup $token.
85a0: 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 3c </code></pre>..<
85b0: 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 hr>..<h3><a name
85c0: 3d 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49 44 ="SPECIAL CONSID
85d0: 45 52 41 54 49 4f 4e 53 22 3e 53 50 45 43 49 41 ERATIONS">SPECIA
85e0: 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 L CONSIDERATIONS
85f0: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 </a></h3>..<p>Th
8600: 65 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 6f e capabilities o
8610: 66 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 63 f this package c
8620: 61 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75 73 an vary enormous
8630: 6c 79 20 62 61 73 65 64 20 75 70 6f 6e 20 68 6f ly based upon ho
8640: 77 20 74 68 65 0a 6c 69 6e 6b 65 64 20 74 6f 20 w the.linked to
8650: 4f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 79 20 OpenSSL library
8660: 77 61 73 20 63 6f 6e 66 69 67 75 72 65 64 20 61 was configured a
8670: 6e 64 20 62 75 69 6c 74 2e 20 4e 65 77 20 76 65 nd built. New ve
8680: 72 73 69 6f 6e 73 20 6d 61 79 20 6f 62 73 6f 6c rsions may obsol
8690: 65 74 65 0a 6f 6c 64 65 72 20 70 72 6f 74 6f 63 ete.older protoc
86a0: 6f 6c 20 76 65 72 73 69 6f 6e 73 2c 20 61 64 64 ol versions, add
86b0: 20 6f 72 20 72 65 6d 6f 76 65 20 63 69 70 68 65 or remove ciphe
86c0: 72 73 2c 20 63 68 61 6e 67 65 20 64 65 66 61 75 rs, change defau
86d0: 6c 74 20 76 61 6c 75 65 73 2c 20 65 74 63 2e 0a lt values, etc..
86e0: 55 73 65 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e Use the <strong>
86f0: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f tls::protocols</
8700: 73 74 72 6f 6e 67 3e 20 63 6f 6d 6d 61 6e 64 73 strong> commands
8710: 20 74 6f 20 6f 62 74 61 69 6e 20 74 68 65 20 73 to obtain the s
8720: 75 70 70 6f 72 74 65 64 0a 70 72 6f 74 6f 63 6f upported.protoco
8730: 6c 20 76 65 72 73 69 6f 6e 73 2e 3c 2f 70 3e 0a l versions.</p>.
8740: 0a 3c 68 72 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 .<hr>..<h3><a na
8750: 6d 65 3d 22 53 45 45 20 41 4c 53 4f 22 3e 53 45 me="SEE ALSO">SE
8760: 45 20 41 4c 53 4f 3c 2f 61 3e 3c 2f 68 33 3e 0a E ALSO</a></h3>.
8770: 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b .<p><strong>sock
8780: 65 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 et</strong>, <st
8790: 72 6f 6e 67 3e 66 69 6c 65 65 76 65 6e 74 3c 2f rong>fileevent</
87a0: 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 strong>, <strong
87b0: 3e 68 74 74 70 3c 2f 73 74 72 6f 6e 67 3e 2c 0a >http</strong>,.
87c0: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
87d0: 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 /www.openssl.org
87e0: 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70 65 6e 53 /"><strong>OpenS
87f0: 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 3c SL</strong></a><
8800: 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70 72 65 3e /p>..<hr>..<pre>
8810: 0a 43 6f 70 79 72 69 67 68 74 20 26 63 6f 70 79 .Copyright ©
8820: 3b 20 31 39 39 39 20 4d 61 74 74 20 4e 65 77 6d ; 1999 Matt Newm
8830: 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74 20 26 63 an..Copyright &c
8840: 6f 70 79 3b 20 32 30 30 34 20 53 74 61 72 66 69 opy; 2004 Starfi
8850: 73 68 20 53 79 73 74 65 6d 73 2e 0a 43 6f 70 79 sh Systems..Copy
8860: 72 69 67 68 74 20 26 63 6f 70 79 3b 20 32 30 32 right © 202
8870: 33 20 42 72 69 61 6e 20 4f 27 48 61 67 61 6e 2e 3 Brian O'Hagan.
8880: 0a 3c 2f 70 72 65 3e 0a 3c 2f 62 6f 64 79 3e 0a .</pre>.</body>.
8890: 3c 2f 68 74 6d 6c 3e 0a </html>.