Changeset 2564 for draft-ietf-httpbis/orig/rfc2818.html
- Timestamp:
- 20/01/14 07:43:53 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/orig/rfc2818.html
r1305 r2564 2 2 PUBLIC "-//W3C//DTD HTML 4.01//EN"> 3 3 <html lang="en"> 4 <head profile="http:// www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">4 <head profile="http://dublincore.org/documents/2008/08/04/dc-html/"> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 6 <title>HTTP Over TLS</title><style type="text/css" title="Xml2Rfc (sans serif)"> … … 24 24 body { 25 25 color: black; 26 font-family: verdana, helvetica, arial, sans-serif; 27 font-size: 10pt; 26 font-family: cambria, helvetica, arial, sans-serif; 27 font-size: 11pt; 28 margin-right: 2em; 28 29 } 29 30 cite { 30 31 font-style: normal; 31 32 } 32 dd {33 margin-right: 2em;34 }35 33 dl { 36 34 margin-left: 2em; 37 35 } 38 39 36 ul.empty { 40 37 list-style-type: none; … … 50 47 } 51 48 h1 { 52 font-size: 1 4pt;49 font-size: 130%; 53 50 line-height: 21pt; 54 51 page-break-after: avoid; … … 57 54 page-break-before: always; 58 55 } 59 h1 a {60 color: #333333;61 }62 56 h2 { 63 font-size: 12 pt;57 font-size: 120%; 64 58 line-height: 15pt; 65 59 page-break-after: avoid; 66 60 } 67 h3 , h4, h5, h6{68 font-size: 1 0pt;61 h3 { 62 font-size: 110%; 69 63 page-break-after: avoid; 70 64 } 71 h2 a, h3 a, h4 a, h5 a, h6 a { 65 h4, h5, h6 { 66 page-break-after: avoid; 67 } 68 h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { 72 69 color: black; 73 70 } … … 77 74 li { 78 75 margin-left: 2em; 79 margin-right: 2em;80 76 } 81 77 ol { 82 78 margin-left: 2em; 83 margin-right: 2em;84 79 } 85 80 ol.la { … … 94 89 p { 95 90 margin-left: 2em; 96 margin-right: 2em;97 91 } 98 92 pre { … … 100 94 background-color: lightyellow; 101 95 padding: .25em; 96 page-break-inside: avoid; 102 97 } 103 98 pre.text2 { … … 129 124 border-spacing: 1px; 130 125 width: 95%; 131 font-size: 1 0pt;126 font-size: 11pt; 132 127 color: white; 133 128 } … … 137 132 td.topnowrap { 138 133 vertical-align: top; 139 white-space: nowrap; 134 white-space: nowrap; 140 135 } 141 136 table.header td { … … 154 149 list-style: none; 155 150 margin-left: 1.5em; 156 margin-right: 0em;157 151 padding-left: 0em; 158 152 } … … 160 154 line-height: 150%; 161 155 font-weight: bold; 162 font-size: 10pt;163 156 margin-left: 0em; 164 margin-right: 0em;165 157 } 166 158 ul.toc li li { 167 159 line-height: normal; 168 160 font-weight: normal; 169 font-size: 9pt;161 font-size: 10pt; 170 162 margin-left: 0em; 171 margin-right: 0em;172 163 } 173 164 li.excluded { … … 176 167 ul p { 177 168 margin-left: 0em; 169 } 170 .title, .filename, h1, h2, h3, h4 { 171 font-family: candara, helvetica, arial, sans-serif; 172 } 173 samp, tt, code, pre { 174 font: consolas, monospace; 178 175 } 179 176 ul.ind, ul.ind ul { 180 177 list-style: none; 181 178 margin-left: 1.5em; 182 margin-right: 0em;183 179 padding-left: 0em; 184 180 page-break-before: avoid; … … 188 184 line-height: 200%; 189 185 margin-left: 0em; 190 margin-right: 0em;191 186 } 192 187 ul.ind li li { … … 194 189 line-height: 150%; 195 190 margin-left: 0em; 196 margin-right: 0em;197 191 } 198 192 .avoidbreak { … … 218 212 font-weight: bold; 219 213 text-align: center; 220 font-size: 9pt;214 font-size: 10pt; 221 215 } 222 216 .filename { 223 217 color: #333333; 218 font-size: 75%; 224 219 font-weight: bold; 225 font-size: 12pt;226 220 line-height: 21pt; 227 221 text-align: center; … … 230 224 font-weight: bold; 231 225 } 232 .hidden {233 display: none;234 }235 226 .left { 236 227 text-align: left; … … 240 231 } 241 232 .title { 242 color: #990000;243 font-size: 1 8pt;233 color: green; 234 font-size: 150%; 244 235 line-height: 18pt; 245 236 font-weight: bold; … … 247 238 margin-top: 36pt; 248 239 } 249 .vcardline {250 display: block;251 }252 240 .warning { 253 font-size: 1 4pt;241 font-size: 130%; 254 242 background-color: yellow; 255 243 } … … 260 248 display: none; 261 249 } 262 250 263 251 a { 264 252 color: black; … … 275 263 background-color: white; 276 264 vertical-align: top; 277 font-size: 1 2pt;278 } 279 280 ul.toc a: :after {265 font-size: 110%; 266 } 267 268 ul.toc a:nth-child(2)::after { 281 269 content: leader('.') target-counter(attr(href), page); 282 270 } 283 271 284 272 ul.ind li li a { 285 273 content: target-counter(attr(href), page); 286 274 } 287 275 288 276 .print2col { 289 277 column-count: 2; … … 295 283 @page { 296 284 @top-left { 297 content: "RFC 2818"; 298 } 285 content: "RFC 2818"; 286 } 299 287 @top-right { 300 content: "May 2000"; 301 } 288 content: "May 2000"; 289 } 302 290 @top-center { 303 content: "HTTP Over TLS"; 304 } 291 content: "HTTP Over TLS"; 292 } 305 293 @bottom-left { 306 content: "Rescorla"; 307 } 294 content: "Rescorla"; 295 } 308 296 @bottom-center { 309 content: "Informational"; 310 } 297 content: "Informational"; 298 } 311 299 @bottom-right { 312 content: "[Page " counter(page) "]"; 313 } 314 } 315 316 @page:first { 300 content: "[Page " counter(page) "]"; 301 } 302 } 303 304 @page:first { 317 305 @top-left { 318 306 content: normal; … … 337 325 <link rel="Help" title="RFC-Editor's Status Page" href="http://www.rfc-editor.org/info/rfc2818"> 338 326 <link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc2818"> 339 <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1. 550, 2011-05-30 14:02:12, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/">327 <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.611, 2013/11/27 12:23:51, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/"> 340 328 <link rel="schema.dct" href="http://purl.org/dc/terms/"> 341 329 <meta name="dct.creator" content="Rescorla, E."> … … 364 352 </table> 365 353 <p class="title">HTTP Over TLS</p> 366 <h1><a id="rfc.status" href="#rfc.status">Status of This Memo</a></h1> 367 <p>This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution 368 of this memo is unlimited. 369 </p> 370 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 371 <p>Copyright © The Internet Society (2000). All Rights Reserved.</p> 372 <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1> 354 <div id="rfc.status"> 355 <h1><a href="#rfc.status">Status of This Memo</a></h1> 356 <p>This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution 357 of this memo is unlimited. 358 </p> 359 </div> 360 <div id="rfc.copyrightnotice"> 361 <h1><a href="#rfc.copyrightnotice">Copyright Notice</a></h1> 362 <p>Copyright © The Internet Society (2000). All Rights Reserved.</p> 363 </div> 364 <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1> 373 365 <p>This memo describes how to use TLS to secure HTTP connections over the Internet. Current practice is to layer HTTP over SSL 374 366 (the predecessor to TLS), distinguishing secured traffic from insecure traffic by the use of a different server port. This 375 367 document documents that practice using TLS. A companion document describes a method for using HTTP/TLS over the same port 376 368 as normal HTTP [RFC2817]. 377 </p> 369 </p> 378 370 <hr class="noprint"> 379 371 <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1> 380 372 <ul class="toc"> 381 <li> 1. <a href="#rfc.section.1">Introduction</a><ul>382 <li> 1.1 <a href="#rfc.section.1.1">Requirements Terminology</a></li>373 <li><a href="#rfc.section.1">1.</a> <a href="#rfc.section.1">Introduction</a><ul> 374 <li><a href="#rfc.section.1.1">1.1</a> <a href="#rfc.section.1.1">Requirements Terminology</a></li> 383 375 </ul> 384 376 </li> 385 <li> 2. <a href="#rfc.section.2">HTTP Over TLS</a><ul>386 <li> 2.1 <a href="#rfc.section.2.1">Connection Initiation</a></li>387 <li> 2.2 <a href="#rfc.section.2.2">Connection Closure</a><ul>388 <li> 2.2.1 <a href="#rfc.section.2.2.1">Client Behavior</a></li>389 <li> 2.2.2 <a href="#rfc.section.2.2.2">Server Behavior</a></li>377 <li><a href="#rfc.section.2">2.</a> <a href="#rfc.section.2">HTTP Over TLS</a><ul> 378 <li><a href="#rfc.section.2.1">2.1</a> <a href="#rfc.section.2.1">Connection Initiation</a></li> 379 <li><a href="#rfc.section.2.2">2.2</a> <a href="#rfc.section.2.2">Connection Closure</a><ul> 380 <li><a href="#rfc.section.2.2.1">2.2.1</a> <a href="#rfc.section.2.2.1">Client Behavior</a></li> 381 <li><a href="#rfc.section.2.2.2">2.2.2</a> <a href="#rfc.section.2.2.2">Server Behavior</a></li> 390 382 </ul> 391 383 </li> 392 <li> 2.3 <a href="#rfc.section.2.3">Port Number</a></li>393 <li> 2.4 <a href="#rfc.section.2.4">URI Format</a></li>384 <li><a href="#rfc.section.2.3">2.3</a> <a href="#rfc.section.2.3">Port Number</a></li> 385 <li><a href="#rfc.section.2.4">2.4</a> <a href="#rfc.section.2.4">URI Format</a></li> 394 386 </ul> 395 387 </li> 396 <li> 3. <a href="#rfc.section.3">Endpoint Identification</a><ul>397 <li> 3.1 <a href="#rfc.section.3.1">Server Identity</a></li>398 <li> 3.2 <a href="#rfc.section.3.2">Client Identity</a></li>388 <li><a href="#rfc.section.3">3.</a> <a href="#rfc.section.3">Endpoint Identification</a><ul> 389 <li><a href="#rfc.section.3.1">3.1</a> <a href="#rfc.section.3.1">Server Identity</a></li> 390 <li><a href="#rfc.section.3.2">3.2</a> <a href="#rfc.section.3.2">Client Identity</a></li> 399 391 </ul> 400 392 </li> 401 <li> 4. <a href="#rfc.references">References</a></li>393 <li><a href="#rfc.section.4">4.</a> <a href="#rfc.references">References</a></li> 402 394 <li><a href="#rfc.authors">Author's Address</a></li> 403 <li> A. <a href="#rfc.section.A">Security Considerations</a></li>395 <li><a href="#rfc.section.A">A.</a> <a href="#rfc.section.A">Security Considerations</a></li> 404 396 <li><a href="#rfc.index">Index</a></li> 405 397 <li><a href="#rfc.ipr">Intellectual Property and Copyright Statements</a></li> 406 398 </ul> 407 <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a> Introduction 408 </h1> 409 <p id="rfc.section.1.p.1">HTTP <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> was originally used in the clear on the Internet. However, increased use of HTTP for sensitive applications has required security 410 measures. SSL, and its successor TLS <a href="#RFC2246"><cite title="The TLS Protocol Version 1.0">[RFC2246]</cite></a> were designed to provide channel-oriented security. This document describes how to use HTTP over TLS. 411 </p> 412 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> Requirements Terminology 413 </h2> 414 <p id="rfc.section.1.1.p.1">Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and "MAY" that appear in this document are to be interpreted 415 as described in <a href="#RFC2119"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>. 416 </p> 417 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> HTTP Over TLS 418 </h1> 419 <p id="rfc.section.2.p.1">Conceptually, HTTP/TLS is very simple. Simply use HTTP over TLS precisely as you would use HTTP over TCP.</p> 420 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> Connection Initiation 421 </h2> 422 <p id="rfc.section.2.1.p.1">The agent acting as the HTTP client should also act as the TLS client. It should initiate a connection to the server on the 423 appropriate port and then send the TLS ClientHello to begin the TLS handshake. When the TLS handshake has finished. The client 424 may then initiate the first HTTP request. All HTTP data <em class="bcp14">MUST</em> be sent as TLS "application data". Normal HTTP behavior, including retained connections should be followed. 425 </p> 426 <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a> Connection Closure 427 </h2> 428 <p id="rfc.section.2.2.p.1">TLS provides a facility for secure connection closure. When a valid closure alert is received, an implementation can be assured 429 that no further data will be received on that connection. TLS implementations <em class="bcp14">MUST</em> initiate an exchange of closure alerts before closing a connection. A TLS implementation <em class="bcp14">MAY</em>, after sending a closure alert, close the connection without waiting for the peer to send its closure alert, generating an 430 "incomplete close". Note that an implementation which does this <em class="bcp14">MAY</em> choose to reuse the session. This <em class="bcp14">SHOULD</em> only be done when the application knows (typically through detecting HTTP message boundaries) that it has received all the 431 message data that it cares about. 432 </p> 433 <p id="rfc.section.2.2.p.2">As specified in <a href="#RFC2246"><cite title="The TLS Protocol Version 1.0">[RFC2246]</cite></a>, any implementation which receives a connection close without first receiving a valid closure alert (a "premature close") <em class="bcp14">MUST NOT</em> reuse that session. Note that a premature close does not call into question the security of the data already received, but 434 simply indicates that subsequent data might have been truncated. Because TLS is oblivious to HTTP request/response boundaries, 435 it is necessary to examine the HTTP data itself (specifically the Content-Length header) to determine whether the truncation 436 occurred inside a message or between messages. 437 </p> 438 <h3 id="rfc.section.2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a> Client Behavior 439 </h3> 440 <p id="rfc.section.2.2.1.p.1">Because HTTP uses connection closure to signal end of server data, client implementations <em class="bcp14">MUST</em> treat any premature closes as errors and the data received as potentially truncated. While in some cases the HTTP protocol 441 allows the client to find out whether truncation took place so that, if it received the complete reply, it may tolerate such 442 errors following the principle to "[be] strict when sending and tolerant when receiving" [RFC1958], often truncation does 443 not show in the HTTP protocol data; two cases in particular deserve special note: 444 </p> 445 <ul class="empty"> 446 <li>A HTTP response without a Content-Length header. Since data length in this situation is signalled by connection close a premature 447 close generated by the server cannot be distinguished from a spurious close generated by an attacker. 448 </li> 449 <li>A HTTP response with a valid Content-Length header closed before all data has been read. Because TLS does not provide document 450 oriented protection, it is impossible to determine whether the server has miscomputed the Content-Length or an attacker has 451 truncated the connection. 452 </li> 453 </ul> 454 <p id="rfc.section.2.2.1.p.3">There is one exception to the above rule. When encountering a premature close, a client <em class="bcp14">SHOULD</em> treat as completed all requests for which it has received as much data as specified in the Content-Length header. 455 </p> 456 <p id="rfc.section.2.2.1.p.4">A client detecting an incomplete close <em class="bcp14">SHOULD</em> recover gracefully. It <em class="bcp14">MAY</em> resume a TLS session closed in this fashion. 457 </p> 458 <p id="rfc.section.2.2.1.p.5">Clients <em class="bcp14">MUST</em> send a closure alert before closing the connection. Clients which are unprepared to receive any more data <em class="bcp14">MAY</em> choose not to wait for the server's closure alert and simply close the connection, thus generating an incomplete close on 459 the server side. 460 </p> 461 <h3 id="rfc.section.2.2.2"><a href="#rfc.section.2.2.2">2.2.2</a> Server Behavior 462 </h3> 463 <p id="rfc.section.2.2.2.p.1">RFC 2616 permits an HTTP client to close the connection at any time, and requires servers to recover gracefully. In particular, 464 servers <em class="bcp14">SHOULD</em> be prepared to receive an incomplete close from the client, since the client can often determine when the end of server data 465 is. Servers <em class="bcp14">SHOULD</em> be willing to resume TLS sessions closed in this fashion. 466 </p> 467 <p id="rfc.section.2.2.2.p.2">Implementation note: In HTTP implementations which do not use persistent connections, the server ordinarily expects to be 468 able to signal end of data by closing the connection. When Content-Length is used, however, the client may have already sent 469 the closure alert and dropped the connection. 470 </p> 471 <p id="rfc.section.2.2.2.p.3">Servers <em class="bcp14">MUST</em> attempt to initiate an exchange of closure alerts with the client before closing the connection. Servers <em class="bcp14">MAY</em> close the connection after sending the closure alert, thus generating an incomplete close on the client side. 472 </p> 473 <h2 id="rfc.section.2.3"><a href="#rfc.section.2.3">2.3</a> Port Number 474 </h2> 475 <p id="rfc.section.2.3.p.1">The first data that an HTTP server expects to receive from the client is the Request-Line production. The first data that 476 a TLS server (and hence an HTTP/TLS server) expects to receive is the ClientHello. Consequently, common practice has been 477 to run HTTP/TLS over a separate port in order to distinguish which protocol is being used. When HTTP/TLS is being run over 478 a TCP/IP connection, the default port is 443. This does not preclude HTTP/TLS from being run over another transport. TLS only 479 presumes a reliable connection-oriented data stream. 480 </p> 481 <div id="rfc.iref.h.1"></div> 482 <div id="rfc.iref.u.1"></div> 483 <h2 id="rfc.section.2.4"><a href="#rfc.section.2.4">2.4</a> URI Format 484 </h2> 485 <p id="rfc.section.2.4.p.1">HTTP/TLS is differentiated from HTTP URIs by using the 'https' protocol identifier in place of the 'http' protocol identifier. 486 An example URI specifying HTTP/TLS is: 487 </p> 488 <div id="rfc.figure.u.1"></div><pre class="text"> 399 <div> 400 <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a> Introduction 401 </h1> 402 <p id="rfc.section.1.p.1">HTTP <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> was originally used in the clear on the Internet. However, increased use of HTTP for sensitive applications has required security 403 measures. SSL, and its successor TLS <a href="#RFC2246"><cite title="The TLS Protocol Version 1.0">[RFC2246]</cite></a> were designed to provide channel-oriented security. This document describes how to use HTTP over TLS. 404 </p> 405 <div> 406 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> Requirements Terminology 407 </h2> 408 <p id="rfc.section.1.1.p.1">Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and "MAY" that appear in this document are to be interpreted 409 as described in <a href="#RFC2119"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>. 410 </p> 411 </div> 412 </div> 413 <div> 414 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> HTTP Over TLS 415 </h1> 416 <p id="rfc.section.2.p.1">Conceptually, HTTP/TLS is very simple. Simply use HTTP over TLS precisely as you would use HTTP over TCP.</p> 417 <div> 418 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> Connection Initiation 419 </h2> 420 <p id="rfc.section.2.1.p.1">The agent acting as the HTTP client should also act as the TLS client. It should initiate a connection to the server on the 421 appropriate port and then send the TLS ClientHello to begin the TLS handshake. When the TLS handshake has finished. The client 422 may then initiate the first HTTP request. All HTTP data <em class="bcp14">MUST</em> be sent as TLS "application data". Normal HTTP behavior, including retained connections should be followed. 423 </p> 424 </div> 425 <div> 426 <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a> Connection Closure 427 </h2> 428 <p id="rfc.section.2.2.p.1">TLS provides a facility for secure connection closure. When a valid closure alert is received, an implementation can be assured 429 that no further data will be received on that connection. TLS implementations <em class="bcp14">MUST</em> initiate an exchange of closure alerts before closing a connection. A TLS implementation <em class="bcp14">MAY</em>, after sending a closure alert, close the connection without waiting for the peer to send its closure alert, generating an 430 "incomplete close". Note that an implementation which does this <em class="bcp14">MAY</em> choose to reuse the session. This <em class="bcp14">SHOULD</em> only be done when the application knows (typically through detecting HTTP message boundaries) that it has received all the 431 message data that it cares about. 432 </p> 433 <p id="rfc.section.2.2.p.2">As specified in <a href="#RFC2246"><cite title="The TLS Protocol Version 1.0">[RFC2246]</cite></a>, any implementation which receives a connection close without first receiving a valid closure alert (a "premature close") <em class="bcp14">MUST NOT</em> reuse that session. Note that a premature close does not call into question the security of the data already received, but 434 simply indicates that subsequent data might have been truncated. Because TLS is oblivious to HTTP request/response boundaries, 435 it is necessary to examine the HTTP data itself (specifically the Content-Length header) to determine whether the truncation 436 occurred inside a message or between messages. 437 </p> 438 <div> 439 <h3 id="rfc.section.2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a> Client Behavior 440 </h3> 441 <p id="rfc.section.2.2.1.p.1">Because HTTP uses connection closure to signal end of server data, client implementations <em class="bcp14">MUST</em> treat any premature closes as errors and the data received as potentially truncated. While in some cases the HTTP protocol 442 allows the client to find out whether truncation took place so that, if it received the complete reply, it may tolerate such 443 errors following the principle to "[be] strict when sending and tolerant when receiving" [RFC1958], often truncation does 444 not show in the HTTP protocol data; two cases in particular deserve special note: 445 </p> 446 <ul class="empty"> 447 <li>A HTTP response without a Content-Length header. Since data length in this situation is signalled by connection close a premature 448 close generated by the server cannot be distinguished from a spurious close generated by an attacker. 449 </li> 450 <li>A HTTP response with a valid Content-Length header closed before all data has been read. Because TLS does not provide document 451 oriented protection, it is impossible to determine whether the server has miscomputed the Content-Length or an attacker has 452 truncated the connection. 453 </li> 454 </ul> 455 <p id="rfc.section.2.2.1.p.3">There is one exception to the above rule. When encountering a premature close, a client <em class="bcp14">SHOULD</em> treat as completed all requests for which it has received as much data as specified in the Content-Length header. 456 </p> 457 <p id="rfc.section.2.2.1.p.4">A client detecting an incomplete close <em class="bcp14">SHOULD</em> recover gracefully. It <em class="bcp14">MAY</em> resume a TLS session closed in this fashion. 458 </p> 459 <p id="rfc.section.2.2.1.p.5">Clients <em class="bcp14">MUST</em> send a closure alert before closing the connection. Clients which are unprepared to receive any more data <em class="bcp14">MAY</em> choose not to wait for the server's closure alert and simply close the connection, thus generating an incomplete close on 460 the server side. 461 </p> 462 </div> 463 <div> 464 <h3 id="rfc.section.2.2.2"><a href="#rfc.section.2.2.2">2.2.2</a> Server Behavior 465 </h3> 466 <p id="rfc.section.2.2.2.p.1">RFC 2616 permits an HTTP client to close the connection at any time, and requires servers to recover gracefully. In particular, 467 servers <em class="bcp14">SHOULD</em> be prepared to receive an incomplete close from the client, since the client can often determine when the end of server data 468 is. Servers <em class="bcp14">SHOULD</em> be willing to resume TLS sessions closed in this fashion. 469 </p> 470 <p id="rfc.section.2.2.2.p.2">Implementation note: In HTTP implementations which do not use persistent connections, the server ordinarily expects to be 471 able to signal end of data by closing the connection. When Content-Length is used, however, the client may have already sent 472 the closure alert and dropped the connection. 473 </p> 474 <p id="rfc.section.2.2.2.p.3">Servers <em class="bcp14">MUST</em> attempt to initiate an exchange of closure alerts with the client before closing the connection. Servers <em class="bcp14">MAY</em> close the connection after sending the closure alert, thus generating an incomplete close on the client side. 475 </p> 476 </div> 477 </div> 478 <div> 479 <h2 id="rfc.section.2.3"><a href="#rfc.section.2.3">2.3</a> Port Number 480 </h2> 481 <p id="rfc.section.2.3.p.1">The first data that an HTTP server expects to receive from the client is the Request-Line production. The first data that 482 a TLS server (and hence an HTTP/TLS server) expects to receive is the ClientHello. Consequently, common practice has been 483 to run HTTP/TLS over a separate port in order to distinguish which protocol is being used. When HTTP/TLS is being run over 484 a TCP/IP connection, the default port is 443. This does not preclude HTTP/TLS from being run over another transport. TLS only 485 presumes a reliable connection-oriented data stream. 486 </p> 487 </div> 488 <div> 489 <div id="rfc.iref.h.1"></div> 490 <div id="rfc.iref.u.1"></div> 491 <h2 id="rfc.section.2.4"><a href="#rfc.section.2.4">2.4</a> URI Format 492 </h2> 493 <p id="rfc.section.2.4.p.1">HTTP/TLS is differentiated from HTTP URIs by using the 'https' protocol identifier in place of the 'http' protocol identifier. 494 An example URI specifying HTTP/TLS is: 495 </p> 496 <div id="rfc.figure.u.1"></div><pre class="text"> 489 497 https://www.example.com/~smith/home.html 490 </pre><h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> Endpoint Identification 491 </h1> 492 <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> Server Identity 493 </h2> 494 <p id="rfc.section.3.1.p.1">In general, HTTP/TLS requests are generated by dereferencing a URI. As a consequence, the hostname for the server is known 495 to the client. If the hostname is available, the client <em class="bcp14">MUST</em> check it against the server's identity as presented in the server's Certificate message, in order to prevent man-in-the-middle 496 attacks. 497 </p> 498 <p id="rfc.section.3.1.p.2">If the client has external information as to the expected identity of the server, the hostname check <em class="bcp14">MAY</em> be omitted. (For instance, a client may be connecting to a machine whose address and hostname are dynamic but the client knows 499 the certificate that the server will present.) In such cases, it is important to narrow the scope of acceptable certificates 500 as much as possible in order to prevent man in the middle attacks. In special cases, it may be appropriate for the client 501 to simply ignore the server's identity, but it must be understood that this leaves the connection open to active attack. 502 </p> 503 <p id="rfc.section.3.1.p.3">If a subjectAltName extension of type dNSName is present, that <em class="bcp14">MUST</em> be used as the identity. Otherwise, the (most specific) Common Name field in the Subject field of the certificate <em class="bcp14">MUST</em> be used. Although the use of the Common Name is existing practice, it is deprecated and Certification Authorities are encouraged 504 to use the dNSName instead. 505 </p> 506 <p id="rfc.section.3.1.p.4">Matching is performed using the matching rules specified by <a href="#RFC2459"><cite title="Internet X.509 Public Key Infrastructure Certificate and CRL Profile">[RFC2459]</cite></a>. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name, a match in any 507 one of the set is considered acceptable.) Names may contain the wildcard character * which is considered to match any single 508 domain name component or component fragment. E.g., *.a.com matches foo.a.com but not bar.foo.a.com. f*.com matches foo.com 509 but not bar.com. 510 </p> 511 <p id="rfc.section.3.1.p.5">In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must 512 be present in the certificate and must exactly match the IP in the URI. 513 </p> 514 <p id="rfc.section.3.1.p.6">If the hostname does not match the identity in the certificate, user oriented clients <em class="bcp14">MUST</em> either notify the user (clients <em class="bcp14">MAY</em> give the user the opportunity to continue with the connection in any case) or terminate the connection with a bad certificate 515 error. Automated clients <em class="bcp14">MUST</em> log the error to an appropriate audit log (if available) and <em class="bcp14">SHOULD</em> terminate the connection (with a bad certificate error). Automated clients <em class="bcp14">MAY</em> provide a configuration setting that disables this check, but <em class="bcp14">MUST</em> provide a setting which enables it. 516 </p> 517 <p id="rfc.section.3.1.p.7">Note that in many cases the URI itself comes from an untrusted source. The above-described check provides no protection against 518 attacks where this source is compromised. For example, if the URI was obtained by clicking on an HTML page which was itself 519 obtained without using HTTP/TLS, a man in the middle could have replaced the URI. In order to prevent this form of attack, 520 users should carefully examine the certificate presented by the server to determine if it meets their expectations. 521 </p> 522 <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a> Client Identity 523 </h2> 524 <p id="rfc.section.3.2.p.1">Typically, the server has no external knowledge of what the client's identity ought to be and so checks (other than that the 525 client has a certificate chain rooted in an appropriate CA) are not possible. If a server has such knowledge (typically from 526 some source external to HTTP or TLS) it <em class="bcp14">SHOULD</em> check the identity as described above. 527 </p> 498 </pre></div> 499 </div> 500 <div> 501 <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> Endpoint Identification 502 </h1> 503 <div> 504 <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> Server Identity 505 </h2> 506 <p id="rfc.section.3.1.p.1">In general, HTTP/TLS requests are generated by dereferencing a URI. As a consequence, the hostname for the server is known 507 to the client. If the hostname is available, the client <em class="bcp14">MUST</em> check it against the server's identity as presented in the server's Certificate message, in order to prevent man-in-the-middle 508 attacks. 509 </p> 510 <p id="rfc.section.3.1.p.2">If the client has external information as to the expected identity of the server, the hostname check <em class="bcp14">MAY</em> be omitted. (For instance, a client may be connecting to a machine whose address and hostname are dynamic but the client knows 511 the certificate that the server will present.) In such cases, it is important to narrow the scope of acceptable certificates 512 as much as possible in order to prevent man in the middle attacks. In special cases, it may be appropriate for the client 513 to simply ignore the server's identity, but it must be understood that this leaves the connection open to active attack. 514 </p> 515 <p id="rfc.section.3.1.p.3">If a subjectAltName extension of type dNSName is present, that <em class="bcp14">MUST</em> be used as the identity. Otherwise, the (most specific) Common Name field in the Subject field of the certificate <em class="bcp14">MUST</em> be used. Although the use of the Common Name is existing practice, it is deprecated and Certification Authorities are encouraged 516 to use the dNSName instead. 517 </p> 518 <p id="rfc.section.3.1.p.4">Matching is performed using the matching rules specified by <a href="#RFC2459"><cite title="Internet X.509 Public Key Infrastructure Certificate and CRL Profile">[RFC2459]</cite></a>. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name, a match in any 519 one of the set is considered acceptable.) Names may contain the wildcard character * which is considered to match any single 520 domain name component or component fragment. E.g., *.a.com matches foo.a.com but not bar.foo.a.com. f*.com matches foo.com 521 but not bar.com. 522 </p> 523 <p id="rfc.section.3.1.p.5">In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must 524 be present in the certificate and must exactly match the IP in the URI. 525 </p> 526 <p id="rfc.section.3.1.p.6">If the hostname does not match the identity in the certificate, user oriented clients <em class="bcp14">MUST</em> either notify the user (clients <em class="bcp14">MAY</em> give the user the opportunity to continue with the connection in any case) or terminate the connection with a bad certificate 527 error. Automated clients <em class="bcp14">MUST</em> log the error to an appropriate audit log (if available) and <em class="bcp14">SHOULD</em> terminate the connection (with a bad certificate error). Automated clients <em class="bcp14">MAY</em> provide a configuration setting that disables this check, but <em class="bcp14">MUST</em> provide a setting which enables it. 528 </p> 529 <p id="rfc.section.3.1.p.7">Note that in many cases the URI itself comes from an untrusted source. The above-described check provides no protection against 530 attacks where this source is compromised. For example, if the URI was obtained by clicking on an HTML page which was itself 531 obtained without using HTTP/TLS, a man in the middle could have replaced the URI. In order to prevent this form of attack, 532 users should carefully examine the certificate presented by the server to determine if it meets their expectations. 533 </p> 534 </div> 535 <div> 536 <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a> Client Identity 537 </h2> 538 <p id="rfc.section.3.2.p.1">Typically, the server has no external knowledge of what the client's identity ought to be and so checks (other than that the 539 client has a certificate chain rooted in an appropriate CA) are not possible. If a server has such knowledge (typically from 540 some source external to HTTP or TLS) it <em class="bcp14">SHOULD</em> check the identity as described above. 541 </p> 542 </div> 543 </div> 528 544 <h1 id="rfc.references"><a href="#rfc.section.4" id="rfc.section.4">4.</a> References 529 545 </h1> 530 <table> 546 <table> 531 547 <tr> 532 548 <td class="reference"><b id="RFC2459">[RFC2459]</b></td> 533 549 <td class="top"><a href="mailto:housley@spyrus.com" title="SPYRUS">Housley, R.</a>, <a href="mailto:wford@verisign.com" title="VeriSign, Inc.">Ford, W.</a>, <a href="mailto:wpolk@nist.gov" title="NIST">Polk, T.</a>, and <a href="mailto:david.solo@citicorp.com" title="Citicorp">D. Solo</a>, “<a href="http://tools.ietf.org/html/rfc2459">Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>”, RFC 2459, January 1999. 534 550 </td> 535 </tr> 551 </tr> 536 552 <tr> 537 553 <td class="reference"><b id="RFC2616">[RFC2616]</b></td> 538 554 <td class="top"><a href="mailto:fielding@ics.uci.edu" title="University of California, Irvine">Fielding, R.</a>, <a href="mailto:jg@w3.org" title="W3C">Gettys, J.</a>, <a href="mailto:mogul@wrl.dec.com" title="Compaq Computer Corporation">Mogul, J.</a>, <a href="mailto:frystyk@w3.org" title="MIT Laboratory for Computer Science">Frystyk, H.</a>, <a href="mailto:masinter@parc.xerox.com" title="Xerox Corporation">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="W3C">T. Berners-Lee</a>, “<a href="http://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>”, RFC 2616, June 1999. 539 555 </td> 540 </tr> 556 </tr> 541 557 <tr> 542 558 <td class="reference"><b id="RFC2119">[RFC2119]</b></td> 543 559 <td class="top"><a href="mailto:sob@harvard.edu" title="Harvard University">Bradner, S.</a>, “<a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>”, BCP 14, RFC 2119, March 1997. 544 560 </td> 545 </tr> 561 </tr> 546 562 <tr> 547 563 <td class="reference"><b id="RFC2246">[RFC2246]</b></td> 548 564 <td class="top"><a href="mailto:tdierks@certicom.com" title="Certicom">Dierks, T.</a> and <a href="mailto:callen@certicom.com" title="Certicom">C. Allen</a>, “<a href="http://tools.ietf.org/html/rfc2246">The TLS Protocol Version 1.0</a>”, RFC 2246, January 1999. 549 565 </td> 550 </tr> 566 </tr> 551 567 <tr> 552 568 <td class="reference"><b id="RFC2817">[RFC2817]</b></td> 553 569 <td class="top">Khare, R. and S. Lawrence, “<a href="http://tools.ietf.org/html/rfc2817">Upgrading to TLS Within HTTP/1.1</a>”, RFC 2817, May 2000. 554 570 </td> 555 </tr> 571 </tr> 556 572 </table> 557 573 <div class="avoidbreak"> 558 574 <h1 id="rfc.authors"><a href="#rfc.authors">Author's Address</a></h1> 559 <address class="vcard"><span class="vcardline"><span class="fn">Eric Rescorla</span><span class="n hidden"><span class="family-name">Rescorla</span><span class="given-name">Eric</span></span></span><span class="org vcardline">RTFM, Inc.</span><span class="adr"><span class="street-address vcardline">30 Newell Road, #16</span><span class="vcardline"><span class="locality">East Palo Alto</span>, <span class="region">CA</span> <span class="postal-code">94303</span></span></span><span class="vcardline tel">Phone: <a href="tel:(650)328-8631"><span class="value">(650) 328-8631</span></a></span><span class="vcardline">Email: <a href="mailto:ekr@rtfm.com"><span class="email">ekr@rtfm.com</span></a></span></address> 560 </div> 561 <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a> Security Considerations 562 </h1> 563 <p id="rfc.section.A.p.1">This entire document is about security.</p> 575 <p><b>Eric Rescorla</b><br>RTFM, Inc.<br>30 Newell Road, #16<br>East Palo Alto, CA 94303<br>Phone: <a href="tel:(650)328-8631">(650) 328-8631</a><br>Email: <a href="mailto:ekr@rtfm.com">ekr@rtfm.com</a></p> 576 </div> 577 <div> 578 <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a> Security Considerations 579 </h1> 580 <p id="rfc.section.A.p.1">This entire document is about security.</p> 581 </div> 564 582 <h1 id="rfc.index"><a href="#rfc.index">Index</a></h1> 565 583 <p class="noprint"><a href="#rfc.index.H">H</a> <a href="#rfc.index.U">U</a> … … 581 599 </ul> 582 600 </div> 583 <h1><a id="rfc.copyright" href="#rfc.copyright">Full Copyright Statement</a></h1> 584 <p>Copyright © The Internet Society (2000). All Rights Reserved.</p> 585 <p>This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise 586 explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without 587 restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative 588 works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references 589 to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards 590 in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to 591 translate it into languages other than English. 592 </p> 593 <p>The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.</p> 594 <p>This document and the information contained herein is provided on an “AS IS” basis and THE INTERNET SOCIETY AND THE INTERNET 595 ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE 596 OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR 597 PURPOSE. 598 </p> 599 <h1><a id="rfc.ipr" href="#rfc.ipr">Intellectual Property</a></h1> 600 <p>The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed 601 to pertain to the implementation or use of the technology described in this document or the extent to which any license under 602 such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. 603 Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be 604 found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, 605 or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors 606 or users of this specification can be obtained from the IETF Secretariat. 607 </p> 608 <p>The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary 609 rights which may cover technology that may be required to practice this standard. Please address the information to the IETF 610 Executive Director. 611 </p> 612 <h1>Acknowledgement</h1> 613 <p>Funding for the RFC Editor function is currently provided by the Internet Society.</p> 601 <div id="rfc.copyright"> 602 <h1><a href="#rfc.copyright">Full Copyright Statement</a></h1> 603 <p>Copyright © The Internet Society (2000). All Rights Reserved.</p> 604 <p>This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise 605 explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without 606 restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative 607 works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references 608 to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards 609 in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to 610 translate it into languages other than English. 611 </p> 612 <p>The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.</p> 613 <p>This document and the information contained herein is provided on an “AS IS” basis and THE INTERNET SOCIETY AND THE INTERNET 614 ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE 615 OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR 616 PURPOSE. 617 </p> 618 </div> 619 <div id="rfc.ipr"> 620 <h1><a href="#rfc.ipr">Intellectual Property</a></h1> 621 <p>The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed 622 to pertain to the implementation or use of the technology described in this document or the extent to which any license under 623 such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. 624 Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be 625 found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, 626 or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors 627 or users of this specification can be obtained from the IETF Secretariat. 628 </p> 629 <p>The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary 630 rights which may cover technology that may be required to practice this standard. Please address the information to the IETF 631 Executive Director. 632 </p> 633 </div> 634 <div> 635 <h1>Acknowledgement</h1> 636 <p>Funding for the RFC Editor function is currently provided by the Internet Society.</p> 637 </div> 614 638 </body> 615 639 </html>
Note: See TracChangeset
for help on using the changeset viewer.