Skip to content

Commit 3d67fa4

Browse files
committed
SSLClient: add setClient()
1 parent e1362a0 commit 3d67fa4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libraries/SSLClient/src/SSLClient.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ SSLClient::SSLClient()
4040
_private_key = NULL;
4141
_pskIdent = NULL;
4242
_psKey = NULL;
43-
44-
ssl_init(sslclient, nullptr, _CA_path);
45-
46-
sslclient->handshake_timeout = 5000;
4743
}
4844

4945
SSLClient::SSLClient(Client* client)
@@ -92,6 +88,13 @@ SSLClient::~SSLClient()
9288
delete sslclient;
9389
}
9490

91+
void SSLClient::setClient(Client& client)
92+
{
93+
ssl_init(sslclient, &client, _CA_path);
94+
95+
sslclient->handshake_timeout = 5000;
96+
}
97+
9598
void SSLClient::stop()
9699
{
97100
if (sslclient->client >= 0) {

libraries/SSLClient/src/SSLClient.h

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class SSLClient : public Client
4848
SSLClient(Client* client, String ca_path);
4949
~SSLClient();
5050

51+
void setClient(Client& client);
52+
5153
int connect(IPAddress ip, uint16_t port);
5254
int connect(IPAddress ip, uint16_t port, int32_t timeout);
5355
int connect(const char *host, uint16_t port);

0 commit comments

Comments
 (0)