1 | <!DOCTYPE html |
---|
2 | PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
---|
3 | <html lang="en"> |
---|
4 | <head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/"> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
6 | <title>HTTP Over TLS</title><style type="text/css" title="Xml2Rfc (sans serif)"> |
---|
7 | a { |
---|
8 | text-decoration: none; |
---|
9 | } |
---|
10 | a.smpl { |
---|
11 | color: black; |
---|
12 | } |
---|
13 | a:hover { |
---|
14 | text-decoration: underline; |
---|
15 | } |
---|
16 | a:active { |
---|
17 | text-decoration: underline; |
---|
18 | } |
---|
19 | address { |
---|
20 | margin-top: 1em; |
---|
21 | margin-left: 2em; |
---|
22 | font-style: normal; |
---|
23 | } |
---|
24 | body { |
---|
25 | color: black; |
---|
26 | font-family: verdana, helvetica, arial, sans-serif; |
---|
27 | font-size: 10pt; |
---|
28 | } |
---|
29 | cite { |
---|
30 | font-style: normal; |
---|
31 | } |
---|
32 | dd { |
---|
33 | margin-right: 2em; |
---|
34 | } |
---|
35 | dl { |
---|
36 | margin-left: 2em; |
---|
37 | } |
---|
38 | |
---|
39 | ul.empty { |
---|
40 | list-style-type: none; |
---|
41 | } |
---|
42 | ul.empty li { |
---|
43 | margin-top: .5em; |
---|
44 | } |
---|
45 | dl p { |
---|
46 | margin-left: 0em; |
---|
47 | } |
---|
48 | dt { |
---|
49 | margin-top: .5em; |
---|
50 | } |
---|
51 | h1 { |
---|
52 | font-size: 14pt; |
---|
53 | line-height: 21pt; |
---|
54 | page-break-after: avoid; |
---|
55 | } |
---|
56 | h1.np { |
---|
57 | page-break-before: always; |
---|
58 | } |
---|
59 | h1 a { |
---|
60 | color: #333333; |
---|
61 | } |
---|
62 | h2 { |
---|
63 | font-size: 12pt; |
---|
64 | line-height: 15pt; |
---|
65 | page-break-after: avoid; |
---|
66 | } |
---|
67 | h3, h4, h5, h6 { |
---|
68 | font-size: 10pt; |
---|
69 | page-break-after: avoid; |
---|
70 | } |
---|
71 | h2 a, h3 a, h4 a, h5 a, h6 a { |
---|
72 | color: black; |
---|
73 | } |
---|
74 | img { |
---|
75 | margin-left: 3em; |
---|
76 | } |
---|
77 | li { |
---|
78 | margin-left: 2em; |
---|
79 | margin-right: 2em; |
---|
80 | } |
---|
81 | ol { |
---|
82 | margin-left: 2em; |
---|
83 | margin-right: 2em; |
---|
84 | } |
---|
85 | ol.la { |
---|
86 | list-style-type: lower-alpha; |
---|
87 | } |
---|
88 | ol.ua { |
---|
89 | list-style-type: upper-alpha; |
---|
90 | } |
---|
91 | ol p { |
---|
92 | margin-left: 0em; |
---|
93 | } |
---|
94 | p { |
---|
95 | margin-left: 2em; |
---|
96 | margin-right: 2em; |
---|
97 | } |
---|
98 | pre { |
---|
99 | margin-left: 3em; |
---|
100 | background-color: lightyellow; |
---|
101 | padding: .25em; |
---|
102 | } |
---|
103 | pre.text2 { |
---|
104 | border-style: dotted; |
---|
105 | border-width: 1px; |
---|
106 | background-color: #f0f0f0; |
---|
107 | width: 69em; |
---|
108 | } |
---|
109 | pre.inline { |
---|
110 | background-color: white; |
---|
111 | padding: 0em; |
---|
112 | } |
---|
113 | pre.text { |
---|
114 | border-style: dotted; |
---|
115 | border-width: 1px; |
---|
116 | background-color: #f8f8f8; |
---|
117 | width: 69em; |
---|
118 | } |
---|
119 | pre.drawing { |
---|
120 | border-style: solid; |
---|
121 | border-width: 1px; |
---|
122 | background-color: #f8f8f8; |
---|
123 | padding: 2em; |
---|
124 | } |
---|
125 | table { |
---|
126 | margin-left: 2em; |
---|
127 | } |
---|
128 | table.header { |
---|
129 | border-spacing: 1px; |
---|
130 | width: 95%; |
---|
131 | font-size: 10pt; |
---|
132 | color: white; |
---|
133 | } |
---|
134 | td.top { |
---|
135 | vertical-align: top; |
---|
136 | } |
---|
137 | td.topnowrap { |
---|
138 | vertical-align: top; |
---|
139 | white-space: nowrap; |
---|
140 | } |
---|
141 | table.header td { |
---|
142 | background-color: gray; |
---|
143 | width: 50%; |
---|
144 | } |
---|
145 | td.reference { |
---|
146 | vertical-align: top; |
---|
147 | white-space: nowrap; |
---|
148 | padding-right: 1em; |
---|
149 | } |
---|
150 | thead { |
---|
151 | display:table-header-group; |
---|
152 | } |
---|
153 | ul.toc, ul.toc ul { |
---|
154 | list-style: none; |
---|
155 | margin-left: 1.5em; |
---|
156 | margin-right: 0em; |
---|
157 | padding-left: 0em; |
---|
158 | } |
---|
159 | ul.toc li { |
---|
160 | line-height: 150%; |
---|
161 | font-weight: bold; |
---|
162 | font-size: 10pt; |
---|
163 | margin-left: 0em; |
---|
164 | margin-right: 0em; |
---|
165 | } |
---|
166 | ul.toc li li { |
---|
167 | line-height: normal; |
---|
168 | font-weight: normal; |
---|
169 | font-size: 9pt; |
---|
170 | margin-left: 0em; |
---|
171 | margin-right: 0em; |
---|
172 | } |
---|
173 | li.excluded { |
---|
174 | font-size: 0pt; |
---|
175 | } |
---|
176 | ul p { |
---|
177 | margin-left: 0em; |
---|
178 | } |
---|
179 | ul.ind, ul.ind ul { |
---|
180 | list-style: none; |
---|
181 | margin-left: 1.5em; |
---|
182 | margin-right: 0em; |
---|
183 | padding-left: 0em; |
---|
184 | page-break-before: avoid; |
---|
185 | } |
---|
186 | ul.ind li { |
---|
187 | font-weight: bold; |
---|
188 | line-height: 200%; |
---|
189 | margin-left: 0em; |
---|
190 | margin-right: 0em; |
---|
191 | } |
---|
192 | ul.ind li li { |
---|
193 | font-weight: normal; |
---|
194 | line-height: 150%; |
---|
195 | margin-left: 0em; |
---|
196 | margin-right: 0em; |
---|
197 | } |
---|
198 | .avoidbreak { |
---|
199 | page-break-inside: avoid; |
---|
200 | } |
---|
201 | .bcp14 { |
---|
202 | font-style: normal; |
---|
203 | text-transform: lowercase; |
---|
204 | font-variant: small-caps; |
---|
205 | } |
---|
206 | .comment { |
---|
207 | background-color: yellow; |
---|
208 | } |
---|
209 | .center { |
---|
210 | text-align: center; |
---|
211 | } |
---|
212 | .error { |
---|
213 | color: red; |
---|
214 | font-style: italic; |
---|
215 | font-weight: bold; |
---|
216 | } |
---|
217 | .figure { |
---|
218 | font-weight: bold; |
---|
219 | text-align: center; |
---|
220 | font-size: 9pt; |
---|
221 | } |
---|
222 | .filename { |
---|
223 | color: #333333; |
---|
224 | font-weight: bold; |
---|
225 | font-size: 12pt; |
---|
226 | line-height: 21pt; |
---|
227 | text-align: center; |
---|
228 | } |
---|
229 | .fn { |
---|
230 | font-weight: bold; |
---|
231 | } |
---|
232 | .hidden { |
---|
233 | display: none; |
---|
234 | } |
---|
235 | .left { |
---|
236 | text-align: left; |
---|
237 | } |
---|
238 | .right { |
---|
239 | text-align: right; |
---|
240 | } |
---|
241 | .title { |
---|
242 | color: #990000; |
---|
243 | font-size: 18pt; |
---|
244 | line-height: 18pt; |
---|
245 | font-weight: bold; |
---|
246 | text-align: center; |
---|
247 | margin-top: 36pt; |
---|
248 | } |
---|
249 | .vcardline { |
---|
250 | display: block; |
---|
251 | } |
---|
252 | .warning { |
---|
253 | font-size: 14pt; |
---|
254 | background-color: yellow; |
---|
255 | } |
---|
256 | |
---|
257 | |
---|
258 | @media print { |
---|
259 | .noprint { |
---|
260 | display: none; |
---|
261 | } |
---|
262 | |
---|
263 | a { |
---|
264 | color: black; |
---|
265 | text-decoration: none; |
---|
266 | } |
---|
267 | |
---|
268 | table.header { |
---|
269 | width: 90%; |
---|
270 | } |
---|
271 | |
---|
272 | td.header { |
---|
273 | width: 50%; |
---|
274 | color: black; |
---|
275 | background-color: white; |
---|
276 | vertical-align: top; |
---|
277 | font-size: 12pt; |
---|
278 | } |
---|
279 | |
---|
280 | ul.toc a::after { |
---|
281 | content: leader('.') target-counter(attr(href), page); |
---|
282 | } |
---|
283 | |
---|
284 | ul.ind li li a { |
---|
285 | content: target-counter(attr(href), page); |
---|
286 | } |
---|
287 | |
---|
288 | .print2col { |
---|
289 | column-count: 2; |
---|
290 | -moz-column-count: 2; |
---|
291 | column-fill: auto; |
---|
292 | } |
---|
293 | } |
---|
294 | |
---|
295 | @page { |
---|
296 | @top-left { |
---|
297 | content: "RFC 2818"; |
---|
298 | } |
---|
299 | @top-right { |
---|
300 | content: "May 2000"; |
---|
301 | } |
---|
302 | @top-center { |
---|
303 | content: "HTTP Over TLS"; |
---|
304 | } |
---|
305 | @bottom-left { |
---|
306 | content: "Rescorla"; |
---|
307 | } |
---|
308 | @bottom-center { |
---|
309 | content: "Informational"; |
---|
310 | } |
---|
311 | @bottom-right { |
---|
312 | content: "[Page " counter(page) "]"; |
---|
313 | } |
---|
314 | } |
---|
315 | |
---|
316 | @page:first { |
---|
317 | @top-left { |
---|
318 | content: normal; |
---|
319 | } |
---|
320 | @top-right { |
---|
321 | content: normal; |
---|
322 | } |
---|
323 | @top-center { |
---|
324 | content: normal; |
---|
325 | } |
---|
326 | } |
---|
327 | </style><link rel="Contents" href="#rfc.toc"> |
---|
328 | <link rel="Author" href="#rfc.authors"> |
---|
329 | <link rel="Copyright" href="#rfc.copyright"> |
---|
330 | <link rel="Index" href="#rfc.index"> |
---|
331 | <link rel="Chapter" title="1 Introduction" href="#rfc.section.1"> |
---|
332 | <link rel="Chapter" title="2 HTTP Over TLS" href="#rfc.section.2"> |
---|
333 | <link rel="Chapter" title="3 Endpoint Identification" href="#rfc.section.3"> |
---|
334 | <link rel="Chapter" href="#rfc.section.4" title="4 References"> |
---|
335 | <link rel="Appendix" title="A Security Considerations" href="#rfc.section.A"> |
---|
336 | <link rel="Alternate" title="Authorative ASCII Version" href="http://www.ietf.org/rfc/rfc2818.txt"> |
---|
337 | <link rel="Help" title="RFC-Editor's Status Page" href="http://www.rfc-editor.org/info/rfc2818"> |
---|
338 | <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/"> |
---|
340 | <link rel="schema.dct" href="http://purl.org/dc/terms/"> |
---|
341 | <meta name="dct.creator" content="Rescorla, E."> |
---|
342 | <meta name="dct.identifier" content="urn:ietf:rfc:2818"> |
---|
343 | <meta name="dct.issued" scheme="ISO8601" content="2000-05"> |
---|
344 | <meta name="dct.abstract" content="This memo describes how to use TLS to secure HTTP connections over the Internet. Current practice is to layer HTTP over SSL (the predecessor to TLS), distinguishing secured traffic from insecure traffic by the use of a different server port. This document documents that practice using TLS. A companion document describes a method for using HTTP/TLS over the same port as normal HTTP [RFC2817]."> |
---|
345 | <meta name="dct.isPartOf" content="urn:issn:2070-1721"> |
---|
346 | <meta name="description" content="This memo describes how to use TLS to secure HTTP connections over the Internet. Current practice is to layer HTTP over SSL (the predecessor to TLS), distinguishing secured traffic from insecure traffic by the use of a different server port. This document documents that practice using TLS. A companion document describes a method for using HTTP/TLS over the same port as normal HTTP [RFC2817]."> |
---|
347 | </head> |
---|
348 | <body> |
---|
349 | <table class="header"> |
---|
350 | <tbody> |
---|
351 | <tr> |
---|
352 | <td class="left">Network Working Group</td> |
---|
353 | <td class="right">E. Rescorla</td> |
---|
354 | </tr> |
---|
355 | <tr> |
---|
356 | <td class="left">Request for Comments: 2818</td> |
---|
357 | <td class="right">RTFM, Inc.</td> |
---|
358 | </tr> |
---|
359 | <tr> |
---|
360 | <td class="left">Category: Informational</td> |
---|
361 | <td class="right">May 2000</td> |
---|
362 | </tr> |
---|
363 | </tbody> |
---|
364 | </table> |
---|
365 | <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> |
---|
373 | <p>This memo describes how to use TLS to secure HTTP connections over the Internet. Current practice is to layer HTTP over SSL |
---|
374 | (the predecessor to TLS), distinguishing secured traffic from insecure traffic by the use of a different server port. This |
---|
375 | document documents that practice using TLS. A companion document describes a method for using HTTP/TLS over the same port |
---|
376 | as normal HTTP [RFC2817]. |
---|
377 | </p> |
---|
378 | <hr class="noprint"> |
---|
379 | <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1> |
---|
380 | <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> |
---|
383 | </ul> |
---|
384 | </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> |
---|
390 | </ul> |
---|
391 | </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> |
---|
394 | </ul> |
---|
395 | </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> |
---|
399 | </ul> |
---|
400 | </li> |
---|
401 | <li>4. <a href="#rfc.references">References</a></li> |
---|
402 | <li><a href="#rfc.authors">Author's Address</a></li> |
---|
403 | <li>A. <a href="#rfc.section.A">Security Considerations</a></li> |
---|
404 | <li><a href="#rfc.index">Index</a></li> |
---|
405 | <li><a href="#rfc.ipr">Intellectual Property and Copyright Statements</a></li> |
---|
406 | </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"> |
---|
489 | 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> |
---|
528 | <h1 id="rfc.references"><a href="#rfc.section.4" id="rfc.section.4">4.</a> References |
---|
529 | </h1> |
---|
530 | <table> |
---|
531 | <tr> |
---|
532 | <td class="reference"><b id="RFC2459">[RFC2459]</b></td> |
---|
533 | <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 | </td> |
---|
535 | </tr> |
---|
536 | <tr> |
---|
537 | <td class="reference"><b id="RFC2616">[RFC2616]</b></td> |
---|
538 | <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 | </td> |
---|
540 | </tr> |
---|
541 | <tr> |
---|
542 | <td class="reference"><b id="RFC2119">[RFC2119]</b></td> |
---|
543 | <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 | </td> |
---|
545 | </tr> |
---|
546 | <tr> |
---|
547 | <td class="reference"><b id="RFC2246">[RFC2246]</b></td> |
---|
548 | <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 | </td> |
---|
550 | </tr> |
---|
551 | <tr> |
---|
552 | <td class="reference"><b id="RFC2817">[RFC2817]</b></td> |
---|
553 | <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 | </td> |
---|
555 | </tr> |
---|
556 | </table> |
---|
557 | <div class="avoidbreak"> |
---|
558 | <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> |
---|
564 | <h1 id="rfc.index"><a href="#rfc.index">Index</a></h1> |
---|
565 | <p class="noprint"><a href="#rfc.index.H">H</a> <a href="#rfc.index.U">U</a> |
---|
566 | </p> |
---|
567 | <div class="print2col"> |
---|
568 | <ul class="ind"> |
---|
569 | <li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul> |
---|
570 | <li>https URI scheme <a href="#rfc.iref.h.1"><b>2.4</b></a></li> |
---|
571 | </ul> |
---|
572 | </li> |
---|
573 | <li><a id="rfc.index.U" href="#rfc.index.U"><b>U</b></a><ul> |
---|
574 | <li>URI scheme |
---|
575 | <ul> |
---|
576 | <li>https <a href="#rfc.iref.u.1"><b>2.4</b></a></li> |
---|
577 | </ul> |
---|
578 | </li> |
---|
579 | </ul> |
---|
580 | </li> |
---|
581 | </ul> |
---|
582 | </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> |
---|
614 | </body> |
---|
615 | </html> |
---|