[GH-ISSUE #239] WiFiClientSecure incompatable? #199

Closed
opened 2026-02-28 01:23:58 +03:00 by kerem · 1 comment
Owner

Originally created by @hutch120 on GitHub (Oct 21, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/239

Hi All,

I'm trying to get this library working with WiFiClientSecure on an ESP8266. I've got the most basic AutoConnect code possible, but when I connect to wifi via this library, then any call to the WiFiClientSecure client fails. But if I connect without this library https requests work.

Console output and code snippets follow.

Console with library enabled:

*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 10.0.1.41
10.0.1.41
SecureRequest: HTTPS connection failed!

Sketch code function snippet:

void SecureRequest() {
  Serial.println(WiFi.localIP()); // No problem, prints an IP, see console output

  if (WiFi.status() != WL_CONNECTED) {
    Serial.println("SecureRequest: WIFI not connected!");   // Does *not* print this, see console output ABOVE
    return;
  }

  WiFiClientSecure client;

  if (!client.connect(host, httpsPort)) {
    Serial.println("SecureRequest: HTTPS connection failed!");   // ALWAYS PRINTS HTTPS connection failed when connected with WiFiManager.
    return;
  }

  Serial.println("SecureRequest: Request sent..."); // Prints this only if connection to AP not using WiFiManager. See console output BELOW
}

Console without the library (direct WIFI connect):

10.0.1.41
SecureRequest: Request sent...
SecureRequest: Headers received...
SecureRequest: Request successful
SecureRequest: Closing HTTPS connection.
Originally created by @hutch120 on GitHub (Oct 21, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/239 Hi All, I'm trying to get this library working with WiFiClientSecure on an ESP8266. I've got the most basic AutoConnect code possible, but when I connect to wifi via this library, then any call to the WiFiClientSecure client fails. But if I connect without this library https requests work. Console output and code snippets follow. Console with library enabled: ``` *WM: AutoConnect *WM: Connecting as wifi client... *WM: Using last saved values, should be faster *WM: Connection result: *WM: 3 *WM: IP Address: *WM: 10.0.1.41 10.0.1.41 SecureRequest: HTTPS connection failed! ``` Sketch code function snippet: ``` void SecureRequest() { Serial.println(WiFi.localIP()); // No problem, prints an IP, see console output if (WiFi.status() != WL_CONNECTED) { Serial.println("SecureRequest: WIFI not connected!"); // Does *not* print this, see console output ABOVE return; } WiFiClientSecure client; if (!client.connect(host, httpsPort)) { Serial.println("SecureRequest: HTTPS connection failed!"); // ALWAYS PRINTS HTTPS connection failed when connected with WiFiManager. return; } Serial.println("SecureRequest: Request sent..."); // Prints this only if connection to AP not using WiFiManager. See console output BELOW } ``` Console without the library (direct WIFI connect): ``` 10.0.1.41 SecureRequest: Request sent... SecureRequest: Headers received... SecureRequest: Request successful SecureRequest: Closing HTTPS connection. ```
kerem closed this issue 2026-02-28 01:23:58 +03:00
Author
Owner

@hutch120 commented on GitHub (Oct 21, 2016):

Please disregard issue relationship with WiFiManager, on further testing I've now seen this issue without using WiFiManager. Just the first call works without WiFiManager. If I get this going I'll post the answer, but closing for now.

For reference: I think this issue has something to do with the function being triggered by AttachInterrupt.

<!-- gh-comment-id:255276835 --> @hutch120 commented on GitHub (Oct 21, 2016): Please disregard issue relationship with WiFiManager, on further testing I've now seen this issue without using WiFiManager. Just the first call works without WiFiManager. If I get this going I'll post the answer, but closing for now. For reference: I think this issue has something to do with the function being triggered by AttachInterrupt.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#199
No description provided.