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;
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;
125 void printerr(WvStringParm func);
128 const char *wstype()
const {
return "WvSSLStream"; }
131 #endif // __WVSSLSTREAM_H
virtual size_t uwrite(const void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by write().
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling ::select().
X509 Class to handle certificates and their related functions.
SSL Stream, handles SSLv2, SSLv3, and TLS Methods - If you want it to be a server,...
WvSSLStream(IWvStream *_slave, WvX509Mgr *_x509=NULL, WvSSLValidateCallback _vcb=0, bool _is_server=false)
Start an SSL connection on the stream _slave.
The in place raw memory buffer type.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
the data structure used by pre_select()/post_select() and internally by select().
virtual void nowrite()
Shuts down the writing side of the stream.
WvStreamClone simply forwards all requests to the "cloned" stream.
virtual size_t uread(void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by read().
virtual bool post_select(SelectInfo &si)
post_select() is called after ::select(), and returns true if this object is now ready.
virtual void noread()
Shuts down the reading side of the stream.
SSL_CTX * ctx
SSL Context - used to create SSL Object.
virtual bool isok() const
return true if the stream is actually usable right now
virtual void close()
Close this stream.
virtual ~WvSSLStream()
Cleans up everything (calls close + frees up the SSL Objects used)
SSL * ssl
Main SSL Object - after SSL_set_fd() we make all calls through the connection through here.