mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-07 11:24:32 +02:00
problem: unsecured websocket is rarely used in production
Solution: support websocket with tls (wss)
This commit is contained in:
12
src/ctx.cpp
12
src/ctx.cpp
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user