Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Better PROXY support and SNI #113

Merged
merged 3 commits into from Aug 10, 2012
Merged

Better PROXY support and SNI #113

merged 3 commits into from Aug 10, 2012

Commits on Jul 20, 2012

  1. Code cleanup

    The code had mixed tabs/spaces and trailing whitespace. I standardized
    on 4-space indentation for stud.c and deleted all trailing whitespace. I
    also cleaned up whitespace in shctx.c (but did not standardize spacing
    there)
    carl-stripe committed Jul 20, 2012
    Copy the full SHA
    f99e976 View commit details
    Browse the repository at this point in the history
  2. Proxy-PROXY support

    A mode that enables transparently passing the PROXY header generated by
    HAProxy et. al. through to the backend connection. This can be useful
    if you are using a TCP load balancer (such as HAProxy in tcp mode) to
    distribute encrypted streams to stud before they are unwrapped.
    carl-stripe committed Jul 20, 2012
    Copy the full SHA
    d78fd49 View commit details
    Browse the repository at this point in the history
  3. Add SNI support

    If multiple certificates are specified, try to perform Server Name
    Indication to serve the most appropriate one. We fall back to the last
    certificate presented if none of the previous ones match, making it a
    useful place to put a star cert.
    
    A few caveats:
    - Certificate names are compared as case-insensitive strings, without
      any special logic for dealing with wildcards. The current workaround
      is to always place wildcard certificates last, where they act as the
      default catch-all.
    - Certificates are examined in order. The first certificate that matches
      any given request will be used.
    - The name -> certificate mapping is stored in a singly linked list.
      This performs very well for use with a handful of certificates, none
      of which have very many Subject Alternative Names, however sites which
      must serve a large number of certificates or names might find a linear
      list scan on every new connection too slow.
    carl-stripe committed Jul 20, 2012
    1
    Copy the full SHA
    b09da7e View commit details
    Browse the repository at this point in the history