33template <
typename TlsPolicy>
36 std::cout <<
" " << label <<
": TLS "
37 << (TlsPolicy::enabled ?
"enabled" :
"disabled") << std::endl;
42 std::cout <<
"=== TLS Policy Example ===" << std::endl;
45 std::cout <<
"\n1. Compile-time policy inspection:" << std::endl;
50 std::cout <<
"\n2. TLS enabled configuration:" << std::endl;
52 tls_config.
cert_path =
"/etc/ssl/certs/server.crt";
53 tls_config.
key_path =
"/etc/ssl/private/server.key";
54 tls_config.
ca_path =
"/etc/ssl/certs/ca-bundle.crt";
57 std::cout <<
" Certificate: " << tls_config.
cert_path << std::endl;
58 std::cout <<
" Private key: " << tls_config.
key_path << std::endl;
59 std::cout <<
" CA bundle: " << tls_config.
ca_path << std::endl;
60 std::cout <<
" Verify peer: " << (tls_config.
verify_peer ?
"yes" :
"no") << std::endl;
63 std::cout <<
"\n3. Compile-time checks:" << std::endl;
66 std::cout <<
" All static assertions passed" << std::endl;
68 std::cout <<
"\nDone." << std::endl;
Main namespace for all Network System components.
static constexpr bool enabled
Policy type indicating TLS/SSL encryption is enabled.
static constexpr bool enabled
Policy-based TLS configuration (no_tls, require_tls, optional_tls).
void describe_policy(const std::string &label)