Implement non blocking-handshake for StreamPeerSSL

This commit is contained in:
Fabio Alessandrelli 2018-07-14 22:33:30 +02:00
parent 1fc7973a00
commit 99d0b7ba14
4 changed files with 78 additions and 33 deletions

View file

@ -49,14 +49,20 @@ protected:
friend class Main;
static bool initialize_certs;
bool blocking_handshake;
public:
enum Status {
STATUS_DISCONNECTED,
STATUS_HANDSHAKING,
STATUS_CONNECTED,
STATUS_ERROR_NO_CERTIFICATE,
STATUS_ERROR,
STATUS_ERROR_HOSTNAME_MISMATCH
};
void set_blocking_handshake_enabled(bool p_enabled);
bool is_blocking_handshake_enabled() const;
virtual void poll() = 0;
virtual Error accept_stream(Ref<StreamPeer> p_base) = 0;
virtual Error connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs = false, const String &p_for_hostname = String()) = 0;