allow late init of ssl

This commit is contained in:
John
2023-05-18 12:04:42 +02:00
parent 4886b016f3
commit ec6dae6abb
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -124,8 +124,9 @@ class HttpClient {
* Constructor.
* @param caFile the CA file to use (uses defaults if neither caFile nor caPath are set), or "#" for insecure.
* @param caPath the path with CA files to use (uses defaults if neither caFile nor caPath are set).
* @param init whether to immediately initialize the library (instead of during connect()).
*/
explicit HttpClient(const char* caFile = nullptr, const char* caPath = nullptr) :
explicit HttpClient(const char* caFile = nullptr, const char* caPath = nullptr, bool init = true) :
#ifdef HAVE_SSL
m_https(false),
m_caFile(caFile),
@@ -133,7 +134,9 @@ class HttpClient {
#endif
m_socket(nullptr), m_port(0), m_timeout(0), m_bufferSize(0), m_buffer(nullptr)
{
initialize();
if (init) {
initialize();
}
}
/**