[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:
parent
2afa175195
commit
adba870534
47 changed files with 338 additions and 203 deletions
|
|
@ -206,7 +206,7 @@ public:
|
|||
tls = Ref<StreamPeerTLS>(StreamPeerTLS::create());
|
||||
peer = tls;
|
||||
tls->set_blocking_handshake_enabled(false);
|
||||
if (tls->accept_stream(tcp, key, cert) != OK) {
|
||||
if (tls->accept_stream(tcp, TLSOptions::server(key, cert)) != OK) {
|
||||
_clear_client();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue