implement secureSocket
This commit is contained in:
parent
1f659c34bd
commit
e26cd1faba
@ -20,7 +20,7 @@ namespace ix
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketSChanne::~SocketSChannel()
|
SocketSChannel::~SocketSChannel()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -32,6 +32,19 @@ namespace ix
|
|||||||
return Socket::connect(host, port, errMsg);
|
return Socket::connect(host, port, errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SocketSChannel::secureSocket()
|
||||||
|
{
|
||||||
|
DWORD dwOptVal = SO_SEC_SSL;
|
||||||
|
DWORD dwBytes = 0;
|
||||||
|
SSLVALIDATECERTHOOK sslValidateFunc;
|
||||||
|
|
||||||
|
sockerror = setsockopt(_sockfd, SOL_SOCKET,
|
||||||
|
SO_SECURE, (LPSTR)&dwOptVal, sizeof(dwOptVal));
|
||||||
|
|
||||||
|
// FIXME do something with sockerror
|
||||||
|
}
|
||||||
|
|
||||||
void SocketSChannel::close()
|
void SocketSChannel::close()
|
||||||
{
|
{
|
||||||
Socket::close();
|
Socket::close();
|
||||||
|
@ -13,14 +13,17 @@ namespace ix
|
|||||||
class SocketSChannel : public Socket
|
class SocketSChannel : public Socket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SocketAppleSSL();
|
SocketSChannel();
|
||||||
~SocketAppleSSL();
|
~SocketSChannel();
|
||||||
|
|
||||||
virtual bool connect(const std::string& host,
|
virtual bool connect(const std::string& host,
|
||||||
int port,
|
int port,
|
||||||
std::string& errMsg) final;
|
std::string& errMsg) final;
|
||||||
virtual void close() final;
|
virtual void close() final;
|
||||||
|
|
||||||
|
// The important override
|
||||||
|
virtual void secureSocket() final;
|
||||||
|
|
||||||
virtual int send(char* buffer, size_t length) final;
|
virtual int send(char* buffer, size_t length) final;
|
||||||
virtual int send(const std::string& buffer) final;
|
virtual int send(const std::string& buffer) final;
|
||||||
virtual int recv(void* buffer, size_t length) final;
|
virtual int recv(void* buffer, size_t length) final;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user