When CryptoAPI performs network retrieval of revocation information, CryptoAPI first determines whether the required revocation information is already cached. The following sections provide details on how network retrieval is performed and how the results are cached.
Using ETags and Max-age in a Request
The use of ETag and Max-age minimize bandwidth usage by helping to identify whether the client must download an updated object from the server.
Figure 1 CRL download with caching at the proxy
For example, take the case of an organization that publishes an updated CRL for its root CA every six months. Without using ETag and Max-age, it is possible that a subordinate CA is revoked one month later, but is not recognized by clients until the previous CRL expires in five months time.
However, although the CA is configured with a six month CRL, you can get clients to poll weekly for updates. You can do this by setting the Max-age to 604800 seconds (1 week) and an ETag value.
When the client (Client A in Figure 1) downloads the CRL from the CRL distribution point, the proxy server used by the client will cache both the CRL object and the header information (including the ETag and Max-age). If another client computer (Client C) connects to the proxy server to download the CRL, the proxy will respond with the cached CRL because the Max-Age is still in the period after the current date and time. This is indicated by set of arrows labeled as 2 in the figure.
A week later, the first client will poll for a new CRL by using a conditional GET. The proxy server or origin server will return the CRL object only if it is different from the version cached on the client. The client also sets the Max-age header to 1 week. This forces the proxy server to revalidate the object headers with the origin server. During the week that follows, successive conditional GET requests will be fielded by the proxy server (unless the object is removed from the proxy cache). This process repeats for another 25 weeks until the CA finally replaces its CRL.
The following sections provide detailed information on how HTTP 1.1 Proxy support reduces the bandwidth used in revocation checking.
The Initial Request and Response
When a request is made to a HTTP 1.1 server, the following HTTP header is sent from the client to the HTTP 1.1 server:
| GET http://crl.verisign.com/pca3.crl HTTP/1.1 Accept: */* User-Agent: Microsoft-CryptoAPI/6.0 Host: crl.verisign.com Proxy-Connection: Keep-Alive |
The first line contains the HTTP method (GET), the URI (http://crl.verisign.com/pca3.crl) and the HTTP version (HTTP/1.1).
When the origin server responds, the following data is sent back to the client:
| HTTP/1.1 200 OK Proxy-Connection: Keep-Alive Connection: Keep-Alive Content-Length: 828 Via: 1.1 PRXY-23 Age: 2339 Date: Wed, 14 May 2008 23:50:38 GMT Content-Type: application/pkix-crl ETag: "570084-33c-64a62480" Server: Apache/2.2.2 (Unix) Last-Modified: Tue, 29 Apr 2008 16:19:14 GMT Accept-Ranges: bytes Cache-Control: max-age = 86400 |
The following details are included in the response:
-
The first line indicates that the highest HTTP version supported by the server is version 1.1, that the Status code for the operation is 200 signifying the operation was successful, and the reason is OK.
-
The Content-Length header indicates the size of the CRL.
-
The Via header indicates the names of the proxy servers.
-
The Date header contains the date and time the message was generated at the origin server.
-
The Content-Type header indicates that the object is a CRL.
-
The ETag header is set to a value of "570084-33c-64a62480".
-
The Last-Modified header contains the date and time at which the origin server asserts the object was last modified.
-
The Cache-Control: Max-age is set to a value of 86,400 which indicates that the proxy can use the cached object for 1 day before it must determine whether a more recent object is available at the origin server.
If another client were to submit a request for the http://crl.verisign.com/pca3.crl object through the PRXY-23 proxy, the proxy server can respond with the cached copy without revalidating with the origin server (as long as the request is within one day of the original request).
Fetching New Objects
When a client fetches a new object for the first time, CryptoAPI performs a simple HTTP GET without any additional headers. In this case, the server may respond with the following headers along with the requested object:
| HTTP/1.1 200 OK Via: 1.1 PRXY-23 Connection: close Proxy-Connection: close Content-Length: 38228 Age: 316 Date: Sat, 03 May 2008 01:24:19 GMT Content-Type: application/pkix-crl Server: Microsoft-IIS/7.0 Accept-Ranges: bytes Last-Modified: Wed, 01 May 2008 16:46:38 GMT ETag: "a29232404390c41:8a2" Cache-Control: max-age = 864000 |
When CryptoAPI receives the object, the object will be added to the local cache. In addition, CryptoAPI will cache the ETag, Max-age, Last-Modified, and Via headers.
Although a simple GET is useful, conditional GETs enable the client to be more efficient by avoiding repeated downloads of information that has not changed on the server
Conditional GETs
Conditional headers to the GET method are used by Windows to determine whether the CRL or OCSP has changed since the last download. The two conditional headers used by CryptoAPI are:
- If-Modified-Since. A client can determine whether the requested object has not been modified since the time specified in the If-Modified-Since header. The server will respond with either Not Modified or the updated object.
- If-None-Match. A client can verify whether a previously requested entity is current by including a list of associated ETags in the If-None-Match header field. The server will respond not modified response that includes the ETag header and updated Max-age header.
If a server receives both the If-None-Match and If-Modified-Since headers, the If-None-Match header takes precedence. CryptoAPI sends only one of these conditional headers in the request. If the server returned the ETag header in its previous response, CryptoAPI will use the If-None-Match header that indicates the provided ETag value.
If the server did not return the ETag, CryptoAPI will use the Last-Modified header’s date and time included in the previous response and use that date and time in the If-Modified-Since header.
If the server returned both the ETag header and the Last-Modified header, a non-CryptoAPI client can include both the If-None-Match and If-Modified-Since headers. If both headers are submitted in a request, an HTTP 1.1 compliant server is supposed to prefer the If-None-Match header to the If-Modified-Since header if both are submitted in a request.
For example, if a client wished to update the cached version of the codesigning.crl file here, the following conditional GET request would be submitted to the origin server:
| GET http://crl.microsoft.com/codesigning.crl HTTP/1.1 If-None-Match: "a29232404390c41:8a2" Cache-Control: max-age=86400 |
The conditional GET also includes a Max-age directive. The directive is included to trigger any intermediate proxies to revalidate with the origin server if the age of its cached object exceeds the max-age indicated in the conditional GET.
Note |
|---|
|
More details about the disk and memory cache are available in the Disk and Memory Caches section later in this document. |
If the Server / Proxy Returned an Expired Object
During the execution of a simple GET or a conditional GET, the server may return an expired object to the client. If the origin server or the proxy server returns an expired object, CryptoAPI will assume that one of the proxies in the path is returning the expired object.
The client determines whether the object is expired by inspecting the NextUpdate field in the certificate, CRL, or OCSP response object. The object is considered expired if the date in the NextUpdate field is earlier than the current date or time.
The object is also considered expired if the response from the origin server or proxy server contains a Date header that is more recent than the Date header from the previously cached response.
To update the expired object, the client will send a new conditional GET request. For an HTTP 1.1 origin server or proxy server, the following request is sent:
| GET http://crl.microsoft.com/codesigning.crl HTTP/1.1 Cache-Control: max-age=0 |
CryptoAPI can also support the use of LDAP for PKI object retrieval. The following section provides details on LDAP object retrieval.