forked from augcampos/asterisk-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSSLSocket.h
More file actions
51 lines (37 loc) · 1.15 KB
/
SSLSocket.h
File metadata and controls
51 lines (37 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/************************************
* Package: RGcpp *
* Authors: Rui Eduardo Gouveia Gil *
* Date: 2010 *
************************************/
#ifndef __RGCPP_SSLSOCKET_H__
#define __RGCPP_SSLSOCKET_H__
#ifdef _WIN32
#include <winsock2.h>
#endif
#include <openssl/ssl.h>
#include <openssl/err.h>
#include "SSLContext.h"
#include "TCPSocket.h"
#include "../exceptions/IOException.h"
namespace asteriskcpp {
class SSLSocket : private TCPSocket {
private:
SSL *ssl;
bool certified;
SSLContext* sslContext;
public:
SSLSocket(SSLContext* sslContext, const int socketFD);
SSLSocket(SSLContext* sslContext, const IPAddress& ipAddress);
~SSLSocket();
int readEncryptedData(char* buffer, const unsigned int size);
void writeEncryptedData(const char* buffer, const unsigned int size);
void setTimeout(const unsigned long timeout);
unsigned long getTimeout();
void release();
bool check4readData(const unsigned long timeout);
IPAddress getLocalAddress();
IPAddress getPeerAddress();
bool isCertifiedConnection();
};
}
#endif