Skip to content

WifiClientSecure (arduino-esp32 v. 3.x) connect() fail on some server (e.g. "speechgen.io") - same code working well with 2.x #10071

Closed
espressif/esp32-arduino-lib-builder
#200
@kaloprojects

Description

@kaloprojects

Board

ESP32 DevKit

Version

v3.0.3

IDE Name

Arduino IDE (1.8.19)

Operating System

Windows 7

Flash frequency

80MHz

PSRAM enabled

yes

Upload speed

115200

Description

Hope someone can review this potential issue:
WifiClientSecure client.connect("some_server_xy", 443) fail

Since upgrade to 3.x (currently using 3.0.3) my earlier code is no longer working. I spent day in searching for root cause (contacted e.g. speechgen.io support team), but found root cause yesterday (more by accident): seems to be a library 2.x to 3.x issue. I downgraded for verification to arduino-esp32 2.x (2.0.16) and same code is working well (server connect successful ..i can call their TTS service API).

So can someone maybe check why this code snippet fails with 3.x: (sketch see below) ?

Hope some folks can analyze or fix a potential bug (as my complete project is on hold now due this issue, because downgrading to 2.x is no longer an option (because lot of other 3.x features needed e.g. new /i2s_std.h).

I also tried '<NetworkClientSecure.h>', HTTPClient etc. ..instead of WifiClientSecure .. all with same result. I also used tried with actual CA certificate (instead client.setInsecure()) .. same result: Successful client.connect() with Arduino-esp32 v. 2.x , but failing with 3.x on server "speechgen.io". Some dedicated server (e.g."api.openai.com") connect succesfully with 3.x and 2.x .. but my urgent needed "speechgen.io" server fails since 3.x

Do you @me-no-dev or any other folks have an idea what might have been changed on .connect() in 3.x .. and how to solve ?

  • Is this a well known issue (some server failing on 3.x .. and some not) ?
  • is there any workaround to connect e.g. "speechgen.io" successfully also with 3.x ? (all idea so much welcome!)

Thx !

Sketch

// Https Connect to Speechgen server "speechgen.io" port 443 
// -> always fails with Arduino-esp32 v. 3.x library (but same code result success with earlier Arduino-esp32 v. 2.x )
// -> other server (e.g. "api.openai.com" are working (also with 3.x)

#include <WiFi.h>           
#include <WiFiClientSecure.h> 
/* .. */
WiFiClientSecure client;  
client.setInsecure();                          
/* .. */  
if ( client.connect("speechgen.io", 443) )   // <- it FAILS here always (with ESP 3.x, only working with 2.x)
{  Serial.println("> Succesfully connected to speeschgen.io port 443"); 
}
else
{ Serial.println("ERROR - WifiClientSecure.connect to SpeechGen.io failed!");    // <-  so we always end here with ESP 3.x
}

Debug Message

ERROR - WifiClientSecure.connect to SpeechGen.io failed!
(means: client.connect("speechgen.io", 443) fail)

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions