[NET] Refactor TLS configuration.
Use a TLSOptions configuration object which is created via static functions. - "TLSOptions.client": uses the standard CA and common name verification. - "TLSOptions.client_unsafe": uses optional CA verification (i.e. if specified) - "TLSOptions.server": is the standard server configuration (chain + key) This will allow us to expand the TLS configuration options to include e.g. mutual authentication without bloating the classes that uses StreamPeerTLS and PacketPeerDTLS as underlying peers.
This commit is contained in:
@ -37,16 +37,14 @@
|
||||
class DTLSServerMbedTLS : public DTLSServer {
|
||||
private:
|
||||
static DTLSServer *_create_func();
|
||||
Ref<CryptoKey> _key;
|
||||
Ref<X509Certificate> _cert;
|
||||
Ref<X509Certificate> _ca_chain;
|
||||
Ref<CookieContextMbedTLS> _cookies;
|
||||
Ref<TLSOptions> tls_options;
|
||||
Ref<CookieContextMbedTLS> cookies;
|
||||
|
||||
public:
|
||||
static void initialize();
|
||||
static void finalize();
|
||||
|
||||
virtual Error setup(Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>());
|
||||
virtual Error setup(Ref<TLSOptions> p_options);
|
||||
virtual void stop();
|
||||
virtual Ref<PacketPeerDTLS> take_connection(Ref<PacketPeerUDP> p_peer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user