00001 /* 00002 * Insert Appropriate Copyright header here.... 00003 * I really don't care just mention me in a changelog somewhere ;) ppatters. 00004 */ 00005 00006 #ifndef __WVSSLSTREAM 00007 #define __WVSSLSTREAM 00008 00009 #include "wvstreamclone.h" 00010 #include "wvx509.h" 00011 #include "wvlog.h" 00012 00013 struct ssl_st; 00014 struct ssl_ctx_st; 00015 struct ssl_method_st; 00016 00017 typedef struct ssl_ctx_st SSL_CTX; 00018 typedef struct ssl_st SSL; 00019 typedef struct ssl_method_st SSL_METHOD; 00020 00026 class WvSSLStream : public WvStreamClone 00027 { 00028 public: 00037 WvSSLStream(WvStream *_slave, WvX509Mgr *x509 = NULL, 00038 bool _verify = false, bool _is_server = false); 00039 00043 virtual ~WvSSLStream(); 00044 00045 virtual bool pre_select(SelectInfo &si); 00046 virtual bool post_select(SelectInfo &si); 00047 00051 virtual void close(); 00052 00053 protected: 00057 WvStream *slave; 00058 00062 SSL_CTX *ctx; 00063 00068 SSL *ssl; 00069 00074 SSL_METHOD *meth; 00075 00080 virtual size_t uwrite(const void *buf, size_t len); 00081 00086 virtual size_t uread(void *buf, size_t len); 00087 00088 private: 00093 volatile bool sslconnected; 00094 00098 bool is_server; 00099 00103 bool verify; 00104 00110 bool read_again; 00111 00115 WvLog debug; 00116 00121 char bouncebuffer[1400]; 00122 size_t writeonly; 00123 00124 }; 00125 00126 #endif