From 97c49c6f294a0b7e931be2692c124bd78fc79946 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 9 May 2023 19:59:15 +0200 Subject: cTCPLink and cUrlClient accept list of trusted root CAs for TLS. --- src/HTTP/UrlClient.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/HTTP/UrlClient.h') diff --git a/src/HTTP/UrlClient.h b/src/HTTP/UrlClient.h index aaff60a87..a73f22521 100644 --- a/src/HTTP/UrlClient.h +++ b/src/HTTP/UrlClient.h @@ -9,6 +9,7 @@ Options that can be set via the Options parameter to the cUrlClient calls: "OwnCert": The client certificate to use, if requested by the server. Any string that can be parsed by cX509Cert. "OwnPrivKey": The private key appropriate for OwnCert. Any string that can be parsed by cCryptoKey. "OwnPrivKeyPassword": The password for OwnPrivKey. If not present or empty, no password is assumed. +"TrustedRootCAs": The trusted root CA certificates (\n-delimited concatenated PEM format) to be used for peer cert verification. If not present, peer cert is not verified. Behavior: - If a redirect is received, and redirection is allowed, the redirection is reported via OnRedirecting() callback @@ -116,16 +117,16 @@ public: cCallbacksPtr && a_Callbacks, AStringMap && a_Headers, const AString & a_Body, - AStringMap && a_Options + const AStringMap & a_Options ); /** Alias for Request("GET", ...) */ static std::pair Get( const AString & a_URL, cCallbacksPtr && a_Callbacks, - AStringMap && a_Headers = AStringMap(), - const AString & a_Body = AString(), - AStringMap && a_Options = AStringMap() + AStringMap && a_Headers = {}, + const AString & a_Body = {}, + const AStringMap & a_Options = {} ); /** Alias for Request("POST", ...) */ @@ -134,7 +135,7 @@ public: cCallbacksPtr && a_Callbacks, AStringMap && a_Headers, const AString & a_Body, - AStringMap && a_Options + const AStringMap & a_Options = {} ); /** Alias for Request("PUT", ...) */ @@ -143,7 +144,7 @@ public: cCallbacksPtr && a_Callbacks, AStringMap && a_Headers, const AString & a_Body, - AStringMap && a_Options + const AStringMap & a_Options = {} ); /** The method will run a thread blocking HTTP request. Any error handling @@ -153,17 +154,17 @@ public: static std::pair BlockingRequest( const AString & a_Method, const AString & a_URL, - AStringMap && a_Headers = AStringMap(), - const AString & a_Body = AString(), - AStringMap && a_Options = AStringMap() + AStringMap && a_Headers = {}, + const AString & a_Body = {}, + const AStringMap & a_Options = {} ); /** Alias for BlockingRequest("GET", ...) */ static std::pair BlockingGet( const AString & a_URL, - AStringMap a_Headers = AStringMap(), - const AString & a_Body = AString(), - AStringMap a_Options = AStringMap() + AStringMap a_Headers = {}, + const AString & a_Body = {}, + const AStringMap & a_Options = {} ); /** Alias for BlockingRequest("POST", ...) */ @@ -171,7 +172,7 @@ public: const AString & a_URL, AStringMap && a_Headers, const AString & a_Body, - AStringMap && a_Options + const AStringMap & a_Options = {} ); /** Alias for BlockingRequest("PUT", ...) */ @@ -179,7 +180,7 @@ public: const AString & a_URL, AStringMap && a_Headers, const AString & a_Body, - AStringMap && a_Options + const AStringMap & a_Options = {} ); }; -- cgit v1.2.3