3#include <zephyr/net/tls_credentials.h>
4#include <zephyr/net/socket.h>
29 _ca_tag(TLS_TAG_NONE),
30 _cert_tag(TLS_TAG_NONE),
31 _key_tag(TLS_TAG_NONE),
32 _next_tag(TAG_BASE) {}
57 if (
_sock < 0)
return 0;
59 if (!_configureTLS(host)) {
81 sec_tag_t _ca_tag, _cert_tag, _key_tag, _next_tag;
83 static constexpr sec_tag_t TAG_BASE = 100;
84 static constexpr sec_tag_t TLS_TAG_NONE = 0;
88 if (!data || len == 0)
return false;
95 bool _configureTLS(
const char* host) {
100 if (host && !_insecure)
105 if (_ca_tag != TLS_TAG_NONE)
tags[n++] = _ca_tag;
106 if (_cert_tag != TLS_TAG_NONE)
tags[n++] = _cert_tag;
107 if (_key_tag != TLS_TAG_NONE)
tags[n++] = _key_tag;