diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/stream_peer_ssl.cpp | 16 | ||||
-rw-r--r-- | core/io/stream_peer_ssl.h | 14 |
2 files changed, 30 insertions, 0 deletions
diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index a7132d99ef..2114993783 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -4,12 +4,28 @@ StreamPeerSSL* (*StreamPeerSSL::_create)()=NULL; + + StreamPeerSSL *StreamPeerSSL::create() { return _create(); } + +StreamPeerSSL::LoadCertsFromMemory StreamPeerSSL::load_certs_func=NULL; +bool StreamPeerSSL::available=false; +bool StreamPeerSSL::initialize_certs=true; + +void StreamPeerSSL::load_certs_from_memory(const ByteArray& p_memory) { + if (load_certs_func) + load_certs_func(p_memory); +} + +bool StreamPeerSSL::is_available() { + return available; +} + void StreamPeerSSL::_bind_methods() { diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index be7504cd8f..4b1c8e93bb 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -5,11 +5,23 @@ class StreamPeerSSL : public StreamPeer { OBJ_TYPE(StreamPeerSSL,StreamPeer); +public: + + typedef void (*LoadCertsFromMemory)(const ByteArray& p_certs); protected: static StreamPeerSSL* (*_create)(); static void _bind_methods(); + + static LoadCertsFromMemory load_certs_func; + static bool available; + + +friend class Main; + static bool initialize_certs; + public: + enum Status { STATUS_DISCONNECTED, STATUS_CONNECTED, @@ -25,6 +37,8 @@ public: static StreamPeerSSL* create(); + static void load_certs_from_memory(const ByteArray& p_memory); + static bool is_available(); StreamPeerSSL(); }; |