sslOverview.html 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>SSL Overview</title>
  5. <!-- Copyright Embedthis Software. All Rights Reserved. -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <meta charset="utf-8" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  10. <meta name="description" content="Simple, fast, secure embedded web server" />
  11. <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700'
  12. rel='stylesheet' type='text/css'>
  13. <link href='https://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
  14. <link href="../images/favicon.ico" rel="shortcut icon" />
  15. <link href="../lib/semantic-ui/semantic.min.css" rel="stylesheet" type="text/css" />
  16. <link href="../css/all.min.css" rel="stylesheet" type="text/css" />
  17. <link href="../css/api.min.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body class="show-sidebar">
  20. <div class="sidebar">
  21. <div class="ui large left vertical inverted labeled menu">
  22. <div class="item">
  23. <a href="../" class="logo">GoAhead Docs</a>
  24. </div>
  25. <div class="item">
  26. <a href="../">
  27. <b>General</b>
  28. </a>
  29. <div class="menu">
  30. <a class="item" href="../">GoAhead Overview</a>
  31. <a class="item" href="../users/features.html">GoAhead Features</a>
  32. <a class="item" href="https://embedthis.com/goahead/download.html">Download</a>
  33. <a class="item" href="../licensing/">Licensing</a>
  34. </div>
  35. </div>
  36. <div class="item">
  37. <a href="../start/">
  38. <b>Getting Started</b>
  39. </a>
  40. <div class="menu">
  41. <a class="item" href="../start/quick.html">Quick Start</a>
  42. <a class="item" href="../start/installing.html">Installing GoAhead</a>
  43. <a class="item" href="../start/running.html">Running GoAhead</a>
  44. <a class="item" href="../start/releaseNotes.html">Release Notes</a>
  45. <a class="item" href="../start/faq.html">GoAhead FAQ</a>
  46. <a class="item" href="../start/source.html">Building from Source</a>
  47. </div>
  48. </div>
  49. <div class="item">
  50. <a href="../users/"><b>User's Guide</b></a>
  51. <div class="menu">
  52. <a class="item" href="../users/ports.html">Ports and Binding</a>
  53. <a class="item" href="../users/routing.html">Routing Requests</a>
  54. <a class="item" href="../users/handlers.html">Request Handlers</a>
  55. <a class="item" href="../users/js.html">Embedded Javascript</a>
  56. <a class="item" href="../users/jst.html">Javascript Templates</a>
  57. <a class="item" href="../users/goactions.html">GoActions</a>
  58. <a class="item" href="../users/cgi.html">CGI Programs</a>
  59. <a class="item" href="../users/authentication.html">User Authentication</a>
  60. <a class="item" href="../users/logFiles.html">Log Files</a>
  61. <a class="item" href="../users/ssl.html">Secure Sockets (SSL)</a>
  62. <a class="item" href="../users/security.html">Security Considerations</a>
  63. <a class="item" href="../users/man.html">Man Pages</a>
  64. </div>
  65. </div>
  66. <div class="item">
  67. <a href="../developers/">Developer's Guide</a>
  68. <div class="menu">
  69. <a class="item" href="../developers/embedding.html">Embedding GoAhead</a>
  70. <a class="item" href="../developers/handlers.html">Creating GoAhead Handlers</a>
  71. <a class="item" href="../developers/authstore.html">Creating Password Verifiers</a>
  72. <a class="item" href="../developers/migrating.html">Migrating to GoAhead 3</a>
  73. <a class="item" href="../developers/rom.html">Serving Pages from ROM</a>
  74. </div>
  75. </div>
  76. <div class="item">
  77. <a href="../ref/">Reference Guide</a>
  78. <div class="menu">
  79. <a class="item" href="../ref/compatibility.html">Compatibility</a>
  80. <a class="item" href="../ref/native.html">API Library</a>
  81. <a class="item" href="../ref/architecture.html">GoAhead Architecture</a>
  82. <a class="item" href="../standards/http.html">HTTP References</a>
  83. </div>
  84. </div>
  85. <div class="item">
  86. <a href="../developers/project.html">Project Resources</a>
  87. <div class="menu">
  88. <a class="item" href="http://goo.gl/IGbiio">Official GoAhead News</a>
  89. <a class="item" href="https://embedthis.com/goahead/">GoAhead Web Site</a>
  90. <a class="item" href="https://github.com/embedthis/goahead">Source Code Repository</a>
  91. <a class="item" href="https://github.com/embedthis/goahead/issues/99">GoAhead Security Alerts</a>
  92. <a class="item" href="https://github.com/embedthis/goahead/issues">Project Issue Database</a>
  93. <a class="item" href="https://github.com/embedthis/goahead/releases">Change Log</a>
  94. <a class="item" href="https://github.com/embedthis/goahead/milestones">Roadmap</a>
  95. <a class="item" href="https://embedthis.com/developers/contributors.html">Contributors Agreement</a>
  96. </div>
  97. </div>
  98. <div class="item">
  99. <b>Links</b>
  100. <div class="menu">
  101. <a class="item" href="https://embedthis.com/">Embedthis Web Site</a>
  102. <a class="item" href="https://embedthis.com/blog/">Embedthis Blog</a>
  103. <a class="item" href="http://twitter.com/embedthat">Twitter</a>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="ui inverted masthead">
  109. <div class="ui fixed inverted menu">
  110. <div class="ui sidebar-launch button">
  111. <i class="icon list layout"></i>
  112. </div>
  113. <div class="right menu">
  114. <a class="item" href="https://embedthis.com/">Embedthis</a>
  115. <a class="item" href="https://embedthis.com/goahead/">GoAhead Site</a>
  116. <span class="desktop-only">
  117. <a class="item" href="http://goo.gl/9bL9rM">GoAhead News</a>
  118. <a class="item" href="https://github.com/embedthis/goahead">Repository</a>
  119. <a class="item" href="https://embedthis.com/blog/">Blog</a>
  120. <a class="item" href="https://twitter.com/embedthat">Twitter</a>
  121. </span>
  122. </div>
  123. </div>
  124. <div class="ui breadcrumb">
  125. <a class="section" href="../">Home</a>
  126. <div class="divider">/</div>
  127. <a class="section" href="../users/">
  128. User's Guide
  129. </a>
  130. <div class="divider">/</div>
  131. <a class="active section" href="sslOverview.html">SSL Overview</a>
  132. </div>
  133. <iframe class="version desktop-only" src="../version.html"></iframe>
  134. </div>
  135. <div class="content">
  136. <h1>Secure Socket Layer (SSL) Overview</h1>
  137. <p>GoAhead supports the Secure Sockets Layer (SSL) protocol for authenticating systems and encrypting data.
  138. Use of this protocol enables secure data transmission to and from clients in a standards-based manner. The
  139. Secure Sockets Layer protocol is a protocol layer which may be placed between a reliable
  140. connection-oriented network layer protocol (e.g. TCP/IP) and the application protocol layer (e.g. HTTP).
  141. SSL provides for secure communication between client and server by allowing mutual authentication, the use
  142. of digital signatures for integrity, and encryption for privacy.</p>
  143. <p>This following document explains SSL and how to configure SSL in GoAhead. It has heavily borrowed from
  144. the Apache Documentation. Many thanks to the fine folks at Apache for this excellent base material and for
  145. Frederick Hirsch who authored quite a bit of the original material.</p>
  146. <p>If you have a good understanding of SSL and now you want to configure SSL for GoAhead, you may wish
  147. to skip the background and read immediately how to setup
  148. <a href="ssl.html">SSL for GoAhead</a>.</p>
  149. <a id="cryptographicTechniques"></a>
  150. <h2 >Cryptographic Techniques</h2>
  151. <p>Understanding SSL requires an understanding of cryptographic algorithms, message digest functions (aka.
  152. one-way or hash functions), and digital signatures. The following section provides a brief introduction to
  153. the cryptographic foundations of SSL. If you are already familiar with this material, please skip forward
  154. to the <a href="#sslOverview">SSL Overview</a> section.</p>
  155. <h3>Cryptographic Algorithms</h3>
  156. <p>Consider the example of Alice who wants to send a message to her bank to transfer some money. She would
  157. like the message to be private, since it will include information such as her account number and transfer
  158. amount. One solution is to use a cryptographic algorithm, a technique that would transform her message into
  159. an encrypted form, unreadable except by those it is intended for. Once in this form, the message may only
  160. be interpreted through the use of a secret key. Without the key, the message is useless: good cryptographic
  161. algorithms make it so difficult for intruders to decode the original text that it isn't worth their
  162. effort.</p>
  163. <p>There are two categories of cryptographic algorithms: conventional and public key.</p>
  164. <h4><a id="symmetricCryptography"></a>Symmetric Cryptography</h4>
  165. <p>Symmetric cryptography, requires the sender and receiver to share a key: a secret piece of information
  166. that may be used to encrypt or decrypt a message. If this key is secret, then nobody other than the sender
  167. or receiver may read the message. If Alice and the bank know a secret key, then they may send each other
  168. private messages. The task of privately choosing a key before communicating, however, can be
  169. problematic.</p>
  170. <h4><a id="publicKeyCryptography"></a>Public Key Cryptography</h4>
  171. <p>Public key cryptography also known as asymmetric cryptography, solves the key exchange problem by
  172. defining an algorithm which uses two keys, each of which may be used to encrypt a message. If one key is
  173. used to encrypt a message then the other may be used to decrypt it. This makes it possible to receive
  174. secure messages by simply publishing one key (the public key) and keeping the other secret (the private
  175. key).</p>
  176. <p>Anyone may encrypt a message using the public key, but only the owner of the private key will be able to
  177. read it. In this way, you may send private messages to the owner of a key-pair (the bank), by encrypting it
  178. using their public key. Only the bank will be able to decrypt it.</p>
  179. <h3><a id="messageDigests"></a>Message Digests</h3>
  180. <p>Although Alice may encrypt her message to make it private, there is still a concern that someone might
  181. modify her original message or substitute it with a different one, in order to transfer the money to
  182. themselves, for instance. One way of guaranteeing the integrity of Alice's message is to create a concise
  183. summary of her message and send this to the bank as well. Upon receipt of the message, the bank creates its
  184. own summary and compares it with the one Alice sent. If they agree then the message was received
  185. intact.</p>
  186. <p>A summary such as this is called a <b>message digest</b>, <em>one-way function</em> or <em>hash
  187. function</em>. Message digests are used to create short, fixed-length representations of longer,
  188. variable-length messages. Digest algorithms are designed to produce unique digests for different messages.
  189. Message digests are designed to make it too difficult to determine the message from the digest, and also
  190. impossible to find two different messages which create the same digest &mdash; thus eliminating the
  191. possibility of substituting one message for another while maintaining the same digest.</p>
  192. <p>Another challenge that Alice faces is finding a way to send the digest to the bank securely; when this
  193. is achieved, the integrity of the associated message is assured. One way to do this is to include the
  194. digest in a digital signature.</p>
  195. <h3><a id="digitalSignatures"></a>Digital Signatures</h3>
  196. <p>When Alice sends a message to the bank, the bank needs to ensure that the message is really from her, so
  197. an intruder does not request a transaction involving her account. A <em>digital signature</em>, created by
  198. Alice and included with the message, serves this purpose.</p>
  199. <p>Digital signatures are created by encrypting a digest of the message, and other information (such as a
  200. sequence number) with the sender's private key. Though anyone may <em>decrypt</em> the signature using the
  201. public key, only the signer knows the private key. This means that only they may have signed it. Including
  202. the digest in the signature means the signature is only good for that message; it also ensures the
  203. integrity of the message since no one can change the digest and still sign it.</p>
  204. <p>To guard against interception and reuse of the signature by an intruder at a later date, the signature
  205. contains a unique sequence number. This protects the bank from a fraudulent claim from Alice that she did
  206. not send the message &mdash; only she could have signed it (non-repudiation).</p><a id="certificates"></a>
  207. <h2 >Certificates</h2>
  208. <p>Although Alice could have sent a private message to the bank, signed it, and ensured the integrity of
  209. the message, she still needs to be sure that she is really communicating with the bank. This means that she
  210. needs to be sure that the public key she is using corresponds to the bank's private key. Similarly, the
  211. bank also needs to verify that the message signature really corresponds to Alice's signature.</p>
  212. <p>If each party has a certificate which validates the other's identity, confirms the public key, and is
  213. signed by a trusted agency, then they both will be assured that they are communicating with whom they think
  214. they are. Such a trusted agency is called a <em>Certificate Authority</em>, and certificates are used for
  215. authentication.</p>
  216. <h3>Certificate Contents</h3>
  217. <p>A certificate associates a public key with the real identity of an individual, server, or other entity,
  218. known as the subject. As shown in <a href="#table1">Table 1</a>, information about the subject includes
  219. identifying information (the distinguished name), and the public key. It also includes the identification
  220. and signature of the Certificate Authority that issued the certificate, and the period of time during which
  221. the certificate is valid. It may have additional information (or extensions) as well as administrative
  222. information for the Certificate Authority's use, such as a serial number.</p>
  223. <h4><a id="table1"></a>Table 1: Certificate Information</h4>
  224. <table title="cert" class="ui table segment">
  225. <tbody>
  226. <tr>
  227. <td class="four wide">Subject</td>
  228. <td>Distinguished Name, Public Key</td>
  229. </tr>
  230. <tr>
  231. <td>Issuer</td>
  232. <td>Distinguished Name, Signature</td>
  233. </tr>
  234. <tr>
  235. <td>Period of Validity</td>
  236. <td>Not Before Date, Not After Date</td>
  237. </tr>
  238. <tr>
  239. <td class="pivot class">Administrative Information</td>
  240. <td>Version, Serial Number</td>
  241. </tr>
  242. <tr>
  243. <td>Extended Information</td>
  244. <td>Basic Constraints, Netscape Flags, etc.</td>
  245. </tr>
  246. </tbody>
  247. </table>
  248. <p>A distinguished name is used to provide an identity in a specific context &mdash; for instance, an
  249. individual might have a personal certificate as well as one for their identity as an employee.
  250. Distinguished names are defined by the X.509 standard, which defines the fields, field names, and
  251. abbreviations used to refer to the fields (see <a href="#table2">Table 2</a>).</p>
  252. <h4><a id="table2"></a>Table 2: Distinguished Name Information</h4>
  253. <table title="info" class="ui table segment">
  254. <thead>
  255. <tr>
  256. <th>DN Field</th>
  257. <th>Abbrev.</th>
  258. <th>Description</th>
  259. <th>Example</th>
  260. </tr>
  261. </thead>
  262. <tbody>
  263. <tr>
  264. <td>Common Name</td>
  265. <td>CN</td>
  266. <td>Name being certified</td>
  267. <td>CN=Joe Average</td>
  268. </tr>
  269. <tr>
  270. <td>Organization or Company</td>
  271. <td>O</td>
  272. <td>Name is associated with this organization</td>
  273. <td>O=Snake Oil, Ltd.</td>
  274. </tr>
  275. <tr>
  276. <td>Organizational Unit</td>
  277. <td>OU</td>
  278. <td>Name is associated with this organization unit, such as a department</td>
  279. <td>OU=Research Institute</td>
  280. </tr>
  281. <tr>
  282. <td>City/Locality</td>
  283. <td>L</td>
  284. <td>Name is located in this City</td>
  285. <td>L=Snake City</td>
  286. </tr>
  287. <tr>
  288. <td>State/Province</td>
  289. <td>ST</td>
  290. <td>Name is located in this State/Province</td>
  291. <td>ST=Desert</td>
  292. </tr>
  293. <tr>
  294. <td>Country</td>
  295. <td>C</td>
  296. <td>Name is located in this Country (ISO code)</td>
  297. <td>C=XZ</td>
  298. </tr>
  299. </tbody>
  300. </table>
  301. <p>A Certificate Authority may define a policy specifying which distinguished field names are optional, and
  302. which are required. It may also place requirements upon the field contents, as may users of certificates.
  303. As an example, a Netscape browser requires that the Common Name for a certificate representing a server has
  304. a name which matches a wildcard pattern for the domain name of that server, such as
  305. <code>*.snakeoil.com</code></p>
  306. <p>The binary format of a certificate is defined using the ASN.1 notation. This notation defines how to
  307. specify the contents, and encoding rules define how this information is translated into binary form. The
  308. binary encoding of the certificate is defined using Distinguished Encoding Rules (DER), which are based on
  309. the more general Basic Encoding Rules (BER). For those transmissions which cannot handle binary, the binary
  310. form may be translated into an ASCII form by using Base64 encoding. This encoded version is called PEM
  311. encoded (the name comes from "Privacy Enhanced Mail"), when placed between begin and end delimiter lines as
  312. illustrated in the following example.</p>
  313. <h3>Example of a PEM-encoded certificate (snakeoil.crt)</h3>
  314. <pre class="ui code segment">
  315. -----BEGIN CERTIFICATE-----
  316. MIIC7jCCAlegAwIBAgIBATANBgkqhkiG9w0BAQQFADCBqTELMAkGA1UEBhMCWFkx
  317. FTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1PEBxMKU25ha2UgVG93bjEXMBUG
  318. A1UEChMOU25ha2UgT2lsLCBMdGQxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhv
  319. cml0eTEVMBMGA1UEAxMMU25ha2UgT2lsIENBMR4wHAYJKoZIhvcNAQkBFg9jYUBz
  320. bmFrZW9pbC5kb20wHhcNOTgxMDIxMDg1ODM2WhcNOTkxMDIxMDg1ODM2WjCBpzEL
  321. MAkGA1UEBhMCWFkxFTATBgNVBAgTDFNuYWtlIELlc2VydDETMBEGA1UEBxMKU25h
  322. a2UgVG93bjEXMBAGA1UEChMOU25ha2UgT2lsLCBMdGQxFzAVBgNVBAsTDldlYnNl
  323. cnZlciBUZWFtMRkwFwYDVQQDExB3d3cuc25ha2VvaWwuZG9tMR8wHQYJKoZIhvcN
  324. AQkBFhB3d3dAc25ha2VvaWwuZG9tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
  325. gQDH9Ge/s2zcH+da+rPTx/DPRp3xGjHZ4GG6pCmvADIEtBtKBFAcZ64n+Dy7Np8b
  326. vKR+yy5DGQiijsH1D/j8HlGE+q4TZ8OFk7BNBFazHxFbYI4OKMiCxdKzdif1yfaa
  327. lWoANFlAzlSdbxeEVHoT0K+gT5w3UxwZKv2DLbETzLZyPwIDAQABoyYwJDAPBgNV
  328. HRMECDAGAQH/AgEAMBEGCWCGSAGG+EIBAQQEAwIAQDANBgkqhkiG9w0BAQQFAAOB
  329. gQAZUIHAL4D09oE6Lv2k56Gp38OBDuILvwLg1v1KL8mQR+KFjghCrtpqaztZqcDt
  330. 2q2QoyulCgSzHbEGmi0EsdkPfg6mp0penssIFePYNI+/8u9HT4LuKMJX15hxBam7
  331. dUHzICxBVC1lnHyYGjDuAMhe396lYAn8bCld1/L4NMGBCQ==
  332. -----END CERTIFICATE-----
  333. </pre>
  334. <h3><a id="certificateAuthorities"></a>Certificate Authorities</h3>
  335. <p>By first verifying the information in a certificate request before granting the certificate, the
  336. Certificate Authority assures the identity of the private key owner of a key-pair. For instance, if Alice
  337. requests a personal certificate, the Certificate Authority must first make sure that Alice really is the
  338. person the certificate request claims.</p>
  339. <h4>Certificate Chains</h4>
  340. <p>A Certificate Authority may also issue a certificate for another Certificate Authority. When examining a
  341. certificate, Alice may need to examine the certificate of the issuer, for each parent Certificate
  342. Authority, until reaching one which she has confidence in. She may decide to trust only certificates with a
  343. limited chain of issuers, to reduce her risk of a "bad" certificate in the chain.</p>
  344. <h4>Creating a Root-Level CA</h4>
  345. <p>As noted earlier, each certificate requires an issuer to assert the validity of the identity of the
  346. certificate subject, up to the top-level Certificate Authority (CA). This presents a problem: Since this is
  347. who vouches for the certificate of the top-level authority, which has no issuer? In this unique case, the
  348. certificate is "self-signed", so the issuer of the certificate is the same as the subject. As a result, one
  349. must exercise extra care in trusting a self-signed certificate. The wide publication of a public key by the
  350. root authority reduces the risk in trusting this key &mdash; it would be obvious if someone else publicized
  351. a key claiming to be the authority. Browsers are preconfigured to trust well-known certificate
  352. authorities.</p>
  353. <p>A number of companies, such as <a href="http://www.thawte.com/">Thawte</a> and <a href=
  354. "http://www.verisign.com/">VeriSign</a> have established themselves as Certificate Authorities. These
  355. companies provide the following services:</p>
  356. <ul>
  357. <li>Verifying certificate requests</li>
  358. <li>Processing certificate requests</li>
  359. <li>Issuing and managing certificates</li>
  360. </ul>
  361. <p>It is also possible to create your own Certificate Authority. Although risky in the Internet
  362. environment, it may be useful within an Intranet where the organization can easily verify the identities of
  363. individuals and servers.</p>
  364. <h4>Certificate Management</h4>
  365. <p>Establishing a Certificate Authority is a responsibility which requires a solid administrative,
  366. technical, and management framework. Certificate Authorities not only issue certificates, they also manage
  367. them &mdash; that is, they determine how long certificates are valid, they renew them, and they keep lists
  368. of certificates that have already been issued but are no longer valid (Certificate Revocation Lists, or
  369. CRLs). Say Alice is entitled to a certificate as an employee of a company. Say too, that the certificate
  370. needs to be revoked when Alice leaves the company. Since certificates are objects that get passed around,
  371. it is impossible to tell from the certificate alone that it has been revoked. When examining certificates
  372. for validity, therefore, it is necessary to contact the issuing Certificate Authority to check CRLs &mdash;
  373. this is not usually an automated part of the process.</p>
  374. <h3>Note</h3>
  375. <p>If you use a Certificate Authority that is not configured into browsers by default, it is necessary to
  376. load the Certificate Authority certificate into the browser, enabling the browser to validate server
  377. certificates signed by that Certificate Authority. Doing so may be dangerous, since once loaded, the
  378. browser will accept all certificates signed by that Certificate Authority.</p>
  379. <a id="sslOverview"></a>
  380. <h2 >Secure Sockets Layer (SSL) Overview</h2>
  381. <p>The Secure Sockets Layer protocols designed to support a range of choices for specific algorithms used for
  382. cryptography, digests, and signatures. This allows algorithm selection for specific servers to be made based on
  383. legal, export or other concerns, and also enables the protocol to take advantage of new algorithms. Choices are
  384. negotiated between client and server at the start of establishing a protocol session.</p>
  385. <h3>Table 4: Versions of the SSL protocol</h3>
  386. <a id="table4"></a>
  387. <table title="protocols" class="ui table segment">
  388. <thead>
  389. <tr>
  390. <th>Version</th>
  391. <th>Source</th>
  392. <th>Description</th>
  393. </tr>
  394. </thead>
  395. <tbody>
  396. <tr>
  397. <td>SSL v2.0</td>
  398. <td>Vendor Standard (from Netscape Corp.)</td>
  399. <td>First SSL protocol for which implementations exists</td>
  400. </tr>
  401. <tr>
  402. <td>SSL v3.0</td>
  403. <td>Expired Internet Draft (from Netscape Corp.)</td>
  404. <td>Revisions to prevent specific security attacks, add non-RSA ciphers, and support for
  405. certificate chains</td>
  406. </tr>
  407. <tr>
  408. <td>TLS v1.0</td>
  409. <td>Proposed Internet Standard (from IETF)</td>
  410. <td>Revision of SSL 3.0 to update the MAC layer to HMAC, add block padding for block ciphers,
  411. message order standardization and more alert messages.</td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. <p>There are a number of versions of the SSL protocol, as shown in <a href="#table4">Table 4</a>. As noted
  416. there, one of the benefits in SSL 3.0 is that it adds support of certificate chain loading. This feature allows
  417. a server to pass a server certificate along with issuer certificates to the browser. Chain loading also permits
  418. the browser to validate the server certificate, even if Certificate Authority certificates are not installed
  419. for the intermediate issuers, since they are included in the certificate chain. SSL 3.0 is the basis for the
  420. Transport Layer Security protocol standard, currently in development by the Internet Engineering Task Force
  421. (IETF).</p>
  422. <h3>Session Establishment</h3>
  423. <p>The SSL session is established by following a handshake sequence between client and server. This sequence
  424. may vary, depending on whether the server is configured to provide a server certificate or request a client
  425. certificate. Though cases exist where additional handshake steps are required for management of cipher
  426. information, this article summarizes one common scenario: see the SSL specification for the full range of
  427. possibilities.</p>
  428. <h3>Note</h3>
  429. <p>Once an SSL session has been established it may be reused, thus avoiding the performance penalty of
  430. repeating the many steps needed to start a session. For this the server assigns each SSL session a unique
  431. session identifier which is cached in the server and which the client can use on forthcoming connections to
  432. reduce the handshake (until the session identifier expires in the cache of the server).</p>
  433. <p class="figure">The elements of the handshake sequence, as used by the client and server, are listed
  434. below:</p>
  435. <ol>
  436. <li>Negotiate the Cipher Suite to be used during data transfer</li>
  437. <li>Establish and share a session key between client and server</li>
  438. <li>Optionally authenticate the server to the client</li>
  439. <li>Optionally authenticate the client to the server</li>
  440. </ol>
  441. <p>The first step, Cipher Suite Negotiation, allows the client and server to choose a Cipher Suite supportable
  442. by both of them. The SSL3.0 protocol specification defines 31 Cipher Suites. A Cipher Suite is defined by the
  443. following components:</p>
  444. <ul>
  445. <li>Key Exchange Method</li>
  446. <li>Cipher for Data Transfer</li>
  447. <li>Message Digest for creating the Message Authentication Code (MAC)</li>
  448. </ul>
  449. <p>These three elements are described in the sections that follow.</p>
  450. <h3>Key Exchange Method</h3>
  451. <p>The key exchange method defines how the shared secret symmetric cryptography key used for application data
  452. transfer will be agreed upon by client and server. SSL 2.0 uses RSA key exchange only, while SSL 3.0 supports a
  453. choice of key exchange algorithms including the RSA key exchange when certificates are used, and Diffie-Hellman
  454. key exchange for exchanging keys without certificates and without prior communication between client and
  455. server.</p>
  456. <p>One variable in the choice of key exchange methods is digital signatures &mdash; whether or not to use them,
  457. and if so, what kind of signatures to use. Signing with a private key provides assurance against a
  458. man-in-the-middle-attack during the information exchange used in generating the shared key.</p>
  459. <h3>Cipher for Data Transfer</h3>
  460. <p>SSL uses the conventional cryptography algorithm (symmetric cryptography) described earlier for encrypting
  461. messages in a session. There are nine choices, including the choice to perform no encryption:</p>
  462. <ul>
  463. <li>No encryption</li>
  464. <li>Stream Ciphers
  465. <ul>
  466. <li>RC4 with 40-bit keys</li>
  467. <li>RC4 with 128-bit keys</li>
  468. </ul>
  469. </li>
  470. <li>CBC Block Ciphers
  471. <ul>
  472. <li>RC2 with 40 bit key</li>
  473. <li>DES with 40 bit key</li>
  474. <li>DES with 56 bit key</li>
  475. <li>Triple-DES with 168 bit key</li>
  476. <li>Idea (128 bit key)</li>
  477. <li>Fortezza (96 bit key)</li>
  478. </ul>
  479. </li>
  480. </ul>
  481. <p>Here "CBC" refers to Cipher Block Chaining, which means that a portion of the previously encrypted cipher
  482. text is used in the encryption of the current block. "DES" refers to the Data Encryption Standard, which has a
  483. number of variants (including DES40 and 3DES_EDE). "Idea" is one of the best and cryptographically strongest
  484. available algorithms, and "RC2" is a proprietary algorithm from RSA DSI.</p>
  485. <h3>Digest Function</h3>
  486. <p>The choice of digest function determines how a digest is created from a record unit. SSL supports the
  487. following:</p>
  488. <ul>
  489. <li>No digest (Null choice)</li>
  490. <li>MD5, a 128-bit hash</li>
  491. <li>Secure Hash Algorithm (SHA-1), a 160-bit hash</li>
  492. </ul>
  493. <p>The message digest is used to create a Message Authentication Code (MAC) which is encrypted with the message
  494. to provide integrity and to prevent against replay attacks.</p>
  495. <h3>Handshake Sequence Protocol</h3>
  496. <p>The handshake sequence uses three protocols:</p>
  497. <ul>
  498. <li>The <dfn>SSL Handshake Protocol</dfn> for performing the client and server SSL session
  499. establishment.</li>
  500. <li>The <dfn>SSL Change Cipher Spec Protocol</dfn> for actually establishing agreement on the Cipher Suite
  501. for the session.</li>
  502. <li>The <dfn>SSL Alert Protocol</dfn> for conveying SSL error messages between client and server.</li>
  503. </ul>
  504. <p>These protocols, as well as application protocol data, are encapsulated in the <dfn>SSL Record
  505. Protocol</dfn>. An encapsulated protocol is transferred as data by the lower layer protocol, which does not
  506. examine the data. The encapsulated protocol has no knowledge of the underlying protocol.</p>
  507. <p>The encapsulation of SSL control protocols by the record protocol means that if an active session is
  508. renegotiated the control protocols will be transmitted securely. If there were no session before, then the Null
  509. cipher suite is used, which means there is no encryption and messages have no integrity digests until the
  510. session has been established.</p>
  511. <h3>Data Transfer</h3>
  512. <p>The SSL Record Protocol is used to transfer application and SSL Control data between the client and server,
  513. possibly fragmenting this data into smaller units, or combining multiple higher level protocol data messages
  514. into single units. It may compress, attach digest signatures, and encrypt these units before transmitting them
  515. using the underlying reliable transport protocol (Note: currently all major SSL implementations lack support
  516. for compression).</p>
  517. <h3 class="figure">Securing HTTP Communication</h3>
  518. <p>One common use of SSL is to secure Web HTTP communication between a browser and a web server. This case does
  519. not preclude the use of non-secured HTTP. The secure version is mainly plain HTTP over SSL (named HTTPS), but
  520. with one major difference: it uses the URL scheme <i>https</i> rather than <i>http</i> and a
  521. different server port (by default 443).</p>
  522. </div>
  523. <div class="terms ui basic center aligned segment">
  524. <p>&copy; Embedthis Software, 2003-2015. All rights reserved.</p>
  525. </div>
  526. <script src="../lib/jquery/jquery.min.js"></script>
  527. <script src="../lib/semantic-ui/semantic.min.js"></script>
  528. <script src="../scripts/sidebar.min.js"></script>
  529. </body>
  530. </html>