
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Mon, 13 Apr 2026 15:13:32 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Roughtime: Securing Time with Digital Signatures]]></title>
            <link>https://blog.cloudflare.com/roughtime/</link>
            <pubDate>Fri, 21 Sep 2018 12:00:00 GMT</pubDate>
            <description><![CDATA[ When you visit a secure website, it offers you a TLS certificate that asserts its identity. Every certificate has an expiration date, and when it’s passed due, it is no longer valid. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>When you visit a secure website, it offers you a <a href="https://www.cloudflare.com/application-services/products/ssl/">TLS certificate</a> that asserts its identity. Every certificate has an expiration date, and when it’s passed due, it is no longer valid. The idea is almost as old as the web itself: limiting the lifetime of certificates is meant to reduce the risk in case a TLS server’s secret key is compromised.</p><p>Certificates aren’t the only cryptographic artifacts that expire. When you visit a site protected by Cloudflare, we also tell you whether its certificate has been revoked (see our blog post on <a href="/high-reliability-ocsp-stapling/">OCSP stapling</a>) — for example, due to the secret key being compromised — and this value (a so-called OCSP staple) has an expiration date, too.</p><p>Thus, to determine if a certificate is valid and hasn’t been revoked, your system needs to know the current time. Indeed, time is crucial for the security of TLS and myriad other protocols. To help keep clocks in sync, we are announcing a free, high-availability, and low-latency authenticated time service called <a href="https://roughtime.googlesource.com/roughtime">Roughtime</a>, available at <a href="https://roughtime.cloudflare.com">roughtime.cloudflare.com</a> on port 2002.</p>
    <div>
      <h2>Time is tricky</h2>
      <a href="#time-is-tricky">
        
      </a>
    </div>
    <p>It may surprise you to learn that, in practice, clients’ clocks are heavily skewed. A <a href="https://acmccs.github.io/papers/p1407-acerA.pdf">recent study of Chrome users</a> showed that a significant fraction of reported <a href="https://www.cloudflare.com/learning/ssl/common-errors/">TLS-certificate errors</a> are caused by client-clock skew. During the period in which error reports were collected, 6.7% of client-reported times were behind by more than 24 hours. (0.05% were ahead by more than 24 hours.) This skew was a causal factor for at least 33.5% of the sampled reports from Windows users, 8.71% from Mac OS, 8.46% from Android, and 1.72% from Chrome OS. These errors are usually presented to users as warnings that the user can click through to get to where they’re going. However, showing too many warnings makes users grow accustomed to clicking through them; <a href="https://en.wikipedia.org/wiki/Alarm_fatigue">this is risky</a>, since these warnings are meant to keep users away from malicious websites.</p><p>Clock skew also holds us back from improving the security of certificates themselves. We’d like to issue certificates with shorter lifetimes because the less time the certificate is valid, the lower the risk of the secret key being exposed. (This is why Let’s Encrypt issues certificates valid for just <a href="https://letsencrypt.org/2015/11/09/why-90-days.html">90 days by default</a>.) But the long tail of skewed clocks limits the effective lifetime of certificates; shortening the lifetime too much would only lead to more warnings.</p><p>Endpoints on the Internet often synchronize their clocks using a protocol like the <a href="https://en.wikipedia.org/wiki/Network_Time_Protocol">Network Time Protocol</a> (NTP). NTP aims for precise synchronization, and even accounts for network latency. However, it is usually deployed without security features, as the added overhead on high-load servers <a href="https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/dowling">degrades precision significantly</a>. As a result, a man-in-the-middle attacker between the client and server can easily influence the client’s clock. By moving the client back in time, the attacker can force it to accept expired (and possibly compromised) certificates; by moving forward in time, it can force the client to accept a certificate that is <i>not yet</i> valid.</p><p>Fortunately, for settings in which both security and precision are paramount, workable solutions are <a href="https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/dowling">on the horizon</a>. But for many applications, precise network time isn’t essential; it suffices to be <i>accurate</i>, say, within 10 seconds of real time. This observation is the primary motivation of Google’s <a href="https://roughtime.googlesource.com/roughtime">Roughtime</a> protocol, a simple protocol by which clients can synchronize their clocks with one or more authenticated servers. Roughtime lacks the precision of NTP, but aims to be accurate enough for cryptographic applications, and since the responses are authenticated, man-in-the-middle attacks aren’t possible.</p><p>The protocol is designed to be simple and flexible. A client can get Roughtime from just one server it trusts, or it may contact many servers to make its calculation more robust. But its most distinctive feature is that it adds <i>accountability</i> to time servers. If a server misbehaves by providing the wrong time, then the protocol allows clients to produce publicly verifiable, cryptographic proof of this misbehavior. Making servers auditable in this manner makes them accountable to provide accurate time.</p><p>We are deploying a Roughtime service for two reasons.</p><p>First, the clock we use for this service is the same as the clock we use to determine whether our customers’ certificates are valid and haven’t been revoked; as a result, exposing this service makes us accountable for the validity of TLS artifacts we serve to clients on behalf of our customers.</p><p>Second, Roughtime is a great idea whose time has come. But it is only useful if several independent organizations participate; the more Roughtime servers there are, the more robust the ecosystem becomes. Our hope is that putting our weight behind it will help the Roughtime ecosystem grow.</p>
    <div>
      <h2>The Roughtime protocol</h2>
      <a href="#the-roughtime-protocol">
        
      </a>
    </div>
    <p>At its most basic level, Roughtime is a one-round protocol in which the client requests the current time and the server sends a signed response. The response is comprised of a timestamp (the number of microseconds since the Unix epoch) and a <i>radius</i> (in microseconds) used to indicate the server’s certainty about the reported time. For example, a radius of 1,000,000μs means the server is reasonably sure that the true time is within one second of the reported time.</p><p>The server proves freshness of its response as follows. The request consists of a short, random string commonly called a <i>nonce</i> (pronounced /<a href="https://www.merriam-webster.com/dictionary/nonce">nän(t)s</a>/, or sometimes /ˈen wən(t)s/). The server incorporates the nonce into its signed response so that it’s needed to verify the signature. If the nonce is sufficiently long (say, 16 bytes), then the number of possible nonces is so large that it’s extremely unlikely the server has encountered (or will ever encounter) a request with the same nonce. Thus, a valid signature serves as cryptographic proof that the response is fresh.</p><p>The client uses the server’s <i>root public key</i> to verify the signature. (The key is obtained out-of-band; you can get our key <a href="https://developers.cloudflare.com/time-services/roughtime/usage/">here</a>.) When the server starts, it generates an online public/secret key pair; the root secret key is used to create a delegation for the online public key, and the online secret key is used to sign the response. The delegation serves the same function as a traditional <a href="https://en.wikipedia.org/wiki/X.509">X.509</a> certificate on the web: as illustrated in the figure below, the client first uses the root public key to verify the delegation, then uses the online public key to verify the response. This allows for operational separation of the delegator and the server and limits exposure of the root secret key.</p><hr />
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/52glM0EDJ0cO6EzChb6oz4/611386837f9e99dfa650d562a850d7ed/Cloudflare-Roughtime-1.png" />
            
            </figure><p>Simplified Roughtime (without delegation)</p><hr />
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3G51im5eHgZt2KlZ3sSaRm/a29f0ede0d24251022a85f719f0c6ff5/Cloudflare-Roughtime-2.png" />
            
            </figure><p>Roughtime with delegation</p><hr /><p>Roughtime offers two features designed to make it scalable.  First, when the volume of requests is high, the server may batch-sign a number of clients’ requests by constructing a <a href="https://en.wikipedia.org/wiki/Merkle_tree">Merkle tree</a> from the nonces. The server signs the root of the tree and sends in its response the information needed to prove to the client that its request is in the tree. (The data structure is a binary tree, so the amount of information is proportional to the base-2 logarithm of the number of requests in the batch; see the figure below) Second, the protocol is executed over UDP. In order to prevent the Roughtime server from being an amplifier for <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/">DDoS attacks</a>, the request is padded to 1KB; if the UDP packet is too short, then it’s dropped without further processing. Check out <a href="https://int08h.com/post/to-catch-a-lying-timeserver/">this blog post</a> for a more in-depth discussion.</p><hr />
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7qbWjYHoaWRrXuc0as57rf/0cc40418c06f19279f23d3cb68d8a5f9/Cloudflare-Roughtime-3.png" />
            
            </figure><p>Roughtime with batching</p><hr />
    <div>
      <h3>Using Roughtime</h3>
      <a href="#using-roughtime">
        
      </a>
    </div>
    <p>The protocol is flexible enough to support a variety of use cases. A web browser could use a Roughtime server to proactively synchronize its clock when validating TLS certificates. It could also be used retroactively to avoid showing the user too many warnings: when a certificate validation error occurs — in particular, when the browser believes it’s expired or not yet valid — Roughtime could be used to determine if the clock skew was the root cause. Instead of telling the user the certificate is invalid, it could tell the user that their clock is incorrect.</p><p>Using just one server is sufficient if that server is trustworthy, but a security-conscious user could make requests to many servers; the delta might be computed by eliminating outliers and averaging the responses, or by some <a href="https://roughtime.googlesource.com/roughtime/+/master/go/client/">more sophisticated method</a>. This makes the calculation robust to one or more of the servers misbehaving.</p>
    <div>
      <h3>Making servers accountable</h3>
      <a href="#making-servers-accountable">
        
      </a>
    </div>
    <p>The real power of Roughtime is that it’s auditable. Consider the following mode of operation. The client has a list of servers it will query in a particular order. The client generates a random string — called a blind in the parlance of Roughtime — hashes it, and uses the output as the nonce for its request to the server. For subsequent requests, it computes the nonce as follows: generate a blind, compute the hash of this string and the response from the previous server (including the timestamp and signature), and use this hash as the nonce for the next request.</p><hr />
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Tud1Kf1Y3Epq0Cpqd6Zvc/8effcbc470799ce34d0f976e8caeb2ec/Cloudflare-Roughtime-4.png" />
            
            </figure><p>Chaining multiple Roughtime servers</p><hr /><p>Creating a chain of timestamps in this way binds each response to the response that precedes it. Thus, the sequence of blinds and signatures constitute a publicly verifiable, cryptographic proof that the timestamps were requested in order (a “clockchain” if you will ?). If the servers are roughly synchronized, then we expect that the sequence to monotonically increase, at least roughly. If one of the servers were consistently behind or ahead of the others, then this would be evident in the sequence. Suppose you get the following sequence of timestamps, each from different servers:</p>
<table>
    <tbody>
        <tr>
            <th>Server
            </th><th>Timestamp
        </th></tr>
        <tr>
            <td>ServerA-Roughtime</td>
            <td>2018-08-29 14:51:50 -0700 PDT</td>
        </tr>
        <tr>
            <td>ServerB-Roughtime</td>
            <td>2018-08-29 14:51:51 -0700 PDT +0:00:01</td>
        </tr>
        <tr>
            <td>Cloudflare-Roughtime</td>
            <td>2018-08-29 12:51:52 -0700 PDT -1:59:59</td>
        </tr>
        <tr>
            <td>ServerC-Roughtime</td>
            <td>2018-08-29 14:51:53 -0700 PDT +2:00:01</td>
        </tr>

    </tbody>
</table>
<p>Servers B and C corroborate the time given by server A, but — oh no! Cloudflare is two hours behind! Unless servers A, B, and C are in cahoots, it’s likely that the time offered by Cloudflare is incorrect. Moreover, you have verifiable, cryptographic proof. In this way, the Roughtime protocol makes our server (and all Roughtime servers) accountable to provide accurate time, or, at least, to be in sync with the others.</p>
    <div>
      <h2>The Roughtime ecosystem</h2>
      <a href="#the-roughtime-ecosystem">
        
      </a>
    </div>
    <p>The infrastructure for monitoring and auditing the <a href="https://roughtime.googlesource.com/roughtime/+/HEAD/ECOSYSTEM.md">Roughtime ecosystem</a> hasn’t been built yet. Right now there’s only a handful of servers: in addition to Cloudflare’s and <a href="https://roughtime.googlesource.com/roughtime/+/master/roughtime-servers.json">Google’s</a>, there’s also a really nice <a href="https://github.com/int08h/roughenough">Rust implementation</a>. The more diversity there is, the healthier the ecosystem becomes. We hope to see more organizations adopt this protocol.</p>
    <div>
      <h3>Cloudflare’s Roughtime service</h3>
      <a href="#cloudflares-roughtime-service">
        
      </a>
    </div>
    <p>For the initial deployment of this service, our primary goals are to ensure high availability and minimal maintenance overhead. Each machine at each Cloudflare location executes an instance of the service and responds to queries using its system clock. The server signs each request individually rather than batch-signing them as described above; we rely on our load balancer to ensure no machine is overwhelmed. There are three ways in which we envision this service could be used:</p><ol><li><p><i>TLS authentication</i>. When a TLS application (a web browser for example) starts, it could make a request to roughtime.cloudflare.com and compute the difference between the reported time and its system time. Whenever it authenticates a TLS server, it would add this difference to the system time to get the current time.</p></li><li><p><i>Roughtime daemon</i>. One could implement an OS daemon that periodically requests the current time. If the reported time differs from the system time by more than a second, it might issue an alert.</p></li><li><p><i>Server auditing</i>. As the <a href="https://roughtime.googlesource.com/roughtime/+/HEAD/ECOSYSTEM.md">Roughtime ecosystem</a> grows, it will be important to ensure that all of the servers are in sync. Individuals or organizations may take it upon themselves to monitor the ecosystem and ensure that the servers are in sync with one another.</p></li></ol><p>The service is reachable wherever you are via our anycast network. This is important for a service like Roughtime, because minimizing network latency helps improve accuracy. For information about how to configure a client to use Cloudflare-Roughtime, check out the <a href="https://developers.cloudflare.com/time-services/roughtime/">developer documentation</a>. Note that our initial release is somewhat experimental. As such, our root public key may change in the future. See the developer docs for information on obtaining the current public key.</p><p>If you want to see what time our Roughtime server returns, click the button below!</p><p>function getTime() { document.getElementById("time-txt-box").innerHTML = "Loading..." fetch("/cdn-cgi/trace").then((res) =&gt; res.text()).then((txt) =&gt; { let ts = txt.match(/ts=([0-9\.]+)/)[1] let str = new Date(parseFloat(ts) * 1000) document.getElementById("time-txt-box").innerHTML = str }) .catch((err) =&gt; { console.log(err) document.getElementById("time-txt-box").innerHTML = "Request failed." }) }</p><p>Get Time! </p><p><a href="/subscribe/"><i>Subscribe to the blog</i></a><i> for daily updates on our announcements.</i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3kjD9adVSlGmVPxJvtg0VJ/ba8c654b3f2cfeef827719c8dcd79ca4/Crypto-Week-1-1-3.png" />
            
            </figure><p></p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">7kCyQ6aExp7N5vYW6kc3gY</guid>
            <dc:creator>Christopher Patton</dc:creator>
        </item>
        <item>
            <title><![CDATA[High-reliability OCSP stapling and why it matters]]></title>
            <link>https://blog.cloudflare.com/high-reliability-ocsp-stapling/</link>
            <pubDate>Mon, 10 Jul 2017 12:43:30 GMT</pubDate>
            <description><![CDATA[ At Cloudflare our focus is making the internet faster and more secure. Today we are announcing a new enhancement to our HTTPS service: High-Reliability OCSP stapling. ]]></description>
            <content:encoded><![CDATA[ <p>At Cloudflare our focus is making the Internet faster and more secure. Today we are announcing a new enhancement to our HTTPS service: High-Reliability OCSP stapling. This feature is a step towards enabling an important security feature on the web: certificate revocation checking. Reliable OCSP stapling also improves connection times by up to 30% in some cases. In this post, we’ll explore the importance of certificate revocation checking in HTTPS, the challenges involved in making it reliable, and how we built a robust OCSP stapling service.</p>
    <div>
      <h3>Why revocation is hard</h3>
      <a href="#why-revocation-is-hard">
        
      </a>
    </div>
    <p>Digital certificates are the cornerstone of trust on the web. A digital certificate is like an identification card for a website. It contains identity information including the website’s hostname along with a cryptographic public key. In public key cryptography, each public key has an associated private key. This private key is kept secret by the site owner. For a browser to trust an HTTPS site, the site’s server must provide a certificate that is valid for the site’s hostname and a proof of control of the certificate’s private key. If someone gets access to a certificate’s private key, they can impersonate the site. Private key compromise is a serious risk to trust on the web.</p><p>Certificate revocation is a way to mitigate the risk of key compromise. A website owner can revoke a compromised certificate by informing the certificate issuer that it should no longer be trusted. For example, back in 2014, <a href="/the-heartbleed-aftermath-all-cloudflare-certificates-revoked-and-reissued/">Cloudflare revoked</a> all managed certificates after it was shown that the Heartbleed vulnerability could be <a href="/the-results-of-the-cloudflare-challenge/">used to steal private keys</a>. There are other reasons to revoke, but key compromise is the most common.</p><p>Certificate revocation has a spotty history. Most of the revocation checking mechanisms implemented today don’t protect site owners from key compromise. If you know about why revocation checking is broken, feel free to skip ahead to the OCSP stapling section <a href="#ocspstapling">below</a>.</p>
    <div>
      <h3>Revocation checking: a history of failure</h3>
      <a href="#revocation-checking-a-history-of-failure">
        
      </a>
    </div>
    <p>There are several ways a web browser can check whether a site’s certificate is revoked or not. The most well-known mechanisms are Certificate Revocation Lists (CRL) and Online Certificate Status Protocol (OCSP). A CRL is a signed list of serial numbers of certificates revoked by a CA. OCSP is a protocol that can be used to query a CA about the revocation status of a given certificate. An OCSP response contains signed assertions that a certificate is not revoked.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6lGxsndXR5EF4yGX4thxuq/6c0e5a895ae6674e8d783aa5d6cef071/image1-1.jpg" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ovTuDaVKP72LIddkcRGIE/cf81791b20b77dfbd5dbf4c0221926fa/Frame-658.png" />
            
            </figure><p>Certificates that support OCSP contain the responder's URL and those that support CRLs contain a URLs where the CRL can be obtained. When a browser is served a certificate as part of an HTTPS connection, it can use the embedded URL to download a CRL or an OCSP response and check that the certificate hasn't been revoked before rendering the web page. The question then becomes: what should the browser do if the request for a CRL or OCSP response fails? As it turns out, both answers to that question are problematic.</p>
    <div>
      <h3>Hard-fail doesn’t work</h3>
      <a href="#hard-fail-doesnt-work">
        
      </a>
    </div>
    <p>When browsers encounter a web page and there’s a problem fetching revocation information, the safe option is to block the page and show a security warning. This is called a hard-fail strategy. This strategy is conservative from a security standpoint, but prone to false positives. For example, if the proof of non-revocation could not be obtained for a valid certificate, a hard-fail strategy will show a security warning. Showing a security warning when no security issue exists is dangerous because it can lead to <a href="http://www.wired.co.uk/article/cybersecurity-warnings-fatigue">warning fatigue</a> and teach users to click through security warnings, which is a bad idea.</p><p>In the real world, false positives are unavoidable. OCSP and CRL endpoints subject to service outages and network errors. There are also common situations where these endpoints are completely inaccessible to the browser, such as when the browser is behind a captive portal. For some access points used in hotels and airplanes, unencrypted traffic (like OCSP endpoints) are blocked. A hard-fail strategy force users behind captive portals and other networks that block OCSP requests to click through unnecessary security warnings. This reality is unpalatable to browser vendors.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3X32ji9gvjXGc5BGcrw6TH/e25942fb12b7844085fbb40c6cf811bd/image3-1.png" />
            
            </figure><p>Another drawback to a hard-fail strategy is that it puts an increased burden on certificate authorities to keep OCSP and CRL endpoints available and online. A broken OCSP or CRL server becomes a central point of failure for all certificates issued by a certificate authority. If browsers followed a hard-fail strategy, an OCSP outage would be an Internet outage. Certificate authorities are organizations optimized to provide trust and accountability, not necessarily resilient infrastructure. In a hard-fail world, the availability of the web as a whole would be limited by the ability for CAs to keep their OCSP services online at all times; a dangerous systemic risk to the internet as a whole.</p>
    <div>
      <h3>Soft-fail: it’s not much better</h3>
      <a href="#soft-fail-its-not-much-better">
        
      </a>
    </div>
    <p>To avoid the downsides of a hard-fail strategy, most browsers take another approach to certificate revocation checking. Upon seeing a new certificate, the browser will attempt to fetch the revocation information from the CRL or OCSP endpoint embedded in the certificate. If the revocation information is available, they rely on it, and otherwise they assume the certificate is not revoked and display the page without any errors. This is called a “soft-fail” strategy.</p><p>The soft-fail strategy has a critical security flaw. An attacker with network position can block the OCSP request. If this attacker also has the private key of a revoked certificate, they can intercept the outgoing connection for the site and present the revoked certificate to the browser. Since the browser doesn’t know the certificate is revoked and is following a soft-fail strategy, the page will load without alerting the user. As Adam Langley <a href="https://www.imperialviolet.org/2012/02/05/crlsets.html">described</a>: “soft-fail revocation checks are like a seat-belt that snaps when you crash. Even though it works 99% of the time, it's worthless because it only works when you don't need it.”</p><p>A soft-fail strategy also makes connections slower. If revocation information for a certificate is not already cached, the browser will block the rendering of the page until the revocation information is retrieved, or a timeout occurs. This additional step causes a noticeable and unwelcome delay, with marginal security benefits. This tradeoff is a hard sell for the performance-obsessed web. Because of the limited benefit, some browsers have eliminated live revocation checking for at least <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1366100">some subset of certificates</a>.</p><p>Live OCSP checking has an additional downside: it leaks private browsing information. OCSP requests are sent over unencrypted HTTP and are tied to a specific certificate. Sending an OCSP request tells the certificate authority which websites you are visiting. Furthermore, everyone on the network path between your browser and the OCSP server will also know which sites you are browsing.</p>
    <div>
      <h3>Alternative revocation checking</h3>
      <a href="#alternative-revocation-checking">
        
      </a>
    </div>
    <p>Some client still perform soft-fail OCSP checking, but it’s becoming less common due to the performance and privacy downsides described above. To protect high-value certificates, some browsers have explored alternative mechanisms for revocation checking.</p><p>One technique is to pre-package a list of revoked certificates and distribute them through browser updates. Because the list of all revoked certificates is so large, only a few high-impact certificates are included in this list. This technique is called <a href="https://blog.mozilla.org/security/2015/03/03/revoking-intermediate-certificates-introducing-onecrl/">OneCRL</a> by Firefox and <a href="https://www.imperialviolet.org/2012/02/05/crlsets.html">CRLSets</a> by Chrome. This has been effective for some high-profile revocations, but it is by no means a complete solution. Not only are not all certificates covered, this technique leaves a window of vulnerability between the time the certificate is revoked and the certificate list gets to browsers.</p>
    <div>
      <h3>OCSP Stapling</h3>
      <a href="#ocsp-stapling">
        
      </a>
    </div>
    <p>OCSP stapling is a technique to get revocation information to browsers that fixes some of the performance and privacy issues associated with live OCSP fetching. In OCSP stapling, the server includes a current OCSP response for the certificate included (or "stapled") into the initial HTTPS connection. That removes the need for the browser to request the OCSP response itself. OCSP stapling is widely supported by modern browsers.</p><p>Not all servers support OCSP stapling, so browsers still take a soft-fail approach to warning the user when the OCSP response is not stapled. Some browsers (such as Safari, Edge and Firefox <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1366100">for now</a>) check certificate revocation for certificates, so OCSP stapling can provide a performance boost of <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30/">up to 30%</a>. For browsers like Chrome that don’t check for revocation for all certificates, OCSP stapling provides a proof of non-revocation that they would not have otherwise.</p>
    <div>
      <h3>High-reliability OCSP stapling</h3>
      <a href="#high-reliability-ocsp-stapling">
        
      </a>
    </div>
    <p>Cloudflare <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30/">started offering OCSP stapling in 2012</a>. Cloudflare’s original implementation relied on code from <a href="https://www.nginx.com/press/globalsign-digicert-and-comodo-collaborate-nginx-improve-online/">nginx</a> that was able to provide OCSP stapling for a some, but not all connections. As Cloudflare’s network grew, the implementation wasn’t able to scale with it, resulting in a drop in the percentage of connections with OCSP responses stapled. The architecture we had chosen had served us well, but we could definitely do better.</p><p>In the last year we redesigned our OCSP stapling infrastructure to make it much more robust and reliable. We’re happy to announce that we now provide reliable OCSP stapling connections to Cloudflare. As long as the certificate authority has set up OCSP for a certificate, Cloudflare will serve a valid OCSP stapled response. All Cloudflare customers now benefit from much more reliable OCSP stapling.</p>
    <div>
      <h3>OCSP stapling past</h3>
      <a href="#ocsp-stapling-past">
        
      </a>
    </div>
    <p>In Cloudflare’s original implementation of OCSP stapling, OCSP responses were fetched opportunistically. Given a connection that required a certificate, Cloudflare would check to see if there was a fresh OCSP response to staple. If there was, it would be included in the connection. If not, then the client would not be sent an OCSP response, and Cloudflare would send a request to refresh the OCSP response in the cache in preparation for the next request.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/695TLaZM0gWEN9q339DdiE/1a275ed24ab629605b3881660fe036e5/image2-1.jpg" />
            
            </figure><p>If a fresh OCSP response wasn’t cached, the connection wouldn’t get an OCSP staple. The next connection for that same certificate would get a OCSP staple, because the cache will have been populated.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/26xAQKhW2tBTI9uwb1R3OD/2095dd4e959366e8c4ddcf7f8bfe337a/image7.jpg" />
            
            </figure><p>This architecture was elegant, but not robust. First, there are several situations in which the client is guaranteed to not get an OCSP response. For example, the first request in every cache region and the first request after an OCSP response expires are guaranteed to not have an OCSP response stapled. With Cloudflare’s expansion to more locations, these failures were more common. Less popular sites would have their OCSP responses fetched less often resulting in an even lower ratio of stapled connections. Another reason that connections could be missing OCSP responses is if the OCSP request from Cloudflare to fill the cache failed. There was a lot of room for improvement.</p>
    <div>
      <h3>Our solution: OCSP pre-fetching</h3>
      <a href="#our-solution-ocsp-pre-fetching">
        
      </a>
    </div>
    <p>In order to be able to reliably include OCSP staples in all connection, we decided to change the model. Instead of fetching the OCSP response when a request came in, we would fetch it in a centralized location and distribute valid responses to all our servers. When a response started getting close to expiration, we’d fetch a new one. If the OCSP request fails, we put it into a queue to re-fetch at a later time. Since most OCSP staples are valid for around 7 days, there is a lot of flexibility in term of refreshing expiring responses.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5VtZ72GF4qvtDLHF4YwnhS/0e788290c059f675821c94ba04194032/image5.jpg" />
            
            </figure><p>To keep our cache of OCSP responses fresh, we created an OCSP fetching service. This service ensures that there is a valid OCSP response for every certificate managed by Cloudflare. We constantly crawl our cache of OCSP responses and refresh those that are close to expiring. We also make sure to never cache invalid OCSP responses, as this can have <a href="https://www.theregister.co.uk/2017/05/29/certificate_snafu_sees_azure_portal_reject_firefox/">bad consequences</a>. This system has been running for several months now, and we are now reliably including OCSP staples for almost every HTTPS request.</p><p>Reliable stapling improves performance for browsers that would have otherwise fetched OCSP, but it also changes the optimal failure strategy for browsers. If a browser can reliably get an OCSP staple for a certificate, why not switch back from a soft-fail to a hard-fail strategy?</p>
    <div>
      <h3>OCSP must-staple</h3>
      <a href="#ocsp-must-staple">
        
      </a>
    </div>
    <p>As <a href="#softfail">described above</a>, the soft-fail strategy for validating OCSP responses opens up a security hole. An attacker with a revoked certificate can simply neglect to provide an OCSP response when a browser connects to it and the browser will accept their revoked certificate.</p><p>In the OCSP fetching case, a soft-fail approach makes sense. There many reasons the browser would not be able to obtain an OCSP: captive portals, broken OCSP servers, network unreliability and more. However, as we have shown with our high-reliability OCSP fetching service, it is possible for a server to fetch OCSP responses without any of these problems. OCSP responses are re-usable and are valid for several days. When one is close to expiring, the server can fetch a new one out-of-band and be able to reliably serve OCSP staples for all connections.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3DwccMgq7pMKrCnU5S7Ivj/fb5bbe40027ccf2d34f9cddb24f076cb/Swingline-stapler.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:Swingline-stapler.jpg">Public Domain</a></p><p>If the client knows that a server will always serve OCSP staples for every connection, it can apply a hard-fail approach, failing a connection if the OCSP response is missing. This closes the security hole introduced by the soft-fail strategy. This is where OCSP must-staple fits in.</p><p>OCSP must-staple is an extension that can be added to a certificate that tells the browser to expect an OCSP staple whenever it sees the certificate. This acts as an explicit signal to the browser that it’s safe to use the more secure hard-fail strategy.</p><p>Firefox enforces OCSP must-staple, returning the following error if such a certificate is presented without a stapled OCSP response.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qH0Q1eryXiXZ2yLcNKS6o/3fa23feece99f107ffc5c58a1d0d249a/image4.jpg" />
            
            </figure><p>Chrome provides the ability to mark a domain as “Expect-Staple”. If Chrome sees a certificate for the domain without a staple, it will send a report to a pre-configured report endpoint.</p>
    <div>
      <h3>Reliability</h3>
      <a href="#reliability">
        
      </a>
    </div>
    <p>As a part of our push to provide reliable OCSP stapling, we put our money where our mouths are and put an OCSP must-staple certificate on blog.cloudflare.com. Now if we ever don’t serve an OCSP staple, this page will fail to load on browsers like Firefox that enforce must-staple. You can identify a certificate by looking at the certificate details for the “1.3.6.1.5.5.7.1.24” OID.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/HdZil165qgzzMx4Cvnm8K/f36c26003ee86ab25888fa1af9ca6f37/image6.jpg" />
            
            </figure><p>Cloudflare customers can choose to upload must-staple custom certificates, but we encourage them not to do so yet because there may be a multi-second delay between the certificate being installed and our ability to populate the OCSP response cache. This will be fixed in the coming months. Other than the first few seconds after uploading the certificate, Cloudflare’s new OCSP fetching is robust enough to offer OCSP staples for every connection thereafter.</p><p>As of today, an attacker with access to the private key for a revoked certificate can still hijack the connection. All they need to do is to place themselves on the network path of the connection and block the OCSP request. OCSP must-staple prevents that, since an attacker will not be able to obtain an OCSP response that says the certificate has not been revoked.</p>
    <div>
      <h3>The weird world of OCSP responders</h3>
      <a href="#the-weird-world-of-ocsp-responders">
        
      </a>
    </div>
    <p>For browsers, an OCSP failure is not the end of the world. Most browsers are configured to soft-fail when an OCSP responder returns an error, so users are unaffected by OCSP server failures. Some Certificate Authorities have had <a href="https://community.letsencrypt.org/t/may-19-2017-ocsp-and-issuance-outage-postmortem/34922">massive multi-day outages</a> in their OCSP servers without affecting the availability of sites that use their certificates.</p><p>There’s no strong feedback mechanism for broken or slow OCSP servers. This lack of feedback has led to an ecosystem of faulty or unreliable OCSP servers. We experienced this first-hand while developing high-reliability OCSP stapling. In this section, we’ll outline half a dozen unexpected behaviors we found when deploying high-reliability OCSP stapling. A big thanks goes out to all the CAs who fixed the issues we pointed out. CA names redacted to preserve their identities.</p>
    <div>
      <h4>CA #1: Non-overlapping periods</h4>
      <a href="#ca-1-non-overlapping-periods">
        
      </a>
    </div>
    <p>We noticed CA #1 certificates frequently missing their refresh-deadline, and during debugging we were lucky enough to see this:</p>
            <pre><code>$ date -u
Sat Mar  4 02:45:35 UTC 2017
$ ocspfetch &lt;redacted, customer ID&gt;
This Update: 2017-03-04 01:45:49 +0000 UTC
Next Update: 2017-03-04 02:45:49 +0000 UTC
$ date -u
Sat Mar  4 02:45:48 UTC 2017
$ ocspfetch &lt;redacted, customer ID&gt;
This Update: 2017-03-04 02:45:49 +0000 UTC
Next Update: 2017-03-04 03:45:49 +0000 UTC</code></pre>
            <p>It shows that CA #1 had configured their OCSP responders to use an incredibly short validity period with almost no overlap between validity periods, which makes it functionally impossible to always have a fresh OCSP response for their certificates. We contacted them, and they reconfigured the responder to produce new responses every half-interval.</p>
    <div>
      <h4>CA #2: Wrong signature algorithm</h4>
      <a href="#ca-2-wrong-signature-algorithm">
        
      </a>
    </div>
    <p>Several certificates from CA #2 started failing with this error:</p>
            <pre><code> bad OCSP signature: crypto/rsa: verification error</code></pre>
            <p>The issue is that the OCSP claims to be signed with SHA256-RSA, when it is actually signed with SHA1-RSA (and the reverse: indicates SHA1-RSA, actually signed with SHA256-RSA).</p>
    <div>
      <h4>CA #3: Malformed OCSP responses</h4>
      <a href="#ca-3-malformed-ocsp-responses">
        
      </a>
    </div>
    <p>When we first started the project, our tool was unable to parse dozens of certificates in our database because of this error</p>
            <pre><code>asn1: structure error: integer not minimally-encoded</code></pre>
            <p>and many OCSP responses that we fetched from the same CA:</p>
            <pre><code>parsing ocsp response: bad OCSP signature: asn1: structure error: integer not minimally-encoded</code></pre>
            <p>What happened was that this CA had begun issuing &lt;1% of certificates with a minor formatting error that rendered them unparseable by Golang’s x509 package. After contacting them directly, they quickly fixed the issue but then we had to patch Golang's parser to be more lenient about encoding bugs.</p>
    <div>
      <h4>CA #4: Failed responder behind a load balancer</h4>
      <a href="#ca-4-failed-responder-behind-a-load-balancer">
        
      </a>
    </div>
    <p>A small number of CA #4’s OCSP responders fell into a "bad state" without them knowing, and would return 404 on every request. Since the CA used load balancing to round-robin requests to a number of responders, it looked like 1 in 6 requests would fail inexplicably.</p><p>Two times between Jan 2017 and May 2017, this CA also experienced some kind of large data-loss event that caused them to return persistent "Try Later" responses for a large number of requests.</p>
    <div>
      <h4>CA #5: Delay between certificate and OCSP responder</h4>
      <a href="#ca-5-delay-between-certificate-and-ocsp-responder">
        
      </a>
    </div>
    <p>When a certificate is issued by CA #5, there is a large delay between the time a certificate is issued and the OCSP responder is able to start returning signed responses. This results in a delay between certificate issance and the availability of OCSP. It has mostly been resolved, but this general pattern is dangerous for OCSP must-staple. There have been some <a href="https://github.com/sleevi/cabforum-docs/pull/2">changes discussed</a> by the <a href="https://cabforum.org/">CA/B Forum</a>, an organization that regulates the issuance and management of certificates, to require CAs to offer OCSP soon after issuance.</p>
    <div>
      <h4>CA #6: Extra certificates</h4>
      <a href="#ca-6-extra-certificates">
        
      </a>
    </div>
    <p>It is typical to embed only one certificate in an OCSP response, if any. The one embedded certificate is supposed to be a leaf specially issued for signing an intermediate's OCSP responses. However, several CAs embed multiple certificates: the leaf they use for signing OCSP responses, the intermediate itself, and sometimes all the intermediates up to the root certificate.</p>
    <div>
      <h3>Conclusions</h3>
      <a href="#conclusions">
        
      </a>
    </div>
    <p>We made OCSP stapling better and more reliable for Cloudflare customers. Despite the various strange behaviors we found in OCSP servers, we’ve been able to consistently serve OCSP responses for over 99.9% of connections since we’ve moved over to the new system. This great work was done by Brendan McMillion and Alessandro Ghedini. This is an important step in protecting the web community from attackers who have compromised certificate private keys.</p> ]]></content:encoded>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Programming]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">7tbSyaQLOejVqQI7xEdGhi</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing CFSSL 1.2]]></title>
            <link>https://blog.cloudflare.com/introducing-cfssl-1-2/</link>
            <pubDate>Thu, 31 Mar 2016 12:00:00 GMT</pubDate>
            <description><![CDATA[ Continuing our commitment to high quality open-source software, we’re happy to announce release 1.2 of CFSSL, our TLS/PKI Swiss Army knife. We haven’t written much about CFSSL here since we originally open sourced the project in 2014, so we thought we’d provide an update. ]]></description>
            <content:encoded><![CDATA[ <p>Continuing our commitment to high quality open-source software, we’re happy to announce release 1.2 of CFSSL, our TLS/PKI Swiss Army knife. We haven’t written much about CFSSL here since we <a href="/introducing-cfssl/">originally open sourced the project</a> in 2014, so we thought we’d provide an update. In the last 20 months, we have added a ton of great features, and CFSSL has attracted an active community of users and <a href="https://github.com/cloudflare/cfssl/graphs/contributors">contributors</a>. Users range from large SaaS providers (Heroku) to game companies (Riot Games) and the newest Certificate Authority (Let’s Encrypt). For them and for CloudFlare, CFSSL has become a core tool for automating certificates and TLS configurations. With added support for configuration scanning, automated provisioning via the transport package, revocation, certificate transparency and PKCS#11, CFSSL is now even more powerful.</p><p>We’re also happy to announce CFSSL’s new home: <a href="http://cfssl.org">cfssl.org</a>. From there you can try out CFSSL’s user interface, download binaries, and test some of its features.</p>
    <div>
      <h3>Motivation</h3>
      <a href="#motivation">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4dDeCSuAPv9TzI9o5urty5/d62243397e9a4bfc071af63314ab9950/image_0.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:NSA_Muscular_Google_Cloud.jpg">Licensing: Public Domain</a></p><p>This 2013 National Security Agency (NSA) slide describing how data from Google’s internal network was collected by intelligence agencies was eye-opening—and shocking—to many technology companies. The idea that an attacker could read messages passed between services wasn’t technically groundbreaking, but it did reveal a security flaw in the way many distributed systems were designed. Many companies only encrypted the data to the border of their datacenter, not inside. The slide showed that private physical networks are being subverted to extract data passing through them. And just because a network has a <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">security perimeter</a>, it doesn’t mean that data can be safely sent between applications unencrypted inside that perimeter. In short: treat your own network as hostile.</p><p>This mentality helped shape CloudFlare’s philosophy for securing internal services and resulted in a simple rule:</p><blockquote><p>Services should only communicate with each other using encrypted and mutually authenticated protocols.</p></blockquote><p>With this in mind we started tackling the harder problem of how to manage the encryption keys for these services. To tackle the issue of service-to-service encryption, <a href="/how-to-build-your-own-public-key-infrastructure/">we built our own public key infrastructure</a> using CFSSL. Much of the new features we’re introducing in this post came about from our effort to make this system robust.</p><p>We have also made an effort to use standards-compliant and interoperable technology. By incorporating support for <a href="http://www.certificate-transparency.org/">certificate transparency</a>, <a href="https://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol">OSCP</a>, and <a href="https://en.wikipedia.org/wiki/Revocation_list">CRL</a>, the standards used by the public Internet can now be used in your private infrastructure. Now, on to the new features.</p>
    <div>
      <h3>Scan</h3>
      <a href="#scan">
        
      </a>
    </div>
    <p>CFSSL now has a full-featured TLS endpoint scanner.</p><p>Just because a server uses encryption, it doesn’t mean that it is secure. There have been a <a href="https://www.youtube.com/watch?v=oovK9YkJ8Co">series of vulnerabilities</a> in TLS that only affect some configurations. To keep your server and its visitors protected against the nearly monthly new attacks you need to pick the right configuration. Staying secure requires testing your configuration against the latest vulnerabilities, and keeping your configuration updated against new threats.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7o6R0dw4TmHnB7cDYIwsvY/7ac9e5e632520f3ca97851f1e7fed8d4/image_1.png" />
            
            </figure><p>History of vulnerabilities in SSL/TLS</p><p>The gold standard for testing a website’s TLS configuration is Ivan Ristić’s <a href="https://www.ssllabs.com">SSL Labs</a>. It provides a simple letter grade for your site’s configuration (sites using CloudFlare get an A, by the way, and A+ if you <a href="/enforce-web-policy-with-hypertext-strict-transport-security-hsts/">enable HSTS</a>). The drawback of SSL Labs is that it only works on public websites: you can’t use it for internal services. At CloudFlare, we needed an easy way to check the configuration of our services as well as our customers’ origins (which are typically not publicly accessible).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3RPq6XPIXqld31gzAhaqVl/6b925d22874b349e657aeddb99459f78/image_2.png" />
            
            </figure><p>To solve this, CloudFlare added functionality to CFSSL to scan a TLS endpoint to evaluate how securely it’s configured. With it, we are able to check the configuration of internal services and protected customer origins for the following configuration issues:</p><ul><li><p>IPv4/IPv6 connectivity</p></li><li><p>Certificate validity (expiration, trust chain, hostnames, etc.)</p></li><li><p>Supported cipher suites and algorithms</p></li><li><p>Session resumption</p></li><li><p>Revoked certificates</p></li></ul><p>Each scan provides a grade of "Good" or "Bad". CFSSL Scan can also be used to scan entire IP ranges or lists of hosts. It can be used either as a CLI or as API-driven server.</p><p>Using the CLI is a simple command:</p>
            <pre><code>$ cfssl scan cloudflare.com
{
  "Connectivity": {
	"DNSLookup": {
	  "grade": "Good",
	  "output": [
		"198.41.215.162",
		"198.41.214.162",
		"2400:cb00:2048:1::c629:d6a2",
		"2400:cb00:2048:1::c629:d7a2"
	  ]
	},
	"TCPDial": {
	  "grade": "Good"
	},
	"TLSDial": {
	  "grade": "Good"
	}
  },
  "PKI": {
	"ChainExpiration": {
	  "grade": "Good",
	  "output": "2016-11-30T23:59:59Z"
	},
	"ChainValidation": {
	  "grade": "Warning",
	  "output": [
		"Certificate for COMODO ECC Extended Validation Secure Server CA is valid for too long"
	  ]
	},
	"MultipleCerts": {
	  "grade": "Good"
	}
  },
  "TLSHandshake": {
	"CertsByCiphers": {
	  "grade": "Good",
	  "output": {
		"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": "SHA256WithRSA",
		"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256": "SHA256WithRSA",
		"TLS_RSA_WITH_3DES_EDE_CBC_SHA": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_128_CBC_SHA": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_128_CBC_SHA256": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_128_GCM_SHA256": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_256_CBC_SHA": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_256_CBC_SHA256": "SHA256WithRSA",
		"TLS_RSA_WITH_AES_256_GCM_SHA384": "SHA256WithRSA"
	  }
	}
  }
}</code></pre>
            <p>CFSSL Scan also accessible as part of the new <a href="https://cfssl.org/scan">CFSSL UI</a>.</p>
    <div>
      <h3>Transport Package</h3>
      <a href="#transport-package">
        
      </a>
    </div>
    <p>An important design pattern in security engineering is secure defaults. Developers want to write secure software and aren’t always security experts, let alone crypto gurus. The two trickiest parts of deploying an application that speaks TLS are:</p><ol><li><p>Configuration</p></li><li><p>Key management</p></li></ol><p>Simplicity is the key to empowering developers to use encryption in their services. We created the CFSSL Transport package to make these two tasks easy for our Go developers.</p><p>Transport is a Go library that takes regular HTTP or TCP connections, and transparently turns them into encrypted connections. Transport handles all the sticky points so that the developer doesn’t have to. This includes creating a private key, getting a certificate for it using a CFSSL CA, renewing certificates before they expire, and choosing the correct cryptographic parameters. If you’re writing a service in Go, you no longer need to know how PKI works.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/LB668vaQzSx7sH0ziXtVI/e520c040366a84eef9f5081ec96af82f/image_3.png" />
            
            </figure><p>Certificate Issuance with CFSSL CA</p><p>Not only does the Transport handle setting up and rotating certificates, it automatically checks to make sure the services your service are connecting to are using a valid certificate, including checking for revocation (more on that later).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/VvQlLi9gWnu1bQzcOZbPN/25fd2cc8aa99655aa67487c04f428861/image_4.png" />
            
            </figure><p>OCSP Check with CFSSL CA</p><p>Internal CAs can be used to set up coarse-grained authorization between services. For example, if you have both an API server and a database, you can set up a dedicated CA for each of them. In the example below, the API server CA is in orange and the DB CA is in red. You can then configure the DB to only trust connections from the API server and vice versa. This type of setup can provide a baseline level of authorization enforcement for your applications. The transport package lets you automate the setup of these mutually-authenticated connections. This type of setup is covered in a <a href="/how-to-build-your-own-public-key-infrastructure/">previous blog post</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2aisydnjxkRWE49YnloHJh/7e46ea56a393031cf1339f2d508f14f3/image_5-1.png" />
            
            </figure><p>Once you have a CFSSL CA (or a multi-root CA) up and running, it just takes a few lines of code to start using TLS in your Go application. Just swap your standard <code>net.Dial</code> or <code>net.Listen/Accept</code> with <code>transport.Dial</code> and <code>transport.Listen/Accept</code>.</p><p>Before:</p>
            <pre><code>conn, err := net.Dial("tcp", addr)
if err != nil {
	// handle error
}</code></pre>
            <p>After (configuration file location stored in the <code>conf</code> variable):</p>
            <pre><code>var id = new(core.Identity)
data, err := ioutil.ReadFile(conf)
if err != nil {
	// handle error
}
err = json.Unmarshal(data, id)
if err != nil {
	// handle error
}

    // Renew 5 minutes before expiry
tr, err := transport.New(5 * time.Minute, id)
if err != nil {
	// handle error
}
conn, err := transport.Dial(addr, tr)
if err != nil {
	// handle error
}</code></pre>
            <p>You can start playing around with the transport package with some examples from Github:</p><p><a href="https://github.com/cloudflare/cfssl/tree/master/transport/example">https://github.com/cloudflare/cfssl/tree/master/transport/example</a></p>
    <div>
      <h3>Revocation and PostgreSQL support</h3>
      <a href="#revocation-and-postgresql-support">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/SozAa3OGRFEYvvIIf2AYd/39af18862a24b84f6280dd7fb5030f00/image_7-1.png" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:Database-postgres.svg">CC Creative Commons Attribution-Share Alike 3.0 Unported</a></p><p>One of the nice things about CFSSL is that you can easily spin it up inside your infrastructure and have a certificate authority. One of the risks of running a PKI is infrastructure compromise. If the private key material for a certificate falls into the wrong hands, there need to be mechanisms so that the rest of the system knows to no longer trust that certificate.</p><p>The first step in knowing which certificates are trusted is knowing which certificates have been issued. To solve this, we added the ability to keep track, in a persistent database, of which certificates have been issued and the subset of those that have been revoked. We are big fans of PostgreSQL, so we built a database backend for CFSSL in PostgreSQL, but other backends like MySQL are <a href="https://github.com/cloudflare/cfssl/pull/562">in development</a>. You can now set up CFSSL to use a certificate database with very little work, and we leveraged that integration to create an automated revocation system.</p><p>The two standard mechanisms for signaling that a certificate is no longer trusted are certificate revocation lists (CRLs) and the online certificate status protocol (OCSP). CFSSL now fully supports both of these mechanisms.</p><p>A CRL is simply a list of revoked certificate serial numbers. It covers all certificates issued by a CA that have not expired, and is digitally signed by the CA’s private key. When a client obtains a certificate, it can simply look at this list to check to see if the certificate has been revoked. CRL files can grow quite a bit if a lot of certificates are revoked, and can therefore cause some scalability issues. We saw this <a href="/the-heartbleed-aftermath-all-cloudflare-certificates-revoked-and-reissued/">after Heartbleed</a>, when we revoked a large number of customer certificates at once.</p><p>Partly to combat these scalability issues, OCSP was introduced. OCSP provides on-demand answers about the revocation status of a given certificate. An OCSP responder is a service that returns signed answers to the question "is this certificate revoked?". The response is either "Yes" or "No". Each response is signed by the CA and has a validity period so the client knows how long to cache the response.</p><p>CFSSL now has an OCSP responder service that can be configured to run in a distributed way, without access to the CA. There are also OCSP management tools in CFSSL to automatically populate the data for the OCSP responder and keep it fresh using the certificate database.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4v0OiQafB9lqAwRrAVssdq/383b720297e414fa6a54c20fedb6db20/image_8.png" />
            
            </figure><p>In CFSSL, you can now programmatically create CRLs and OCSP responses for certificates issued by your CA. Using standards-compatible revocation mechanisms allows these certificates to be shared outside of our infrastructure and to work with most software that implements TLS.</p>
    <div>
      <h3>Certificate Transparency</h3>
      <a href="#certificate-transparency">
        
      </a>
    </div>
    <p>Another exciting new PKI standard is Certificate Transparency (CT). It helps provide (as the name implies) transparency into the workings of a certificate authority by providing an append-only log of issued certificates.</p><p>You can think of CT as a public ledger of all certificates issued. Any certificate on the list (even if issued for use on a private network) is made public and can be checked to see if it was issued according to the rules of the CA/Browser forum. If you encounter a certificate that is not on the ledger, then it may have been created fraudulently. Google Chrome <a href="https://www.certificate-transparency.org/ev-ct-plan">currently requires</a> all Extended Validation certificates used by websites to be in the CT log.</p><p>CFSSL now allows you to submit certificates to a CT log at issuance time and automatically embed the proof that it has been logged into the certificate. Running a CT log inside your internal infrastructure is a nice way to audit your CA and catch mis-issuances.</p>
    <div>
      <h3>PKCS #11</h3>
      <a href="#pkcs-11">
        
      </a>
    </div>
    <p>CFSSL is great for software deployments, as you can spin it up anywhere and run it on any platform that Go supports. You can even use our convenient Dockerfiles to deploy it in a containerized environment. However, in some situations (like running a publicly-trusted CA), keeping a private key in software is not secure enough. For these situations, hardware-based protection is needed.</p><p>The industry standard protocol for working with cryptographic hardware is called <a href="https://en.wikipedia.org/wiki/PKCS_11">PKCS#11</a>. With help from Richard Barnes of Mozilla and others we were able to add support for PKCS#11 into CFSSL. This feature is can be enabled in programs that use the <a href="https://github.com/cloudflare/cfssl/tree/master/signer/local">signer/local package</a> and the <a href="https://github.com/letsencrypt/pkcs11key">pkcs11key package</a>. We also have plans to add command line support using the <a href="https://tools.ietf.org/html/rfc7512">PKCS#11 URI specification</a>. If you have a PKCS#11 interface to your HSM, certificate creation using that key is fully supported by the <code>cfssl/signer</code> package. Power users including Let’s Encrypt use CFSSL to run their publicly trusted CA while keeping the private key in a FIPS 140-2 certified HSM.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Open source is hard. Different people have different needs, and as a project maintainer you have to be respectful of these needs while honoring the spirit of the project. CloudFlare’s needs for CFSSL are not identical to the needs of its other users. We have attempted to strike a balance between building a tool for our own specific use cases and building a great general-purpose toolkit for PKI/TLS. We are grateful to the open source community for their valuable contributions to this project and are proud to be part of the tradition of free and open source software.</p><p>I’d like to thank one of the largest contributors to CFSSL over the last year: the Let’s Encrypt project. They have contributed code reviews and useful features while integrating CFSSL into Boulder, the software that manages their certificate authority. I’d also like to thank the Open Academy participants from Cornell and UCSD who worked on the project for a semester, and everyone else who helped contribute to this release. The core CFSSL team is Kyle Isom, Zi Lin, Jacob Haven, and Nick Sullivan.</p> ]]></content:encoded>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[CFSSL]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[Postgres]]></category>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[Programming]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">68velcvOW35if8MiypaluK</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[The Hidden Costs of Heartbleed]]></title>
            <link>https://blog.cloudflare.com/the-hard-costs-of-heartbleed/</link>
            <pubDate>Thu, 17 Apr 2014 10:00:00 GMT</pubDate>
            <description><![CDATA[ A quick followup to our last blog post on our decision to reissue and revoke all of CloudFlare's customers' SSL certificates. One question we've received is why we didn't just reissue and revoke all SSL certificates as soon as we got word about the Heartbleed vulnerability? ]]></description>
            <content:encoded><![CDATA[ <p></p><p>A quick followup to our <a href="/the-heartbleed-aftermath-all-cloudflare-certificates-revoked-and-reissued">last blog post</a> on our decision to reissue and revoke all of CloudFlare's customers' SSL certificates. One question we've received is why we didn't just reissue and revoke all SSL certificates as soon as we got word about the Heartbleed vulnerability? The answer is that the revocation process for SSL certificates is far from perfect and imposes a significant cost on the Internet's infrastructure.</p><p>Today, after having done a mass reissuance and revocation, we have a tangible sense of that cost. To understand it, you need to understand a bit about how your browser checks if an SSL certificate has been revoked.</p>
    <div>
      <h4>OCSP &amp; CRL</h4>
      <a href="#ocsp-crl">
        
      </a>
    </div>
    <p>When most browsers visit web pages over HTTPS they perform a check using one of two certificate revocation methods: Online Certificate Status Protocol (OCSP) or Certificate Revocation List (CRL). For OCSP, the browser pings the certificate authority and asks whether a particular site's certificate has been revoked. For CRL, the browser pings the certificate authority (CA) and downloads a complete list of all the certificates that have been revoked by that CA.</p><p>There are pluses and minuses to both systems. OCSP imposes a lighter bandwidth cost, but a higher number of requests and backend lookups. CRL doesn't generate as many requests, but, as the CRL becomes large, can impose a significant bandwidth burden. These costs are borne by visitors to websites, whose experience will be slower as a result, but even more so by the CAs who need significant resources in place to handle these requests.</p>
    <div>
      <h4>Technical Costs of Revocation</h4>
      <a href="#technical-costs-of-revocation">
        
      </a>
    </div>
    <p>Yesterday, CloudFlare completed the process of reissuing all the SSL certificates we manage for our customers. Once that was complete, we revoked all previously used certificates. You can see the <a href="https://isc.sans.edu/crls.html">spike in global CRL activity we generated:</a></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3CNjOM7MCaMDYxuCGiSmWL/84c419b302d21af761426202bb4904fa/2.png" />
            
            </figure><p>What you can't see is the spike in bandwidth that imposed. Globalsign, who is CloudFlare's primary CA partner, saw their CRL grow to approximately 4.7MB in size from approximately 22KB on Monday. The activity of browsers downloading the Globalsign CRL generated around 40Gbps of net new traffic across the Internet. If you assume that the global average price for bandwidth is around \$10/Mbps, just supporting the traffic to deliver the CRL would have added \$400,000USD to Globalsign's monthly bandwidth bill.</p><p>Lest you think that’s an overestimate, to make the total costs more accurate, we ran the numbers using AWS’s CloudFront price calculator using a mix of traffic across regions that approximates what we see at CloudFlare. The total cost to Globalsign if they were using AWS’s infrastructure, would be at least \$952,992.40/month. Undoubtedly they’d give some additional discounts above the pricing they list publicly, but any way you slice it the costs are significant.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5YmAaiDr57652FzPmoRra9/f5569bf2ee96800507060561c2c59897/3.png" />
            
            </figure><p>Beyond the cost, many CAs are not setup to be able to handle this increased load. Revoking SSL certificates threatens to create a sort of denial of service attack on their own infrastructures. Thankfully, CloudFlare helps <a href="/cloudflare-works-with-globalsign-to-make-ssl">power Globalsign's OCSP and CRL infrastructure</a>. We were able to bear the brunt of the load, allowing us to move forward with revocation as quickly as we did. And, no, we didn’t charge them anything extra.</p><p>So, if you're wondering why some people are dragging their feet on mass certificate revocation, now you know why — it imposes a real cost. And if you're a CA who's wondering what you're going to do when you inevitably have to revoke all the certs you've issued over the last year, <a href="http://www.cloudflare.com/enterprise-service-request">we're happy to help</a>.</p> ]]></content:encoded>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Vulnerabilities]]></category>
            <category><![CDATA[Reliability]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[OpenSSL]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">2txTmq7enKYTm52KaMZyPr</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[What We Just Did to Make SSL Even Faster]]></title>
            <link>https://blog.cloudflare.com/what-we-just-did-to-make-ssl-even-faster/</link>
            <pubDate>Tue, 11 Dec 2012 17:24:00 GMT</pubDate>
            <description><![CDATA[ A little over a month ago, we published a couple of blog posts about how we were making SSL faster. Specifically, we enabled OCSP stapling across our network. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>A little over a month ago, we published a couple of <a href="/cloudflare-works-with-globalsign-to-make-ssl">blog</a> <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30">posts</a> about how we were making SSL faster. Specifically, we enabled OCSP stapling across our network. In brief, when you visit a page over HTTPS, your browser checks to see if the <a href="https://www.cloudflare.com/application-services/products/ssl/">SSL certificate</a> is still valid via a protocol called OCSP. Those checks can be slow so we took multiple steps to make them faster. The net effect was that, for browsers that supported OCSP stapling, visitors to HTTPS sites on CloudFlare would see about a 30% performance increase on their SSL handshakes.</p><p>That was the good news. What happened next was a number of people checked our SSL setup to validate our claims. While we had increased performance around OCSP checks, these investigations turned up a number of ways in which we weren't optimally deploying SSL. In particular, William Chan wrote a <a href="https://insouciant.org/tech/ssl-performance-case-study/">blog post</a> looking at our SSL deployment and suggesting a number of things we could do to make it better.</p><p>We took this criticism to heart and today released an improved SSL process. Our goal is to provide the fastest, strongest SSL with the most ubiquitous browser support. Since a number of other cloud service providers are likely to face the same challenges, and since we haven't found anyone else that was automatically optimizing certificate bundles intelligently, we wanted to document what we did.</p>
    <div>
      <h3>SSL: A Chain of Trust</h3>
      <a href="#ssl-a-chain-of-trust">
        
      </a>
    </div>
    <p>In the simple case, SSL is easy. When your browser connects to a website over HTTPS, the site's web server returns a SSL certificate back to the browser. This certificate is used to verify the identity of the website and encrypt data exchanged between the browser and the web server.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2MFUJWFwU9cZ1yquDxScyM/6d9fe3ccd696ba1b15204fc4203f4c4a/chain.jpg.scaled500.jpg" />
            
            </figure><p>In order to perform these functions, the certificate has to be trusted by the browser. A website's SSL certificate is issued by a Certificate Authority (CA). CAs vouch for a website's certificate as being valid. The CAs then have what are known as root certificates that are trusted by the browser. Since the CA's root is trusted by the browser, and since the CA trusts the web server's SSL certificate, by the transitive property the browser trusts the SSL certificate and a secure HTTPS connection can be established.</p><p>The challenge is that the world of SSL isn't always that clean. To begin, most CAs don't use their root certificate to directly sign the SSL certificates they issue to clients. Instead they use "intermediate" certificates. The chain of intermediate certificates can be of any arbitrary length, strung together to pass trust from the root to the eventual final certificate used by the web server. More complicated still, one intermediate certificate can have multiple parent certificates that vouch for its identity. GoDaddy, for example, has a case where their own root certificate as well as Valicert's root certificate both vouch for a GoDaddy intermediate certificate.</p>
    <div>
      <h3>Long Chain = Slow Performance</h3>
      <a href="#long-chain-slow-performance">
        
      </a>
    </div>
    <p>While trust can pass along any length of SSL chain, the longer the chain is the more of a performance impact there is on setting up a HTTPS connection. While some of this overhead comes from validating all the certs in the chain, much also has to do with just having to transmit all the data that makes up the intermediate certificates.</p><p>As William Chan pointed out, CloudFlare was including more than we needed to and thereby overflowing the maximum amount of data per packet. This can have an especially large impact on web performance since SSL data is the first thing to be exchanged, no more data can be exchanged until after the SSL handshake takes place, so getting rid of a round trip on the SSL handshake can speed up everything else down the line.</p>
    <div>
      <h3>CloudFlare's Smarter SSL Bundler</h3>
      <a href="#cloudflares-smarter-ssl-bundler">
        
      </a>
    </div>
    <p>For SSL certificates we issued ourselves (such as those we create for Pro customers), this wasn't a problem. However, for custom SSL certificates, like those available for Business and Enterprise subscribers, we were not being smart about what we were including in the SSL bundle. The lowest hanging fruit in terms of reducing the size of these certificates was to remove the root certificates from the certificate bundle. There's no reason to include these since they should already be present in browsers and, even if they're not, the browser won't trust them.</p><p>We wanted to be even smarter about how we build bundles, so we spent some time developing a system that would find the shortest path between a certificate a user uploads to our system and one of the root certificates present in browsers. To do this, we needed to build a directory of the web's most common intermediate certificates. You'd think that's something someone would have assembled and published. We searched around for quite some time to find all these and didn't find it anywhere, so we created one ourselves. (PS - So no one else has to go through this same painful exercise, we're going to be publishing the directory on GitHub in the next few days and will keep it updated as we find more intermediate certificates.)</p>
    <div>
      <h3>Build the Chains, Pick the Best</h3>
      <a href="#build-the-chains-pick-the-best">
        
      </a>
    </div>
    <p>Today, when someone uploads a custom SSL certificate, we use our directory of intermediate certificates to build all the possible chains from the uploaded cert to a trusted browser root. We then rank these chains based on a number of factors including:</p><ol><li><p>The length of the certificate chain</p></li><li><p>The ubiquity of the root certificate in browsers and other clients</p></li><li><p>The security of each step in the chain (e.g., does their Extended Key Usage include Server Authentication)</p></li><li><p>The length of the validity period of all the steps in the chain</p></li></ol><p>The result is a server bundle that is small, fast and strong while having ubiquitous browser and client support. These are all optimizations that organizations concerned with performance and security should be doing by hand. What we're excited about is that we've automated this process and made it easy for anyone who wants the fastest possible SSL for their given certificate. If you were already using SSL through CloudFlare, your SSL bundle has been automatically optimized. If your site seemed a bit faster, that's why.</p><p>Going forward, in addition to releasing the directory of intermediate SSL certificates on Github, we plan on releasing our SSL bundler as a free service so you can package up your SSL certificates as efficiently as possible, even if you're not using CloudFlare. Just one more way we're working to make the web fast and safe.</p> ]]></content:encoded>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">4oLzo0Gp6bobCnI1xMxT06</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[CloudFlare Works with GlobalSign to Make SSL Faster Across the Web]]></title>
            <link>https://blog.cloudflare.com/cloudflare-works-with-globalsign-to-make-ssl/</link>
            <pubDate>Thu, 01 Nov 2012 16:34:00 GMT</pubDate>
            <description><![CDATA[ Earlier this week we announced how CloudFlare enabled OCSP stapling in order to improve our customers' SSL performance. OCSP stapling is awesome and improves SSL performance by as much as 30%. However, it is limited to browsers that support OCSP stapling and only benefits CloudFlare's customers. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Earlier this week we announced how <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30">CloudFlare enabled OCSP stapling</a> in order to improve our customers' SSL performance. OCSP stapling is awesome and improves SSL performance by as much as 30%. However, it is limited to browsers that support OCSP stapling and only benefitsCloudFlare's customers. So, until every browser vendor updates to support OCSP stapling and until every website uses CloudFlare, we wantedto see if we could do something else to improve SSL performance across the web.</p>
    <div>
      <h3>GlobalSign Partnership</h3>
      <a href="#globalsign-partnership">
        
      </a>
    </div>
    <p>CloudFlare has worked with GlobalSign since we first launched in September 2010. Prior to that we surveyed nearly every certificate authority in an effort to find one that was forward thinking enough to support what we needed. GlobalSign has been a terrific partner and is shaking up what has been a commodity industry.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6MtTUFv0BJXAuB11ocPMzb/fdf53fe8da2860211e90ca098f8fb204/GlobalSign-His-Res-Logo.png.scaled500.png" />
            
            </figure><p>Several months ago, GlobalSign approached us to talk about SSL performance. Their goal was simple: become the fastest SSL provider on the Internet. As I've written about before, whenever you visit a website over a HTTPS connection your browser has to <a href="/how-cloudflare-is-making-ssl-fast">perform a check to see if the certificate has been revoked</a>. Depending on your browser, these checks are either over the CRL (Certificate Revocation List) or OCSP (Online Certificate Status Protocol) protocol. In either case, they require a request be sent back to the certificate authority and to get a response before content is downloaded. In other words, CRL and OCSP requests inherently slow down HTTPS performance.</p><p>The amount that these checks slow down performance varies depending on the certificate authority. On average, across the industry, a typical OCSP or CRL response time can be 500ms. That's half a second. In other words, every time you visit a site over HTTPS, you waste half a second waiting for the SSL check to complete. Talking with GlobalSign we realized we could do something about that.</p>
    <div>
      <h3>Now Saving 1.5 Years Worth of Time a Day</h3>
      <a href="#now-saving-1-5-years-worth-of-time-a-day">
        
      </a>
    </div>
    <p>This morning we officially announced our work with GlobalSign to make their CRL and OCSP requests the fastest on the Internet. GlobalSign's SSL checks (OCSP and CRL GET and POST requests) are now served from our cache across CloudFlare's global infrastructure. The results have been awesome. The requests that previously averaging around 500ms are <a href="http://unmitigatedrisk.com/?p=147">now under 100ms</a>. At GlobalSign's scale, that means we're now saving the web about a <i>year and a half of time every day</i> that people would have otherwise spent waiting for web pages to load. That's crazy.</p><p>This improvement accrues to sites using GlobalSign SSL certificates, regardless of whether the sites themselves are running on CloudFlare's network. Getting more sites using SSL is critical for increasing web security and promoting new performance protocols like SPDY. If you are choosing a CA, typically a commodity decision, now there's a good reason to pick GlobalSign over the other choices: they will ensure your site is as fast as possible over HTTPS. Put simply, GlobalSign is now the fastest certificate authority in the world, and nearly <a href="http://unmitigatedrisk.com/?p=147">3x as fast as Symantec/Verisign</a>.</p><p>CloudFlare's mission is to power a faster, safer Internet so working with GlobalSign to <a href="https://www.cloudflare.com/application-services/products/ssl/">make SSL as fast as possible</a> has been a perfect fit. Our hope is that other certificate authorities will follow GlobalSign's lead and spend the time to optimize their SSL checks for optimal performance. As an added bonus, we've also helped GlobalSign be the first certificate authority to have their SSL checks be available over IPv6. This is all part of our efforts to help build a better Internet. As we like to tweet: <a href="https://twitter.com/search/realtime?q=%23savetheweb">#savetheweb</a>.</p> ]]></content:encoded>
            <category><![CDATA[Save The Web]]></category>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">12xwGQPuSZhrjNSLR2CQbc</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[OCSP Stapling: How CloudFlare Just Made SSL 30% Faster]]></title>
            <link>https://blog.cloudflare.com/ocsp-stapling-how-cloudflare-just-made-ssl-30/</link>
            <pubDate>Mon, 29 Oct 2012 17:54:00 GMT</pubDate>
            <description><![CDATA[ This week CloudFlare is announcing several things we're doing to significantly improve the performance of SSL. Too few sites are secured with SSL. One of the reasons sites don't implement SSL is that it can slow down web performance.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p><a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0</a> <a href="https://upload.wikimedia.org/wikipedia/commons/a/ab/2009-cheetah-sprint.jpg">image</a> by <a href="https://commons.wikimedia.org/wiki/User:Yathin_sk">Yathin sk</a></p><p>This week CloudFlare is announcing several things we're doing to significantly improve the performance of SSL. Too few sites are secured with SSL. One of the reasons sites don't implement SSL is that it can slow down web performance. One of the less frequently discussed, but most significant, performance hits to SSL is the OCSP/CRL check. These checks make up 30% or more of the HTTPS overhead. That's painful.</p><p>The best solution to speed up OCSP/CRL performance is something called <a href="http://en.wikipedia.org/wiki/OCSP_stapling">OCSP Stapling</a>. CloudFlare is committed to making the Internet faster and safer so we just enabled OCSP Stapling network wide in order to speed up all HTTPS connectionsand making the decision to secure a site with SSL a no-brainer. So what is the OCSP/CRL check? Why does it slow down page loads so significantly? And how have we eliminated this performance tax on HTTP connections with OCSP Stapling? Read on to find out.</p>
    <div>
      <h3>The Revocation Overhead</h3>
      <a href="#the-revocation-overhead">
        
      </a>
    </div>
    <p>To support secure web connections over HTTPS a website must have a SSL certificate. <a href="https://www.cloudflare.com/application-services/products/ssl/">SSL certificates</a> are issued by what is known as a Certificate Authority (CA). SSL certificates are issued for a period of time during which they will be trusted by browsers. If, however, a SSL certificate is stolen or compromised in some way before it expires, sites need a way to revoke the certificate so it will no longer be trusted.</p><p>The OCSP and CRL are the two protocols used to revoke certificates. CRL, which stands for Certificate Revocation List, is the older and cruder of the two protocols. When a CA receives a CRL request from a browser, it returns a complete list of all the certificates that CA manages that have been revoked. The browser then needs to parse the list and determine if the certificate of the visited site has been revoked.</p><p>With OCSP, the browser sends the certificate for the site in question to the CA. The CA then returns good, revoked, or unknown for the particular certificate. OCSP is generally preferable because less data needs to be sent and there's less overhead from the browser having to parse the CRL response. While every browser handles the revocation check process differently, generally modern browsers prefer OCSP to CRL checks.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3TmhgM2xaDZSYQBQOLCbnt/f001d00601ca6540870cbc70802b6da2/guard_dogs.jpg.scaled500.jpg" />
            
            </figure>
    <div>
      <h3>Revocation Checks: 30%+ of SSL Slowness</h3>
      <a href="#revocation-checks-30-of-ssl-slowness">
        
      </a>
    </div>
    <p>Regardless of whether the browser performs an OCSP or CRL check, the check adds significant overhead. To give you a sense, the following connection flow is taken from this post on <a href="http://www.belshe.com/2012/02/04/rethinking-ssl-for-mobile-apps/">SSL overhead on mobile devices</a>:</p><ol><li><p>DNS (1334ms)</p></li><li><p>TCP handshake (240ms)</p></li><li><p>SSL handshake (376ms)</p></li><li><p>Follow certificate chain (1011ms)</p></li><li><p>DNS to CA (300ms)</p></li><li><p>TCP to CA (407ms)</p></li><li><p>OCSP to CA #1 (598ms)</p></li><li><p>TCP to CA #2 (317ms)</p></li><li><p>OCSP to CA #2 (444ms)</p></li><li><p>Finish SSL handshake (1270ms)</p></li></ol><p>The red portions in the list above (steps 5 - 9) represent the overhead required for the revocation check requests. Add up the time for each step and you'll see that over 30% of the SSL overhead comes from checking whether the certificate has been revoked. And, unfortunately, this check is not done in parallel. In most browsers, until the revocation check is complete, the browser won't begin downloading any additional content. In other words, the OCSP check is blocking on content delivery and inherently adds a significant amount of time to the request. Painful.</p>
    <div>
      <h3>Stapling OCSP for the Win</h3>
      <a href="#stapling-ocsp-for-the-win">
        
      </a>
    </div>
    <p>The key to speeding up OCSP is to get rid of the requests that go back to the CA. Rather than needing to request the OCSP response from the CA directly, the OCSP response can be included in the initial SSL handshake (step 3 in the example above). In this sense, the OCSP response is "stapled" to the initial SSL handshake. While it seems like this approach would be less secure, the response is signed by the CA's root certificate so the browser can verify its authenticity even if it is not delivered directly from the CA's OCSP server.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6uInqYkKZt1noMtSsVPuWc/dc2b7b8ae7da8ca138dc2bb805459699/sneakers_ssl.jpg.scaled500.jpg" />
            
            </figure><p>While OCSP Stapling makes a ton of sense, it unfortunately hasn't previously been widely supported by web servers. Part of the problem is that it often requires a significant technical investment by web administrators. While that investment may not make sense for many individual sites, CloudFlare sits in a unique position to enable OCSP Stapling for a large number of sites in one fell swoop. So that's what we just did.</p><p>At CloudFlare, our mission is to make the web faster and more secure. Inherent to this mission is eliminating the performance penalty of SSL connections so as many sites as possible will support secure HTTPS connections. Our SSL performance was already best of class, now it's even faster. If you're already a CloudFlare customer with SSL enabled, your HTTPS performance is now about 30% faster than it was last week. If you're not yet a CloudFlare customer but you want to make sure your SSL performance it as fast as possible, it only takes about 5 minutes to <a href="https://www.cloudflare.com/sign-up">sign up</a>.</p><p>Stay tuned this week for more announcements on how we're helping improve SSL performance for the whole web.</p> ]]></content:encoded>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[SSL]]></category>
            <guid isPermaLink="false">221Sss3sGkYkFefjFnoPHP</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[How to make SSL fast]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-is-making-ssl-fast/</link>
            <pubDate>Fri, 29 Jun 2012 02:15:00 GMT</pubDate>
            <description><![CDATA[ HTTP, the protocol of the web, is unencrypted by default. That means it is trivial for someone using the same local network as you to spy on all the data you send to and receive from most websites.  ]]></description>
            <content:encoded><![CDATA[ <p>HTTP, the protocol of the web, is unencrypted by default. That means it is trivial for someone using the same local network as you to spy on all the data you send to and receive from most websites. If, for example, someone sniffs your session cookie for a website then they can install it themselves and log in as if they were you without knowing your password. One high profile example was when actor <a href="http://www.huffingtonpost.com/2011/03/02/ashton-kutcher-twitter-hacked_n_830619.html">Ashton Kutcher's Twitter session cookie was sniffed off the TED conference's wifi network</a>, allowing a hacker to take control of his Twitter account.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3OIpYAf5gSb7J12tffxHPR/5a44292a36dd95a531eb6c47bda818e8/we_love_ssl.png.scaled500.png" />
            
            </figure><p>The solution to problems like Ashton's is to use an encrypted HTTPS connection which requires a website to support SSL. The problem is that the SSL protocol imposes a heavy burden. I'm fairly technically savvy and still find the process of installing and maintaining SSL keys on a web server Byzantine. SSL sessions also add considerable CPU load to web servers and slow down web performance.</p><p>CloudFlare is the web performance <i>and</i> security company. For security, we believe it is incumbent on us to make SSL easier and more widely deployed. Given that, in order to maximize performance, we are spending significant resources in order to improve the performance of SSL.</p>
    <div>
      <h3>What Makes SSL Slow?</h3>
      <a href="#what-makes-ssl-slow">
        
      </a>
    </div>
    <p>SSL imposes an additional tax on web performance, but it's important to understand exactly how. The primary source of the SSL performance tax comes from the initial setup of a new connection. Before any web page data can be exchanged, a SSL session must be "negotiated" between the client and the server. A simplified version of this process is as follows.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7qw0GzK3LEAQJhgAzEj8qH/c0a07000c380a43afe64e61832497323/SSL_session_negotiation.png.scaled500.png" />
            
            </figure><p>If you have multiple resources on your web page under different domains, your visitors' browsers will need to negotiate an SSL session for each domain. Because each SSL session requires at least 4 additional exchanges, the <a href="/the-bandwidth-of-a-boeing-747-and-its-impact">problems of flakey connections with high loss rates</a> (e.g., <a href="/why-mobile-performance-is-difficult">connections to mobile devices</a>) are amplified over HTTPS.</p>
    <div>
      <h3>OCSP &amp; CRL: Hidden Vampires</h3>
      <a href="#ocsp-crl-hidden-vampires">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/application-services/products/ssl/">SSL certificates </a>are issued by a certificate authority (CA). The CA attests that the website behind the certificate is who they say they are. Sometimes, after a certificate is issued, it is lost or compromised and needs to be revoked. CAs maintain a list of certificates that have been revoked, known as a Certificate Revocation List (CRL). Browsers, when they access a SSL-protected site, can query to download a CA's CRL and parse the list to see if a particular site is on it. Alternatively, they can issue a request via the Online Certificate Status Protocol (OCSP) to check if a particular site has had its certificate revoked.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Xs4W7wZZ7iObBu9fYpu8d/98e9e755602900133a9c474721881890/revoked_cert.png.scaled500.png" />
            
            </figure><p>The problem is, for most CAs CRL and OCSP performance appears to be an afterthought. The CRL and OCSP servers are also not typically geographically distributed or tuned for performance. Verisign, one of the largest CAs, averages nearly <a href="http://unmitigatedrisk.com/?p=147">300ms to respond to a OCSP request</a>. That inherently means an additional third of a second gets added to your page load time for any visitor connecting to your site if you're using Verisign's SSL. To add insult to injury, most CAs don't yet accept IPv6 requests to their CRL or OCSP servers.</p><p>The problem of CRL and OCSP slowness is a significant enough impact on SSL performance that browser vendors have begun to <a href="http://www.imperialviolet.org/2012/02/05/crlsets.html">discuss removing the verifications entirely</a>. While that may help performance, it would hurt overall web security and make it harder to reliably trust a site's SSL.</p>
    <div>
      <h3>More SSL Sluggishness</h3>
      <a href="#more-ssl-sluggishness">
        
      </a>
    </div>
    <p>A number of other factors further contribute to SSL's overall slowness. Often certificates are chained using a number of intermediate certificates, which can increase the amount of data that needs to be exchanged during the initial session negotiation. Most sites haven't taken the time to optimize their crypto cypher. Choosing a crypto cypher that is too weak can subject your site to a number of potential vulnerabilities. On the other hand, choosing a stronger cypher can add load if your site is already CPU bound.</p><p>Overall, we regularly hear from customers who want to have SSL protection on their sites but find it either too difficult or to resource intensive. The end result is that many sites that should use SSL don't, sacrificing security for performance. And, for those sites that do support SSL, it is often implemented in a way that causes a significant performance penalty. Neither case is good for the web, so we wanted to see what we could do to help fix the problem.</p>
    <div>
      <h3>Speeding Up SSL</h3>
      <a href="#speeding-up-ssl">
        
      </a>
    </div>
    <p>CloudFlare is working on a number of initiatives to speed up SSL. First, we have a number of techniques to limit the number of connections that a browser needs to make and therefore reduce the number of session initiation handshakes that need be made. Rocket Loader, for example, <a href="/how-cloudflare-rocket-loader-redefines-the-modern-cdn/">combines requests for scripts</a>, even across third party services, into a single connection under a site's own domain. We're also <a href="/introducing-spdy">rolling out support for SPDY for all SSL-enabled sites</a>, which allows requests to be multiplexed across a single connection.</p><p>Beyond reducing the number of connections to improve SSL performance, we're working with Globalsign, our primary CA, to speed up CRL and OCSP. Today, Globalsign's CRL and OCSP requests are powered through CloudFlare's global network and <a href="http://unmitigatedrisk.com/?p=147">response times are under 100ms</a>. We are also planning on rolling out OCSP stapling, which allows the query for whether a certificate is invalid to be sent from the server without making an additional request to the CA's infrastructure.</p><p>CloudFlare runs all its own infrastructure, which allowed us to spec the hardware for maximum SSL performance. We worked with Intel to integrate a custom tuned version of OpenSSL which takes advantage of special instruction sets on our servers' CPUs to make encryption and decryption as fast as possible. In our tests, it is about 30% faster and uses fewer CPU resources. This allows us to choose stronger cyphers that maximize performance without suffering a performance penalty.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/CWlaNy0UKN5jhdaxwOj7a/3e520924d55f99ca8f89fc01996644f6/speedy-gonzales.jpeg.scaled500.jpg" />
            
            </figure>
    <div>
      <h3>Expanding SSL Adoption</h3>
      <a href="#expanding-ssl-adoption">
        
      </a>
    </div>
    <p>Equally important, we've worked to make SSL as easy as possible, regardless of the capabilities of your own infrastructure. SSL is included automatically for every <a href="http://www.cloudflare.com/plans">paid CloudFlare plan</a> and is provisioned automatically with a single click. We allow customers to choose Full SSL, which ensures end-to-end encryption, or Flexible SSL, which encrypts the connection from the browser to CloudFlare's network, the riskiest part of the transaction, but doesn't require you to run SSL on your origin server. This allows you to <a href="/ssl-on-tumblr-wordpress-blogger-appengine-pos">add SSL to services like Google AppEngine and Tumblr</a>, which don't allow SSL support themselves or only include it as an expensive add on.</p><p>While CloudFlare's Pro accounts include SSL certificates issued by our own systems, with the launch of our <a href="http://www.cloudflare.com/plans">Business and Enterprise tiers</a>, customers can now upload their own certificates to use on our network. This allows support of extended validation (EV) certificates on our optimized infrastructure.</p><p>As new performance technologies like SPDY require SSL support, and as new threats continue to emerge online, ensuring SSL runs as fast and secure as possible becomes increasingly important. CloudFlare will continue to work to make SSL performance faster in order to fulfill our mission of building a web that is both safer <i>and</i> faster.</p> ]]></content:encoded>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[Speed]]></category>
            <category><![CDATA[spdy]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">2bJs2dMtixCi7wEflqRkzM</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
    </channel>
</rss>