Hex Artifact Content

Artifact 6b8ffb24fdeac5f97cb1f912a3c52ac732765bdc658a17ae69537214b2ec910e:


0000: 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 20 70  <!doctype html p
0010: 75 62 6c 69 63 20 22 2d 2f 2f 57 33 43 2f 2f 44  ublic "-//W3C//D
0020: 54 44 20 48 54 4d 4c 20 34 2e 30 20 54 72 61 6e  TD HTML 4.0 Tran
0030: 73 69 74 69 6f 6e 61 6c 2f 2f 45 4e 22 3e 0a 0a  sitional//EN">..
0040: 3c 68 74 6d 6c 3e 0a 0a 3c 68 65 61 64 3e 0a 3c  <html>..<head>.<
0050: 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d  meta http-equiv=
0060: 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 0a 63  "Content-Type".c
0070: 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 6d  ontent="text/htm
0080: 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d 38  l; charset=iso-8
0090: 38 35 39 2d 31 22 3e 0a 3c 6d 65 74 61 20 6e 61  859-1">.<meta na
00a0: 6d 65 3d 22 43 6f 70 79 72 69 67 68 74 22 20 63  me="Copyright" c
00b0: 6f 6e 74 65 6e 74 3d 22 31 39 39 39 20 4d 61 74  ontent="1999 Mat
00c0: 74 20 4e 65 77 6d 61 6e 20 2f 20 32 30 30 34 20  t Newman / 2004 
00d0: 53 74 61 72 66 69 73 68 20 53 79 73 74 65 6d 73  Starfish Systems
00e0: 22 3e 0a 3c 74 69 74 6c 65 3e 54 4c 53 20 28 53  ">.<title>TLS (S
00f0: 53 4c 29 20 54 63 6c 20 43 6f 6d 6d 61 6e 64 73  SL) Tcl Commands
0100: 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68 65 61 64 3e  </title>.</head>
0110: 0a 0a 3c 62 6f 64 79 20 62 67 63 6f 6c 6f 72 3d  ..<body bgcolor=
0120: 22 23 46 46 46 46 46 46 22 3e 0a 0a 3c 64 6c 3e  "#FFFFFF">..<dl>
0130: 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68 72 65 66  .    <dd><a href
0140: 3d 22 23 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61  ="#NAME">NAME</a
0150: 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c 64 64 3e  >.    <dl>..<dd>
0160: 3c 62 3e 74 6c 73 3c 2f 62 3e 20 2d 20 62 69 6e  <b>tls</b> - bin
0170: 64 69 6e 67 20 74 6f 20 3c 62 3e 4f 70 65 6e 53  ding to <b>OpenS
0180: 53 4c 3c 2f 62 3e 20 74 6f 6f 6c 6b 69 74 2e 3c  SL</b> toolkit.<
0190: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 20  /dd>.    </dl>. 
01a0: 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64     </dd>.    <dd
01b0: 3e 3c 61 20 68 72 65 66 3d 22 23 53 59 4e 4f 50  ><a href="#SYNOP
01c0: 53 49 53 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61  SIS">SYNOPSIS</a
01d0: 3e 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  > </dd>.    <dd>
01e0: 3c 64 6c 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62  <dl>..    <dd><b
01f0: 3e 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  >package require
0200: 20 54 63 6c 3c 2f 62 3e 20 3c 65 6d 3e 3f 38 2e   Tcl</b> <em>?8.
0210: 34 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20  4?</em></dd>..  
0220: 20 20 3c 64 64 3e 3c 62 3e 70 61 63 6b 61 67 65    <dd><b>package
0230: 20 72 65 71 75 69 72 65 20 74 6c 73 3c 2f 62 3e   require tls</b>
0240: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 74 3e 26  </dd>..    <dt>&
0250: 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 20 20 20 20  nbsp;</dt>..    
0260: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 69 6e 69 74  <dd><b>tls::init
0270: 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f 70 74 69 6f 6e  </b> <em>?option
0280: 73 3f 3c 2f 65 6d 3e 20 3c 2f 64 64 3e 0a 09 20  s?</em> </dd>.. 
0290: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73     <dd><b>tls::s
02a0: 6f 63 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e 3f 6f  ocket</b> <em>?o
02b0: 70 74 69 6f 6e 73 3f 20 68 6f 73 74 20 70 6f 72  ptions? host por
02c0: 74 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20  t</em></dd>..   
02d0: 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63   <dd><b>tls::soc
02e0: 6b 65 74 3c 2f 62 3e 20 3c 65 6d 3e 20 3f 2d 73  ket</b> <em> ?-s
02f0: 65 72 76 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f  erver command? ?
0300: 6f 70 74 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 65  options? port</e
0310: 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64  m></dd>..    <dd
0320: 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61  ><b>tls::handsha
0330: 6b 65 3c 2f 62 3e 20 3c 65 6d 3e 20 63 68 61 6e  ke</b> <em> chan
0340: 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20  nel</em></dd>.. 
0350: 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73     <dd><b>tls::s
0360: 74 61 74 75 73 20 3c 2f 62 3e 20 3c 65 6d 3e 3f  tatus </b> <em>?
0370: 2d 6c 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c  -local? channel<
0380: 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c  /em></dd>..    <
0390: 64 64 3e 3c 62 3e 74 6c 73 3a 3a 63 6f 6e 6e 65  dd><b>tls::conne
03a0: 63 74 69 6f 6e 20 3c 2f 62 3e 20 3c 65 6d 3e 63  ction </b> <em>c
03b0: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e  hannel</em></dd>
03c0: 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73  ..    <dd><b>tls
03d0: 3a 3a 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d  ::import</b> <em
03e0: 3e 63 68 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e  >channel ?option
03f0: 73 3f 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20  s?</em></dd>..  
0400: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 75 6e    <dd><b>tls::un
0410: 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 65 6d 3e 63  import</b> <em>c
0420: 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 64 64 3e  hannel</em></dd>
0430: 0a 09 20 20 20 20 3c 64 74 3e 26 6e 62 73 70 3b  ..    <dt>&nbsp;
0440: 3c 2f 64 74 3e 0a 09 20 20 20 20 3c 64 64 3e 3c  </dt>..    <dd><
0450: 62 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f  b>tls::ciphers</
0460: 62 3e 20 3c 65 6d 3e 3f 70 72 6f 74 6f 63 6f 6c  b> <em>?protocol
0470: 3f 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70  ? ?verbose? ?sup
0480: 70 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 64 64  ported?</em></dd
0490: 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c  >..    <dd><b>tl
04a0: 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62 3e  s::protocols</b>
04b0: 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64 3e 3c  </dd>..    <dd><
04c0: 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f  b>tls::version</
04d0: 62 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 74  b></dd>..    <dt
04e0: 3e 26 6e 62 73 70 3b 3c 2f 64 74 3e 0a 09 20 20  >&nbsp;</dt>..  
04f0: 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 64 69    <dd><b>tls::di
0500: 67 65 73 74 3c 2f 62 3e 20 3c 65 6d 3e 74 79 70  gest</b> <em>typ
0510: 65 20 64 61 74 61 3c 2f 65 6d 3e 3c 2f 64 64 3e  e data</em></dd>
0520: 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73  ..    <dd><b>tls
0530: 3a 3a 64 69 67 65 73 74 73 3c 2f 62 3e 3c 2f 64  ::digests</b></d
0540: 64 3e 0a 09 20 20 20 20 3c 64 64 3e 3c 62 3e 74  d>..    <dd><b>t
0550: 6c 73 3a 3a 6d 64 34 3c 2f 62 3e 20 3c 65 6d 3e  ls::md4</b> <em>
0560: 64 61 74 61 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09  data</em></dd>..
0570: 20 20 20 20 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a      <dd><b>tls::
0580: 6d 64 35 3c 2f 62 3e 20 3c 65 6d 3e 64 61 74 61  md5</b> <em>data
0590: 3c 2f 65 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20  </em></dd>..    
05a0: 3c 64 64 3e 3c 62 3e 74 6c 73 3a 3a 73 68 61 31  <dd><b>tls::sha1
05b0: 3c 2f 62 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65  </b> <em>data</e
05c0: 6d 3e 3c 2f 64 64 3e 0a 09 20 20 20 20 3c 64 64  m></dd>..    <dd
05d0: 3e 3c 62 3e 74 6c 73 3a 3a 73 68 61 32 35 36 3c  ><b>tls::sha256<
05e0: 2f 62 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d  /b> <em>data</em
05f0: 3e 3c 2f 64 64 3e 0a 09 3c 2f 64 6c 3e 0a 20 20  ></dd>..</dl>.  
0600: 20 20 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e    </dd>.    <dd>
0610: 3c 61 20 68 72 65 66 3d 22 23 43 4f 4d 4d 41 4e  <a href="#COMMAN
0620: 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 3c 2f 61 3e  DS">COMMANDS</a>
0630: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61  </dd>.    <dd><a
0640: 20 68 72 65 66 3d 22 23 43 41 4c 4c 42 41 43 4b   href="#CALLBACK
0650: 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c 4c 42 41   OPTIONS">CALLBA
0660: 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f  CK OPTIONS</a></
0670: 64 64 3e 0a 20 20 20 20 3c 64 64 3e 3c 61 20 68  dd>.    <dd><a h
0680: 72 65 66 3d 22 23 48 54 54 50 53 20 45 58 41 4d  ref="#HTTPS EXAM
0690: 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41 4d 50  PLE">HTTPS EXAMP
06a0: 4c 45 3c 2f 61 3e 3c 2f 64 64 3e 0a 20 20 20 20  LE</a></dd>.    
06b0: 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 53 45  <dd><a href="#SE
06c0: 45 20 41 4c 53 4f 22 3e 53 50 45 43 49 41 4c 20  E ALSO">SPECIAL 
06d0: 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e 53 3c 2f  CONSIDERATIONS</
06e0: 61 3e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 64 3e  a></dd>.    <dd>
06f0: 3c 61 20 68 72 65 66 3d 22 23 53 45 45 20 41 4c  <a href="#SEE AL
0700: 53 4f 22 3e 53 45 45 20 41 4c 53 4f 3c 2f 61 3e  SO">SEE ALSO</a>
0710: 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 0a 3c 68 72  </dd>.</dl>..<hr
0720: 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22  >..<h3><a name="
0730: 4e 41 4d 45 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f  NAME">NAME</a></
0740: 68 33 3e 0a 0a 3c 70 3e 3c 73 74 72 6f 6e 67 3e  h3>..<p><strong>
0750: 74 6c 73 3c 2f 73 74 72 6f 6e 67 3e 20 2d 20 62  tls</strong> - b
0760: 69 6e 64 69 6e 67 20 74 6f 20 3c 73 74 72 6f 6e  inding to <stron
0770: 67 3e 4f 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e  g>OpenSSL</stron
0780: 67 3e 0a 74 6f 6f 6c 6b 69 74 2e 3c 2f 70 3e 0a  g>.toolkit.</p>.
0790: 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53 59  .<h3><a name="SY
07a0: 4e 4f 50 53 49 53 22 3e 53 59 4e 4f 50 53 49 53  NOPSIS">SYNOPSIS
07b0: 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c 62  </a></h3>..<p><b
07c0: 3e 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  >package require
07d0: 20 54 63 6c 20 38 2e 35 3c 2f 62 3e 3c 62 72 3e   Tcl 8.5</b><br>
07e0: 0a 3c 62 3e 70 61 63 6b 61 67 65 20 72 65 71 75  .<b>package requ
07f0: 69 72 65 20 74 6c 73 3c 2f 62 3e 3c 62 72 3e 0a  ire tls</b><br>.
0800: 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74  <br>.<a href="#t
0810: 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e 74 6c 73  ls::init"><b>tls
0820: 3a 3a 69 6e 69 74 3c 2f 62 3e 20 3c 69 3e 3f 6f  ::init</b> <i>?o
0830: 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c  ptions?</i></a><
0840: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
0850: 73 3a 3a 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c  s::socket"><b>tl
0860: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 20 3c 69  s::socket</b> <i
0870: 3e 3f 6f 70 74 69 6f 6e 73 3f 20 68 6f 73 74 20  >?options? host 
0880: 70 6f 72 74 3c 2f 69 3e 3c 62 72 3e 0a 3c 61 20  port</i><br>.<a 
0890: 68 72 65 66 3d 22 23 74 6c 73 3a 3a 73 6f 63 6b  href="#tls::sock
08a0: 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a 73 6f 63 6b  et"><b>tls::sock
08b0: 65 74 3c 2f 62 3e 20 3c 69 3e 3f 2d 73 65 72 76  et</b> <i>?-serv
08c0: 65 72 20 63 6f 6d 6d 61 6e 64 3f 20 3f 6f 70 74  er command? ?opt
08d0: 69 6f 6e 73 3f 20 70 6f 72 74 3c 2f 69 3e 3c 2f  ions? port</i></
08e0: 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22  a><br>.<a href="
08f0: 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c 62  #tls::status"><b
0900: 3e 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f 62 3e  >tls::status</b>
0910: 20 3c 69 3e 3f 2d 6c 6f 63 61 6c 3f 20 63 68 61   <i>?-local? cha
0920: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e  nnel</i></a><br>
0930: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
0940: 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c 62 3e 74  connection"><b>t
0950: 6c 73 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 3c 2f  ls::connection</
0960: 62 3e 20 3c 69 3e 63 68 61 6e 6e 65 6c 3c 2f 69  b> <i>channel</i
0970: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65  ></a><br>.<a hre
0980: 66 3d 22 23 74 6c 73 3a 3a 68 61 6e 64 73 68 61  f="#tls::handsha
0990: 6b 65 22 3e 3c 62 3e 74 6c 73 3a 3a 68 61 6e 64  ke"><b>tls::hand
09a0: 73 68 61 6b 65 3c 2f 62 3e 20 3c 69 3e 63 68 61  shake</b> <i>cha
09b0: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e  nnel</i></a><br>
09c0: 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a  .<a href="#tls::
09d0: 69 6d 70 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a  import"><b>tls::
09e0: 69 6d 70 6f 72 74 3c 2f 62 3e 20 3c 69 3e 63 68  import</b> <i>ch
09f0: 61 6e 6e 65 6c 20 3f 6f 70 74 69 6f 6e 73 3f 3c  annel ?options?<
0a00: 2f 69 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68  /i></a><br>.<a h
0a10: 72 65 66 3d 22 23 74 6c 73 3a 3a 75 6e 69 6d 70  ref="#tls::unimp
0a20: 6f 72 74 22 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69  ort"><b>tls::uni
0a30: 6d 70 6f 72 74 3c 2f 62 3e 20 3c 69 3e 63 68 61  mport</b> <i>cha
0a40: 6e 6e 65 6c 3c 2f 69 3e 3c 2f 61 3e 3c 62 72 3e  nnel</i></a><br>
0a50: 0a 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23  .<br>.<a href="#
0a60: 74 6c 73 3a 3a 63 69 70 68 65 72 73 22 3e 3c 62  tls::ciphers"><b
0a70: 3e 74 6c 73 3a 3a 63 69 70 68 65 72 73 3c 2f 62  >tls::ciphers</b
0a80: 3e 20 3c 69 3e 3f 70 72 6f 74 6f 63 6f 6c 3f 20  > <i>?protocol? 
0a90: 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75 70 70 6f  ?verbose? ?suppo
0aa0: 72 74 65 64 3f 3c 2f 69 3e 3c 2f 61 3e 3c 62 72  rted?</i></a><br
0ab0: 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a  >.<a href="#tls:
0ac0: 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e 3c 62 3e 74  :protocols"><b>t
0ad0: 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 3c 2f 62  ls::protocols</b
0ae0: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65  ></a><br>.<a hre
0af0: 66 3d 22 23 74 6c 73 3a 3a 76 65 72 73 69 6f 6e  f="#tls::version
0b00: 22 3e 3c 62 3e 74 6c 73 3a 3a 76 65 72 73 69 6f  "><b>tls::versio
0b10: 6e 3c 2f 62 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 62  n</b></a><br>.<b
0b20: 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73  r>.<a href="#tls
0b30: 3a 3a 64 69 67 65 73 74 22 3e 3c 62 3e 74 6c 73  ::digest"><b>tls
0b40: 3a 3a 64 69 67 65 73 74 3c 2f 62 3e 20 3c 69 3e  ::digest</b> <i>
0b50: 74 79 70 65 20 64 61 74 61 3c 2f 69 3e 3c 2f 61  type data</i></a
0b60: 3e 3c 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23  ><br>.<a href="#
0b70: 74 6c 73 3a 3a 64 69 67 65 73 74 73 22 3e 3c 62  tls::digests"><b
0b80: 3e 74 6c 73 3a 3a 64 69 67 65 73 74 73 3c 2f 62  >tls::digests</b
0b90: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65  ></a><br>.<a hre
0ba0: 66 3d 22 23 74 6c 73 3a 3a 6d 64 34 22 3e 3c 62  f="#tls::md4"><b
0bb0: 3e 74 6c 73 3a 3a 6d 64 34 3c 2f 62 3e 20 3c 69  >tls::md4</b> <i
0bc0: 3e 64 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c 62 72  >data</i></a><br
0bd0: 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a  >.<a href="#tls:
0be0: 3a 6d 64 35 22 3e 3c 62 3e 74 6c 73 3a 3a 6d 64  :md5"><b>tls::md
0bf0: 35 3c 2f 62 3e 20 3c 69 3e 64 61 74 61 3c 2f 69  5</b> <i>data</i
0c00: 3e 3c 2f 61 3e 3c 62 72 3e 0a 3c 61 20 68 72 65  ></a><br>.<a hre
0c10: 66 3d 22 23 74 6c 73 3a 3a 73 68 61 31 22 3e 3c  f="#tls::sha1"><
0c20: 62 3e 74 6c 73 3a 3a 73 68 61 31 3c 2f 62 3e 20  b>tls::sha1</b> 
0c30: 3c 69 3e 64 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c  <i>data</i></a><
0c40: 62 72 3e 0a 3c 61 20 68 72 65 66 3d 22 23 74 6c  br>.<a href="#tl
0c50: 73 3a 3a 73 68 61 32 35 36 22 3e 3c 62 3e 74 6c  s::sha256"><b>tl
0c60: 73 3a 3a 73 68 61 32 35 36 3c 2f 62 3e 20 3c 69  s::sha256</b> <i
0c70: 3e 64 61 74 61 3c 2f 69 3e 3c 2f 61 3e 3c 62 72  >data</i></a><br
0c80: 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61 20 6e  >.</p>..<h3><a n
0c90: 61 6d 65 3d 22 44 45 53 43 52 49 50 54 49 4f 4e  ame="DESCRIPTION
0ca0: 22 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61  ">DESCRIPTION</a
0cb0: 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 68 69 73 20  ></h3>..<p>This 
0cc0: 65 78 74 65 6e 73 69 6f 6e 20 70 72 6f 76 69 64  extension provid
0cd0: 65 73 20 61 20 67 65 6e 65 72 69 63 20 62 69 6e  es a generic bin
0ce0: 64 69 6e 67 20 74 6f 20 3c 61 0a 68 72 65 66 3d  ding to <a.href=
0cf0: 22 68 74 74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e  "http://www.open
0d00: 73 73 6c 2e 6f 72 67 2f 22 3e 4f 70 65 6e 53 53  ssl.org/">OpenSS
0d10: 4c 3c 2f 61 3e 2c 20 75 74 69 6c 69 7a 69 6e 67  L</a>, utilizing
0d20: 20 74 68 65 0a 3c 73 74 72 6f 6e 67 3e 54 63 6c   the.<strong>Tcl
0d30: 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 3c 2f 73  _StackChannel</s
0d40: 74 72 6f 6e 67 3e 0a 41 50 49 20 66 6f 72 20 54  trong>.API for T
0d50: 63 6c 20 38 2e 34 20 61 6e 64 20 68 69 67 68 65  cl 8.4 and highe
0d60: 72 2e 20 54 68 65 20 73 6f 63 6b 65 74 73 20 62  r. The sockets b
0d70: 65 68 61 76 65 20 65 78 61 63 74 6c 79 20 74 68  ehave exactly th
0d80: 65 20 73 61 6d 65 0a 61 73 20 63 68 61 6e 6e 65  e same.as channe
0d90: 6c 73 20 63 72 65 61 74 65 64 20 75 73 69 6e 67  ls created using
0da0: 20 54 63 6c 27 73 20 62 75 69 6c 74 2d 69 6e 20   Tcl's built-in 
0db0: 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f  <strong>socket</
0dc0: 73 74 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 20  strong>.command 
0dd0: 77 69 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20  with additional 
0de0: 6f 70 74 69 6f 6e 73 20 66 6f 72 20 63 6f 6e 74  options for cont
0df0: 72 6f 6c 6c 69 6e 67 20 74 68 65 20 53 53 4c 20  rolling the SSL 
0e00: 73 65 73 73 69 6f 6e 2e 0a 3c 2f 70 3e 0a 0a 3c  session..</p>..<
0e10: 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 43 4f 4d 4d  h3><a name="COMM
0e20: 41 4e 44 53 22 3e 43 4f 4d 4d 41 4e 44 53 3c 2f  ANDS">COMMANDS</
0e30: 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54 79 70 69  a></h3>..<p>Typi
0e40: 63 61 6c 6c 79 20 6f 6e 65 20 77 6f 75 6c 64 20  cally one would 
0e50: 75 73 65 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e  use the <strong>
0e60: 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 3c 2f 73 74  tls::socket </st
0e70: 72 6f 6e 67 3e 63 6f 6d 6d 61 6e 64 0a 77 68 69  rong>command.whi
0e80: 63 68 20 70 72 6f 76 69 64 65 73 20 63 6f 6d 70  ch provides comp
0e90: 61 74 69 62 69 6c 69 74 79 20 77 69 74 68 20 74  atibility with t
0ea0: 68 65 20 6e 61 74 69 76 65 20 54 63 6c 20 3c 73  he native Tcl <s
0eb0: 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73 74  trong>socket</st
0ec0: 72 6f 6e 67 3e 0a 63 6f 6d 6d 61 6e 64 2e 20 49  rong>.command. I
0ed0: 6e 20 73 75 63 68 20 63 61 73 65 73 20 3c 73 74  n such cases <st
0ee0: 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74  rong>tls::import
0ef0: 3c 2f 73 74 72 6f 6e 67 3e 20 73 68 6f 75 6c 64  </strong> should
0f00: 20 6e 6f 74 20 62 65 0a 75 73 65 64 20 64 69 72   not be.used dir
0f10: 65 63 74 6c 79 2e 3c 2f 70 3e 0a 0a 3c 64 6c 3e  ectly.</p>..<dl>
0f20: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
0f30: 3d 22 74 6c 73 3a 3a 69 6e 69 74 22 3e 3c 62 3e  ="tls::init"><b>
0f40: 74 6c 73 3a 3a 69 6e 69 74 20 3c 2f 62 3e 3c 69  tls::init </b><i
0f50: 3e 3f 6f 70 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f  >?options?</i></
0f60: 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e  a></dt>.    <dd>
0f70: 4f 70 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f  Optional functio
0f80: 6e 20 74 6f 20 73 65 74 20 74 68 65 20 64 65 66  n to set the def
0f90: 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20 75 73 65  ault options use
0fa0: 64 20 62 79 0a 09 3c 73 74 72 6f 6e 67 3e 74 6c  d by..<strong>tl
0fb0: 73 3a 3a 73 6f 63 6b 65 74 3c 2f 73 74 72 6f 6e  s::socket</stron
0fc0: 67 3e 2e 20 49 66 20 79 6f 75 20 63 61 6c 6c 20  g>. If you call 
0fd0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70  <strong>tls::imp
0fe0: 6f 72 74 3c 2f 73 74 72 6f 6e 67 3e 0a 09 64 69  ort</strong>..di
0ff0: 72 65 63 74 6c 79 20 74 68 69 73 20 72 6f 75 74  rectly this rout
1000: 69 6e 65 20 68 61 73 20 6e 6f 20 65 66 66 65 63  ine has no effec
1010: 74 2e 20 41 6e 79 20 6f 66 20 74 68 65 20 6f 70  t. Any of the op
1020: 74 69 6f 6e 73 0a 09 74 68 61 74 20 3c 73 74 72  tions..that <str
1030: 6f 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c  ong>tls::socket<
1040: 2f 73 74 72 6f 6e 67 3e 20 61 63 63 65 70 74 73  /strong> accepts
1050: 20 63 61 6e 20 62 65 20 73 65 74 0a 09 75 73 69   can be set..usi
1060: 6e 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 2c  ng this command,
1070: 20 74 68 6f 75 67 68 20 79 6f 75 20 73 68 6f 75   though you shou
1080: 6c 64 20 6c 69 6d 69 74 20 79 6f 75 72 20 6f 70  ld limit your op
1090: 74 69 6f 6e 73 0a 09 74 6f 20 6f 6e 6c 79 20 54  tions..to only T
10a0: 4c 53 20 72 65 6c 61 74 65 64 20 6f 6e 65 73 2e  LS related ones.
10b0: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e  </dd>.    <dt>&n
10c0: 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  bsp;</dt>.    <d
10d0: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
10e0: 73 6f 63 6b 65 74 22 3e 3c 62 3e 74 6c 73 3a 3a  socket"><b>tls::
10f0: 73 6f 63 6b 65 74 20 3c 2f 62 3e 3c 65 6d 3e 3f  socket </b><em>?
1100: 6f 70 74 69 6f 6e 73 3f 0a 09 68 6f 73 74 20 70  options?..host p
1110: 6f 72 74 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74  ort</em></a></dt
1120: 3e 0a 20 20 20 20 3c 64 74 3e 3c 62 3e 74 6c 73  >.    <dt><b>tls
1130: 3a 3a 73 6f 63 6b 65 74 3c 2f 62 3e 3c 65 6d 3e  ::socket</b><em>
1140: 20 3f 2d 73 65 72 76 65 72 20 63 6f 6d 6d 61 6e   ?-server comman
1150: 64 3f 20 3f 6f 70 74 69 6f 6e 73 3f 20 70 6f 72  d? ?options? por
1160: 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20  t</em></dt>.    
1170: 3c 64 64 3e 54 68 69 73 20 69 73 20 61 20 68 65  <dd>This is a he
1180: 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e 20 74 68  lper function th
1190: 61 74 20 75 74 69 6c 69 7a 65 73 20 74 68 65 20  at utilizes the 
11a0: 75 6e 64 65 72 6c 79 69 6e 67 0a 09 63 6f 6d 6d  underlying..comm
11b0: 61 6e 64 73 20 28 3c 73 74 72 6f 6e 67 3e 74 6c  ands (<strong>tl
11c0: 73 3a 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e  s::import</stron
11d0: 67 3e 29 2e 20 49 74 20 62 65 68 61 76 65 73 0a  g>). It behaves.
11e0: 09 65 78 61 63 74 6c 79 20 74 68 65 20 73 61 6d  .exactly the sam
11f0: 65 20 61 73 20 74 68 65 20 6e 61 74 69 76 65 20  e as the native 
1200: 54 63 6c 20 3c 73 74 72 6f 6e 67 3e 73 6f 63 6b  Tcl <strong>sock
1210: 65 74 3c 2f 73 74 72 6f 6e 67 3e 0a 09 63 6f 6d  et</strong>..com
1220: 6d 61 6e 64 20 65 78 63 65 70 74 20 74 68 61 74  mand except that
1230: 20 74 68 65 20 6f 70 74 69 6f 6e 73 20 63 61 6e   the options can
1240: 20 69 6e 63 6c 75 64 65 20 61 6e 79 20 6f 66 20   include any of 
1250: 74 68 65 0a 09 61 70 70 6c 69 63 61 62 6c 65 20  the..applicable 
1260: 3c 61 20 68 72 65 66 3d 22 23 74 6c 73 3a 3a 69  <a href="#tls::i
1270: 6d 70 6f 72 74 22 3e 3c 73 74 72 6f 6e 67 3e 74  mport"><strong>t
1280: 6c 73 3a 69 6d 70 6f 72 74 3c 2f 73 74 72 6f 6e  ls:import</stron
1290: 67 3e 3c 2f 61 3e 0a 09 6f 70 74 69 6f 6e 73 20  g></a>..options 
12a0: 77 69 74 68 20 6f 6e 65 20 61 64 64 69 74 69 6f  with one additio
12b0: 6e 61 6c 20 6f 70 74 69 6f 6e 3a 0a 3c 62 6c 6f  nal option:.<blo
12c0: 63 6b 71 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c  ckquote>.    <dl
12d0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d  >..<dt><strong>-
12e0: 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 3c 2f  autoservername</
12f0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c  strong> <em>bool
1300: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e  </em></dt>..<dd>
1310: 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 73 65  Automatically se
1320: 6e 64 20 74 68 65 20 2d 73 65 72 76 65 72 6e 61  nd the -serverna
1330: 6d 65 20 61 73 20 74 68 65 20 3c 65 6d 3e 68 6f  me as the <em>ho
1340: 73 74 3c 2f 65 6d 3e 20 61 72 67 75 6d 65 6e 74  st</em> argument
1350: 0a 09 20 20 20 20 28 64 65 66 61 75 6c 74 20 69  ..    (default i
1360: 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d 3e  s <em>false</em>
1370: 29 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e  )</dd>.    </dl>
1380: 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a  .</blockquote>..
1390: 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d      <dt><a name=
13a0: 22 74 6c 73 3a 3a 69 6d 70 6f 72 74 22 3e 3c 62  "tls::import"><b
13b0: 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 20 3c 2f 62  >tls::import </b
13c0: 3e 3c 69 3e 63 68 61 6e 6e 65 6c 0a 09 3f 6f 70  ><i>channel..?op
13d0: 74 69 6f 6e 73 3f 3c 2f 69 3e 3c 2f 61 3e 3c 2f  tions?</i></a></
13e0: 64 74 3e 0a 20 20 20 20 3c 64 64 3e 53 53 4c 2d  dt>.    <dd>SSL-
13f0: 65 6e 61 62 6c 65 20 61 20 72 65 67 75 6c 61 72  enable a regular
1400: 20 54 63 6c 20 63 68 61 6e 6e 65 6c 20 2d 20 69   Tcl channel - i
1410: 74 20 6e 65 65 64 20 6e 6f 74 20 62 65 20 61 0a  t need not be a.
1420: 09 73 6f 63 6b 65 74 2c 20 62 75 74 20 6d 75 73  .socket, but mus
1430: 74 20 70 72 6f 76 69 64 65 20 62 69 2d 64 69 72  t provide bi-dir
1440: 65 63 74 69 6f 6e 61 6c 20 66 6c 6f 77 2e 20 41  ectional flow. A
1450: 6c 73 6f 0a 09 73 65 74 74 69 6e 67 20 73 65 73  lso..setting ses
1460: 73 69 6f 6e 20 70 61 72 61 6d 65 74 65 72 73 20  sion parameters 
1470: 66 6f 72 20 53 53 4c 20 68 61 6e 64 73 68 61 6b  for SSL handshak
1480: 65 2e 3c 2f 64 64 3e 0a 0a 3c 62 6c 6f 63 6b 71  e.</dd>..<blockq
1490: 75 6f 74 65 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09  uote>.    <dl>..
14a0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 61 6c 70  <dt><strong>-alp
14b0: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c  n</strong> <em>l
14c0: 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ist</em></dt>..<
14d0: 64 64 3e 4c 69 73 74 20 6f 66 20 70 72 6f 74 6f  dd>List of proto
14e0: 63 6f 6c 73 20 74 6f 20 6f 66 66 65 72 20 64 75  cols to offer du
14f0: 72 69 6e 67 20 41 70 70 6c 69 63 61 74 69 6f 6e  ring Application
1500: 2d 4c 61 79 65 72 0a 09 20 20 20 20 50 72 6f 74  -Layer..    Prot
1510: 6f 63 6f 6c 20 4e 65 67 6f 74 69 61 74 69 6f 6e  ocol Negotiation
1520: 20 28 41 4c 50 4e 29 2e 20 46 6f 72 20 65 78 61   (ALPN). For exa
1530: 6d 70 6c 65 3a 20 3c 65 6d 3e 68 32 3c 2f 65 6d  mple: <em>h2</em
1540: 3e 20 61 6e 64 0a 09 20 20 20 20 3c 65 6d 3e 68  > and..    <em>h
1550: 74 74 70 2f 31 2e 31 3c 2f 65 6d 3e 2c 20 62 75  ttp/1.1</em>, bu
1560: 74 20 6e 6f 74 20 3c 65 6d 3e 68 33 3c 2f 65 6d  t not <em>h3</em
1570: 3e 20 6f 72 20 3c 65 6d 3e 71 75 69 63 3c 2f 65  > or <em>quic</e
1580: 6d 3e 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  m>.</dd>..<dt><s
1590: 74 72 6f 6e 67 3e 2d 63 61 64 69 72 3c 2f 73 74  trong>-cadir</st
15a0: 72 6f 6e 67 3e 20 3c 65 6d 3e 64 69 72 3c 2f 65  rong> <em>dir</e
15b0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 74  m></dt>..<dd>Set
15c0: 20 74 68 65 20 43 41 20 63 65 72 74 69 66 69 63   the CA certific
15d0: 61 74 65 73 20 70 61 74 68 2e 20 54 68 65 20 64  ates path. The d
15e0: 65 66 61 75 6c 74 20 64 69 72 65 63 74 6f 72 79  efault directory
15f0: 20 69 73 20 70 6c 61 74 66 6f 72 6d 0a 09 20 20   is platform..  
1600: 20 20 73 70 65 63 69 66 69 63 20 61 6e 64 20 63    specific and c
1610: 61 6e 20 62 65 20 73 65 74 20 61 74 20 63 6f 6d  an be set at com
1620: 70 69 6c 65 20 74 69 6d 65 2e 20 54 68 69 73 20  pile time. This 
1630: 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65  can be overridde
1640: 6e 0a 09 20 20 20 20 76 69 61 20 74 68 65 20 3c  n..    via the <
1650: 62 3e 53 53 4c 5f 43 45 52 54 5f 44 49 52 3c 2f  b>SSL_CERT_DIR</
1660: 62 3e 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76  b> environment v
1670: 61 72 69 61 62 6c 65 2e 3c 2f 64 64 3e 0a 09 3c  ariable.</dd>..<
1680: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 61 66 69  dt><strong>-cafi
1690: 6c 65 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e  le </strong><em>
16a0: 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64  filename</em></d
16b0: 74 3e 0a 09 3c 64 64 3e 53 65 74 20 74 68 65 20  t>..<dd>Set the 
16c0: 63 65 72 74 69 66 69 63 61 74 65 20 61 75 74 68  certificate auth
16d0: 6f 72 69 74 79 20 28 43 41 29 20 63 65 72 74 69  ority (CA) certi
16e0: 66 69 63 61 74 65 73 20 66 69 6c 65 2e 20 54 68  ficates file. Th
16f0: 65 20 64 65 66 61 75 6c 74 0a 09 20 20 20 20 69  e default..    i
1700: 73 20 74 68 65 20 63 65 72 74 2e 70 65 6d 20 66  s the cert.pem f
1710: 69 6c 65 20 69 6e 20 74 68 65 20 4f 70 73 6e 53  ile in the OpsnS
1720: 53 4c 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68  SL directory. Th
1730: 69 73 20 63 61 6e 20 61 6c 73 6f 20 62 65 0a 09  is can also be..
1740: 20 20 20 20 6f 76 65 72 72 69 64 64 65 6e 20 76      overridden v
1750: 69 61 20 74 68 65 20 3c 62 3e 53 53 4c 5f 43 45  ia the <b>SSL_CE
1760: 52 54 5f 46 49 4c 45 3c 2f 62 3e 20 65 6e 76 69  RT_FILE</b> envi
1770: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
1780: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
1790: 6f 6e 67 3e 2d 63 65 72 74 66 69 6c 65 3c 2f 73  ong>-certfile</s
17a0: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e  trong> <em>filen
17b0: 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ame</em></dt>..<
17c0: 64 64 3e 53 70 65 63 69 66 79 20 74 68 65 20 66  dd>Specify the f
17d0: 69 6c 65 6e 61 6d 65 20 77 69 74 68 20 74 68 65  ilename with the
17e0: 20 63 65 72 74 69 66 69 63 61 74 65 20 74 6f 20   certificate to 
17f0: 75 73 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  use.</dd>..<dt><
1800: 73 74 72 6f 6e 67 3e 2d 63 65 72 74 3c 2f 73 74  strong>-cert</st
1810: 72 6f 6e 67 3e 20 3c 65 6d 3e 66 69 6c 65 6e 61  rong> <em>filena
1820: 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  me</em></dt>..<d
1830: 64 3e 53 70 65 63 69 66 79 20 74 68 65 20 63 6f  d>Specify the co
1840: 6e 74 65 6e 74 73 20 6f 66 20 61 20 63 65 72 74  ntents of a cert
1850: 69 66 69 63 61 74 65 20 74 6f 20 75 73 65 2c 20  ificate to use, 
1860: 61 73 20 61 20 44 45 52 0a 09 20 20 20 20 65 6e  as a DER..    en
1870: 63 6f 64 65 64 20 62 69 6e 61 72 79 20 76 61 6c  coded binary val
1880: 75 65 20 28 58 2e 35 30 39 20 44 45 52 29 2e 3c  ue (X.509 DER).<
1890: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
18a0: 67 3e 2d 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e  g>-cipher</stron
18b0: 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65  g> <em>string</e
18c0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73  m></dt>..<dd>Lis
18d0: 74 20 6f 66 20 63 69 70 68 65 72 73 20 74 6f 20  t of ciphers to 
18e0: 75 73 65 2e 20 53 74 72 69 6e 67 20 69 73 20 61  use. String is a
18f0: 20 63 6f 6c 6f 6e 20 28 22 3a 22 29 20 73 65 70   colon (":") sep
1900: 61 72 61 74 65 64 20 6c 69 73 74 0a 09 20 20 20  arated list..   
1910: 20 6f 66 20 63 69 70 68 65 72 73 20 6f 72 20 63   of ciphers or c
1920: 69 70 68 65 72 20 73 75 69 74 65 73 2e 20 43 69  ipher suites. Ci
1930: 70 68 65 72 20 73 75 69 74 65 73 20 63 61 6e 20  pher suites can 
1940: 62 65 20 63 6f 6d 62 69 6e 65 64 0a 09 20 20 20  be combined..   
1950: 20 75 73 69 6e 67 20 74 68 65 20 3c 62 3e 2b 3c   using the <b>+<
1960: 2f 62 3e 20 63 68 61 72 61 63 74 65 72 2e 20 50  /b> character. P
1970: 72 65 66 69 78 65 73 20 63 61 6e 20 62 65 20 75  refixes can be u
1980: 73 65 64 20 74 6f 20 70 65 72 6d 61 6e 65 6e 74  sed to permanent
1990: 6c 79 0a 09 20 20 20 20 72 65 6d 6f 76 65 20 28  ly..    remove (
19a0: 22 21 22 29 2c 20 64 65 6c 65 74 65 20 28 22 2d  "!"), delete ("-
19b0: 22 29 2c 20 6f 72 20 6d 6f 76 65 20 61 20 63 79  "), or move a cy
19c0: 70 68 65 72 20 74 6f 20 74 68 65 20 65 6e 64 20  pher to the end 
19d0: 6f 66 0a 09 20 20 20 20 74 68 65 20 6c 69 73 74  of..    the list
19e0: 20 28 22 2b 22 29 2e 20 4b 65 79 77 6f 72 64 73   ("+"). Keywords
19f0: 20 3c 62 3e 40 53 54 52 45 4e 47 54 48 3c 2f 62   <b>@STRENGTH</b
1a00: 3e 20 28 73 6f 72 74 20 62 79 20 61 6c 67 6f 72  > (sort by algor
1a10: 69 74 68 6d 0a 09 20 20 20 20 6b 65 79 20 6c 65  ithm..    key le
1a20: 6e 67 74 68 29 2c 20 3c 62 3e 40 53 45 43 4c 45  ngth), <b>@SECLE
1a30: 56 45 4c 3d 3c 2f 62 3e 3c 69 3e 6e 3c 2f 69 3e  VEL=</b><i>n</i>
1a40: 20 28 73 65 74 20 73 65 63 75 72 69 74 79 20 6c   (set security l
1a50: 65 76 65 6c 20 74 6f 0a 09 20 20 20 20 6e 29 2c  evel to..    n),
1a60: 20 61 6e 64 20 3c 62 3e 44 45 46 41 55 4c 54 3c   and <b>DEFAULT<
1a70: 2f 62 3e 20 28 75 73 65 20 64 65 66 61 75 6c 74  /b> (use default
1a80: 20 63 69 70 68 65 72 20 6c 69 73 74 2c 20 61 74   cipher list, at
1a90: 20 73 74 61 72 74 20 6f 6e 6c 79 29 0a 09 20 20   start only)..  
1aa0: 20 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 73 70    can also be sp
1ab0: 65 63 69 66 69 65 64 2e 20 53 65 65 20 4f 70 65  ecified. See Ope
1ac0: 6e 53 53 4c 20 64 6f 63 75 6d 65 6e 74 61 74 69  nSSL documentati
1ad0: 6f 6e 20 66 6f 72 20 74 68 65 20 66 75 6c 6c 0a  on for the full.
1ae0: 09 20 20 20 20 6c 69 73 74 20 6f 66 20 76 61 6c  .    list of val
1af0: 69 64 20 76 61 6c 75 65 73 2e 20 28 54 4c 53 20  id values. (TLS 
1b00: 31 2e 32 20 61 6e 64 20 65 61 72 6c 69 65 72 20  1.2 and earlier 
1b10: 6f 6e 6c 79 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e  only)</dd>..<dt>
1b20: 3c 73 74 72 6f 6e 67 3e 2d 63 69 70 68 65 72 73  <strong>-ciphers
1b30: 75 69 74 65 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c  uites</strong> <
1b40: 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f  em>string</em></
1b50: 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66  dt>..<dd>List of
1b60: 20 63 69 70 68 65 72 20 73 75 69 74 65 73 20 74   cipher suites t
1b70: 6f 20 75 73 65 2e 20 53 74 72 69 6e 67 20 69 73  o use. String is
1b80: 20 61 20 63 6f 6c 6f 6e 20 28 22 3a 22 29 0a 09   a colon (":")..
1b90: 20 20 20 20 73 65 70 61 72 61 74 65 64 20 6c 69      separated li
1ba0: 73 74 20 6f 66 20 63 69 70 68 65 72 20 73 75 69  st of cipher sui
1bb0: 74 65 20 6e 61 6d 65 73 2e 20 28 54 4c 53 20 31  te names. (TLS 1
1bc0: 2e 33 20 6f 6e 6c 79 29 3c 2f 64 64 3e 0a 09 3c  .3 only)</dd>..<
1bd0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d  dt><strong>-comm
1be0: 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  and</strong> <em
1bf0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 3c 2f  >callback</em></
1c00: 64 74 3e 0a 09 3c 64 64 3e 43 61 6c 6c 62 61 63  dt>..<dd>Callbac
1c10: 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 61 74 20 73  k to invoke at s
1c20: 65 76 65 72 61 6c 20 70 6f 69 6e 74 73 20 64 75  everal points du
1c30: 72 69 6e 67 20 74 68 65 20 68 61 6e 64 73 68 61  ring the handsha
1c40: 6b 65 2e 0a 09 20 20 20 20 54 68 69 73 20 69 73  ke...    This is
1c50: 20 75 73 65 64 20 74 6f 20 70 61 73 73 20 65 72   used to pass er
1c60: 72 6f 72 73 20 61 6e 64 20 74 72 61 63 69 6e 67  rors and tracing
1c70: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e   information, an
1c80: 64 0a 09 20 20 20 20 69 74 20 63 61 6e 20 61 6c  d..    it can al
1c90: 6c 6f 77 20 54 63 6c 20 73 63 72 69 70 74 73 20  low Tcl scripts 
1ca0: 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 69 72  to perform their
1cb0: 20 6f 77 6e 20 63 65 72 74 69 66 69 63 61 74 65   own certificate
1cc0: 0a 09 20 20 20 20 76 61 6c 69 64 61 74 69 6f 6e  ..    validation
1cd0: 20 69 6e 20 70 6c 61 63 65 20 6f 66 20 74 68 65   in place of the
1ce0: 20 64 65 66 61 75 6c 74 20 76 61 6c 69 64 61 74   default validat
1cf0: 69 6f 6e 20 70 72 6f 76 69 64 65 64 20 62 79 0a  ion provided by.
1d00: 09 20 20 20 20 4f 70 65 6e 53 53 4c 2e 20 53 65  .    OpenSSL. Se
1d10: 65 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c  e <a href="#CALL
1d20: 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41  BACK OPTIONS">CA
1d30: 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f  LLBACK OPTIONS</
1d40: 61 3e 0a 09 20 20 20 20 66 6f 72 20 66 75 72 74  a>..    for furt
1d50: 68 65 72 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c  her discussion.<
1d60: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
1d70: 67 3e 2d 64 68 70 61 72 61 6d 73 20 3c 2f 73 74  g>-dhparams </st
1d80: 72 6f 6e 67 3e 3c 65 6d 3e 66 69 6c 65 6e 61 6d  rong><em>filenam
1d90: 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  e</em></dt>..<dd
1da0: 3e 53 70 65 63 69 66 79 20 74 68 65 20 44 69 66  >Specify the Dif
1db0: 66 69 65 2d 48 65 6c 6c 6d 61 6e 20 70 61 72 61  fie-Hellman para
1dc0: 6d 65 74 65 72 73 20 66 69 6c 65 2e 3c 2f 64 64  meters file.</dd
1dd0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d  >..<dt><strong>-
1de0: 6b 65 79 66 69 6c 65 3c 2f 73 74 72 6f 6e 67 3e  keyfile</strong>
1df0: 20 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65   <em>filename</e
1e00: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65  m></dt>..<dd>Spe
1e10: 63 69 66 79 20 74 68 65 20 70 72 69 76 61 74 65  cify the private
1e20: 20 6b 65 79 20 66 69 6c 65 2e 20 28 64 65 66 61   key file. (defa
1e30: 75 6c 74 20 69 73 0a 09 20 20 20 20 76 61 6c 75  ult is..    valu
1e40: 65 20 6f 66 20 2d 63 65 72 74 66 69 6c 65 29 3c  e of -certfile)<
1e50: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
1e60: 67 3e 2d 6b 65 79 3c 2f 73 74 72 6f 6e 67 3e 20  g>-key</strong> 
1e70: 3c 65 6d 3e 66 69 6c 65 6e 61 6d 65 3c 2f 65 6d  <em>filename</em
1e80: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63  ></dt>..<dd>Spec
1e90: 69 66 79 20 74 68 65 20 70 72 69 76 61 74 65 20  ify the private 
1ea0: 6b 65 79 20 74 6f 20 75 73 65 20 61 73 20 61 20  key to use as a 
1eb0: 44 45 52 20 65 6e 63 6f 64 65 64 20 76 61 6c 75  DER encoded valu
1ec0: 65 20 28 50 4b 43 53 23 31 20 44 45 52 29 3c 2f  e (PKCS#1 DER)</
1ed0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
1ee0: 3e 2d 6d 6f 64 65 6c 3c 2f 73 74 72 6f 6e 67 3e  >-model</strong>
1ef0: 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65 6d   <em>channel</em
1f00: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 46 6f 72 63  ></dt>..<dd>Forc
1f10: 65 20 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 74  e this channel t
1f20: 6f 20 73 68 61 72 65 20 74 68 65 20 73 61 6d 65  o share the same
1f30: 20 3c 65 6d 3e 3c 73 74 72 6f 6e 67 3e 53 53 4c   <em><strong>SSL
1f40: 5f 43 54 58 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 65  _CTX</strong></e
1f50: 6d 3e 0a 09 20 20 20 20 73 74 72 75 63 74 75 72  m>..    structur
1f60: 65 20 61 73 20 74 68 65 20 73 70 65 63 69 66 69  e as the specifi
1f70: 65 64 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f  ed <em>channel</
1f80: 65 6d 3e 2c 20 61 6e 64 0a 09 20 20 20 20 74 68  em>, and..    th
1f90: 65 72 65 66 6f 72 65 20 73 68 61 72 65 20 63 61  erefore share ca
1fa0: 6c 6c 62 61 63 6b 73 20 65 74 63 2e 3c 2f 64 64  llbacks etc.</dd
1fb0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d  >..<dt><strong>-
1fc0: 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67  password</strong
1fd0: 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f  > <em>callback</
1fe0: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 61  em></dt>..<dd>Ca
1ff0: 6c 6c 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65  llback to invoke
2000: 20 77 68 65 6e 20 4f 70 65 6e 53 53 4c 20 6e 65   when OpenSSL ne
2010: 65 64 73 20 74 6f 20 6f 62 74 61 69 6e 20 61 20  eds to obtain a 
2020: 70 61 73 73 77 6f 72 64 2c 0a 09 20 20 20 20 74  password,..    t
2030: 79 70 69 63 61 6c 6c 79 20 74 6f 20 75 6e 6c 6f  ypically to unlo
2040: 63 6b 20 74 68 65 20 70 72 69 76 61 74 65 20 6b  ck the private k
2050: 65 79 20 6f 66 20 61 20 63 65 72 74 69 66 69 63  ey of a certific
2060: 61 74 65 2e 20 54 68 65 0a 09 20 20 20 20 63 61  ate. The..    ca
2070: 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 72 65  llback should re
2080: 74 75 72 6e 20 61 20 73 74 72 69 6e 67 20 77 68  turn a string wh
2090: 69 63 68 20 72 65 70 72 65 73 65 6e 74 73 20 74  ich represents t
20a0: 68 65 20 70 61 73 73 77 6f 72 64 0a 09 20 20 20  he password..   
20b0: 20 74 6f 20 62 65 20 75 73 65 64 2e 20 53 65 65   to be used. See
20c0: 20 3c 61 20 68 72 65 66 3d 22 23 43 41 4c 4c 42   <a href="#CALLB
20d0: 41 43 4b 20 4f 50 54 49 4f 4e 53 22 3e 43 41 4c  ACK OPTIONS">CAL
20e0: 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 3c 2f 61  LBACK OPTIONS</a
20f0: 3e 0a 09 20 20 20 20 66 6f 72 20 66 75 72 74 68  >..    for furth
2100: 65 72 20 64 69 73 63 75 73 73 69 6f 6e 2e 3c 2f  er discussion.</
2110: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
2120: 3e 2d 70 6f 73 74 5f 68 61 6e 64 73 68 61 6b 65  >-post_handshake
2130: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
2140: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ol</em></dt>..<d
2150: 64 3e 41 6c 6c 6f 77 20 70 6f 73 74 2d 68 61 6e  d>Allow post-han
2160: 64 73 68 61 6b 65 20 74 69 63 6b 65 74 20 75 70  dshake ticket up
2170: 64 61 74 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74  dates.</dd>..<dt
2180: 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75 65 73  ><strong>-reques
2190: 74 20 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62  t </strong><em>b
21a0: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ool</em></dt>..<
21b0: 64 64 3e 52 65 71 75 65 73 74 20 61 20 63 65 72  dd>Request a cer
21c0: 74 69 66 69 63 61 74 65 20 66 72 6f 6d 20 70 65  tificate from pe
21d0: 65 72 20 64 75 72 69 6e 67 20 53 53 4c 20 68 61  er during SSL ha
21e0: 6e 64 73 68 61 6b 65 2e 0a 09 20 20 20 20 28 64  ndshake...    (d
21f0: 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72  efault is <em>tr
2200: 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c  ue</em>)</dd>..<
2210: 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75  dt><strong>-requ
2220: 69 72 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ire</strong> <em
2230: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
2240: 09 3c 64 64 3e 52 65 71 75 69 72 65 20 61 20 76  .<dd>Require a v
2250: 61 6c 69 64 20 63 65 72 74 69 66 69 63 61 74 65  alid certificate
2260: 20 66 72 6f 6d 20 70 65 65 72 20 64 75 72 69 6e   from peer durin
2270: 67 20 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 2e  g SSL handshake.
2280: 0a 09 20 20 20 20 49 66 20 74 68 69 73 20 69 73  ..    If this is
2290: 20 73 65 74 20 74 6f 20 74 72 75 65 2c 20 74 68   set to true, th
22a0: 65 6e 20 3c 73 74 72 6f 6e 67 3e 2d 72 65 71 75  en <strong>-requ
22b0: 65 73 74 3c 2f 73 74 72 6f 6e 67 3e 20 6d 75 73  est</strong> mus
22c0: 74 0a 09 20 20 20 20 61 6c 73 6f 20 62 65 20 73  t..    also be s
22d0: 65 74 20 74 6f 20 74 72 75 65 2e 20 28 64 65 66  et to true. (def
22e0: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73  ault is <em>fals
22f0: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64  e</em>)</dd>..<d
2300: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 63 75 72  t><strong>-secur
2310: 69 74 79 6c 65 76 65 6c 3c 2f 73 74 72 6f 6e 67  itylevel</strong
2320: 3e 20 3c 65 6d 3e 69 6e 74 65 67 65 72 3c 2f 65  > <em>integer</e
2330: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53 65 74  m></dt>..<dd>Set
2340: 20 73 65 63 75 72 69 74 79 20 6c 65 76 65 6c 2e   security level.
2350: 20 4d 75 73 74 20 62 65 20 30 20 74 6f 20 35 2e   Must be 0 to 5.
2360: 20 54 68 65 20 73 65 63 75 72 69 74 79 20 6c 65   The security le
2370: 76 65 6c 20 61 66 66 65 63 74 73 0a 09 20 20 20  vel affects..   
2380: 20 63 69 70 68 65 72 20 73 75 69 74 65 20 65 6e   cipher suite en
2390: 63 72 79 70 74 69 6f 6e 20 61 6c 67 6f 72 69 74  cryption algorit
23a0: 68 6d 73 2c 20 73 75 70 70 6f 72 74 65 64 20 45  hms, supported E
23b0: 43 43 20 63 75 72 76 65 73 2c 0a 09 20 20 20 20  CC curves,..    
23c0: 73 75 70 70 6f 72 74 65 64 20 73 69 67 6e 61 74  supported signat
23d0: 75 72 65 20 61 6c 67 6f 72 69 74 68 6d 73 2c 20  ure algorithms, 
23e0: 44 48 20 70 61 72 61 6d 65 74 65 72 20 73 69 7a  DH parameter siz
23f0: 65 73 2c 20 63 65 72 74 69 66 69 63 61 74 65 0a  es, certificate.
2400: 09 20 20 20 20 6b 65 79 20 73 69 7a 65 73 20 61  .    key sizes a
2410: 6e 64 20 73 69 67 6e 61 74 75 72 65 20 61 6c 67  nd signature alg
2420: 6f 72 69 74 68 6d 73 2e 20 54 68 65 20 64 65 66  orithms. The def
2430: 61 75 6c 74 20 69 73 20 31 2e 0a 09 20 20 20 20  ault is 1...    
2440: 4c 65 76 65 6c 20 33 20 61 6e 64 20 68 69 67 68  Level 3 and high
2450: 65 72 20 64 69 73 61 62 6c 65 20 73 75 70 70 6f  er disable suppo
2460: 72 74 20 66 6f 72 20 73 65 73 73 69 6f 6e 20 74  rt for session t
2470: 69 63 6b 65 74 73 20 61 6e 64 20 6f 6e 6c 79 0a  ickets and only.
2480: 09 20 20 20 20 61 63 63 65 70 74 20 63 69 70 68  .    accept ciph
2490: 65 72 20 73 75 69 74 65 73 20 74 68 61 74 20 70  er suites that p
24a0: 72 6f 76 69 64 65 20 66 6f 72 77 61 72 64 20 73  rovide forward s
24b0: 65 63 72 65 63 79 2e 3c 2f 64 64 3e 0a 09 3c 64  ecrecy.</dd>..<d
24c0: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65 72 76 65  t><strong>-serve
24d0: 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62  r</strong> <em>b
24e0: 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ool</em></dt>..<
24f0: 64 64 3e 48 61 6e 64 73 68 61 6b 65 20 61 73 20  dd>Handshake as 
2500: 73 65 72 76 65 72 20 69 66 20 74 72 75 65 2c 20  server if true, 
2510: 65 6c 73 65 20 68 61 6e 64 73 68 61 6b 65 20 61  else handshake a
2520: 73 0a 09 20 20 20 20 63 6c 69 65 6e 74 2e 20 28  s..    client. (
2530: 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66  default is <em>f
2540: 61 6c 73 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a  alse</em>)</dd>.
2550: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 65  .<dt><strong>-se
2560: 72 76 65 72 6e 61 6d 65 3c 2f 73 74 72 6f 6e 67  rvername</strong
2570: 3e 20 3c 65 6d 3e 68 6f 73 74 3c 2f 65 6d 3e 3c  > <em>host</em><
2580: 2f 64 74 3e 0a 09 3c 64 64 3e 53 70 65 63 69 66  /dt>..<dd>Specif
2590: 79 20 73 65 72 76 65 72 20 68 6f 73 74 6e 61 6d  y server hostnam
25a0: 65 2e 20 4f 6e 6c 79 20 61 76 61 69 6c 61 62 6c  e. Only availabl
25b0: 65 20 69 66 20 74 68 65 20 4f 70 65 6e 53 53 4c  e if the OpenSSL
25c0: 20 6c 69 62 72 61 72 79 0a 09 20 20 20 20 74 68   library..    th
25d0: 65 20 70 61 63 6b 61 67 65 20 69 73 20 6c 69 6e  e package is lin
25e0: 6b 65 64 20 61 67 61 69 6e 73 74 20 73 75 70 70  ked against supp
25f0: 6f 72 74 73 20 74 68 65 20 54 4c 53 20 68 6f 73  orts the TLS hos
2600: 74 6e 61 6d 65 20 65 78 74 65 6e 73 69 6f 6e 0a  tname extension.
2610: 09 20 20 20 20 66 6f 72 20 27 53 65 72 76 65 72  .    for 'Server
2620: 20 4e 61 6d 65 20 49 6e 64 69 63 61 74 69 6f 6e   Name Indication
2630: 27 20 28 53 4e 49 29 2e 20 55 73 65 20 74 6f 20  ' (SNI). Use to 
2640: 6e 61 6d 65 20 74 68 65 20 6c 6f 67 69 63 61 6c  name the logical
2650: 20 68 6f 73 74 0a 09 20 20 20 20 77 65 20 61 72   host..    we ar
2660: 65 20 74 61 6c 6b 69 6e 67 20 74 6f 20 61 6e 64  e talking to and
2670: 20 65 78 70 65 63 74 69 6e 67 20 61 20 63 65 72   expecting a cer
2680: 74 69 66 69 63 61 74 65 20 66 6f 72 2e 3c 2f 64  tificate for.</d
2690: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
26a0: 2d 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74 72  -session_id</str
26b0: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
26c0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 53  /em></dt>..<dd>S
26d0: 65 73 73 69 6f 6e 20 69 64 20 74 6f 20 72 65 73  ession id to res
26e0: 75 6d 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64  ume session.</dd
26f0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d  >..<dt><strong>-
2700: 73 73 6c 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  ssl2</strong> <e
2710: 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e  m>bool</em></dt>
2720: 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65  ..<dd>Enable use
2730: 20 6f 66 20 53 53 4c 20 76 32 2e 20 28 64 65 66   of SSL v2. (def
2740: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 66 61 6c 73  ault is <em>fals
2750: 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64  e</em>)</dd>..<d
2760: 74 3e 3c 73 74 72 6f 6e 67 3e 2d 73 73 6c 33 20  t><strong>-ssl3 
2770: 3c 2f 73 74 72 6f 6e 67 3e 3c 65 6d 3e 62 6f 6f  </strong><em>boo
2780: 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  l</em></dt>..<dd
2790: 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20 53  >Enable use of S
27a0: 53 4c 20 76 33 2e 20 28 64 65 66 61 75 6c 74 20  SL v3. (default 
27b0: 69 73 20 3c 65 6d 3e 66 61 6c 73 65 3c 2f 65 6d  is <em>false</em
27c0: 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 2d 3c 73  >)</dd>..<dt>-<s
27d0: 74 72 6f 6e 67 3e 74 6c 73 31 3c 2f 73 74 72 6f  trong>tls1</stro
27e0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d  ng> <em>bool</em
27f0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 6e 61 62  ></dt>..<dd>Enab
2800: 6c 65 20 75 73 65 20 6f 66 20 54 4c 53 20 76 31  le use of TLS v1
2810: 2e 20 28 64 65 66 61 75 6c 74 20 69 73 20 3c 65  . (default is <e
2820: 6d 3e 74 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64  m>true</em>)</dd
2830: 3e 0a 09 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e  >..<dt>-<strong>
2840: 74 6c 73 31 2e 31 3c 2f 73 74 72 6f 6e 67 3e 20  tls1.1</strong> 
2850: 3c 65 6d 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64  <em>bool</em></d
2860: 74 3e 0a 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75  t>..<dd>Enable u
2870: 73 65 20 6f 66 20 54 4c 53 20 76 31 2e 31 20 28  se of TLS v1.1 (
2880: 64 65 66 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74  default is <em>t
2890: 72 75 65 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09  rue</em>)</dd>..
28a0: 3c 64 74 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73  <dt>-<strong>tls
28b0: 31 2e 32 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  1.2</strong> <em
28c0: 3e 62 6f 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  >bool</em></dt>.
28d0: 09 3c 64 64 3e 45 6e 61 62 6c 65 20 75 73 65 20  .<dd>Enable use 
28e0: 6f 66 20 54 4c 53 20 76 31 2e 32 20 28 64 65 66  of TLS v1.2 (def
28f0: 61 75 6c 74 20 69 73 20 3c 65 6d 3e 74 72 75 65  ault is <em>true
2900: 3c 2f 65 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74  </em>)</dd>..<dt
2910: 3e 2d 3c 73 74 72 6f 6e 67 3e 74 6c 73 31 2e 33  >-<strong>tls1.3
2920: 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f  </strong> <em>bo
2930: 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ol</em></dt>..<d
2940: 64 3e 45 6e 61 62 6c 65 20 75 73 65 20 6f 66 20  d>Enable use of 
2950: 54 4c 53 20 76 31 2e 33 20 28 64 65 66 61 75 6c  TLS v1.3 (defaul
2960: 74 20 69 73 20 3c 65 6d 3e 74 72 75 65 3c 2f 65  t is <em>true</e
2970: 6d 3e 29 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  m>)</dd>..<dt><s
2980: 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 63  trong>-validatec
2990: 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20  ommand</strong> 
29a0: 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d  <em>callback</em
29b0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 61 6c 6c  ></dt>..<dd>Call
29c0: 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 74  back to invoke t
29d0: 6f 20 76 65 72 69 66 79 20 6f 72 20 76 61 6c 69  o verify or vali
29e0: 64 61 74 65 20 70 72 6f 74 6f 63 6f 6c 20 63 6f  date protocol co
29f0: 6e 66 69 67 0a 09 20 20 20 20 70 61 72 61 6d 65  nfig..    parame
2a00: 74 65 72 73 20 64 75 72 69 6e 67 20 74 68 65 20  ters during the 
2a10: 70 72 6f 74 6f 63 6f 6c 20 6e 65 67 6f 74 69 61  protocol negotia
2a20: 74 69 6f 6e 20 70 68 61 73 65 2e 20 53 65 65 0a  tion phase. See.
2a30: 09 20 20 20 20 3c 61 20 68 72 65 66 3d 22 23 43  .    <a href="#C
2a40: 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e 53 22  ALLBACK OPTIONS"
2a50: 3e 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49 4f 4e  >CALLBACK OPTION
2a60: 53 3c 2f 61 3e 0a 09 20 20 20 20 66 6f 72 20 66  S</a>..    for f
2a70: 75 72 74 68 65 72 20 64 69 73 63 75 73 73 69 6f  urther discussio
2a80: 6e 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c  n.</dd>.    </dl
2a90: 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a  >.</blockquote>.
2aa0: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
2ab0: 3d 22 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72 74 22  ="tls::unimport"
2ac0: 3e 3c 62 3e 74 6c 73 3a 3a 75 6e 69 6d 70 6f 72  ><b>tls::unimpor
2ad0: 74 20 3c 2f 62 3e 3c 69 3e 63 68 61 6e 6e 65 6c  t </b><i>channel
2ae0: 3c 2f 69 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20  </i></a></dt>.  
2af0: 20 20 3c 64 64 3e 50 72 6f 76 69 64 65 64 20 66    <dd>Provided f
2b00: 6f 72 20 73 79 6d 6d 65 74 72 79 20 74 6f 20 3c  or symmetry to <
2b10: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f  strong>tls::impo
2b20: 72 74 3c 2f 73 74 72 6f 6e 67 3e 2c 20 74 68 69  rt</strong>, thi
2b30: 73 0a 20 20 20 20 20 20 75 6e 73 74 61 63 6b 73  s.      unstacks
2b40: 20 74 68 65 20 53 53 4c 2d 65 6e 61 62 6c 69 6e   the SSL-enablin
2b50: 67 20 6f 66 20 61 20 72 65 67 75 6c 61 72 20 54  g of a regular T
2b60: 63 6c 20 63 68 61 6e 6e 65 6c 2e 20 20 41 6e 20  cl channel.  An 
2b70: 65 72 72 6f 72 0a 20 20 20 20 20 20 69 73 20 74  error.      is t
2b80: 68 72 6f 77 6e 20 69 66 20 54 4c 53 20 69 73 20  hrown if TLS is 
2b90: 6e 6f 74 20 74 68 65 20 74 6f 70 20 73 74 61 63  not the top stac
2ba0: 6b 65 64 20 63 68 61 6e 6e 65 6c 20 74 79 70 65  ked channel type
2bb0: 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26  .</dd>.    <dt>&
2bc0: 6e 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c  nbsp;</dt>.    <
2bd0: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
2be0: 3a 68 61 6e 64 73 68 61 6b 65 22 3e 3c 73 74 72  :handshake"><str
2bf0: 6f 6e 67 3e 74 6c 73 3a 3a 68 61 6e 64 73 68 61  ong>tls::handsha
2c00: 6b 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  ke</strong> <em>
2c10: 63 68 61 6e 6e 65 6c 3c 2f 65 6d 3e 3c 2f 61 3e  channel</em></a>
2c20: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 46 6f  </dt>.    <dd>Fo
2c30: 72 63 65 73 20 68 61 6e 64 73 68 61 6b 65 20 74  rces handshake t
2c40: 6f 20 74 61 6b 65 20 70 6c 61 63 65 2c 20 61 6e  o take place, an
2c50: 64 20 72 65 74 75 72 6e 73 20 30 20 69 66 0a 09  d returns 0 if..
2c60: 68 61 6e 64 73 68 61 6b 65 20 69 73 20 73 74 69  handshake is sti
2c70: 6c 6c 20 69 6e 20 70 72 6f 67 72 65 73 73 20 28  ll in progress (
2c80: 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 29 2c 20 6f  non-blocking), o
2c90: 72 20 31 20 69 66 0a 09 74 68 65 20 68 61 6e 64  r 1 if..the hand
2ca0: 73 68 61 6b 65 20 77 61 73 20 73 75 63 63 65 73  shake was succes
2cb0: 73 66 75 6c 2e 20 49 66 20 74 68 65 20 68 61 6e  sful. If the han
2cc0: 64 73 68 61 6b 65 20 66 61 69 6c 65 64 0a 09 74  dshake failed..t
2cd0: 68 69 73 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c  his routine will
2ce0: 20 74 68 72 6f 77 20 61 6e 20 65 72 72 6f 72 2e   throw an error.
2cf0: 3c 2f 64 64 3e 0a 20 20 20 20 3c 64 74 3e 26 6e  </dd>.    <dt>&n
2d00: 62 73 70 3b 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  bsp;</dt>.    <d
2d10: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
2d20: 73 74 61 74 75 73 22 3e 3c 73 74 72 6f 6e 67 3e  status"><strong>
2d30: 74 6c 73 3a 3a 73 74 61 74 75 73 3c 2f 73 74 72  tls::status</str
2d40: 6f 6e 67 3e 0a 20 20 20 20 3c 65 6d 3e 3f 2d 6c  ong>.    <em>?-l
2d50: 6f 63 61 6c 3f 20 63 68 61 6e 6e 65 6c 3c 2f 65  ocal? channel</e
2d60: 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  m></a></dt>.    
2d70: 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20  <dd>Returns the 
2d80: 63 75 72 72 65 6e 74 20 73 74 61 74 75 73 20 6f  current status o
2d90: 66 20 74 68 65 20 63 65 72 74 69 66 69 63 61 74  f the certificat
2da0: 65 20 66 6f 72 20 61 6e 20 53 53 4c 0a 09 63 68  e for an SSL..ch
2db0: 61 6e 6e 65 6c 2e 20 54 68 65 20 72 65 73 75 6c  annel. The resul
2dc0: 74 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 6b  t is a list of k
2dd0: 65 79 2d 76 61 6c 75 65 20 70 61 69 72 73 20 64  ey-value pairs d
2de0: 65 73 63 72 69 62 69 6e 67 0a 09 74 68 65 20 63  escribing..the c
2df0: 65 72 74 69 66 69 63 61 74 65 2e 20 49 66 20 74  ertificate. If t
2e00: 68 65 20 72 65 73 75 6c 74 20 69 73 20 61 6e 20  he result is an 
2e10: 65 6d 70 74 79 20 6c 69 73 74 20 74 68 65 6e 20  empty list then 
2e20: 74 68 65 0a 09 53 53 4c 20 68 61 6e 64 73 68 61  the..SSL handsha
2e30: 6b 65 20 68 61 73 20 6e 6f 74 20 79 65 74 20 63  ke has not yet c
2e40: 6f 6d 70 6c 65 74 65 64 2e 20 49 66 20 3c 65 6d  ompleted. If <em
2e50: 3e 2d 6c 6f 63 61 6c 3c 2f 65 6d 3e 20 69 73 0a  >-local</em> is.
2e60: 09 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e  .specified, then
2e70: 20 74 68 65 20 6c 6f 63 61 6c 20 63 65 72 74 69   the local certi
2e80: 66 69 63 61 74 65 20 69 73 20 75 73 65 64 2e 3c  ficate is used.<
2e90: 2f 64 64 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65  /dd>.<blockquote
2ea0: 3e 0a 09 3c 62 3e 53 53 4c 20 53 74 61 74 75 73  >..<b>SSL Status
2eb0: 3c 2f 62 3e 0a 20 20 20 20 3c 64 6c 3e 0a 09 3c  </b>.    <dl>..<
2ec0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 61 6c 70 6e 3c  dt><strong>alpn<
2ed0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 70 72 6f  /strong> <em>pro
2ee0: 74 6f 63 6f 6c 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  tocol</em></dt>.
2ef0: 09 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f  .<dd>The protoco
2f00: 6c 20 73 65 6c 65 63 74 65 64 20 61 66 74 65 72  l selected after
2f10: 20 41 70 70 6c 69 63 61 74 69 6f 6e 2d 4c 61 79   Application-Lay
2f20: 65 72 20 50 72 6f 74 6f 63 6f 6c 0a 09 20 20 20  er Protocol..   
2f30: 20 4e 65 67 6f 74 69 61 74 69 6f 6e 20 28 41 4c   Negotiation (AL
2f40: 50 4e 29 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  PN).</dd>..<dt><
2f50: 73 74 72 6f 6e 67 3e 63 69 70 68 65 72 3c 2f 73  strong>cipher</s
2f60: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 69 70 68 65  trong> <em>ciphe
2f70: 72 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  r</em></dt>..<dd
2f80: 3e 54 68 65 20 63 75 72 72 65 6e 74 20 63 69 70  >The current cip
2f90: 68 65 72 20 69 6e 20 75 73 65 20 62 65 74 77 65  her in use betwe
2fa0: 65 6e 20 74 68 65 20 63 6c 69 65 6e 74 20 61 6e  en the client an
2fb0: 64 0a 09 20 20 20 20 73 65 72 76 65 72 20 63 68  d..    server ch
2fc0: 61 6e 6e 65 6c 73 2e 3c 2f 64 64 3e 0a 09 3c 64  annels.</dd>..<d
2fd0: 74 3e 3c 73 74 72 6f 6e 67 3e 70 65 65 72 6e 61  t><strong>peerna
2fe0: 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  me</strong> <em>
2ff0: 6e 61 6d 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  name</em></dt>..
3000: 3c 64 64 3e 54 68 65 20 70 65 65 72 6e 61 6d 65  <dd>The peername
3010: 20 66 72 6f 6d 20 74 68 65 20 63 65 72 74 69 66   from the certif
3020: 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74  icate.</dd>..<dt
3030: 3e 3c 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f  ><strong>protoco
3040: 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76  l</strong> <em>v
3050: 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e  ersion</em></dt>
3060: 0a 09 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f 63  ..<dd>The protoc
3070: 6f 6c 20 76 65 72 73 69 6f 6e 20 75 73 65 64 20  ol version used 
3080: 66 6f 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69  for the connecti
3090: 6f 6e 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20 53  on:..    SSL2, S
30a0: 53 4c 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 2e  SL3, TLS1, TLS1.
30b0: 31 2c 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31 2e  1, TLS1.2, TLS1.
30c0: 33 2c 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f  3, or unknown.</
30d0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
30e0: 3e 73 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20  >sbits</strong> 
30f0: 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  <em>n</em></dt>.
3100: 09 3c 64 64 3e 54 68 65 20 6e 75 6d 62 65 72 20  .<dd>The number 
3110: 6f 66 20 62 69 74 73 20 75 73 65 64 20 66 6f 72  of bits used for
3120: 20 74 68 65 20 73 65 73 73 69 6f 6e 20 6b 65 79   the session key
3130: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
3140: 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 48 61 73  ong>signatureHas
3150: 68 41 6c 67 6f 72 69 74 68 6d 3c 2f 73 74 72 6f  hAlgorithm</stro
3160: 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68  ng> <em>algorith
3170: 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  m</em></dt>..<dd
3180: 3e 54 68 65 20 73 69 67 6e 61 74 75 72 65 20 68  >The signature h
3190: 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 2e 3c 2f  ash algorithm.</
31a0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
31b0: 3e 73 69 67 6e 61 74 75 72 65 54 79 70 65 3c 2f  >signatureType</
31c0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 74 79 70 65  strong> <em>type
31d0: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e  </em></dt>..<dd>
31e0: 54 68 65 20 73 69 67 6e 61 74 75 72 65 20 74 79  The signature ty
31f0: 70 65 20 76 61 6c 75 65 2e 3c 2f 64 64 3e 0a 09  pe value.</dd>..
3200: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 69  <dt><strong>veri
3210: 66 79 44 65 70 74 68 3c 2f 73 74 72 6f 6e 67 3e  fyDepth</strong>
3220: 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e   <em>n</em></dt>
3230: 0a 09 3c 64 64 3e 4d 61 78 69 6d 75 6d 20 64 65  ..<dd>Maximum de
3240: 70 74 68 20 66 6f 72 20 74 68 65 20 63 65 72 74  pth for the cert
3250: 69 66 69 63 61 74 65 20 63 68 61 69 6e 20 76 65  ificate chain ve
3260: 72 69 66 69 63 61 74 69 6f 6e 2e 0a 09 20 20 20  rification...   
3270: 20 44 65 66 61 75 6c 74 20 69 73 20 2d 31 2c 20   Default is -1, 
3280: 74 6f 20 63 68 65 63 6b 20 61 6c 6c 2e 3c 2f 64  to check all.</d
3290: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
32a0: 76 65 72 69 66 79 4d 6f 64 65 3c 2f 73 74 72 6f  verifyMode</stro
32b0: 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d  ng> <em>list</em
32c0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74  ></dt>..<dd>List
32d0: 20 6f 66 20 63 65 72 74 69 66 69 63 61 74 65 20   of certificate 
32e0: 76 65 72 69 66 69 63 61 74 69 6f 6e 20 6d 6f 64  verification mod
32f0: 65 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73  es.</dd>..<dt><s
3300: 74 72 6f 6e 67 3e 76 65 72 69 66 79 52 65 73 75  trong>verifyResu
3310: 6c 74 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  lt</strong> <em>
3320: 72 65 73 75 6c 74 3c 2f 65 6d 3e 3c 2f 64 74 3e  result</em></dt>
3330: 0a 09 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74  ..<dd>Certificat
3340: 65 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 72  e verification r
3350: 65 73 75 6c 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74  esult.</dd>..<dt
3360: 3e 3c 73 74 72 6f 6e 67 3e 63 61 5f 6e 61 6d 65  ><strong>ca_name
3370: 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6c  s</strong> <em>l
3380: 69 73 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  ist</em></dt>..<
3390: 64 64 3e 4c 69 73 74 20 6f 66 20 74 68 65 20 43  dd>List of the C
33a0: 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f  ertificate Autho
33b0: 72 69 74 69 65 73 20 75 73 65 64 20 74 6f 20 63  rities used to c
33c0: 72 65 61 74 65 20 74 68 65 20 63 65 72 74 69 66  reate the certif
33d0: 69 63 61 74 65 2e 3c 2f 64 64 3e 0a 20 20 20 20  icate.</dd>.    
33e0: 3c 2f 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f  </dl>.</blockquo
33f0: 74 65 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  te>.<blockquote>
3400: 0a 09 3c 62 3e 43 65 72 74 69 66 69 63 61 74 65  ..<b>Certificate
3410: 20 53 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20   Status</b>.    
3420: 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  <dl>..<dt><stron
3430: 67 3e 61 6c 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c  g>all</strong> <
3440: 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f  em>string</em></
3450: 64 74 3e 0a 09 3c 64 64 3e 44 75 6d 70 20 6f 66  dt>..<dd>Dump of
3460: 20 61 6c 6c 20 63 65 72 74 69 66 69 63 61 74 65   all certificate
3470: 20 69 6e 66 6f 2e 3c 2f 64 64 3e 0a 0a 09 3c 64   info.</dd>...<d
3480: 74 3e 3c 73 74 72 6f 6e 67 3e 76 65 72 73 69 6f  t><strong>versio
3490: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76  n</strong> <em>v
34a0: 61 6c 75 65 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  alue</em></dt>..
34b0: 3c 64 64 3e 54 68 65 20 63 65 72 74 69 66 69 63  <dd>The certific
34c0: 61 74 65 20 76 65 72 73 69 6f 6e 2e 3c 2f 64 64  ate version.</dd
34d0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73  >..<dt><strong>s
34e0: 65 72 69 61 6c 4e 75 6d 62 65 72 3c 2f 73 74 72  erialNumber</str
34f0: 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d 3e 3c  ong> <em>n</em><
3500: 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 73 65  /dt>..<dd>The se
3510: 72 69 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74  rial number of t
3520: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 20 61  he certificate a
3530: 73 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64  s hex string.</d
3540: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
3550: 73 69 67 6e 61 74 75 72 65 3c 2f 73 74 72 6f 6e  signature</stron
3560: 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d  g> <em>algorithm
3570: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e  </em></dt>..<dd>
3580: 43 69 70 68 65 72 20 61 6c 67 6f 72 69 74 68 6d  Cipher algorithm
3590: 20 75 73 65 64 20 66 6f 72 20 63 65 72 74 69 66   used for certif
35a0: 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65 2e  icate signature.
35b0: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
35c0: 6e 67 3e 69 73 73 75 65 72 3c 2f 73 74 72 6f 6e  ng>issuer</stron
35d0: 67 3e 20 3c 65 6d 3e 64 6e 3c 2f 65 6d 3e 3c 2f  g> <em>dn</em></
35e0: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 64 69 73  dt>..<dd>The dis
35f0: 74 69 6e 67 75 69 73 68 65 64 20 6e 61 6d 65 20  tinguished name 
3600: 28 44 4e 29 20 6f 66 20 74 68 65 20 63 65 72 74  (DN) of the cert
3610: 69 66 69 63 61 74 65 20 69 73 73 75 65 72 2e 3c  ificate issuer.<
3620: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3630: 67 3e 6e 6f 74 42 65 66 6f 72 65 3c 2f 73 74 72  g>notBefore</str
3640: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65  ong> <em>date</e
3650: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65  m></dt>..<dd>The
3660: 20 62 65 67 69 6e 20 64 61 74 65 20 66 6f 72 20   begin date for 
3670: 74 68 65 20 76 61 6c 69 64 69 74 79 20 6f 66 20  the validity of 
3680: 74 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e  the certificate.
3690: 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f  </dd>..<dt><stro
36a0: 6e 67 3e 6e 6f 74 41 66 74 65 72 3c 2f 73 74 72  ng>notAfter</str
36b0: 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 65 3c 2f 65  ong> <em>date</e
36c0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65  m></dt>..<dd>The
36d0: 20 65 78 70 69 72 61 74 69 6f 6e 20 64 61 74 65   expiration date
36e0: 20 66 6f 72 20 74 68 65 20 63 65 72 74 69 66 69   for the certifi
36f0: 63 61 74 65 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e  cate.</dd>..<dt>
3700: 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65 63 74 3c  <strong>subject<
3710: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64 6e 3c  /strong> <em>dn<
3720: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54  /em></dt>..<dd>T
3730: 68 65 20 64 69 73 74 69 6e 67 75 69 73 68 65 64  he distinguished
3740: 20 6e 61 6d 65 20 28 44 4e 29 20 6f 66 20 74 68   name (DN) of th
3750: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 73 75  e certificate su
3760: 62 6a 65 63 74 2e 0a 09 20 20 20 20 46 69 65 6c  bject...    Fiel
3770: 64 73 20 69 6e 63 6c 75 64 65 3a 20 43 6f 6d 6d  ds include: Comm
3780: 6f 6e 20 4e 61 6d 65 20 28 43 4e 29 2c 20 4f 72  on Name (CN), Or
3790: 67 61 6e 69 7a 61 74 69 6f 6e 20 28 4f 29 2c 20  ganization (O), 
37a0: 4c 6f 63 61 6c 69 74 79 0a 09 20 20 20 20 6f 72  Locality..    or
37b0: 20 43 69 74 79 20 28 4c 29 2c 20 53 74 61 74 65   City (L), State
37c0: 20 6f 72 20 50 72 6f 76 69 6e 63 65 20 28 53 29   or Province (S)
37d0: 2c 20 61 6e 64 20 43 6f 75 6e 74 72 79 20 4e 61  , and Country Na
37e0: 6d 65 20 28 43 29 2e 3c 2f 64 64 3e 0a 09 3c 64  me (C).</dd>..<d
37f0: 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 73 75 65 72  t><strong>issuer
3800: 55 6e 69 71 75 65 49 44 3c 2f 73 74 72 6f 6e 67  UniqueID</strong
3810: 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d  > <em>string</em
3820: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
3830: 69 73 73 75 65 72 20 75 6e 69 71 75 65 20 69 64  issuer unique id
3840: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
3850: 6f 6e 67 3e 73 75 62 6a 65 63 74 55 6e 69 71 75  ong>subjectUniqu
3860: 65 49 44 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  eID</strong> <em
3870: 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  >string</em></dt
3880: 3e 0a 09 3c 64 64 3e 54 68 65 20 73 75 62 6a 65  >..<dd>The subje
3890: 63 74 20 75 6e 69 71 75 65 20 69 64 2e 3c 2f 64  ct unique id.</d
38a0: 64 3e 0a 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  d>...<dt><strong
38b0: 3e 6e 75 6d 5f 65 78 74 65 6e 73 69 6f 6e 73 3c  >num_extensions<
38c0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f  /strong> <em>n</
38d0: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4e 75  em></dt>..<dd>Nu
38e0: 6d 62 65 72 20 6f 66 20 63 65 72 74 69 66 69 63  mber of certific
38f0: 61 74 65 20 65 78 74 65 6e 73 69 6f 6e 73 2e 3c  ate extensions.<
3900: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3910: 67 3e 65 78 74 65 6e 73 69 6f 6e 73 3c 2f 73 74  g>extensions</st
3920: 72 6f 6e 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f  rong> <em>list</
3930: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69  em></dt>..<dd>Li
3940: 73 74 20 6f 66 20 63 65 72 74 69 66 69 63 61 74  st of certificat
3950: 65 20 65 78 74 65 6e 73 69 6f 6e 20 6e 61 6d 65  e extension name
3960: 73 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74  s.</dd>..<dt><st
3970: 72 6f 6e 67 3e 61 75 74 68 6f 72 69 74 79 4b 65  rong>authorityKe
3980: 79 49 64 65 6e 74 69 66 69 65 72 3c 2f 73 74 72  yIdentifier</str
3990: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
39a0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 28  /em></dt>..<dd>(
39b0: 41 4b 49 29 20 4b 65 79 20 69 64 65 6e 74 69 66  AKI) Key identif
39c0: 69 65 72 20 6f 66 20 74 68 65 20 49 73 73 75 69  ier of the Issui
39d0: 6e 67 20 43 41 20 63 65 72 74 69 66 69 63 61 74  ng CA certificat
39e0: 65 20 74 68 61 74 20 73 69 67 6e 65 64 0a 09 20  e that signed.. 
39f0: 20 20 20 74 68 65 20 53 53 4c 20 63 65 72 74 69     the SSL certi
3a00: 66 69 63 61 74 65 20 61 73 20 68 65 78 20 73 74  ficate as hex st
3a10: 72 69 6e 67 2e 20 54 68 69 73 20 76 61 6c 75 65  ring. This value
3a20: 20 6d 61 74 63 68 65 73 20 74 68 65 20 53 4b 49   matches the SKI
3a30: 0a 09 20 20 20 20 76 61 6c 75 65 20 6f 66 20 74  ..    value of t
3a40: 68 65 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20  he Intermediate 
3a50: 43 41 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c  CA certificate.<
3a60: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3a70: 67 3e 73 75 62 6a 65 63 74 4b 65 79 49 64 65 6e  g>subjectKeyIden
3a80: 74 69 66 69 65 72 3c 2f 73 74 72 6f 6e 67 3e 20  tifier</strong> 
3a90: 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c  <em>string</em><
3aa0: 2f 64 74 3e 0a 09 3c 64 64 3e 28 53 4b 49 29 20  /dt>..<dd>(SKI) 
3ab0: 48 61 73 68 20 6f 66 20 74 68 65 20 70 75 62 6c  Hash of the publ
3ac0: 69 63 20 6b 65 79 20 69 6e 73 69 64 65 20 74 68  ic key inside th
3ad0: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73  e certificate as
3ae0: 20 68 65 78 0a 09 20 20 20 73 74 72 69 6e 67 2e   hex..   string.
3af0: 20 55 73 65 64 20 74 6f 20 69 64 65 6e 74 69 66   Used to identif
3b00: 79 20 63 65 72 74 69 66 69 63 61 74 65 73 20 74  y certificates t
3b10: 68 61 74 20 63 6f 6e 74 61 69 6e 20 61 20 70 61  hat contain a pa
3b20: 72 74 69 63 75 6c 61 72 0a 09 20 20 20 70 75 62  rticular..   pub
3b30: 6c 69 63 20 6b 65 79 2e 3c 2f 64 64 3e 0a 09 3c  lic key.</dd>..<
3b40: 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 75 62 6a 65  dt><strong>subje
3b50: 63 74 41 6c 74 4e 61 6d 65 3c 2f 73 74 72 6f 6e  ctAltName</stron
3b60: 67 3e 20 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e  g> <em>list</em>
3b70: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20  </dt>..<dd>List 
3b80: 6f 66 20 61 6c 6c 20 6f 66 20 74 68 65 20 61 6c  of all of the al
3b90: 74 65 72 6e 61 74 69 76 65 20 64 6f 6d 61 69 6e  ternative domain
3ba0: 20 6e 61 6d 65 73 2c 20 73 75 62 20 64 6f 6d 61   names, sub doma
3bb0: 69 6e 73 2c 0a 09 20 20 20 20 61 6e 64 20 49 50  ins,..    and IP
3bc0: 20 61 64 64 72 65 73 73 65 73 20 74 68 61 74 20   addresses that 
3bd0: 61 72 65 20 73 65 63 75 72 65 64 20 62 79 20 74  are secured by t
3be0: 68 65 20 63 65 72 74 69 66 69 63 61 74 65 2e 3c  he certificate.<
3bf0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3c00: 67 3e 6f 63 73 70 3c 2f 73 74 72 6f 6e 67 3e 20  g>ocsp</strong> 
3c10: 3c 65 6d 3e 6c 69 73 74 3c 2f 65 6d 3e 3c 2f 64  <em>list</em></d
3c20: 74 3e 0a 09 3c 64 64 3e 4c 69 73 74 20 6f 66 20  t>..<dd>List of 
3c30: 61 6c 6c 20 4f 6e 6c 69 6e 65 20 43 65 72 74 69  all Online Certi
3c40: 66 69 63 61 74 65 20 53 74 61 74 75 73 20 50 72  ficate Status Pr
3c50: 6f 74 6f 63 6f 6c 20 28 4f 43 53 50 29 20 55 52  otocol (OCSP) UR
3c60: 4c 73 2e 3c 2f 64 64 3e 0a 0a 09 3c 64 74 3e 3c  Ls.</dd>...<dt><
3c70: 73 74 72 6f 6e 67 3e 63 65 72 74 69 66 69 63 61  strong>certifica
3c80: 74 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  te</strong> <em>
3c90: 63 65 72 74 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  cert</em></dt>..
3ca0: 3c 64 64 3e 54 68 65 20 50 45 4d 20 65 6e 63 6f  <dd>The PEM enco
3cb0: 64 65 64 20 63 65 72 74 69 66 69 63 61 74 65 2e  ded certificate.
3cc0: 3c 2f 64 64 3e 0a 0a 09 3c 64 74 3e 3c 73 74 72  </dd>...<dt><str
3cd0: 6f 6e 67 3e 73 69 67 6e 61 74 75 72 65 41 6c 67  ong>signatureAlg
3ce0: 6f 72 69 74 68 6d 3c 2f 73 74 72 6f 6e 67 3e 20  orithm</strong> 
3cf0: 3c 65 6d 3e 61 6c 67 6f 72 69 74 68 6d 3c 2f 65  <em>algorithm</e
3d00: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 69 70  m></dt>..<dd>Cip
3d10: 68 65 72 20 61 6c 67 6f 72 69 74 68 6d 20 75 73  her algorithm us
3d20: 65 64 20 66 6f 72 20 63 65 72 74 69 66 69 63 61  ed for certifica
3d30: 74 65 20 73 69 67 6e 61 74 75 72 65 2e 3c 2f 64  te signature.</d
3d40: 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e  d>..<dt><strong>
3d50: 73 69 67 6e 61 74 75 72 65 56 61 6c 75 65 3c 2f  signatureValue</
3d60: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69  strong> <em>stri
3d70: 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  ng</em></dt>..<d
3d80: 64 3e 43 65 72 74 69 66 69 63 61 74 65 20 73 69  d>Certificate si
3d90: 67 6e 61 74 75 72 65 20 61 73 20 68 65 78 20 73  gnature as hex s
3da0: 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a 09 3c 64 74  tring.</dd>..<dt
3db0: 3e 3c 73 74 72 6f 6e 67 3e 73 69 67 6e 61 74 75  ><strong>signatu
3dc0: 72 65 44 69 67 65 73 74 3c 2f 73 74 72 6f 6e 67  reDigest</strong
3dd0: 3e 20 3c 65 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65  > <em>version</e
3de0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 65 72  m></dt>..<dd>Cer
3df0: 74 69 66 69 63 61 74 65 20 73 69 67 6e 69 6e 67  tificate signing
3e00: 20 64 69 67 65 73 74 2e 3c 2f 64 64 3e 0a 09 3c   digest.</dd>..<
3e10: 64 74 3e 3c 73 74 72 6f 6e 67 3e 70 75 62 6c 69  dt><strong>publi
3e20: 63 4b 65 79 41 6c 67 6f 72 69 74 68 6d 3c 2f 73  cKeyAlgorithm</s
3e30: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 61 6c 67 6f 72  trong> <em>algor
3e40: 69 74 68 6d 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  ithm</em></dt>..
3e50: 3c 64 64 3e 43 65 72 74 69 66 69 63 61 74 65 20  <dd>Certificate 
3e60: 73 69 67 6e 61 74 75 72 65 20 70 75 62 6c 69 63  signature public
3e70: 20 6b 65 79 20 61 6c 67 6f 72 69 74 68 6d 2e 3c   key algorithm.<
3e80: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
3e90: 67 3e 70 75 62 6c 69 63 4b 65 79 3c 2f 73 74 72  g>publicKey</str
3ea0: 6f 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c  ong> <em>string<
3eb0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43  /em></dt>..<dd>C
3ec0: 65 72 74 69 66 69 63 61 74 65 20 73 69 67 6e 61  ertificate signa
3ed0: 74 75 72 65 20 70 75 62 6c 69 63 20 6b 65 79 20  ture public key 
3ee0: 61 73 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f  as hex string.</
3ef0: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
3f00: 3e 62 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c  >bits</strong> <
3f10: 65 6d 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  em>n</em></dt>..
3f20: 3c 64 64 3e 4e 75 6d 62 65 72 20 6f 66 20 62 69  <dd>Number of bi
3f30: 74 73 20 75 73 65 64 20 66 6f 72 20 63 65 72 74  ts used for cert
3f40: 69 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72  ificate signatur
3f50: 65 20 6b 65 79 3c 2f 64 64 3e 0a 09 3c 64 74 3e  e key</dd>..<dt>
3f60: 3c 73 74 72 6f 6e 67 3e 73 65 6c 66 5f 73 69 67  <strong>self_sig
3f70: 6e 65 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  ned</strong> <em
3f80: 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f 64  >boolean</em></d
3f90: 74 3e 0a 09 3c 64 64 3e 49 73 20 63 65 72 74 69  t>..<dd>Is certi
3fa0: 66 69 63 61 74 65 20 73 69 67 6e 61 74 75 72 65  ficate signature
3fb0: 20 73 65 6c 66 20 73 69 67 6e 65 64 2e 3c 2f 64   self signed.</d
3fc0: 64 3e 0a 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  d>...<dt><strong
3fd0: 3e 73 68 61 31 5f 68 61 73 68 3c 2f 73 74 72 6f  >sha1_hash</stro
3fe0: 6e 67 3e 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d  ng> <em>hash</em
3ff0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
4000: 53 48 41 31 20 68 61 73 68 20 6f 66 20 74 68 65  SHA1 hash of the
4010: 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73 20   certificate as 
4020: 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e  hex string.</dd>
4030: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 68  ..<dt><strong>sh
4040: 61 32 35 36 5f 68 61 73 68 3c 2f 73 74 72 6f 6e  a256_hash</stron
4050: 67 3e 20 3c 65 6d 3e 68 61 73 68 3c 2f 65 6d 3e  g> <em>hash</em>
4060: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 53  </dt>..<dd>The S
4070: 48 41 32 35 36 20 68 61 73 68 20 6f 66 20 74 68  HA256 hash of th
4080: 65 20 63 65 72 74 69 66 69 63 61 74 65 20 61 73  e certificate as
4090: 20 68 65 78 20 73 74 72 69 6e 67 2e 3c 2f 64 64   hex string.</dd
40a0: 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f 62 6c  >.    </dl>.</bl
40b0: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 20 20 20 20 3c  ockquote>..    <
40c0: 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a  dt><a name="tls:
40d0: 3a 63 6f 6e 6e 65 63 74 69 6f 6e 22 3e 3c 73 74  :connection"><st
40e0: 72 6f 6e 67 3e 74 6c 73 3a 3a 63 6f 6e 6e 65 63  rong>tls::connec
40f0: 74 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 0a 20 20  tion</strong>.  
4100: 20 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 3c 2f 65    <em>channel</e
4110: 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  m></a></dt>.    
4120: 3c 64 64 3e 52 65 74 75 72 6e 73 20 74 68 65 20  <dd>Returns the 
4130: 63 75 72 72 65 6e 74 20 63 6f 6e 6e 65 63 74 69  current connecti
4140: 6f 6e 20 73 74 61 74 75 73 20 6f 66 20 61 6e 20  on status of an 
4150: 53 53 4c 20 63 68 61 6e 6e 65 6c 2e 20 54 68 65  SSL channel. The
4160: 0a 09 72 65 73 75 6c 74 20 69 73 20 61 20 6c 69  ..result is a li
4170: 73 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20  st of key-value 
4180: 70 61 69 72 73 20 64 65 73 63 72 69 62 69 6e 67  pairs describing
4190: 20 74 68 65 0a 09 63 6f 6e 6e 65 63 74 65 64 20   the..connected 
41a0: 70 65 65 72 2e 3c 2f 64 64 3e 0a 3c 62 6c 6f 63  peer.</dd>.<bloc
41b0: 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 53 53 4c 20  kquote>..<b>SSL 
41c0: 53 74 61 74 75 73 3c 2f 62 3e 0a 20 20 20 20 3c  Status</b>.    <
41d0: 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dl>..<dt><strong
41e0: 3e 73 74 61 74 65 3c 2f 73 74 72 6f 6e 67 3e 20  >state</strong> 
41f0: 3c 65 6d 3e 73 74 61 74 65 3c 2f 65 6d 3e 3c 2f  <em>state</em></
4200: 64 74 3e 0a 09 3c 64 64 3e 53 74 61 74 65 20 6f  dt>..<dd>State o
4210: 66 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e  f the connection
4220: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4230: 6f 6e 67 3e 73 65 72 76 65 72 6e 61 6d 65 3c 2f  ong>servername</
4240: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65  strong> <em>name
4250: 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e  </em></dt>..<dd>
4260: 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20  The name of the 
4270: 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 73 65 72  connected to ser
4280: 76 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  ver.</dd>..<dt><
4290: 73 74 72 6f 6e 67 3e 70 72 6f 74 6f 63 6f 6c 3c  strong>protocol<
42a0: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 76 65 72  /strong> <em>ver
42b0: 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  sion</em></dt>..
42c0: 3c 64 64 3e 54 68 65 20 70 72 6f 74 6f 63 6f 6c  <dd>The protocol
42d0: 20 76 65 72 73 69 6f 6e 20 75 73 65 64 20 66 6f   version used fo
42e0: 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e  r the connection
42f0: 3a 0a 09 20 20 20 20 53 53 4c 32 2c 20 53 53 4c  :..    SSL2, SSL
4300: 33 2c 20 54 4c 53 31 2c 20 54 4c 53 31 2e 31 2c  3, TLS1, TLS1.1,
4310: 20 54 4c 53 31 2e 32 2c 20 54 4c 53 31 2e 33 2c   TLS1.2, TLS1.3,
4320: 20 6f 72 20 75 6e 6b 6e 6f 77 6e 2e 3c 2f 64 64   or unknown.</dd
4330: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 72  >..<dt><strong>r
4340: 65 6e 65 67 6f 74 69 61 74 69 6f 6e 3c 2f 73 74  enegotiation</st
4350: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61  rong> <em>boolea
4360: 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64  n</em></dt>..<dd
4370: 3e 57 68 65 74 68 65 72 20 70 72 6f 74 6f 63 6f  >Whether protoco
4380: 6c 20 72 65 6e 65 67 6f 74 69 61 74 69 6f 6e 20  l renegotiation 
4390: 69 73 20 73 75 70 70 6f 72 74 65 64 20 6f 72 20  is supported or 
43a0: 6e 6f 74 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c  not.</dd>..<dt><
43b0: 73 74 72 6f 6e 67 3e 73 65 63 75 72 69 74 79 6c  strong>securityl
43c0: 65 76 65 6c 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  evel</strong> <e
43d0: 6d 3e 6c 65 76 65 6c 3c 2f 65 6d 3e 3c 2f 64 74  m>level</em></dt
43e0: 3e 0a 09 3c 64 64 3e 54 68 65 20 73 65 63 75 72  >..<dd>The secur
43f0: 69 74 79 20 6c 65 76 65 6c 20 75 73 65 64 20 66  ity level used f
4400: 6f 72 20 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20  or selection of 
4410: 63 69 70 68 65 72 73 2c 20 6b 65 79 20 73 69 7a  ciphers, key siz
4420: 65 2c 20 65 74 63 2e 3c 2f 64 64 3e 0a 09 3c 64  e, etc.</dd>..<d
4430: 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f  t><strong>sessio
4440: 6e 5f 72 65 75 73 65 64 3c 2f 73 74 72 6f 6e 67  n_reused</strong
4450: 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65  > <em>boolean</e
4460: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 57 68 65  m></dt>..<dd>Whe
4470: 74 68 65 72 20 74 68 65 20 73 65 73 73 69 6f 6e  ther the session
4480: 20 68 61 73 20 62 65 65 6e 20 72 65 75 73 65 64   has been reused
4490: 20 6f 72 20 6e 6f 74 2e 3c 2f 64 64 3e 0a 09 3c   or not.</dd>..<
44a0: 64 74 3e 3c 73 74 72 6f 6e 67 3e 69 73 5f 73 65  dt><strong>is_se
44b0: 72 76 65 72 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  rver</strong> <e
44c0: 6d 3e 62 6f 6f 6c 65 61 6e 3c 2f 65 6d 3e 3c 2f  m>boolean</em></
44d0: 64 74 3e 0a 09 3c 64 64 3e 57 68 65 74 68 65 72  dt>..<dd>Whether
44e0: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20   the connection 
44f0: 69 73 20 63 6f 6e 66 69 67 75 72 65 64 20 61 73  is configured as
4500: 20 61 20 73 65 72 76 65 72 20 28 31 29 20 6f 72   a server (1) or
4510: 20 63 6c 69 65 6e 74 20 28 30 29 2e 3c 2f 64 64   client (0).</dd
4520: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 63  >..<dt><strong>c
4530: 6f 6d 70 72 65 73 73 69 6f 6e 3c 2f 73 74 72 6f  ompression</stro
4540: 6e 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d  ng> <em>mode</em
4550: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43 6f 6d 70  ></dt>..<dd>Comp
4560: 72 65 73 73 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c  ression method.<
4570: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
4580: 67 3e 65 78 70 61 6e 73 69 6f 6e 3c 2f 73 74 72  g>expansion</str
4590: 6f 6e 67 3e 20 3c 65 6d 3e 6d 6f 64 65 3c 2f 65  ong> <em>mode</e
45a0: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 45 78 70  m></dt>..<dd>Exp
45b0: 61 6e 73 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c 2f  ansion method.</
45c0: 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c 2f  dd>.    </dl>.</
45d0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 6c 6f  blockquote>.<blo
45e0: 63 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 43 69 70  ckquote>..<b>Cip
45f0: 68 65 72 20 49 6e 66 6f 3c 2f 62 3e 0a 20 20 20  her Info</b>.   
4600: 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f   <dl>..<dt><stro
4610: 6e 67 3e 63 69 70 68 65 72 3c 2f 73 74 72 6f 6e  ng>cipher</stron
4620: 67 3e 20 3c 65 6d 3e 63 69 70 68 65 72 3c 2f 65  g> <em>cipher</e
4630: 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65  m></dt>..<dd>The
4640: 20 63 75 72 72 65 6e 74 20 63 69 70 68 65 72 20   current cipher 
4650: 69 6e 20 75 73 65 20 66 6f 72 20 74 68 65 20 63  in use for the c
4660: 6f 6e 6e 65 63 74 69 6f 6e 2e 3c 2f 64 64 3e 0a  onnection.</dd>.
4670: 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 74 61  .<dt><strong>sta
4680: 6e 64 61 72 64 5f 6e 61 6d 65 3c 2f 73 74 72 6f  ndard_name</stro
4690: 6e 67 3e 20 3c 65 6d 3e 6e 61 6d 65 3c 2f 65 6d  ng> <em>name</em
46a0: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
46b0: 73 74 61 6e 64 61 72 64 20 52 46 43 20 6e 61 6d  standard RFC nam
46c0: 65 20 6f 66 20 63 69 70 68 65 72 2e 3c 2f 64 64  e of cipher.</dd
46d0: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 62  >..<dt><strong>b
46e0: 69 74 73 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d  its</strong> <em
46f0: 3e 6e 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64  >n</em></dt>..<d
4700: 64 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20  d>The number of 
4710: 70 72 6f 63 65 73 73 65 64 20 62 69 74 73 20 75  processed bits u
4720: 73 65 64 20 66 6f 72 20 63 69 70 68 65 72 2e 3c  sed for cipher.<
4730: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
4740: 67 3e 73 65 63 72 65 74 5f 62 69 74 73 3c 2f 73  g>secret_bits</s
4750: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 6e 3c 2f 65 6d  trong> <em>n</em
4760: 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20  ></dt>..<dd>The 
4770: 6e 75 6d 62 65 72 20 6f 66 20 73 65 63 72 65 74  number of secret
4780: 20 62 69 74 73 20 75 73 65 64 20 66 6f 72 20 63   bits used for c
4790: 69 70 68 65 72 2e 3c 2f 64 64 3e 0a 09 3c 64 74  ipher.</dd>..<dt
47a0: 3e 3c 73 74 72 6f 6e 67 3e 6d 69 6e 5f 76 65 72  ><strong>min_ver
47b0: 73 69 6f 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  sion</strong> <e
47c0: 6d 3e 76 65 72 73 69 6f 6e 3c 2f 65 6d 3e 3c 2f  m>version</em></
47d0: 64 74 3e 0a 09 3c 64 64 3e 54 68 65 20 6d 69 6e  dt>..<dd>The min
47e0: 69 6d 75 6d 20 70 72 6f 74 6f 63 6f 6c 20 76 65  imum protocol ve
47f0: 72 73 69 6f 6e 20 66 6f 72 20 63 69 70 68 65 72  rsion for cipher
4800: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4810: 6f 6e 67 3e 69 64 3c 2f 73 74 72 6f 6e 67 3e 20  ong>id</strong> 
4820: 3c 65 6d 3e 69 64 3c 2f 65 6d 3e 3c 2f 64 74 3e  <em>id</em></dt>
4830: 0a 09 3c 64 64 3e 54 68 65 20 4f 70 65 6e 53 53  ..<dd>The OpenSS
4840: 4c 20 63 69 70 68 65 72 20 69 64 2e 3c 2f 64 64  L cipher id.</dd
4850: 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 64  >..<dt><strong>d
4860: 65 73 63 72 69 70 74 69 6f 6e 3c 2f 73 74 72 6f  escription</stro
4870: 6e 67 3e 20 3c 65 6d 3e 73 74 72 69 6e 67 3c 2f  ng> <em>string</
4880: 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 41 20  em></dt>..<dd>A 
4890: 74 65 78 74 20 64 65 73 63 72 69 70 74 69 6f 6e  text description
48a0: 20 6f 66 20 74 68 65 20 63 69 70 68 65 72 2e 3c   of the cipher.<
48b0: 2f 64 64 3e 0a 20 20 20 20 3c 2f 64 6c 3e 0a 3c  /dd>.    </dl>.<
48c0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 6c  /blockquote>.<bl
48d0: 6f 63 6b 71 75 6f 74 65 3e 0a 09 3c 62 3e 53 65  ockquote>..<b>Se
48e0: 73 73 69 6f 6e 20 49 6e 66 6f 3c 2f 62 3e 0a 20  ssion Info</b>. 
48f0: 20 20 20 3c 64 6c 3e 0a 09 3c 64 74 3e 3c 73 74     <dl>..<dt><st
4900: 72 6f 6e 67 3e 61 6c 70 6e 3c 2f 73 74 72 6f 6e  rong>alpn</stron
4910: 67 3e 20 3c 65 6d 3e 70 72 6f 74 6f 63 6f 6c 3c  g> <em>protocol<
4920: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 54  /em></dt>..<dd>T
4930: 68 65 20 70 72 6f 74 6f 63 6f 6c 20 73 65 6c 65  he protocol sele
4940: 63 74 65 64 20 61 66 74 65 72 20 41 70 70 6c 69  cted after Appli
4950: 63 61 74 69 6f 6e 2d 4c 61 79 65 72 20 50 72 6f  cation-Layer Pro
4960: 74 6f 63 6f 6c 0a 09 20 20 20 20 4e 65 67 6f 74  tocol..    Negot
4970: 69 61 74 69 6f 6e 20 28 41 4c 50 4e 29 2e 3c 2f  iation (ALPN).</
4980: 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67  dd>..<dt><strong
4990: 3e 72 65 73 75 6d 61 62 6c 65 3c 2f 73 74 72 6f  >resumable</stro
49a0: 6e 67 3e 20 3c 65 6d 3e 62 6f 6f 6c 65 61 6e 3c  ng> <em>boolean<
49b0: 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c 64 64 3e 43  /em></dt>..<dd>C
49c0: 61 6e 20 74 68 65 20 73 65 73 73 69 6f 6e 20 62  an the session b
49d0: 65 20 72 65 73 75 6d 65 64 20 6f 72 20 6e 6f 74  e resumed or not
49e0: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
49f0: 6f 6e 67 3e 73 74 61 72 74 5f 74 69 6d 65 3c 2f  ong>start_time</
4a00: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63 6f  strong> <em>seco
4a10: 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09 3c  nds</em></dt>..<
4a20: 64 64 3e 54 69 6d 65 20 73 69 6e 63 65 20 73 65  dd>Time since se
4a30: 73 73 69 6f 6e 20 73 74 61 72 74 65 64 20 69 6e  ssion started in
4a40: 20 73 65 63 6f 6e 64 73 20 73 69 6e 63 65 20 65   seconds since e
4a50: 70 6f 63 68 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e  poch.</dd>..<dt>
4a60: 3c 73 74 72 6f 6e 67 3e 74 69 6d 65 6f 75 74 3c  <strong>timeout<
4a70: 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 73 65 63  /strong> <em>sec
4a80: 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 09  onds</em></dt>..
4a90: 3c 64 64 3e 4d 61 78 20 64 75 72 61 74 69 6f 6e  <dd>Max duration
4aa0: 20 6f 66 20 73 65 73 73 69 6f 6e 20 69 6e 20 73   of session in s
4ab0: 65 63 6f 6e 64 73 20 62 65 66 6f 72 65 20 74 69  econds before ti
4ac0: 6d 65 2d 6f 75 74 2e 3c 2f 64 64 3e 0a 09 3c 64  me-out.</dd>..<d
4ad0: 74 3e 3c 73 74 72 6f 6e 67 3e 6c 69 66 65 74 69  t><strong>lifeti
4ae0: 6d 65 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e  me</strong> <em>
4af0: 73 65 63 6f 6e 64 73 3c 2f 65 6d 3e 3c 2f 64 74  seconds</em></dt
4b00: 3e 0a 09 3c 64 64 3e 53 65 73 73 69 6f 6e 20 74  >..<dd>Session t
4b10: 69 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 20 68  icket lifetime h
4b20: 69 6e 74 20 69 6e 20 73 65 63 6f 6e 64 73 2e 3c  int in seconds.<
4b30: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
4b40: 67 3e 73 65 73 73 69 6f 6e 5f 69 64 3c 2f 73 74  g>session_id</st
4b50: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79  rong> <em>binary
4b60: 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  _string</em></dt
4b70: 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65  >..<dd>Unique se
4b80: 73 73 69 6f 6e 20 69 64 20 66 6f 72 20 75 73 65  ssion id for use
4b90: 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74 68 65   in resuming the
4ba0: 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e 0a 09   session.</dd>..
4bb0: 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 73 65 73 73  <dt><strong>sess
4bc0: 69 6f 6e 5f 74 69 63 6b 65 74 3c 2f 73 74 72 6f  ion_ticket</stro
4bd0: 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79 5f 73  ng> <em>binary_s
4be0: 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a  tring</em></dt>.
4bf0: 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65 73 73  .<dd>Unique sess
4c00: 69 6f 6e 20 74 69 63 6b 65 74 20 66 6f 72 20 75  ion ticket for u
4c10: 73 65 20 69 6e 20 72 65 73 75 6d 69 6e 67 20 74  se in resuming t
4c20: 68 65 20 73 65 73 73 69 6f 6e 2e 3c 2f 64 64 3e  he session.</dd>
4c30: 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 74 69  ..<dt><strong>ti
4c40: 63 6b 65 74 5f 61 70 70 5f 64 61 74 61 3c 2f 73  cket_app_data</s
4c50: 74 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72  trong> <em>binar
4c60: 79 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64  y_string</em></d
4c70: 74 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73  t>..<dd>Unique s
4c80: 65 73 73 69 6f 6e 20 74 69 63 6b 65 74 20 61 70  ession ticket ap
4c90: 70 6c 69 63 61 74 69 6f 6e 20 64 61 74 61 2e 3c  plication data.<
4ca0: 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72 6f 6e  /dd>..<dt><stron
4cb0: 67 3e 6d 61 73 74 65 72 5f 6b 65 79 3c 2f 73 74  g>master_key</st
4cc0: 72 6f 6e 67 3e 20 3c 65 6d 3e 62 69 6e 61 72 79  rong> <em>binary
4cd0: 5f 73 74 72 69 6e 67 3c 2f 65 6d 3e 3c 2f 64 74  _string</em></dt
4ce0: 3e 0a 09 3c 64 64 3e 55 6e 69 71 75 65 20 73 65  >..<dd>Unique se
4cf0: 73 73 69 6f 6e 20 6d 61 73 74 65 72 20 6b 65 79  ssion master key
4d00: 2e 3c 2f 64 64 3e 0a 09 3c 64 74 3e 3c 73 74 72  .</dd>..<dt><str
4d10: 6f 6e 67 3e 73 65 73 73 69 6f 6e 5f 63 61 63 68  ong>session_cach
4d20: 65 5f 6d 6f 64 65 3c 2f 73 74 72 6f 6e 67 3e 20  e_mode</strong> 
4d30: 3c 65 6d 3e 6d 6f 64 65 3c 2f 65 6d 3e 3c 2f 64  <em>mode</em></d
4d40: 74 3e 0a 09 3c 64 64 3e 53 65 72 76 65 72 20 63  t>..<dd>Server c
4d50: 61 63 68 65 20 6d 6f 64 65 20 28 63 6c 69 65 6e  ache mode (clien
4d60: 74 2c 20 73 65 72 76 65 72 2c 20 6f 72 20 62 6f  t, server, or bo
4d70: 74 68 29 2e 3c 2f 64 64 3e 0a 20 20 20 20 3c 2f  th).</dd>.    </
4d80: 64 6c 3e 0a 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65  dl>.</blockquote
4d90: 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61  >..    <dt><a na
4da0: 6d 65 3d 22 74 6c 73 3a 3a 63 69 70 68 65 72 73  me="tls::ciphers
4db0: 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63  "><strong>tls::c
4dc0: 69 70 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 0a  iphers</strong>.
4dd0: 20 20 20 20 3c 65 6d 3e 3f 70 72 6f 74 6f 63 6f      <em>?protoco
4de0: 6c 3f 20 3f 76 65 72 62 6f 73 65 3f 20 3f 73 75  l? ?verbose? ?su
4df0: 70 70 6f 72 74 65 64 3f 3c 2f 65 6d 3e 3c 2f 61  pported?</em></a
4e00: 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 57  ></dt>.    <dd>W
4e10: 69 74 68 6f 75 74 20 61 6e 79 20 61 72 67 73 2c  ithout any args,
4e20: 20 72 65 74 75 72 6e 73 20 61 20 6c 69 73 74 20   returns a list 
4e30: 6f 66 20 61 6c 6c 20 63 69 70 68 65 72 73 2e 20  of all ciphers. 
4e40: 57 69 74 68 0a 09 3c 65 6d 3e 70 72 6f 74 6f 63  With..<em>protoc
4e50: 6f 6c 3c 2f 65 6d 3e 2c 20 6f 6e 6c 79 20 74 68  ol</em>, only th
4e60: 65 20 63 69 70 68 65 72 73 20 73 75 70 70 6f 72  e ciphers suppor
4e70: 74 74 65 64 20 66 6f 72 20 74 68 61 74 20 70 72  tted for that pr
4e80: 6f 74 6f 63 6f 6c 0a 09 61 72 65 20 72 65 74 75  otocol..are retu
4e90: 72 6e 65 64 20 77 68 65 72 65 20 3c 65 6d 3e 70  rned where <em>p
4ea0: 72 6f 74 6f 63 6f 6c 3c 2f 65 6d 3e 20 6d 75 73  rotocol</em> mus
4eb0: 74 20 62 65 20 6f 6e 65 20 6f 66 20 3c 62 3e 73  t be one of <b>s
4ec0: 73 6c 32 2c 20 73 73 6c 33 2c 0a 09 74 6c 73 31  sl2, ssl3,..tls1
4ed0: 2c 20 74 6c 73 31 2e 31 2c 20 74 6c 73 31 2e 32  , tls1.1, tls1.2
4ee0: 2c 3c 2f 62 3e 20 6f 72 20 3c 62 3e 74 6c 73 31  ,</b> or <b>tls1
4ef0: 2e 33 3c 2f 62 3e 2e 20 49 66 20 3c 65 6d 3e 76  .3</b>. If <em>v
4f00: 65 72 62 6f 73 65 3c 2f 65 6d 3e 20 69 73 0a 09  erbose</em> is..
4f10: 73 70 65 63 69 66 69 65 64 20 61 73 20 74 72 75  specified as tru
4f20: 65 20 74 68 65 6e 20 61 20 76 65 72 62 6f 73 65  e then a verbose
4f30: 2c 20 68 75 6d 61 6e 20 72 65 61 64 61 62 6c 65  , human readable
4f40: 20 6c 69 73 74 20 69 73 20 72 65 74 75 72 6e 65   list is returne
4f50: 64 0a 09 77 69 74 68 20 61 64 64 69 74 69 6f 6e  d..with addition
4f60: 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f  al information o
4f70: 6e 20 74 68 65 20 63 69 70 68 65 72 2e 20 49 66  n the cipher. If
4f80: 20 3c 65 6d 3e 73 75 70 70 6f 72 74 65 64 3c 2f   <em>supported</
4f90: 65 6d 3e 0a 09 69 73 20 73 70 65 63 69 66 69 65  em>..is specifie
4fa0: 64 20 61 73 20 74 72 75 65 2c 20 74 68 65 6e 20  d as true, then 
4fb0: 6f 6e 6c 79 20 74 68 65 20 63 69 70 68 65 72 73  only the ciphers
4fc0: 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 20 70   supported for p
4fd0: 72 6f 74 6f 63 6f 6c 0a 09 77 69 6c 6c 20 62 65  rotocol..will be
4fe0: 20 6c 69 73 74 65 64 2e 3c 2f 64 64 3e 0a 0a 20   listed.</dd>.. 
4ff0: 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22     <dt><a name="
5000: 74 6c 73 3a 3a 70 72 6f 74 6f 63 6f 6c 73 22 3e  tls::protocols">
5010: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 72 6f  <strong>tls::pro
5020: 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67 3e 3c  tocols</strong><
5030: 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  /a></dt>.    <dd
5040: 3e 52 65 74 75 72 6e 73 20 61 20 6c 69 73 74 20  >Returns a list 
5050: 6f 66 20 73 75 70 70 6f 72 74 65 64 20 70 72 6f  of supported pro
5060: 74 6f 63 6f 6c 73 2e 20 56 61 6c 69 64 20 76 61  tocols. Valid va
5070: 6c 75 65 73 20 61 72 65 3a 0a 09 3c 62 3e 73 73  lues are:..<b>ss
5080: 6c 32 3c 2f 62 3e 2c 20 3c 62 3e 73 73 6c 33 3c  l2</b>, <b>ssl3<
5090: 2f 62 3e 2c 20 3c 62 3e 74 6c 73 31 3c 2f 62 3e  /b>, <b>tls1</b>
50a0: 2c 20 3c 62 3e 74 6c 73 31 2e 31 3c 2f 62 3e 2c  , <b>tls1.1</b>,
50b0: 20 3c 62 3e 74 6c 73 31 2e 32 3c 2f 62 3e 2c 0a   <b>tls1.2</b>,.
50c0: 09 61 6e 64 20 3c 62 3e 74 6c 73 31 2e 33 3c 2f  .and <b>tls1.3</
50d0: 62 3e 2e 20 45 78 61 63 74 20 6c 69 73 74 20 64  b>. Exact list d
50e0: 65 70 65 6e 64 73 20 6f 6e 20 4f 70 65 6e 53 53  epends on OpenSS
50f0: 4c 20 76 65 72 73 69 6f 6e 20 61 6e 64 0a 09 63  L version and..c
5100: 6f 6d 70 69 6c 65 20 74 69 6d 65 20 66 6c 61 67  ompile time flag
5110: 73 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74  s.</dd>..    <dt
5120: 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 76  ><a name="tls::v
5130: 65 72 73 69 6f 6e 22 3e 3c 73 74 72 6f 6e 67 3e  ersion"><strong>
5140: 74 6c 73 3a 3a 76 65 72 73 69 6f 6e 3c 2f 73 74  tls::version</st
5150: 72 6f 6e 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20  rong></a></dt>. 
5160: 20 20 20 3c 64 64 3e 52 65 74 75 72 6e 73 20 74     <dd>Returns t
5170: 68 65 20 4f 70 65 6e 53 53 4c 20 76 65 72 73 69  he OpenSSL versi
5180: 6f 6e 20 73 74 72 69 6e 67 2e 3c 2f 64 64 3e 0a  on string.</dd>.
5190: 0a 20 20 20 20 3c 62 72 3e 0a 20 20 20 20 3c 64  .    <br>.    <d
51a0: 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a  t><a name="tls::
51b0: 64 69 67 65 73 74 22 3e 3c 73 74 72 6f 6e 67 3e  digest"><strong>
51c0: 74 6c 73 3a 3a 64 69 67 65 73 74 3c 2f 73 74 72  tls::digest</str
51d0: 6f 6e 67 3e 20 3c 65 6d 3e 74 79 70 65 20 64 61  ong> <em>type da
51e0: 74 61 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e  ta</em></a></dt>
51f0: 0a 20 20 20 20 3c 64 64 3e 43 61 6c 63 75 6c 61  .    <dd>Calcula
5200: 74 65 20 74 68 65 20 6d 65 73 73 61 67 65 20 64  te the message d
5210: 69 67 65 73 74 20 66 6f 72 20 3c 65 6d 3e 64 61  igest for <em>da
5220: 74 61 3c 2f 65 6d 3e 20 75 73 69 6e 67 20 3c 65  ta</em> using <e
5230: 6d 3e 74 79 70 65 3c 2f 65 6d 3e 0a 09 68 61 73  m>type</em>..has
5240: 68 20 61 6c 67 6f 72 69 74 68 6d 2e 20 52 65 74  h algorithm. Ret
5250: 75 72 6e 73 20 76 61 6c 75 65 20 61 73 20 61 20  urns value as a 
5260: 68 65 78 20 73 74 72 69 6e 67 2e 20 54 79 70 65  hex string. Type
5270: 20 63 61 6e 20 62 65 20 61 6e 79 0a 09 4f 70 65   can be any..Ope
5280: 6e 53 53 4c 20 73 75 70 70 6f 72 74 65 64 20 68  nSSL supported h
5290: 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 20 69 6e  ash algorithm in
52a0: 63 6c 75 64 69 6e 67 3a 20 3c 62 3e 6d 64 34 3c  cluding: <b>md4<
52b0: 2f 62 3e 2c 20 3c 62 3e 6d 64 35 3c 2f 62 3e 2c  /b>, <b>md5</b>,
52c0: 0a 09 3c 62 3e 73 68 61 31 3c 2f 62 3e 2c 20 3c  ..<b>sha1</b>, <
52d0: 62 3e 73 68 61 32 35 36 3c 2f 62 3e 2c 20 3c 62  b>sha256</b>, <b
52e0: 3e 73 68 61 35 31 32 3c 2f 62 3e 2c 20 3c 62 3e  >sha512</b>, <b>
52f0: 73 68 61 33 2d 32 35 36 3c 2f 62 3e 2c 20 65 74  sha3-256</b>, et
5300: 63 2e 0a 09 53 65 65 20 3c 62 3e 64 69 67 65 73  c...See <b>diges
5310: 74 73 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 20 66  ts</b> command f
5320: 6f 72 20 61 20 66 75 6c 6c 20 6c 69 73 74 2e 3c  or a full list.<
5330: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61  /dd>..    <dt><a
5340: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 64 69 67 65   name="tls::dige
5350: 73 74 73 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73  sts"><strong>tls
5360: 3a 3a 64 69 67 65 73 74 73 3c 2f 73 74 72 6f 6e  ::digests</stron
5370: 67 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20  g></a></dt>.    
5380: 3c 64 64 3e 52 65 74 75 72 6e 73 20 61 20 6c 69  <dd>Returns a li
5390: 73 74 20 6f 66 20 74 68 65 20 76 61 6c 69 64 20  st of the valid 
53a0: 68 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 73 20  hash algorithms 
53b0: 75 73 65 64 20 74 6f 20 63 72 65 61 74 65 20 6d  used to create m
53c0: 65 73 73 61 67 65 20 64 69 67 65 73 74 73 2e 3c  essage digests.<
53d0: 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 61  /dd>..    <dt><a
53e0: 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 6d 64 34 22   name="tls::md4"
53f0: 3e 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 6d 64  ><strong>tls::md
5400: 34 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 64  4</strong> <em>d
5410: 61 74 61 3c 2f 65 6d 3e 3c 2f 61 3e 3c 2f 64 74  ata</em></a></dt
5420: 3e 0a 20 20 20 20 3c 64 64 3e 52 65 74 75 72 6e  >.    <dd>Return
5430: 20 74 68 65 20 4d 44 34 20 6d 65 73 73 61 67 65   the MD4 message
5440: 2d 64 69 67 65 73 74 20 66 6f 72 20 3c 65 6d 3e  -digest for <em>
5450: 64 61 74 61 3c 2f 65 6d 3e 2e 3c 2f 64 64 3e 0a  data</em>.</dd>.
5460: 0a 20 20 20 20 3c 64 74 3e 3c 61 20 6e 61 6d 65  .    <dt><a name
5470: 3d 22 74 6c 73 3a 3a 6d 64 35 22 3e 3c 73 74 72  ="tls::md5"><str
5480: 6f 6e 67 3e 74 6c 73 3a 3a 6d 64 35 3c 2f 73 74  ong>tls::md5</st
5490: 72 6f 6e 67 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f  rong> <em>data</
54a0: 65 6d 3e 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20  em></a></dt>.   
54b0: 20 3c 64 64 3e 52 65 74 75 72 6e 20 74 68 65 20   <dd>Return the 
54c0: 4d 44 35 20 6d 65 73 73 61 67 65 2d 64 69 67 65  MD5 message-dige
54d0: 73 74 20 66 6f 72 20 3c 65 6d 3e 64 61 74 61 3c  st for <em>data<
54e0: 2f 65 6d 3e 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20  /em>.</dd>..    
54f0: 3c 64 74 3e 3c 61 20 6e 61 6d 65 3d 22 74 6c 73  <dt><a name="tls
5500: 3a 3a 73 68 61 31 22 3e 3c 73 74 72 6f 6e 67 3e  ::sha1"><strong>
5510: 74 6c 73 3a 3a 73 68 61 31 3c 2f 73 74 72 6f 6e  tls::sha1</stron
5520: 67 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e  g> <em>data</em>
5530: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  </a></dt>.    <d
5540: 64 3e 52 65 74 75 72 6e 20 74 68 65 20 53 48 41  d>Return the SHA
5550: 31 20 73 65 63 75 72 65 20 68 61 73 68 20 61 6c  1 secure hash al
5560: 67 6f 72 69 74 68 6d 20 64 69 67 65 73 74 20 66  gorithm digest f
5570: 6f 72 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e  or <em>data</em>
5580: 2e 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 64 74 3e  .</dd>..    <dt>
5590: 3c 61 20 6e 61 6d 65 3d 22 74 6c 73 3a 3a 73 68  <a name="tls::sh
55a0: 61 32 35 36 22 3e 3c 73 74 72 6f 6e 67 3e 74 6c  a256"><strong>tl
55b0: 73 3a 3a 73 68 61 32 35 36 3c 2f 73 74 72 6f 6e  s::sha256</stron
55c0: 67 3e 20 3c 65 6d 3e 64 61 74 61 3c 2f 65 6d 3e  g> <em>data</em>
55d0: 3c 2f 61 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64  </a></dt>.    <d
55e0: 64 3e 52 65 74 75 72 6e 20 74 68 65 20 53 48 41  d>Return the SHA
55f0: 2d 32 20 53 48 41 32 35 36 20 73 65 63 75 72 65  -2 SHA256 secure
5600: 20 68 61 73 68 20 61 6c 67 6f 72 69 74 68 6d 20   hash algorithm 
5610: 64 69 67 65 73 74 20 66 6f 72 20 3c 65 6d 3e 64  digest for <em>d
5620: 61 74 61 3c 2f 65 6d 3e 2e 3c 2f 64 64 3e 0a 3c  ata</em>.</dd>.<
5630: 2f 64 6c 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d  /dl>..<h3><a nam
5640: 65 3d 22 43 41 4c 4c 42 41 43 4b 20 4f 50 54 49  e="CALLBACK OPTI
5650: 4f 4e 53 22 3e 43 41 4c 4c 42 41 43 4b 20 4f 50  ONS">CALLBACK OP
5660: 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a  TIONS</a></h3>..
5670: 3c 70 3e 0a 41 73 20 69 6e 64 69 63 61 74 65 64  <p>.As indicated
5680: 20 61 62 6f 76 65 2c 20 69 6e 64 69 76 69 64 75   above, individu
5690: 61 6c 20 63 68 61 6e 6e 65 6c 73 20 63 61 6e 20  al channels can 
56a0: 62 65 20 67 69 76 65 6e 20 74 68 65 69 72 20 6f  be given their o
56b0: 77 6e 20 63 61 6c 6c 62 61 63 6b 73 0a 74 6f 20  wn callbacks.to 
56c0: 68 61 6e 64 6c 65 20 69 6e 74 65 72 6d 65 64 69  handle intermedi
56d0: 61 74 65 20 70 72 6f 63 65 73 73 69 6e 67 20 62  ate processing b
56e0: 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 6c 69  y the OpenSSL li
56f0: 62 72 61 72 79 2c 20 75 73 69 6e 67 20 74 68 65  brary, using the
5700: 0a 3c 73 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e  .<strong>-comman
5710: 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72  d</strong>, <str
5720: 6f 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73  ong>-password</s
5730: 74 72 6f 6e 67 3e 2c 20 61 6e 64 0a 3c 73 74 72  trong>, and.<str
5740: 6f 6e 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f  ong>-validate_co
5750: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f  mmand</strong> o
5760: 70 74 69 6f 6e 73 20 70 61 73 73 65 64 20 74 6f  ptions passed to
5770: 20 65 69 74 68 65 72 20 6f 66 0a 3c 73 74 72 6f   either of.<stro
5780: 6e 67 3e 74 6c 73 3a 3a 73 6f 63 6b 65 74 3c 2f  ng>tls::socket</
5790: 73 74 72 6f 6e 67 3e 20 6f 72 20 3c 73 74 72 6f  strong> or <stro
57a0: 6e 67 3e 74 6c 73 3a 3a 69 6d 70 6f 72 74 3c 2f  ng>tls::import</
57b0: 73 74 72 6f 6e 67 3e 2e 0a 49 66 20 74 68 65 20  strong>..If the 
57c0: 63 61 6c 6c 62 61 63 6b 20 67 65 6e 65 72 61 74  callback generat
57d0: 65 73 20 61 6e 20 65 72 72 6f 72 2c 20 74 68 65  es an error, the
57e0: 20 3c 62 3e 62 67 65 72 72 6f 72 3c 2f 62 3e 20   <b>bgerror</b> 
57f0: 63 6f 6d 6d 61 6e 64 20 77 69 74 68 20 62 65 0a  command with be.
5800: 69 6e 76 6f 6b 65 64 20 77 69 74 68 20 74 68 65  invoked with the
5810: 20 65 72 72 6f 72 20 69 6e 66 6f 72 6d 61 74 69   error informati
5820: 6f 6e 2e 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b  on..</p>..<block
5830: 71 75 6f 74 65 3e 0a 3c 64 6c 3e 0a 0a 20 20 20  quote>.<dl>..   
5840: 20 3c 64 74 3e 3c 73 74 72 6f 6e 67 3e 2d 63 6f   <dt><strong>-co
5850: 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 3c  mmand</strong> <
5860: 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e  em>callback</em>
5870: 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64 3e 0a 09  </dt>.    <dd>..
5880: 49 6e 76 6f 6b 65 73 20 74 68 65 20 73 70 65 63  Invokes the spec
5890: 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c 6c 62 61  ified <em>callba
58a0: 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70 74 20 61  ck</em> script a
58b0: 74 20 73 65 76 65 72 61 6c 20 70 6f 69 6e 74 73  t several points
58c0: 0a 09 64 75 72 69 6e 67 20 74 68 65 20 4f 70 65  ..during the Ope
58d0: 6e 53 53 4c 20 68 61 6e 64 73 68 61 6b 65 20 61  nSSL handshake a
58e0: 6e 64 20 75 73 65 2e 20 53 65 65 20 62 65 6c 6f  nd use. See belo
58f0: 77 20 66 6f 72 20 74 68 65 20 70 6f 73 73 69 62  w for the possib
5900: 6c 65 0a 09 61 72 67 75 6d 65 6e 74 73 20 70 61  le..arguments pa
5910: 73 73 65 64 20 74 6f 20 74 68 65 20 63 61 6c 6c  ssed to the call
5920: 62 61 63 6b 20 73 63 72 69 70 74 2e 20 56 61 6c  back script. Val
5930: 75 65 73 20 72 65 74 75 72 6e 65 64 20 66 72 6f  ues returned fro
5940: 6d 20 74 68 65 0a 09 63 61 6c 6c 62 61 63 6b 20  m the..callback 
5950: 61 72 65 20 69 67 6e 6f 72 65 64 2e 0a 0a 09 3c  are ignored....<
5960: 62 72 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e  br>..<br>...<dl>
5970: 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f  ...<dt>..  <stro
5980: 6e 67 3e 65 72 72 6f 72 3c 2f 73 74 72 6f 6e 67  ng>error</strong
5990: 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20 6d 65  > <em>channel me
59a0: 73 73 61 67 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74  ssage</em>..</dt
59b0: 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 65 20 3c  >..<dd>..  The <
59c0: 65 6d 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20  em>message</em> 
59d0: 61 72 67 75 6d 65 6e 74 20 63 6f 6e 74 61 69 6e  argument contain
59e0: 73 20 61 6e 20 65 72 72 6f 72 20 6d 65 73 73 61  s an error messa
59f0: 67 65 20 67 65 6e 65 72 61 74 65 64 0a 09 20 20  ge generated..  
5a00: 62 79 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66  by the OpenSSL f
5a10: 75 6e 63 74 69 6f 6e 20 3c 63 6f 64 65 3e 45 52  unction <code>ER
5a20: 52 5f 72 65 61 73 6f 6e 5f 65 72 72 6f 72 5f 73  R_reason_error_s
5a30: 74 72 69 6e 67 28 29 3c 2f 63 6f 64 65 3e 2e 0a  tring()</code>..
5a40: 09 3c 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09  .</dd>...<br>...
5a50: 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e  <dt>..  <strong>
5a60: 69 6e 66 6f 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65  info</strong> <e
5a70: 6d 3e 63 68 61 6e 6e 65 6c 20 6d 61 6a 6f 72 20  m>channel major 
5a80: 6d 69 6e 6f 72 20 6d 65 73 73 61 67 65 20 74 79  minor message ty
5a90: 70 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09  pe</em>..</dt>..
5aa0: 3c 64 64 3e 0a 09 20 20 54 68 69 73 20 66 6f 72  <dd>..  This for
5ab0: 6d 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73  m of callback is
5ac0: 20 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20   invoked by the 
5ad0: 4f 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e  OpenSSL function
5ae0: 0a 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54  ..  <code>SSL_CT
5af0: 58 5f 73 65 74 5f 69 6e 66 6f 5f 63 61 6c 6c 62  X_set_info_callb
5b00: 61 63 6b 28 29 3c 2f 63 6f 64 65 3e 20 64 75 72  ack()</code> dur
5b10: 69 6e 67 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73  ing connection s
5b20: 65 74 75 70 0a 09 20 20 61 6e 64 20 75 73 65 2e  etup..  and use.
5b30: 0a 09 20 20 3c 62 72 3e 0a 09 20 20 3c 75 6c 3e  ..  <br>..  <ul>
5b40: 0a 09 20 20 3c 6c 69 3e 50 6f 73 73 69 62 6c 65  ..  <li>Possible
5b50: 20 76 61 6c 75 65 73 20 66 6f 72 20 3c 65 6d 3e   values for <em>
5b60: 6d 61 6a 6f 72 3c 2f 65 6d 3e 20 61 72 65 3a 0a  major</em> are:.
5b70: 09 20 20 3c 63 6f 64 65 3e 68 61 6e 64 73 68 61  .  <code>handsha
5b80: 6b 65 2c 20 61 6c 65 72 74 2c 20 63 6f 6e 6e 65  ke, alert, conne
5b90: 63 74 2c 20 61 63 63 65 70 74 3c 2f 63 6f 64 65  ct, accept</code
5ba0: 3e 2e 3c 2f 6c 69 3e 0a 09 20 20 3c 6c 69 3e 50  >.</li>..  <li>P
5bb0: 6f 73 73 69 62 6c 65 20 76 61 6c 75 65 73 20 66  ossible values f
5bc0: 6f 72 20 3c 65 6d 3e 6d 69 6e 6f 72 3c 2f 65 6d  or <em>minor</em
5bd0: 3e 20 61 72 65 3a 0a 09 20 20 3c 63 6f 64 65 3e  > are:..  <code>
5be0: 73 74 61 72 74 2c 20 64 6f 6e 65 2c 20 72 65 61  start, done, rea
5bf0: 64 2c 20 77 72 69 74 65 2c 20 6c 6f 6f 70 2c 20  d, write, loop, 
5c00: 65 78 69 74 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c 69  exit</code>.</li
5c10: 3e 0a 09 20 20 3c 6c 69 3e 54 68 65 20 3c 65 6d  >..  <li>The <em
5c20: 3e 6d 65 73 73 61 67 65 3c 2f 65 6d 3e 20 61 72  >message</em> ar
5c30: 67 75 6d 65 6e 74 20 69 73 20 61 20 64 65 73 63  gument is a desc
5c40: 72 69 70 74 69 76 65 20 73 74 72 69 6e 67 20 77  riptive string w
5c50: 68 69 63 68 20 6d 61 79 0a 09 20 20 62 65 20 67  hich may..  be g
5c60: 65 6e 65 72 61 74 65 64 20 65 69 74 68 65 72 20  enerated either 
5c70: 62 79 20 3c 63 6f 64 65 3e 53 53 4c 5f 73 74 61  by <code>SSL_sta
5c80: 74 65 5f 73 74 72 69 6e 67 5f 6c 6f 6e 67 28 29  te_string_long()
5c90: 3c 2f 63 6f 64 65 3e 20 6f 72 20 62 79 0a 09 20  </code> or by.. 
5ca0: 20 3c 63 6f 64 65 3e 53 53 4c 5f 61 6c 65 72 74   <code>SSL_alert
5cb0: 5f 64 65 73 63 5f 73 74 72 69 6e 67 5f 6c 6f 6e  _desc_string_lon
5cc0: 67 28 29 3c 2f 63 6f 64 65 3e 2c 20 64 65 70 65  g()</code>, depe
5cd0: 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 63 6f 6e  nding on the con
5ce0: 74 65 78 74 2e 3c 2f 6c 69 3e 0a 09 20 20 3c 6c  text.</li>..  <l
5cf0: 69 3e 46 6f 72 20 61 6c 65 72 74 73 2c 20 74 68  i>For alerts, th
5d00: 65 20 70 6f 73 73 69 62 6c 65 20 76 61 6c 75 65  e possible value
5d10: 73 20 66 6f 72 20 3c 65 6d 3e 74 79 70 65 3c 2f  s for <em>type</
5d20: 65 6d 3e 20 61 72 65 3a 0a 09 20 20 3c 63 6f 64  em> are:..  <cod
5d30: 65 3e 77 61 72 6e 69 6e 67 2c 20 66 61 74 61 6c  e>warning, fatal
5d40: 2c 20 61 6e 64 20 75 6e 6b 6e 6f 77 6e 3c 2f 63  , and unknown</c
5d50: 6f 64 65 3e 2e 20 46 6f 72 20 6f 74 68 65 72 73  ode>. For others
5d60: 2c 0a 09 20 20 3c 63 6f 64 65 3e 69 6e 66 6f 3c  ,..  <code>info<
5d70: 2f 63 6f 64 65 3e 20 69 73 20 75 73 65 64 2e 3c  /code> is used.<
5d80: 2f 6c 69 3e 0a 09 20 20 3c 2f 75 6c 3e 0a 09 3c  /li>..  </ul>..<
5d90: 2f 64 64 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c  /dd>...<dt>..  <
5da0: 73 74 72 6f 6e 67 3e 6d 65 73 73 61 67 65 3c 2f  strong>message</
5db0: 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e  strong> <em>chan
5dc0: 6e 65 6c 20 64 69 72 65 63 74 69 6f 6e 20 76 65  nel direction ve
5dd0: 72 73 69 6f 6e 20 63 6f 6e 74 65 6e 74 5f 74 79  rsion content_ty
5de0: 70 65 20 64 61 74 61 3c 2f 65 6d 3e 0a 09 3c 2f  pe data</em>..</
5df0: 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54 68 69  dt>..<dd>..  Thi
5e00: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
5e10: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 62 79  ck is invoked by
5e20: 20 74 68 65 20 4f 70 65 6e 53 53 4c 20 66 75 6e   the OpenSSL fun
5e30: 63 74 69 6f 6e 0a 09 20 20 3c 63 6f 64 65 3e 53  ction..  <code>S
5e40: 53 4c 5f 73 65 74 5f 6d 73 67 5f 63 61 6c 6c 62  SL_set_msg_callb
5e50: 61 63 6b 28 29 3c 2f 63 6f 64 65 3e 20 77 68 65  ack()</code> whe
5e60: 6e 65 76 65 72 20 61 20 6d 65 73 73 61 67 65 20  never a message 
5e70: 69 73 20 73 65 6e 74 20 6f 72 0a 09 20 20 72 65  is sent or..  re
5e80: 63 65 69 76 65 64 2e 20 49 74 20 69 73 20 6f 6e  ceived. It is on
5e90: 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 77 68 65  ly available whe
5ea0: 6e 0a 09 20 20 4f 70 65 6e 53 53 4c 20 69 73 20  n..  OpenSSL is 
5eb0: 63 6f 6d 70 6c 69 65 64 20 77 69 74 68 20 74 68  complied with th
5ec0: 65 20 3c 65 6d 3e 65 6e 61 62 6c 65 2d 73 73 6c  e <em>enable-ssl
5ed0: 2d 74 72 61 63 65 3c 2f 65 6d 3e 20 6f 70 74 69  -trace</em> opti
5ee0: 6f 6e 2e 0a 09 20 20 57 68 65 72 65 20 3c 65 6d  on...  Where <em
5ef0: 3e 64 69 72 65 63 74 69 6f 6e 3c 2f 65 6d 3e 20  >direction</em> 
5f00: 69 73 20 53 65 6e 74 20 6f 72 20 52 65 63 65 69  is Sent or Recei
5f10: 76 65 64 2c 20 3c 65 6d 3e 76 65 72 73 69 6f 6e  ved, <em>version
5f20: 3c 2f 65 6d 3e 20 69 73 20 74 68 65 0a 09 20 20  </em> is the..  
5f30: 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69 6f 6e  protocol version
5f40: 2c 20 3c 65 6d 3e 63 6f 6e 74 65 6e 74 5f 74 79  , <em>content_ty
5f50: 70 65 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 6d  pe</em> is the m
5f60: 65 73 73 61 67 65 20 63 6f 6e 74 65 6e 74 20 74  essage content t
5f70: 79 70 65 2c 0a 09 20 20 61 6e 64 20 3c 65 6d 3e  ype,..  and <em>
5f80: 64 61 74 61 3c 2f 65 6d 3e 20 69 73 20 6d 6f 72  data</em> is mor
5f90: 65 20 69 6e 66 6f 20 6f 6e 20 74 68 65 20 6d 65  e info on the me
5fa0: 73 73 61 67 65 20 66 72 6f 6d 20 74 68 65 20 3c  ssage from the <
5fb0: 63 6f 64 65 3e 53 53 4c 5f 74 72 61 63 65 3c 2f  code>SSL_trace</
5fc0: 63 6f 64 65 3e 20 41 50 49 2e 0a 09 3c 2f 64 64  code> API...</dd
5fd0: 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09  >..<br>...<dt>..
5fe0: 20 20 3c 73 74 72 6f 6e 67 3e 73 65 73 73 69 6f    <strong>sessio
5ff0: 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63  n</strong> <em>c
6000: 68 61 6e 6e 65 6c 20 73 65 73 73 69 6f 6e 5f 69  hannel session_i
6010: 64 20 74 69 63 6b 65 74 20 6c 69 66 65 74 69 6d  d ticket lifetim
6020: 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c  e</em>..</dt>..<
6030: 64 64 3e 0a 09 20 20 54 68 69 73 20 66 6f 72 6d  dd>..  This form
6040: 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 69 73 20   of callback is 
6050: 69 6e 76 6f 6b 65 64 20 62 79 20 74 68 65 20 4f  invoked by the O
6060: 70 65 6e 53 53 4c 20 66 75 6e 63 74 69 6f 6e 0a  penSSL function.
6070: 09 20 20 3c 63 6f 64 65 3e 53 53 4c 5f 43 54 58  .  <code>SSL_CTX
6080: 5f 73 65 73 73 5f 73 65 74 5f 6e 65 77 5f 63 62  _sess_set_new_cb
6090: 28 29 3c 2f 63 6f 64 65 3e 2e 0a 09 20 20 57 68  ()</code>...  Wh
60a0: 65 72 65 20 3c 65 6d 3e 73 65 73 73 69 6f 6e 5f  ere <em>session_
60b0: 69 64 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 63  id</em> is the c
60c0: 75 72 72 65 6e 74 20 73 65 73 73 69 6f 6e 20 69  urrent session i
60d0: 64 65 6e 74 69 66 69 65 72 2c 0a 09 20 20 3c 65  dentifier,..  <e
60e0: 6d 3e 74 69 63 6b 65 74 3c 2f 65 6d 3e 20 69 73  m>ticket</em> is
60f0: 20 74 68 65 20 73 65 73 73 69 6f 6e 20 74 69 63   the session tic
6100: 6b 65 74 20 69 6e 66 6f 2c 20 61 6e 64 20 3c 65  ket info, and <e
6110: 6d 3e 6c 69 66 65 74 69 6d 65 3c 2f 65 6d 3e 0a  m>lifetime</em>.
6120: 09 20 20 69 73 20 74 68 65 20 74 68 65 20 74 69  .  is the the ti
6130: 63 6b 65 74 20 6c 69 66 65 74 69 6d 65 20 69 6e  cket lifetime in
6140: 20 73 65 63 6f 6e 64 73 2e 0a 09 3c 2f 64 64 3e   seconds...</dd>
6150: 0a 09 3c 62 72 3e 0a 09 3c 2f 64 6c 3e 0a 20 20  ..<br>..</dl>.  
6160: 20 20 3c 2f 64 64 3e 0a 0a 20 20 20 20 3c 62 72    </dd>..    <br
6170: 3e 0a 0a 20 20 20 20 3c 64 74 3e 3c 73 74 72 6f  >..    <dt><stro
6180: 6e 67 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74  ng>-password</st
6190: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61  rong> <em>callba
61a0: 63 6b 3c 2f 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20  ck</em></dt>.   
61b0: 20 3c 64 64 3e 0a 09 49 6e 76 6f 6b 65 73 20 74   <dd>..Invokes t
61c0: 68 65 20 73 70 65 63 69 66 69 65 64 20 3c 65 6d  he specified <em
61d0: 3e 63 61 6c 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73  >callback</em> s
61e0: 63 72 69 70 74 20 77 68 65 6e 20 4f 70 65 6e 53  cript when OpenS
61f0: 53 4c 20 6e 65 65 64 73 20 74 6f 0a 09 6f 62 74  SL needs to..obt
6200: 61 69 6e 20 61 20 70 61 73 73 77 6f 72 64 2e 20  ain a password. 
6210: 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68  See below for th
6220: 65 20 70 6f 73 73 69 62 6c 65 20 61 72 67 75 6d  e possible argum
6230: 65 6e 74 73 20 70 61 73 73 65 64 20 74 6f 0a 09  ents passed to..
6240: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72  the callback scr
6250: 69 70 74 2e 20 53 65 65 20 62 65 6c 6f 77 20 66  ipt. See below f
6260: 6f 72 20 76 61 6c 69 64 20 72 65 74 75 72 6e 20  or valid return 
6270: 76 61 6c 75 65 73 2e 0a 0a 09 3c 62 72 3e 0a 09  values....<br>..
6280: 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a 09 3c 64  <br>...<dl>...<d
6290: 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 70 61  t>..  <strong>pa
62a0: 73 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 20  ssword</strong> 
62b0: 3c 65 6d 3e 72 77 66 6c 61 67 20 73 69 7a 65 3c  <em>rwflag size<
62c0: 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c 64 64  /em>..</dt>..<dd
62d0: 3e 0a 09 20 20 49 6e 76 6f 6b 65 64 20 77 68 65  >..  Invoked whe
62e0: 6e 20 6c 6f 61 64 69 6e 67 20 6f 72 20 73 74 6f  n loading or sto
62f0: 72 69 6e 67 20 61 20 50 45 4d 20 63 65 72 74 69  ring a PEM certi
6300: 66 69 63 61 74 65 20 77 69 74 68 20 65 6e 63 72  ficate with encr
6310: 79 70 74 69 6f 6e 2e 0a 09 20 20 57 68 65 72 65  yption...  Where
6320: 20 3c 65 6d 3e 72 77 66 6c 61 67 3c 2f 65 6d 3e   <em>rwflag</em>
6330: 20 69 73 20 30 20 66 6f 72 20 72 65 61 64 69 6e   is 0 for readin
6340: 67 2f 64 65 63 72 79 70 74 69 6f 6e 20 6f 72 20  g/decryption or 
6350: 31 20 66 6f 72 0a 09 20 20 77 72 69 74 69 6e 67  1 for..  writing
6360: 2f 65 6e 63 72 79 70 74 69 6f 6e 20 28 63 61 6e  /encryption (can
6370: 20 70 72 6f 6d 70 74 20 75 73 65 72 20 74 6f 20   prompt user to 
6380: 63 6f 6e 66 69 72 6d 29 20 61 6e 64 0a 09 20 20  confirm) and..  
6390: 3c 65 6d 3e 73 69 7a 65 3c 2f 65 6d 3e 20 69 73  <em>size</em> is
63a0: 20 74 68 65 20 6d 61 78 20 70 61 73 73 77 6f 72   the max passwor
63b0: 64 20 6c 65 6e 67 74 68 20 69 6e 20 62 79 74 65  d length in byte
63c0: 73 2e 0a 09 20 20 54 68 65 20 63 61 6c 6c 62 61  s...  The callba
63d0: 63 6b 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  ck should return
63e0: 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 61 73   the password as
63f0: 20 61 20 73 74 72 69 6e 67 2e 0a 09 3c 2f 64 64   a string...</dd
6400: 3e 0a 20 20 20 20 3c 2f 64 64 3e 0a 0a 20 20 20  >.    </dd>..   
6410: 20 3c 62 72 3e 0a 0a 0a 20 20 20 20 3c 64 74 3e   <br>...    <dt>
6420: 3c 73 74 72 6f 6e 67 3e 2d 76 61 6c 69 64 61 74  <strong>-validat
6430: 65 63 6f 6d 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67  ecommand</strong
6440: 3e 20 3c 65 6d 3e 63 61 6c 6c 62 61 63 6b 3c 2f  > <em>callback</
6450: 65 6d 3e 3c 2f 64 74 3e 0a 20 20 20 20 3c 64 64  em></dt>.    <dd
6460: 3e 0a 09 49 6e 76 6f 6b 65 73 20 74 68 65 20 73  >..Invokes the s
6470: 70 65 63 69 66 69 65 64 20 3c 65 6d 3e 63 61 6c  pecified <em>cal
6480: 6c 62 61 63 6b 3c 2f 65 6d 3e 20 73 63 72 69 70  lback</em> scrip
6490: 74 20 64 75 72 69 6e 67 20 68 61 6e 64 73 68 61  t during handsha
64a0: 6b 65 20 69 6e 0a 09 6f 72 64 65 72 20 74 6f 20  ke in..order to 
64b0: 76 61 6c 69 64 61 74 65 20 74 68 65 20 70 72 6f  validate the pro
64c0: 76 69 64 65 64 20 76 61 6c 75 65 28 73 29 2e 20  vided value(s). 
64d0: 53 65 65 20 62 65 6c 6f 77 20 66 6f 72 20 74 68  See below for th
64e0: 65 20 70 6f 73 73 69 62 6c 65 0a 09 61 72 67 75  e possible..argu
64f0: 6d 65 6e 74 73 20 70 61 73 73 65 64 20 74 6f 20  ments passed to 
6500: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 63 72  the callback scr
6510: 69 70 74 2e 0a 09 54 6f 20 72 65 6a 65 63 74 20  ipt...To reject 
6520: 74 68 65 20 76 61 6c 75 65 20 61 6e 64 20 61 62  the value and ab
6530: 6f 72 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20  ort connection, 
6540: 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f  the callback sho
6550: 75 6c 64 20 72 65 74 75 72 6e 20 30 2e 0a 09 54  uld return 0...T
6560: 6f 20 61 63 63 65 70 74 20 74 68 65 20 76 61 6c  o accept the val
6570: 75 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20  ue and continue 
6580: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20  the connection, 
6590: 69 74 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e  it should return
65a0: 20 31 2e 0a 09 54 6f 20 72 65 6a 65 63 74 20 74   1...To reject t
65b0: 68 65 20 76 61 6c 75 65 2c 20 62 75 74 20 63 6f  he value, but co
65c0: 6e 74 69 6e 75 65 20 74 68 65 20 63 6f 6e 6e 65  ntinue the conne
65d0: 63 74 69 6f 6e 2c 20 69 74 20 73 68 6f 75 6c 64  ction, it should
65e0: 20 72 65 74 75 72 6e 20 32 2e 0a 0a 09 3c 62 72   return 2....<br
65f0: 3e 0a 09 3c 62 72 3e 0a 0a 09 3c 64 6c 3e 0a 0a  >..<br>...<dl>..
6600: 09 3c 64 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67  .<dt>..  <strong
6610: 3e 61 6c 70 6e 3c 2f 73 74 72 6f 6e 67 3e 20 3c  >alpn</strong> <
6620: 65 6d 3e 63 68 61 6e 6e 65 6c 20 70 72 6f 74 6f  em>channel proto
6630: 63 6f 6c 20 6d 61 74 63 68 3c 2f 65 6d 3e 0a 09  col match</em>..
6640: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 46  </dt>..<dd>..  F
6650: 6f 72 20 73 65 72 76 65 72 73 2c 20 74 68 69 73  or servers, this
6660: 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61 63   form of callbac
6670: 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65  k is invoked whe
6680: 6e 20 74 68 65 20 63 6c 69 65 6e 74 20 41 4c 50  n the client ALP
6690: 4e 0a 09 20 20 65 78 74 65 6e 73 69 6f 6e 20 69  N..  extension i
66a0: 73 20 72 65 63 65 69 76 65 64 2e 20 49 66 20 3c  s received. If <
66b0: 65 6d 3e 6d 61 74 63 68 3c 2f 65 6d 3e 20 69 73  em>match</em> is
66c0: 20 74 72 75 65 2c 20 3c 65 6d 3e 70 72 6f 74 6f   true, <em>proto
66d0: 63 6f 6c 3c 2f 65 6d 3e 0a 09 20 20 69 73 20 74  col</em>..  is t
66e0: 68 65 20 66 69 72 73 74 20 3c 62 3e 2d 61 6c 70  he first <b>-alp
66f0: 6e 3c 2f 62 3e 20 73 70 65 63 69 66 69 65 64 20  n</b> specified 
6700: 70 72 6f 74 6f 63 6f 6c 20 63 6f 6d 6d 6f 6e 20  protocol common 
6710: 74 6f 20 74 68 65 20 62 6f 74 68 20 74 68 65 0a  to the both the.
6720: 09 20 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65  .  client and se
6730: 72 76 65 72 2e 20 49 66 20 6e 6f 74 2c 20 74 68  rver. If not, th
6740: 65 20 66 69 72 73 74 20 63 6c 69 65 6e 74 20 73  e first client s
6750: 70 65 63 69 66 69 65 64 20 70 72 6f 74 6f 63 6f  pecified protoco
6760: 6c 20 69 73 0a 09 20 20 75 73 65 64 2e 20 43 61  l is..  used. Ca
6770: 6c 6c 65 64 20 61 66 74 65 72 20 68 65 6c 6c 6f  lled after hello
6780: 20 61 6e 64 20 41 4c 50 4e 20 63 61 6c 6c 62 61   and ALPN callba
6790: 63 6b 73 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c 62  cks...</dd>...<b
67a0: 72 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73 74  r>...<dt>..  <st
67b0: 72 6f 6e 67 3e 68 65 6c 6c 6f 3c 2f 73 74 72 6f  rong>hello</stro
67c0: 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65 6c 20  ng> <em>channel 
67d0: 73 65 72 76 65 72 6e 61 6d 65 3c 2f 65 6d 3e 0a  servername</em>.
67e0: 09 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20  .</dt>..<dd>..  
67f0: 46 6f 72 20 73 65 72 76 65 72 73 2c 20 74 68 69  For servers, thi
6800: 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c 62 61  s form of callba
6810: 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 64 75  ck is invoked du
6820: 72 69 6e 67 20 63 6c 69 65 6e 74 20 68 65 6c 6c  ring client hell
6830: 6f 0a 09 20 20 6d 65 73 73 61 67 65 20 70 72 6f  o..  message pro
6840: 63 65 73 73 69 6e 67 2e 20 49 74 20 69 73 20 75  cessing. It is u
6850: 73 65 64 20 74 6f 20 73 65 6c 65 63 74 20 61 6e  sed to select an
6860: 20 61 70 70 72 6f 70 72 69 61 74 65 20 63 65 72   appropriate cer
6870: 74 69 66 69 63 61 74 65 20 74 6f 0a 09 20 20 70  tificate to..  p
6880: 72 65 73 65 6e 74 2c 20 61 6e 64 20 6d 61 6b 65  resent, and make
6890: 20 6f 74 68 65 72 20 63 6f 6e 66 69 67 75 72 61   other configura
68a0: 74 69 6f 6e 20 61 64 6a 75 73 74 6d 65 6e 74 73  tion adjustments
68b0: 20 72 65 6c 65 76 61 6e 74 20 74 6f 20 74 68 61   relevant to tha
68c0: 74 0a 09 20 20 73 65 72 76 65 72 20 6e 61 6d 65  t..  server name
68d0: 20 61 6e 64 20 69 74 73 20 63 6f 6e 66 69 67 75   and its configu
68e0: 72 61 74 69 6f 6e 2e 20 43 61 6c 6c 65 64 20 62  ration. Called b
68f0: 65 66 6f 72 65 20 53 4e 49 20 61 6e 64 20 41 4c  efore SNI and AL
6900: 50 4e 20 63 61 6c 6c 62 61 63 6b 73 2e 0a 09 3c  PN callbacks...<
6910: 2f 64 64 3e 0a 0a 09 3c 62 72 3e 0a 0a 09 3c 64  /dd>...<br>...<d
6920: 74 3e 0a 09 20 20 3c 73 74 72 6f 6e 67 3e 73 6e  t>..  <strong>sn
6930: 69 3c 2f 73 74 72 6f 6e 67 3e 20 3c 65 6d 3e 63  i</strong> <em>c
6940: 68 61 6e 6e 65 6c 20 73 65 72 76 65 72 6e 61 6d  hannel servernam
6950: 65 3c 2f 65 6d 3e 0a 09 3c 2f 64 74 3e 0a 09 3c  e</em>..</dt>..<
6960: 64 64 3e 0a 09 20 20 46 6f 72 20 73 65 72 76 65  dd>..  For serve
6970: 72 73 2c 20 74 68 69 73 20 66 6f 72 6d 20 6f 66  rs, this form of
6980: 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76   callback is inv
6990: 6f 6b 65 64 20 77 68 65 6e 20 74 68 65 20 53 4e  oked when the SN
69a0: 49 20 65 78 74 65 6e 73 69 6f 6e 0a 09 20 20 66  I extension..  f
69b0: 72 6f 6d 20 74 68 65 20 63 6c 69 65 6e 74 20 69  rom the client i
69c0: 73 20 72 65 63 65 69 76 65 64 2e 20 57 68 65 72  s received. Wher
69d0: 65 20 3c 65 6d 3e 73 65 72 76 65 72 6e 61 6d 65  e <em>servername
69e0: 3c 2f 65 6d 3e 20 69 73 20 74 68 65 20 63 6c 69  </em> is the cli
69f0: 65 6e 74 0a 09 20 20 70 72 6f 76 69 64 65 64 20  ent..  provided 
6a00: 73 65 72 76 65 72 20 6e 61 6d 65 20 66 72 6f 6d  server name from
6a10: 20 74 68 65 20 3c 62 3e 2d 73 65 72 76 65 72 6e   the <b>-servern
6a20: 61 6d 65 3c 2f 62 3e 20 6f 70 74 69 6f 6e 2e 20  ame</b> option. 
6a30: 54 68 69 73 20 69 73 0a 09 20 20 75 73 65 64 20  This is..  used 
6a40: 77 68 65 6e 20 61 20 73 65 72 76 65 72 20 73 75  when a server su
6a50: 70 70 6f 72 74 73 20 6d 75 6c 74 69 70 6c 65 20  pports multiple 
6a60: 6e 61 6d 65 73 2c 20 73 6f 20 74 68 65 20 72 69  names, so the ri
6a70: 67 68 74 20 63 65 72 74 69 66 69 63 61 74 65 0a  ght certificate.
6a80: 09 20 20 63 61 6e 20 62 65 20 75 73 65 64 2e 20  .  can be used. 
6a90: 43 61 6c 6c 65 64 20 61 66 74 65 72 20 68 65 6c  Called after hel
6aa0: 6c 6f 20 63 61 6c 6c 62 61 63 6b 20 62 75 74 20  lo callback but 
6ab0: 62 65 66 6f 72 65 20 41 4c 50 4e 20 63 61 6c 6c  before ALPN call
6ac0: 62 61 63 6b 2e 0a 09 3c 2f 64 64 3e 0a 0a 09 3c  back...</dd>...<
6ad0: 62 72 3e 0a 0a 09 3c 64 74 3e 0a 09 20 20 3c 73  br>...<dt>..  <s
6ae0: 74 72 6f 6e 67 3e 76 65 72 69 66 79 3c 2f 73 74  trong>verify</st
6af0: 72 6f 6e 67 3e 20 3c 65 6d 3e 63 68 61 6e 6e 65  rong> <em>channe
6b00: 6c 20 64 65 70 74 68 20 63 65 72 74 20 73 74 61  l depth cert sta
6b10: 74 75 73 20 65 72 72 6f 72 3c 2f 65 6d 3e 0a 09  tus error</em>..
6b20: 3c 2f 64 74 3e 0a 09 3c 64 64 3e 0a 09 20 20 54  </dt>..<dd>..  T
6b30: 68 69 73 20 66 6f 72 6d 20 6f 66 20 63 61 6c 6c  his form of call
6b40: 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20  back is invoked 
6b50: 62 79 20 4f 70 65 6e 53 53 4c 20 77 68 65 6e 20  by OpenSSL when 
6b60: 61 20 6e 65 77 20 63 65 72 74 69 66 69 63 61 74  a new certificat
6b70: 65 0a 09 20 20 69 73 20 72 65 63 65 69 76 65 64  e..  is received
6b80: 20 66 72 6f 6d 20 74 68 65 20 70 65 65 72 2e 20   from the peer. 
6b90: 49 74 20 61 6c 6c 6f 77 73 20 74 68 65 20 63 6c  It allows the cl
6ba0: 69 65 6e 74 20 74 6f 20 63 68 65 63 6b 20 74 68  ient to check th
6bb0: 65 0a 09 20 20 63 65 72 74 69 66 69 63 61 74 65  e..  certificate
6bc0: 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 72 65   verification re
6bd0: 73 75 6c 74 73 20 61 6e 64 20 63 68 6f 6f 73 65  sults and choose
6be0: 20 77 68 65 74 68 65 72 20 74 6f 20 63 6f 6e 74   whether to cont
6bf0: 69 6e 75 65 0a 09 20 20 6f 72 20 6e 6f 74 2e 20  inue..  or not. 
6c00: 49 74 20 69 73 20 63 61 6c 6c 65 64 20 66 6f 72  It is called for
6c10: 20 65 61 63 68 20 63 65 72 74 69 66 69 63 61 74   each certificat
6c20: 65 20 69 6e 20 74 68 65 20 63 65 72 74 69 66 69  e in the certifi
6c30: 63 61 74 65 20 63 68 61 69 6e 2e 0a 09 20 20 3c  cate chain...  <
6c40: 75 6c 3e 0a 09 20 20 3c 6c 69 3e 54 68 65 20 3c  ul>..  <li>The <
6c50: 65 6d 3e 64 65 70 74 68 3c 2f 65 6d 3e 20 61 72  em>depth</em> ar
6c60: 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 69 6e 74  gument is an int
6c70: 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 69 6e  eger representin
6c80: 67 20 74 68 65 0a 09 20 20 63 75 72 72 65 6e 74  g the..  current
6c90: 20 64 65 70 74 68 20 6f 6e 20 74 68 65 20 63 65   depth on the ce
6ca0: 72 74 69 66 69 63 61 74 65 20 63 68 61 69 6e 2c  rtificate chain,
6cb0: 20 77 69 74 68 0a 09 20 20 3c 63 6f 64 65 3e 30   with..  <code>0
6cc0: 3c 2f 63 6f 64 65 3e 20 61 73 20 74 68 65 20 70  </code> as the p
6cd0: 65 65 72 20 63 65 72 74 69 66 69 63 61 74 65 20  eer certificate 
6ce0: 61 6e 64 20 68 69 67 68 65 72 20 76 61 6c 75 65  and higher value
6cf0: 73 20 67 6f 69 6e 67 0a 09 20 20 75 70 20 74 6f  s going..  up to
6d00: 20 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65   the Certificate
6d10: 20 41 75 74 68 6f 72 69 74 79 20 28 43 41 29 2e   Authority (CA).
6d20: 3c 2f 6c 69 3e 0a 09 20 20 3c 6c 69 3e 54 68 65  </li>..  <li>The
6d30: 20 3c 65 6d 3e 63 65 72 74 3c 2f 65 6d 3e 20 61   <em>cert</em> a
6d40: 72 67 75 6d 65 6e 74 20 69 73 20 61 20 6c 69 73  rgument is a lis
6d50: 74 20 6f 66 20 6b 65 79 2d 76 61 6c 75 65 20 70  t of key-value p
6d60: 61 69 72 73 20 73 69 6d 69 6c 61 72 0a 09 20 20  airs similar..  
6d70: 74 6f 20 74 68 6f 73 65 20 72 65 74 75 72 6e 65  to those returne
6d80: 64 20 62 79 0a 09 20 20 3c 61 20 68 72 65 66 3d  d by..  <a href=
6d90: 22 23 74 6c 73 3a 3a 73 74 61 74 75 73 22 3e 3c  "#tls::status"><
6da0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 73 74 61 74  strong>tls::stat
6db0: 75 73 3c 2f 73 74 72 6f 6e 67 3e 3c 2f 61 3e 2e  us</strong></a>.
6dc0: 3c 2f 6c 69 3e 0a 09 20 20 3c 6c 69 3e 54 68 65  </li>..  <li>The
6dd0: 20 3c 65 6d 3e 73 74 61 74 75 73 3c 2f 65 6d 3e   <em>status</em>
6de0: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20   argument is an 
6df0: 62 6f 6f 6c 65 61 6e 20 72 65 70 72 65 73 65 6e  boolean represen
6e00: 74 69 6e 67 20 74 68 65 0a 09 20 20 76 61 6c 69  ting the..  vali
6e10: 64 69 74 79 20 6f 66 20 74 68 65 20 63 75 72 72  dity of the curr
6e20: 65 6e 74 20 63 65 72 74 69 66 69 63 61 74 65 2e  ent certificate.
6e30: 0a 09 20 20 41 20 76 61 6c 75 65 20 6f 66 20 3c  ..  A value of <
6e40: 63 6f 64 65 3e 30 3c 2f 63 6f 64 65 3e 20 6d 65  code>0</code> me
6e50: 61 6e 73 20 74 68 65 20 63 65 72 74 69 66 69 63  ans the certific
6e60: 61 74 65 20 69 73 20 64 65 65 6d 65 64 20 69 6e  ate is deemed in
6e70: 76 61 6c 69 64 2e 0a 09 20 20 41 20 76 61 6c 75  valid...  A valu
6e80: 65 20 6f 66 20 3c 63 6f 64 65 3e 31 3c 2f 63 6f  e of <code>1</co
6e90: 64 65 3e 20 6d 65 61 6e 73 20 74 68 65 20 63 65  de> means the ce
6ea0: 72 74 69 66 69 63 61 74 65 20 69 73 20 64 65 65  rtificate is dee
6eb0: 6d 65 64 20 76 61 6c 69 64 2e 3c 2f 6c 69 3e 0a  med valid.</li>.
6ec0: 09 20 20 3c 6c 69 3e 54 68 65 20 3c 65 6d 3e 65  .  <li>The <em>e
6ed0: 72 72 6f 72 3c 2f 65 6d 3e 20 61 72 67 75 6d 65  rror</em> argume
6ee0: 6e 74 20 73 75 70 70 6c 69 65 73 20 74 68 65 20  nt supplies the 
6ef0: 6d 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2c  message, if any,
6f00: 20 67 65 6e 65 72 61 74 65 64 0a 09 20 20 62 79   generated..  by
6f10: 20 3c 63 6f 64 65 3e 58 35 30 39 5f 53 54 4f 52   <code>X509_STOR
6f20: 45 5f 43 54 58 5f 67 65 74 5f 65 72 72 6f 72 28  E_CTX_get_error(
6f30: 29 3c 2f 63 6f 64 65 3e 2e 3c 2f 6c 69 3e 0a 09  )</code>.</li>..
6f40: 20 20 3c 2f 75 6c 3e 0a 09 3c 2f 64 64 3e 0a 09    </ul>..</dd>..
6f50: 3c 62 72 3e 0a 09 3c 2f 64 6c 3e 0a 20 20 20 20  <br>..</dl>.    
6f60: 3c 2f 64 64 3e 0a 3c 2f 64 6c 3e 0a 3c 2f 62 6c  </dd>.</dl>.</bl
6f70: 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 0a 52  ockquote>..<p>.R
6f80: 65 66 65 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65  eference impleme
6f90: 6e 74 61 74 69 6f 6e 73 20 6f 66 20 74 68 65 73  ntations of thes
6fa0: 65 20 63 61 6c 6c 62 61 63 6b 73 20 61 72 65 20  e callbacks are 
6fb0: 70 72 6f 76 69 64 65 64 20 69 6e 20 74 68 65 0a  provided in the.
6fc0: 64 69 73 74 72 69 62 75 74 69 6f 6e 20 61 73 20  distribution as 
6fd0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c  <strong>tls::cal
6fe0: 6c 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c 20  lback</strong>, 
6ff0: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73  <strong>tls::pas
7000: 73 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 0a  sword</strong>,.
7010: 61 6e 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a  and <strong>tls:
7020: 3a 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e  :validate_comman
7030: 64 3c 2f 73 74 72 6f 6e 67 3e 20 72 65 73 70 65  d</strong> respe
7040: 63 74 69 76 65 6c 79 2e 20 20 4e 6f 74 65 20 74  ctively.  Note t
7050: 68 61 74 20 74 68 65 73 65 20 61 72 65 0a 3c 65  hat these are.<e
7060: 6d 3e 73 61 6d 70 6c 65 3c 2f 65 6d 3e 20 69 6d  m>sample</em> im
7070: 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 6e  plementations on
7080: 6c 79 2e 20 20 49 6e 20 61 20 6d 6f 72 65 20 72  ly.  In a more r
7090: 65 61 6c 69 73 74 69 63 20 64 65 70 6c 6f 79 6d  ealistic deploym
70a0: 65 6e 74 0a 79 6f 75 20 77 6f 75 6c 64 20 73 70  ent.you would sp
70b0: 65 63 69 66 79 20 79 6f 75 72 20 6f 77 6e 20 63  ecify your own c
70c0: 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 73 20  allback scripts 
70d0: 6f 6e 20 65 61 63 68 20 54 4c 53 20 63 68 61 6e  on each TLS chan
70e0: 6e 65 6c 20 75 73 69 6e 67 20 74 68 65 0a 3c 73  nel using the.<s
70f0: 74 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f  trong>-command</
7100: 73 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67  strong>, <strong
7110: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f  >-password</stro
7120: 6e 67 3e 2c 20 61 6e 64 20 3c 73 74 72 6f 6e 67  ng>, and <strong
7130: 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61  >-validate_comma
7140: 6e 64 3c 2f 73 74 72 6f 6e 67 3e 20 6f 70 74 69  nd</strong> opti
7150: 6f 6e 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54  ons..</p>..<p>.T
7160: 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76  he default behav
7170: 69 6f 72 20 77 68 65 6e 20 74 68 65 20 3c 73 74  ior when the <st
7180: 72 6f 6e 67 3e 2d 63 6f 6d 6d 61 6e 64 3c 2f 73  rong>-command</s
7190: 74 72 6f 6e 67 3e 20 61 6e 64 20 3c 73 74 72 6f  trong> and <stro
71a0: 6e 67 3e 2d 76 61 6c 69 64 61 74 65 5f 63 6f 6d  ng>-validate_com
71b0: 6d 61 6e 64 3c 2f 73 74 72 6f 6e 67 3e 0a 6f 70  mand</strong>.op
71c0: 74 69 6f 6e 73 20 61 72 65 20 6e 6f 74 20 73 70  tions are not sp
71d0: 65 63 69 66 69 65 64 20 69 73 20 66 6f 72 20 54  ecified is for T
71e0: 4c 53 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68  LS to process th
71f0: 65 20 61 73 73 6f 63 69 61 74 65 64 20 6c 69 62  e associated lib
7200: 72 61 72 79 20 63 61 6c 6c 62 61 63 6b 73 0a 69  rary callbacks.i
7210: 6e 74 65 72 6e 61 6c 6c 79 2e 20 54 68 65 20 64  nternally. The d
7220: 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20  efault behavior 
7230: 77 68 65 6e 20 74 68 65 20 3c 73 74 72 6f 6e 67  when the <strong
7240: 3e 2d 70 61 73 73 77 6f 72 64 3c 2f 73 74 72 6f  >-password</stro
7250: 6e 67 3e 20 6f 70 74 69 6f 6e 20 69 73 20 6e 6f  ng> option is no
7260: 74 0a 73 70 65 63 69 66 69 65 64 20 69 73 20 66  t.specified is f
7270: 6f 72 20 54 4c 53 20 74 6f 20 70 72 6f 63 65 73  or TLS to proces
7280: 73 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64  s the associated
7290: 20 6c 69 62 72 61 72 79 20 63 61 6c 6c 62 61 63   library callbac
72a0: 6b 73 20 62 79 20 61 74 74 65 6d 70 74 69 6e 67  ks by attempting
72b0: 0a 74 6f 20 63 61 6c 6c 20 3c 73 74 72 6f 6e 67  .to call <strong
72c0: 3e 74 6c 73 3a 3a 70 61 73 73 77 6f 72 64 3c 2f  >tls::password</
72d0: 73 74 72 6f 6e 67 3e 2e 0a 54 68 65 20 64 69 66  strong>..The dif
72e0: 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20  ference between 
72f0: 74 68 65 73 65 20 74 77 6f 20 62 65 68 61 76 69  these two behavi
7300: 6f 72 73 20 69 73 20 61 20 63 6f 6e 73 65 71 75  ors is a consequ
7310: 65 6e 63 65 20 6f 66 20 6d 61 69 6e 74 61 69 6e  ence of maintain
7320: 69 6e 67 0a 63 6f 6d 70 61 74 69 62 69 6c 69 74  ing.compatibilit
7330: 79 20 77 69 74 68 20 65 61 72 6c 69 65 72 20 69  y with earlier i
7340: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2e 0a  mplementations..
7350: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 3c 73  </p>..<p>.The <s
7360: 74 72 6f 6e 67 3e 74 6c 73 3a 3a 64 65 62 75 67  trong>tls::debug
7370: 3c 2f 73 74 72 6f 6e 67 3e 20 76 61 72 69 61 62  </strong> variab
7380: 6c 65 20 70 72 6f 76 69 64 65 73 20 73 6f 6d 65  le provides some
7390: 20 61 64 64 69 74 69 6f 6e 61 6c 0a 63 6f 6e 74   additional.cont
73a0: 72 6f 6c 20 6f 76 65 72 20 74 68 65 73 65 20 72  rol over these r
73b0: 65 66 65 72 65 6e 63 65 20 63 61 6c 6c 62 61 63  eference callbac
73c0: 6b 73 2e 20 20 49 74 73 20 76 61 6c 75 65 20 69  ks.  Its value i
73d0: 73 20 7a 65 72 6f 20 62 79 20 64 65 66 61 75 6c  s zero by defaul
73e0: 74 2e 0a 48 69 67 68 65 72 20 76 61 6c 75 65 73  t..Higher values
73f0: 20 70 72 6f 64 75 63 65 20 6d 6f 72 65 20 64 69   produce more di
7400: 61 67 6e 6f 73 74 69 63 20 6f 75 74 70 75 74 2c  agnostic output,
7410: 20 61 6e 64 20 77 69 6c 6c 20 61 6c 73 6f 20 66   and will also f
7420: 6f 72 63 65 20 74 68 65 0a 76 65 72 69 66 79 20  orce the.verify 
7430: 6d 65 74 68 6f 64 20 69 6e 20 3c 73 74 72 6f 6e  method in <stron
7440: 67 3e 74 6c 73 3a 3a 63 61 6c 6c 62 61 63 6b 3c  g>tls::callback<
7450: 2f 73 74 72 6f 6e 67 3e 20 74 6f 20 61 63 63 65  /strong> to acce
7460: 70 74 20 74 68 65 0a 63 65 72 74 69 66 69 63 61  pt the.certifica
7470: 74 65 2c 20 65 76 65 6e 20 77 68 65 6e 20 69 74  te, even when it
7480: 20 69 73 20 69 6e 76 61 6c 69 64 2e 0a 3c 2f 70   is invalid..</p
7490: 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68 65 20  >..<p>.<em>.The 
74a0: 75 73 65 20 6f 66 20 74 68 65 20 72 65 66 65 72  use of the refer
74b0: 65 6e 63 65 20 63 61 6c 6c 62 61 63 6b 73 20 3c  ence callbacks <
74c0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 61 6c 6c  strong>tls::call
74d0: 62 61 63 6b 3c 2f 73 74 72 6f 6e 67 3e 2c 0a 3c  back</strong>,.<
74e0: 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70 61 73 73  strong>tls::pass
74f0: 77 6f 72 64 3c 2f 73 74 72 6f 6e 67 3e 2c 20 61  word</strong>, a
7500: 6e 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a  nd <strong>tls::
7510: 76 61 6c 69 64 61 74 65 5f 63 6f 6d 6d 61 6e 64  validate_command
7520: 3c 2f 73 74 72 6f 6e 67 3e 0a 69 73 20 6e 6f 74  </strong>.is not
7530: 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 20 54   recommended.  T
7540: 68 65 79 20 6d 61 79 20 62 65 20 72 65 6d 6f 76  hey may be remov
7550: 65 64 20 66 72 6f 6d 20 66 75 74 75 72 65 20 72  ed from future r
7560: 65 6c 65 61 73 65 73 2e 0a 3c 2f 65 6d 3e 0a 3c  eleases..</em>.<
7570: 2f 70 3e 0a 0a 3c 70 3e 0a 3c 65 6d 3e 0a 54 68  /p>..<p>.<em>.Th
7580: 65 20 75 73 65 20 6f 66 20 74 68 65 20 76 61 72  e use of the var
7590: 69 61 62 6c 65 20 3c 73 74 72 6f 6e 67 3e 74 6c  iable <strong>tl
75a0: 73 3a 3a 64 65 62 75 67 3c 2f 73 74 72 6f 6e 67  s::debug</strong
75b0: 3e 20 69 73 20 6e 6f 74 20 72 65 63 6f 6d 6d 65  > is not recomme
75c0: 6e 64 65 64 2e 0a 49 74 20 6d 61 79 20 62 65 20  nded..It may be 
75d0: 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 66 75 74  removed from fut
75e0: 75 72 65 20 72 65 6c 65 61 73 65 73 2e 0a 3c 2f  ure releases..</
75f0: 65 6d 3e 0a 3c 2f 70 3e 0a 0a 3c 68 33 3e 3c 61  em>.</p>..<h3><a
7600: 20 6e 61 6d 65 3d 22 44 45 42 55 47 22 3e 44 45   name="DEBUG">DE
7610: 42 55 47 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 54 4c  BUG</a></h3>..TL
7620: 53 20 6b 65 79 20 6c 6f 67 67 69 6e 67 20 63 61  S key logging ca
7630: 6e 20 62 65 20 65 6e 61 62 6c 65 64 20 62 79 20  n be enabled by 
7640: 73 65 74 74 69 6e 67 20 74 68 65 20 65 6e 76 69  setting the envi
7650: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
7660: 0a 3c 62 3e 53 53 4c 4b 45 59 4c 4f 47 46 49 4c  .<b>SSLKEYLOGFIL
7670: 45 3c 2f 62 3e 20 74 6f 20 74 68 65 20 6e 61 6d  E</b> to the nam
7680: 65 20 6f 66 20 74 68 65 20 66 69 6c 65 20 74 6f  e of the file to
7690: 20 6c 6f 67 20 74 6f 2e 20 54 68 65 6e 20 77 68   log to. Then wh
76a0: 65 6e 65 76 65 72 20 54 4c 53 0a 6b 65 79 20 6d  enever TLS.key m
76b0: 61 74 65 72 69 61 6c 20 69 73 20 67 65 6e 65 72  aterial is gener
76c0: 61 74 65 64 20 6f 72 20 72 65 63 65 69 76 65 64  ated or received
76d0: 20 69 74 20 77 69 6c 6c 20 62 65 20 6c 6f 67 67   it will be logg
76e0: 65 64 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20  ed to the file. 
76f0: 54 68 69 73 0a 69 73 20 75 73 65 66 75 6c 20 66  This.is useful f
7700: 6f 72 20 6c 6f 67 67 69 6e 67 20 6b 65 79 20 64  or logging key d
7710: 61 74 61 20 66 6f 72 20 6e 65 74 77 6f 72 6b 20  ata for network 
7720: 6c 6f 67 67 69 6e 67 20 74 6f 6f 6c 73 20 74 6f  logging tools to
7730: 20 75 73 65 20 74 6f 0a 64 65 63 72 79 70 74 20   use to.decrypt 
7740: 74 68 65 20 64 61 74 61 2e 0a 0a 3c 68 33 3e 3c  the data...<h3><
7750: 61 20 6e 61 6d 65 3d 22 48 54 54 50 53 20 45 58  a name="HTTPS EX
7760: 41 4d 50 4c 45 22 3e 48 54 54 50 53 20 45 58 41  AMPLE">HTTPS EXA
7770: 4d 50 4c 45 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c  MPLE</a></h3>..<
7780: 70 3e 54 68 69 73 20 65 78 61 6d 70 6c 65 20 75  p>This example u
7790: 73 65 73 20 61 20 73 61 6d 70 6c 65 20 73 65 72  ses a sample ser
77a0: 76 65 72 2e 70 65 6d 20 70 72 6f 76 69 64 65 64  ver.pem provided
77b0: 20 77 69 74 68 20 74 68 65 20 54 4c 53 20 72 65   with the TLS re
77c0: 6c 65 61 73 65 2c 0a 63 6f 75 72 74 65 73 79 20  lease,.courtesy 
77d0: 6f 66 20 74 68 65 20 3c 73 74 72 6f 6e 67 3e 4f  of the <strong>O
77e0: 70 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 20  penSSL</strong> 
77f0: 70 72 6f 6a 65 63 74 2e 3c 2f 70 3e 0a 0a 3c 70  project.</p>..<p
7800: 72 65 3e 3c 63 6f 64 65 3e 0a 70 61 63 6b 61 67  re><code>.packag
7810: 65 20 72 65 71 75 69 72 65 20 68 74 74 70 0a 70  e require http.p
7820: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74  ackage require t
7830: 6c 73 0a 0a 68 74 74 70 3a 3a 72 65 67 69 73 74  ls..http::regist
7840: 65 72 20 68 74 74 70 73 20 34 34 33 20 5b 6c 69  er https 443 [li
7850: 73 74 20 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74  st ::tls::socket
7860: 20 2d 61 75 74 6f 73 65 72 76 65 72 6e 61 6d 65   -autoservername
7870: 20 74 72 75 65 20 2d 72 65 71 75 69 72 65 20 74   true -require t
7880: 72 75 65 20 2d 63 61 64 69 72 20 2f 65 74 63 2f  rue -cadir /etc/
7890: 73 73 6c 2f 63 65 72 74 73 5d 0a 0a 73 65 74 20  ssl/certs]..set 
78a0: 74 6f 6b 20 5b 68 74 74 70 3a 3a 67 65 74 75 72  tok [http::getur
78b0: 6c 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 74 63  l https://www.tc
78c0: 6c 2e 74 6b 2f 5d 0a 3c 2f 63 6f 64 65 3e 3c 2f  l.tk/].</code></
78d0: 70 72 65 3e 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d  pre>..<h3><a nam
78e0: 65 3d 22 53 50 45 43 49 41 4c 20 43 4f 4e 53 49  e="SPECIAL CONSI
78f0: 44 45 52 41 54 49 4f 4e 53 22 3e 53 50 45 43 49  DERATIONS">SPECI
7900: 41 4c 20 43 4f 4e 53 49 44 45 52 41 54 49 4f 4e  AL CONSIDERATION
7910: 53 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 54  S</a></h3>..<p>T
7920: 68 65 20 63 61 70 61 62 69 6c 69 74 69 65 73 20  he capabilities 
7930: 6f 66 20 74 68 69 73 20 70 61 63 6b 61 67 65 20  of this package 
7940: 63 61 6e 20 76 61 72 79 20 65 6e 6f 72 6d 6f 75  can vary enormou
7950: 73 6c 79 20 62 61 73 65 64 20 75 70 6f 6e 20 68  sly based upon h
7960: 6f 77 20 79 6f 75 72 0a 4f 70 65 6e 53 53 4c 20  ow your.OpenSSL 
7970: 6c 69 62 72 61 72 79 20 77 61 73 20 63 6f 6e 66  library was conf
7980: 69 67 75 72 65 64 20 61 6e 64 20 62 75 69 6c 74  igured and built
7990: 2e 20 4e 65 77 20 76 65 72 73 69 6f 6e 73 20 6d  . New versions m
79a0: 61 79 20 6f 62 73 6f 6c 65 74 65 20 6f 6c 64 65  ay obsolete olde
79b0: 72 0a 70 72 6f 74 6f 63 6f 6c 20 76 65 72 73 69  r.protocol versi
79c0: 6f 6e 73 2c 20 61 64 64 20 6f 72 20 72 65 6d 6f  ons, add or remo
79d0: 76 65 20 63 69 70 68 65 72 73 2c 20 63 68 61 6e  ve ciphers, chan
79e0: 67 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65  ge default value
79f0: 73 2c 20 65 74 63 2e 20 55 73 65 20 74 68 65 0a  s, etc. Use the.
7a00: 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 63 69 70  <strong>tls::cip
7a10: 68 65 72 73 3c 2f 73 74 72 6f 6e 67 3e 20 61 6e  hers</strong> an
7a20: 64 20 3c 73 74 72 6f 6e 67 3e 74 6c 73 3a 3a 70  d <strong>tls::p
7a30: 72 6f 74 6f 63 6f 6c 73 3c 2f 73 74 72 6f 6e 67  rotocols</strong
7a40: 3e 20 63 6f 6d 6d 61 6e 64 73 20 74 6f 0a 6f 62  > commands to.ob
7a50: 74 61 69 6e 20 74 68 65 20 73 75 70 70 6f 72 74  tain the support
7a60: 65 64 20 76 65 72 73 69 6f 6e 73 2e 3c 2f 70 3e  ed versions.</p>
7a70: 0a 0a 3c 68 33 3e 3c 61 20 6e 61 6d 65 3d 22 53  ..<h3><a name="S
7a80: 45 45 20 41 4c 53 4f 22 3e 53 45 45 20 41 4c 53  EE ALSO">SEE ALS
7a90: 4f 3c 2f 61 3e 3c 2f 68 33 3e 0a 0a 3c 70 3e 3c  O</a></h3>..<p><
7aa0: 73 74 72 6f 6e 67 3e 73 6f 63 6b 65 74 3c 2f 73  strong>socket</s
7ab0: 74 72 6f 6e 67 3e 2c 20 3c 73 74 72 6f 6e 67 3e  trong>, <strong>
7ac0: 66 69 6c 65 65 76 65 6e 74 2c 20 3c 2f 73 74 72  fileevent, </str
7ad0: 6f 6e 67 3e 3c 61 0a 68 72 65 66 3d 22 68 74 74  ong><a.href="htt
7ae0: 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 73 73 6c 2e  p://www.openssl.
7af0: 6f 72 67 2f 22 3e 3c 73 74 72 6f 6e 67 3e 4f 70  org/"><strong>Op
7b00: 65 6e 53 53 4c 3c 2f 73 74 72 6f 6e 67 3e 3c 2f  enSSL</strong></
7b10: 61 3e 3c 2f 70 3e 0a 0a 3c 68 72 3e 0a 0a 3c 70  a></p>..<hr>..<p
7b20: 72 65 3e 0a 43 6f 70 79 72 69 67 68 74 20 26 63  re>.Copyright &c
7b30: 6f 70 79 3b 20 31 39 39 39 20 4d 61 74 74 20 4e  opy; 1999 Matt N
7b40: 65 77 6d 61 6e 2e 0a 43 6f 70 79 72 69 67 68 74  ewman..Copyright
7b50: 20 26 63 6f 70 79 3b 20 32 30 30 34 20 53 74 61   &copy; 2004 Sta
7b60: 72 66 69 73 68 20 53 79 73 74 65 6d 73 2e 0a 3c  rfish Systems..<
7b70: 2f 70 72 65 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f  /pre>.</body>.</
7b80: 68 74 6d 6c 3e 0a                                html>.