forked from zephyrproject-rtos/gsoc-2022-arduino-core
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connect() temporarily accepts a third parameter with a PEM encoded certificate Cleanest way to add it is via raw strings const char * certificate = R"(-----BEGIN CERTIFICATE----- .... -----END CERTIFICATE-----)";
- Loading branch information
Showing
3 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "SocketWrapper.h" | ||
#include "api/Client.h" | ||
#include "unistd.h" | ||
#include "zephyr/sys/printk.h" | ||
#include "ZephyrClient.h" | ||
|
||
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) | ||
class ZephyrSSLClient : public ZephyrClient { | ||
|
||
public: | ||
int connect(const char* host, uint16_t port, const char* cert) { | ||
return connectSSL(host, port, (char*)cert); | ||
} | ||
int connect(const char* host, uint16_t port, char* cert) { | ||
return connectSSL(host, port, cert); | ||
} | ||
}; | ||
#endif |