Skip to content

Latest commit

 

History

History
114 lines (85 loc) · 3.22 KB

README.md

File metadata and controls

114 lines (85 loc) · 3.22 KB

tls_certificate_check

Erlang Versions

tls_certificate_check is a library for Erlang/OTP and Elixir intended on easing the establishement of more secure HTTPS connections in ordinary setups.

Other kinds of TLS/SSL connections may also benefit from it.

It wraps Mozilla's CA certificate store, as extracted by curl, together with ssl_verify_fun plus all the the boilerplate code required for validating misordered certificate chains.

The trusted authorities' certificates are hardcoded in PEM format, decoded when the application starts and made available to the API through persistent_term.

Usage - Erlang

1. Import as a dependency

rebar.config

{deps,
 [% [...]
  {tls_certificate_check, "~> 1.16"}
  ]}.

your_application.app.src

  {applications,
   [kernel,
    stdlib,
    % [...]
    tls_certificate_check
   ]}
2. Make your connections safer
Host = "example.com",
Options = tls_certificate_check:options(Host),
ssl:connect(Host, 443, Options, 5000)

Usage - Elixir

1. Import as a dependency

mix.exs

  defp deps do
    [
      # [...]
      {:tls_certificate_check, "~> 1.16"}
    ]
  end
2. Make your connections safer
host = "example.com"
options = :tls_certificate_check.options(host)
:ssl.connect(host, 443, options, 5000)

API Reference

The API reference can be found on HexDocs.

Tested setup

  • Erlang/OTP 22 or newer
  • rebar3

License

MIT License

Copyright (c) 2020-2022 Guilherme Andrade

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.