File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ class ZephyrClient : public arduino::Client, ZephyrSocketWrapper {
31
31
return ret;
32
32
}
33
33
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
34
- int connectSSL (const char * host, uint16_t port, char * cert) {
35
- auto ret = ZephyrSocketWrapper::connectSSL ((char *)host, port, cert);
34
+ int connectSSL (const char * host, uint16_t port, const char * cert) {
35
+ auto ret = ZephyrSocketWrapper::connectSSL ((char *)host, port, ( char *) cert);
36
36
if (ret) {
37
37
_connected = true ;
38
38
}
Original file line number Diff line number Diff line change 8
8
9
9
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)
10
10
class ZephyrSSLClient : public ZephyrClient {
11
+ private:
12
+ const char * _cert = nullptr ;
11
13
12
14
public:
13
15
int connect (const char * host, uint16_t port) override {
14
- return connectSSL (host, port, nullptr );
16
+ return connectSSL (host, port, _cert );
15
17
}
16
- int connect (const char * host, uint16_t port, char * cert) {
18
+ int connect (const char * host, uint16_t port, const char * cert) {
17
19
return connectSSL (host, port, cert);
18
20
}
21
+ void setCACert (const char * cert) {
22
+ _cert = cert;
23
+ }
19
24
};
20
25
#endif
You can’t perform that action at this time.
0 commit comments