vnet::tls¶
-
namespace tls¶
Functions
-
bool init()¶
Read VNET_TLS, VNET_TLS_CERT, VNET_TLS_KEY and VNET_TLS_CA.
When TLS is off this returns true and enabled() stays false.
-
ssl_st *handshake_client(int fd)¶
Blocking handshake.
The fd should be blocking. Returns null on failure.
-
ssl_st *handshake_server(int fd)¶
-
ssl_st *new_session(int fd)¶
A session bound to fd with no handshake done yet, for the non-blocking handshake that NetQueue drives.
Null when TLS is off or the session cannot be made.
-
void free_session(ssl_st *ssl)¶
-
std::string peer_role(ssl_st *ssl)¶
The role named in the peer certificate’s OU, or “” when there is no certificate or no OU.
-
bool peer_has_role(ssl_st *ssl, const char *role)¶
True when the peer may act as role: TLS is off, VNET_TLS_ROLE_CHECK=0, or the peer certificate’s OU is exactly role.
With one certificate per role, a key found on a contestant machine cannot be used to pose as a switch or the conductor.
-
bool init()¶