12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef _JNETLIB_SSL_H_
- #define _JNETLIB_SSL_H_
- #include "netinc.h"
- #include "util.h"
- #include "connection.h"
- #include <openssl/ssl.h>
- class JNL_SSL_Connection : public JNL_Connection
- {
- protected:
- SSL *m_ssl;
- bool m_bcontextowned;
- bool m_bsslinit;
-
- public:
- JNL_SSL_Connection();
- JNL_SSL_Connection( SSL *pssl, JNL_AsyncDNS *dns, size_t sendbufsize, size_t recvbufsize );
- virtual ~JNL_SSL_Connection();
- virtual void connect( SOCKET sock, sockaddr *addr, socklen_t length );
- virtual void run( size_t max_send_bytes = -1, size_t max_recv_bytes = -1, size_t *bytes_sent = NULL, size_t *bytes_rcvd = NULL );
-
- protected:
- virtual void socket_shutdown();
- virtual ssize_t socket_recv( char *buf, size_t len, int options );
- virtual ssize_t socket_send( const char *buf, size_t len, int options );
- virtual int socket_connect();
- virtual void on_socket_connected();
-
- bool init_ssl_connection();
- bool forceConnect;
- };
- extern SSL_CTX *sslContext;
- #endif
|