Skip to content
API Documentation
BastionGuard™
tls_intercept.hpp File Reference

Go to the source code of this file.

Classes

struct  TlsIntercept::detail::IntermediateCA
struct  TlsIntercept::detail::CacheEntry

Namespaces

namespace  TlsIntercept
namespace  TlsIntercept::detail

Typedefs

using TlsIntercept::detail::Clock = std::chrono::steady_clock

Functions

static void TlsIntercept::set_no_expiry (X509 *cert)
static void TlsIntercept::set_realistic_validity (X509 *cert)
static fs::path TlsIntercept::detail::ca_dir ()
static fs::path TlsIntercept::detail::ca_cert_path ()
static fs::path TlsIntercept::detail::ca_key_path ()
static std::string TlsIntercept::detail::drain_errors ()
static EVP_PKEY * TlsIntercept::detail::gen_rsa (int bits)
static bool TlsIntercept::detail::add_ext (X509 *cert, X509V3_CTX *v3ctx, int nid, const char *val)
static bool TlsIntercept::detail::write_pem (const fs::path &path, std::function< int(BIO *)> writer)
static std::shared_ptr< IntermediateCA > TlsIntercept::detail::generate_ca ()
static std::shared_ptr< IntermediateCA > TlsIntercept::detail::load_ca ()
static bool TlsIntercept::detail::ca_needs_rotation ()
static void TlsIntercept::detail::install_generated_ca ()
static std::shared_ptr< IntermediateCA > TlsIntercept::detail::get_ca ()
static std::shared_ptr< asio::ssl::context > TlsIntercept::detail::make_ssl_ctx_for_host (const std::string &host, const std::shared_ptr< IntermediateCA > &ca)
static void TlsIntercept::detail::evict_expired ()
static std::shared_ptr< asio::ssl::context > TlsIntercept::detail::get_or_create_ctx (const std::string &host)
static std::string TlsIntercept::detail::make_tls_response (const std::string &host, const std::string &type)
static std::string TlsIntercept::extract_path_from_request (const std::string &raw)
static std::shared_ptr< asio::ssl::context > TlsIntercept::make_stealth_upstream_ctx (const std::string &host)
static std::string TlsIntercept::lower_ascii (std::string v)
static std::string TlsIntercept::trim_ascii (std::string v)
static std::string TlsIntercept::request_method_from_raw (const std::string &raw)
static std::string TlsIntercept::header_value_ci (const std::string &raw, const std::string &wanted)
static bool TlsIntercept::is_stateful_method (const std::string &method_l)
static bool TlsIntercept::is_speculative_request (const std::string &raw)
static bool TlsIntercept::should_passthrough_transaction (const std::string &raw)
static void TlsIntercept::send_speculative_no_content (asio::ssl::stream< tcp::socket > &tls)
static bool TlsIntercept::parse_content_length (const std::string &raw, std::size_t &out_len)
static bool TlsIntercept::is_chunked_request (const std::string &raw)
static bool TlsIntercept::read_more (asio::ssl::stream< tcp::socket > &tls, std::string &raw, std::size_t min_total, std::size_t max_total)
static bool TlsIntercept::read_complete_chunked (asio::ssl::stream< tcp::socket > &tls, std::string &raw, std::size_t body_start, std::size_t max_total)
static bool TlsIntercept::read_complete_http1_request (asio::ssl::stream< tcp::socket > &tls, std::string &raw)
static std::string TlsIntercept::force_connection_close (const std::string &raw)
static bool TlsIntercept::forward_transaction_https (asio::ssl::stream< tcp::socket > &client_tls, const std::string &host, std::string raw_request)
static void TlsIntercept::send_passthrough_failure (asio::ssl::stream< tcp::socket > &tls)
static void TlsIntercept::do_intercept (tcp::socket sock, const std::string &host, const std::string &type, std::function< void(const std::string &)> on_url_ready=nullptr)

Variables

static constexpr long TlsIntercept::CTX_CACHE_TTL_SEC = 30L * 24 * 3600
static std::shared_ptr< IntermediateCA > TlsIntercept::detail::g_ca
static std::mutex TlsIntercept::detail::g_ca_mutex
static std::shared_mutex TlsIntercept::detail::g_ctx_mutex
static std::unordered_map< std::string, CacheEntry > TlsIntercept::detail::g_ctx_cache