Skip to content

HTTPClient - add stubs for SSL-related overloads #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ bool HTTPClient::begin(WiFiClient &client, String url) {

_port = (protocol == "https" ? 443 : 80);
_secure = (protocol == "https");
return beginInternal(url, protocol.c_str());
if (_secure)
return false;
else
return beginInternal(url, protocol.c_str());
}


Expand Down Expand Up @@ -160,7 +163,7 @@ bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String ur
_uri = uri;
_protocol = (https ? "https" : "http");
_secure = https;
return true;
return https ? false : true;
}


Expand Down
9 changes: 6 additions & 3 deletions libraries/HTTPClient/src/HTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,13 @@ class HTTPClient

#ifdef HTTPCLIENT_1_1_COMPATIBLE
bool begin(String url);
bool begin(String url, const char* CAcert);
[[deprecated("SSL is not supported in this lib")]]
bool begin(String url, const char* CAcert){ return false; };
bool begin(String host, uint16_t port, String uri = "/");
bool begin(String host, uint16_t port, String uri, const char* CAcert);
bool begin(String host, uint16_t port, String uri, const char* CAcert, const char* cli_cert, const char* cli_key);
[[deprecated("SSL is not supported in this lib")]]
bool begin(String host, uint16_t port, String uri, const char* CAcert){ return false; };
[[deprecated("SSL is not supported in this lib")]]
bool begin(String host, uint16_t port, String uri, const char* CAcert, const char* cli_cert, const char* cli_key){ return false; };
#endif

void end(void);
Expand Down