problem: unsecured websocket is rarely used in production

Solution: support websocket with tls (wss)
This commit is contained in:
somdoron
2019-09-29 18:30:37 +03:00
parent 8fe620901f
commit 7296fb5b15
27 changed files with 705 additions and 60 deletions

View File

@@ -56,6 +56,10 @@
#include <nss.h>
#endif
#ifdef ZMQ_USE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe
#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef
@@ -95,6 +99,10 @@ zmq::ctx_t::ctx_t () :
#ifdef ZMQ_USE_NSS
NSS_NoDB_Init (NULL);
#endif
#ifdef ZMQ_USE_GNUTLS
gnutls_global_init ();
#endif
}
bool zmq::ctx_t::check_tag ()
@@ -131,6 +139,10 @@ zmq::ctx_t::~ctx_t ()
NSS_Shutdown ();
#endif
#ifdef ZMQ_USE_GNUTLS
gnutls_global_deinit ();
#endif
// Remove the tag, so that the object is considered dead.
_tag = ZMQ_CTX_TAG_VALUE_BAD;
}