Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MTLS Support #657

Closed
wants to merge 24 commits into from
Closed

Add MTLS Support #657

wants to merge 24 commits into from

Commits on Sep 11, 2018

  1. Add support for MTLS.

    * Add an optional configuration for Rocket.toml, ca_certs, to take
      in a directory and use it for MTLS.
    * Update Cargo.toml to point to fork of hyper-sync-rustls with updates
      for MTLS.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    25b3ff4 View commit details
    Browse the repository at this point in the history
  2. Make TLS peer certificates available to Request

    * Save peer certificates from network stream to Data
    * Add peer_certs field to Request
    * Move certificates from Data to Request
    akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    bff3e2d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0f917fe View commit details
    Browse the repository at this point in the history
  4. Add client certificate verification.

    * Lookup domain name associated with client's IP Address.
    * Verify that the domain name match the certificate common name.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    9a704fd View commit details
    Browse the repository at this point in the history
  5. Improve error handling.

    * Clean up code.
    * Added better comments.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    4026e37 View commit details
    Browse the repository at this point in the history
  6. Make MTLS certificate store path optional.

    * Make cert_store_path optional.
    * Modify code sample to reflect changes.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    2c51d66 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    33daf7a View commit details
    Browse the repository at this point in the history
  8. Consolidate TLS and MTLS and add retrievable certificate information.

    * Move mtls.rs contents into tls.rs.
    * Parse certificat into MutualTlsUser.
    * Create getter methods for MutualTlsUser.
    * Generate MutualTlsUser from first accepted certificate from
      array the client provides.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    5d46b2e View commit details
    Browse the repository at this point in the history
  9. Fix spacing and indentation.

    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    24ab52e View commit details
    Browse the repository at this point in the history
  10. Make MutualTlsUser more robust.

    * Add more comments explaining sections of code.
    * Add documentation and examples.
    * Remove public key and signature from MutualTlsUser.
    * Improve error handling to not panic when generating a new
      MutualTlsUser.
    * Replace unwraps with exceptions to specify what failed.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    03f2c0d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0486d18 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    513003a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8a4d519 View commit details
    Browse the repository at this point in the history
  14. Clean up code and comments.

    * Combine lines of code that can be together and simplify
      get_not_before and get_not_after method names.
    * Remove methods referenced in comments that are no longer
      implemented.
    Kmoneal authored and akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    fd676c8 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    4dd1d3a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    62842bd View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    bd8cdfb View commit details
    Browse the repository at this point in the history
  18. Address some stylistic issues

    * Use combinators instead of explicit matches where possible
    * Remove some clone() calls
    * Return references instead of copies
    akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    82fd1a9 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c381395 View commit details
    Browse the repository at this point in the history
  20. Move name validation logic into tls

    This keeps the internals of the name validation out of the
    `from_request` logic for `MutualTlsUser`, which is currently still in
    the core rocket lib to avoid circular dependencies.
    akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    7e3c30f View commit details
    Browse the repository at this point in the history
  21. Remove certificate parsing from MutualTlsUser

    Even without exposing the certificate details, MutualTlsUser provides a
    guard that only allows authenticated clients to connect. Removing the
    certificate parsing will allow this functionality to be added before all
    the details of parsing the certificates have been figured out.
    
    * Remove all fields and methods from MutualTlsUser
    * Remove openssl dependency
    * Update tests
    akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    aade841 View commit details
    Browse the repository at this point in the history
  22. Expose subject name for MutualTlsUser

    This is not necessarily the value stored in the subject name of the
    certificate, but it is the name for which the provided certifcate was
    validated.
    akuanti committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    8ca69ce View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2019

  1. Configuration menu
    Copy the full SHA
    931bc52 View commit details
    Browse the repository at this point in the history
  2. Remove trailing whitespace

    akuanti committed Mar 11, 2019
    Configuration menu
    Copy the full SHA
    7071a7c View commit details
    Browse the repository at this point in the history