 |
libfilezilla
|
Go to the documentation of this file. 1 #ifndef LIBFILEZILLA_TLS_LAYER_HEADER
2 #define LIBFILEZILLA_TLS_LAYER_HEADER
11 class logger_interface;
12 class tls_system_trust_store;
13 class tls_session_info;
18 struct certificate_verification_event_type;
55 bool client_handshake(std::vector<uint8_t>
const& required_certificate, std::vector<uint8_t>
const& session_to_resume = std::vector<uint8_t>(),
native_string const& session_hostname =
native_string());
73 bool client_handshake(
event_handler *
const verification_handler, std::vector<uint8_t>
const& session_to_resume = std::vector<uint8_t>(),
native_string const& session_hostname =
native_string());
90 bool server_handshake(std::vector<uint8_t>
const& session_to_resume = {}, std::string_view
const& preamble = {});
93 std::vector<uint8_t> get_session_parameters()
const;
96 std::vector<uint8_t> get_raw_certificate()
const;
103 void set_verification_result(
bool trusted);
105 std::string get_protocol()
const;
107 std::string get_key_exchange()
const;
108 std::string get_cipher()
const;
109 std::string get_mac()
const;
110 int get_algorithm_warnings()
const;
113 bool resumed_session()
const;
116 static std::string list_tls_ciphers(std::string
const& priority);
136 bool set_certificate(std::string
const& key, std::string
const& certs,
native_string const& password,
bool pem =
true);
139 static std::string get_gnutls_version();
149 static std::pair<std::string, std::string> generate_selfsigned_certificate(
native_string const& password, std::string
const& distinguished_name, std::vector<std::string>
const& hostnames);
156 bool set_alpn(std::string_view
const& alpn);
157 bool set_alpn(std::vector<std::string>
const& alpns);
160 std::string get_alpn()
const;
165 bool is_server()
const;
169 virtual int connect(
native_string const& host,
unsigned int port, address_type family = address_type::unknown)
override;
171 virtual int read(
void *
buffer,
unsigned int size,
int& error)
override;
172 virtual int write(
void const*
buffer,
unsigned int size,
int& error)
override;
174 virtual int shutdown()
override;
176 virtual int shutdown_read()
override;
181 virtual void FZ_PRIVATE_SYMBOL operator()(
event_base const& ev)
override;
183 friend class tls_layer_impl;
184 std::unique_ptr<tls_layer_impl> impl_;
The buffer class is a simple buffer where data can be appended at the end and consumed at the front....
Definition: buffer.hpp:25
socket_state
State transitions are monotonically increasing.
Definition: socket.hpp:326
Common base class for all events.
Definition: event.hpp:22
This is the recommended event class.
Definition: event.hpp:65
A Transport Layer Security (TLS) layer.
Definition: tls_layer.hpp:38
A base class for socket layers.
Definition: socket.hpp:567
socket_event_flag
The type of a socket event.
Definition: socket.hpp:33
Socket classes for networking.
Abstract interface for logging strings.
Definition: logger.hpp:49
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition: string.hpp:33
simple_event< certificate_verification_event_type, tls_layer *, tls_session_info > certificate_verification_event
This event gets sent during the handshake with details about the session and the used certificate.
Definition: tls_layer.hpp:18
Interface for sockets.
Definition: socket.hpp:358
Simple handler for asynchronous event processing.
Definition: event_handler.hpp:54
A threaded event loop that supports sending events and timers.
Definition: event_loop.hpp:33
Opaque class to load the system trust store asynchronously.
Definition: tls_system_trust_store.hpp:29
The namespace used by libfilezilla.
Definition: apply.hpp:17