7 #ifndef __WVSSLSTREAM_H 8 #define __WVSSLSTREAM_H 10 #include "wvfdstream.h" 12 #include "wvstreamclone.h" 19 typedef struct ssl_ctx_st SSL_CTX;
20 typedef struct ssl_st SSL;
21 typedef struct ssl_method_st SSL_METHOD;
27 typedef wv::function<bool(WvX509*)> WvSSLValidateCallback;
28 typedef wv::function<bool(WvX509*, WvSSLStream *)> WvSSLGlobalValidateCallback;
48 static WvSSLGlobalValidateCallback global_vcb;
55 WvSSLValidateCallback _vcb = 0,
bool _is_server =
false);
64 virtual bool isok()
const;
80 virtual size_t uwrite(
const void *buf,
size_t len);
81 virtual size_t uread(
void *buf,
size_t len);
89 SelectRequest connect_wants;
92 void setconnected(
bool conn);
98 bool ssl_stop_read, ssl_stop_write;
101 WvSSLValidateCallback vcb;
128 const char *wstype()
const {
return "WvSSLStream"; }
131 #endif // __WVSSLSTREAM_H A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
SSL Stream, handles SSLv2, SSLv3, and TLS Methods - If you want it to be a server, then you must feed the constructor a WvX509Mgr object.
The in place raw memory buffer type.
virtual size_t uwrite(const void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by write().
X509 Class to handle certificates and their related functions.
WvSSLStream(IWvStream *_slave, WvX509Mgr *_x509=NULL, WvSSLValidateCallback _vcb=0, bool _is_server=false)
Start an SSL connection on the stream _slave.
the data structure used by pre_select()/post_select() and internally by select(). ...
virtual bool isok() const
return true if the stream is actually usable right now
virtual void noread()
Shuts down the reading side of the stream.
virtual void nowrite()
Shuts down the writing side of the stream.
virtual bool post_select(SelectInfo &si)
post_select() is called after ::select(), and returns true if this object is now ready.
virtual void close()
Close this stream.
virtual size_t uread(void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by read().
SSL * ssl
Main SSL Object - after SSL_set_fd() we make all calls through the connection through here...
virtual ~WvSSLStream()
Cleans up everything (calls close + frees up the SSL Objects used)
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's...
SSL_CTX * ctx
SSL Context - used to create SSL Object.
WvStreamClone simply forwards all requests to the "cloned" stream.
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling ::select().