Let's Encrypt Website Documentation

repository·main·Indexed 21 days ago

https://github.com/letsencrypt/website

Source code and documentation for the main Let's Encrypt website, built with Hugo. Includes guides on running the site locally, managing translations, and technical details regarding Root CAs (ISRG Root X1, X2, YE, YR), certificate chains, ASN.1 serialization (DER and PEM), and Object Identifiers (OIDs).

Tokens
51.3K
Snippets
70
Records
269
Agent score
75%

What's inside letsencrypt-website

  1. Understand Let's Encrypt test certificate sites

    main

    Let's Encrypt hosts specialized test websites for each of its root certificates to allow developers to test how their clients handle different certificate states. For every root certificate, three distinct types of sites are maintained:

    • Valid: A standard site with a valid certificate.
    • Expired: A site serving a certificate that has passed its expiry date.
    • Revoked: A site serving a certificate that has been revoked via ACME but is not yet expired. This is a critical test case for ensuring clients correctly handle revocation without relying on expiration.

    These sites are useful for testing browser revocation checking (like Firefox's CRLite) and terminal HTTP clients.

    Accessing Test Sites

    You can access the test sites for the four current root certificates (X1, X2, YE, YR) via the following patterns:

    RootValidExpiredRevoked
    Root X1https://valid.x1.test-certs.letsencrypt.orghttps://expired.x1.test-certs.letsencrypt.orghttps://revoked.x1.test-certs.letsencrypt.org
    Root X2https://valid.x2.test-certs.letsencrypt.orghttps://expired.x2.test-certs.letsencrypt.orghttps://revoked.x2.test-certs.letsencrypt.org
    Root YEhttps://valid.ye.test-certs.letsencrypt.orghttps://expired.ye.test-certs.letsencrypt.orghttps://revoked.ye.test-certs.letsencrypt.org
    Root YRhttps://valid.yr.test-certs.letsencrypt.orghttps://expired.yr.test-certs.letsencrypt.orghttps://revoked.yr.test-certs.letsencrypt.org

    Content Negotiation

    To make testing easier for terminal clients (like curl), the sites support content negotiation via URL parameters:

    • Use ?txt to request the plain text version (includes ASCII art).
    • Use ?html to request the HTML version.
    • If no Accept header is provided, the server defaults to plain text to avoid spewing HTML into a terminal.
  2. What is ACME Renewal Information (ARI)?

    main

    ACME Renewal Information (ARI) is an IETF-standardized protocol extension (RFC 9773) used by Let's Encrypt to signal certificate renewal requirements to ACME clients.

    ARI provides several key capabilities:

    • Automated Early Renewal: Let's Encrypt can signal a client to renew a certificate before its natural expiration (e.g., signaling at 60 days for a 90-day certificate).
    • Revocation Handling: If a certificate must be revoked, ARI can signal that a renewal is required immediately, allowing for automated replacement without service disruption.
    • Load Modulation: Let's Encrypt can use ARI to suggest optimal renewal times, helping to prevent massive load spikes on infrastructure.
    • Future-Proofing: ARI prepares clients for shorter-lived certificates by establishing a reliable signaling mechanism for renewal windows.

    Note: ARI is a signal or suggestion. ACME clients can still choose to renew certificates whenever they want or need, regardless of ARI signals.

  3. What is an OBJECT IDENTIFIER (OID)?

    main

    An OBJECT IDENTIFIER (OID) is a globally unique, hierarchical identifier composed of a sequence of integers. They are used to identify standards, algorithms, certificate extensions, organizations, or policies.

    OIDs are organized in an "OID arc" (a hierarchy). For example:

    • 1.2.840.113549 identifies RSA Security LLC.
    • 2.5.4.6 identifies countryName.
    • 2.5.4.10 identifies organizationName.

    In specifications, OIDs are often represented using human-readable names via concatenation. For example, an OID can be defined by referencing a parent arc and adding new components:

       pkcs-1    OBJECT IDENTIFIER ::= {
           iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1
       }
       ...
       sha256WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 11 }
  4. What is OCSP Stapling and why use it?

    main

    OCSP (Online Certificate Status Protocol) stapling is an optimization for checking certificate revocation status.

    In traditional OCSP, the client (browser) must contact the Certificate Authority (CA) directly to verify a certificate. This introduces:

    • Privacy Risks: The CA can track which users are visiting which sites.
    • Performance Latency: Browsers must establish a separate connection to the CA before loading the web page.
    • Resource Strain: High-traffic sites can overwhelm the CA's OCSP responder.

    OCSP Stapling solves this by having the certificate holder (the web server) query the OCSP responder at regular intervals and cache the signed, time-stamped response. The server then "staples" this response to the initial TLS handshake. This eliminates the need for the client to contact the CA, improving privacy and speed.

  5. What is Sunlight and how does it improve Certificate Transparency?

    main

    Sunlight is a new implementation of a Certificate Transparency (CT) log designed for scalability, ease of operation, and reduced cost. Unlike traditional CT log architectures (like 'Oak') that rely on large relational databases, Sunlight uses a tile-based approach for its read path and a simplified single-node architecture for its write path.

    Key improvements include:

    • Scalable Read Path: Uses static 'tiles' instead of dynamic API endpoints, allowing logs to be served via cloud object storage (like S3) and CDNs.
    • Simplified Write Path: Replaces complex leader election systems (like etcd) with a single-node writer using a compare-and-swap mechanism for checkpoints.
    • Elimination of Merge Delay: Holds submissions to batch and integrate certificates immediately, avoiding the risks associated with the traditional 'Maximum Merge Delay' promise.
  6. What is the Static CT API and how does it differ from traditional CT logs?

    main

    The Static CT API is a next-generation architecture for Certificate Transparency (CT) logs. Unlike the original 2013 CT design, the Static CT API represents logs as simple collections of flat files known as "tiles" (or "tiled logs").

    Key Differences and Benefits:

    • Data Distribution: Because logs are composed of flat files, they can be easily downloaded and distributed via CDNs, making data sharing and verification more efficient.
    • Operational Efficiency: The architecture is simpler and requires fewer resources, allowing log operators to run highly available, distributed log services at a lower cost.
    • Zero Merge Delay: Implementations like Sunlight ensure that newly-submitted certificates are completely incorporated before returning a Signed Certificate Timestamp (SCT). This eliminates the risk of a log missing the maximum merge delay, a common failure mode in traditional logs.
    • Browser Support: Major browsers (Chrome and Safari) are beginning to accept Static CT API logs into their log programs, provided they are used alongside traditional RFC 6962 logs.
  7. What is ASN.1 and how is it used?

    main

    ASN.1 (Abstract Syntax Notation One) is a language used to define data structures and file formats in a language-independent way. It is used to define the contents of HTTPS certificates (following RFC 5280).

    Unlike language-specific definitions (like C struct or Go type), ASN.1 allows different machines using different CPUs or operating systems to communicate by providing a standard way to define types and serialize them into bytes. A collection of ASN.1 definitions is referred to as a "module."

    Point ::= SEQUENCE {
      x INTEGER,
      y INTEGER,
      label UTF8String
    }
  8. Understand ASN.1 serialization formats: DER and PEM

    main

    ASN.1 defines how in-memory data structures are turned into a series of bytes (serialization).

    • DER (Distinguished Encoding Rules): A canonical serialization format. It is a variant of BER (Basic Encoding Rules) that adds rules to ensure a unique, deterministic encoding. For example, members in a SET OF must be sorted for DER.
    • PEM (Privacy Enhanced Mail): A format often used to wrap DER-encoded certificates. It uses Base64 to encode the arbitrary bytes into alphanumeric characters and adds header/footer separators like -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----. PEM is primarily used for ease of copy-pasting.
  9. Use BIT STRING and OCTET STRING for unstructured data

    main

    In ASN.1, BIT STRING and OCTET STRING are used to hold arbitrary bits or bytes. They are ideal for unstructured data such as nonces or hash function outputs. They can also function similarly to a void pointer in C or an interface{} in Go, allowing you to hold data with a structure that is defined separately from the type system.

    Example of a BIT STRING used for a certificate signature:

    Certificate  ::=  SEQUENCE  {
         tbsCertificate       TBSCertificate,
         signatureAlgorithm   AlgorithmIdentifier,
         signature            BIT STRING  }
  10. How Certificate Revocation works

    main

    Revocation allows a client to invalidate a certificate before its expiration date:

    1. Signed Request: The client creates a revocation request and signs it using the account key pair authorized for the domain.
    2. CA Verification: The Let's Encrypt CA verifies the authorization of the request.
    3. CRL Publication: Upon successful verification, the CA publishes the revocation information via a Certificate Revocation List (CRL), allowing browsers and other relying parties to reject the certificate.
  11. Understand HTTP-01 challenges

    main

    The HTTP-01 challenge is the most common validation method. Let's Encrypt provides a token, and your ACME client places a file at http://<YOUR_DOMAIN>/.well-known/acme-challenge/<TOKEN>. Let's Encrypt then attempts to retrieve this file to verify domain control.

    Key Technical Details

    • Port Requirement: Must be performed on port 80.
    • Redirects: Supports redirects up to 10 levels deep, but only to http: or https: on ports 80 or 443. When redirecting to HTTPS, Let's Encrypt does not validate the certificate (to allow bootstrapping valid certificates).
    • Capabilities: Can be used to validate IP addresses.

    Pros and Cons

    Pros:

    • Easy to automate with standard web server configurations.
    • Supports domains CNAMEd to a hosting provider.
    • Works with off-the-shelf web servers.
    • Supports IP address validation.

    Cons:

    • Does not work if your ISP blocks port 80.
    • Cannot be used to issue wildcard certificates.
    • Requires the challenge file to be available on all web servers if you have a multi-server setup.
  12. Use IMPLICIT vs EXPLICIT encoding instructions

    main

    ASN.1 encoding instructions (like [5]) define how a field is wrapped.

    • IMPLICIT: Encodes the field using the underlying type, but uses the tag number and class provided in the ASN.1 module. It uses fewer bytes.
    • EXPLICIT: Encodes the field as the underlying type and then wraps it in an outer encoding layer that carries the tag number and class from the module. This sets the Constructed bit.

    Defaults: If no keyword is present, the default is EXPLICIT, unless the module specifies EXPLICIT TAGS, IMPLICIT TAGS, or AUTOMATIC TAGS at the top.

    # IMPLICIT example
    [5] IMPLICIT UTF8String
    # Encodes "hi" as: 85 02 68 69
    
    # EXPLICIT example
    [5] EXPLICIT UTF8String
    # Encodes "hi" as: A5 04 0C 02 68 69