ws curl + http client tls option handling + ca cert processing for mbedtls

This commit is contained in:
Benjamin Sergeant
2019-09-29 21:13:11 -07:00
parent 4e4792d6dc
commit 55141aa875
9 changed files with 51 additions and 14 deletions

View File

@ -14,6 +14,8 @@
#include <mbedtls/error.h>
#include <mbedtls/net.h>
#include <mbedtls/platform.h>
#include <mbedtls/x509.h>
#include <mbedtls/x509_crt.h>
#include <mutex>
namespace ix
@ -21,7 +23,7 @@ namespace ix
class SocketMbedTLS final : public Socket
{
public:
SocketMbedTLS(const SocketTLSOptions& tlsOptions);
SocketMbedTLS(const SocketTLSOptions& tlsOptions, int fd = -1);
~SocketMbedTLS();
virtual bool connect(const std::string& host,
@ -39,6 +41,7 @@ namespace ix
mbedtls_ssl_config _conf;
mbedtls_entropy_context _entropy;
mbedtls_ctr_drbg_context _ctr_drbg;
mbedtls_x509_crt _cacert;
std::mutex _mutex;
SocketTLSOptions _tlsOptions;