BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

ESP32 Secure connection failed

Symptoms:
Board does not connect to Blynk server using SSL. I’m using the standard example:

It works fine when using the non-SSL version of Blynk. The board also works fine using the standard “WiFiClientSecure” example.

The log output looks like this:

[2664] Connected to WiFi
[2665] IP: 192.168.2.194
[2665]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v1.0.1 on ESP32

[2675] Connecting to blynk.cloud:443
[2896] Secure connection failed
[7676] Connecting to blynk.cloud:443
[7876] Secure connection failed
[12677] Connecting to blynk.cloud:443
[12880] Secure connection failed

• Hardware model + communication type: ESP32 via WiFi
• Smartphone OS: Android
• Blynk server: blynk.cloud:443
• Blynk Library version: 1.0.1

Code (I filled the credentials before compiling, of coarse):

/*************************************************************

  You’ll need:
   - Blynk IoT app (download from App Store or Google Play)
   - ESP32 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            "YourAuthToken"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32_SSL.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 443);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8443);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

Have you tried rebooting your router?

Pete.

Yes, I just did. No effect. It looks like a problem with the certificate check to me.

I found a workaround in this post:

I was running ESP32 Board package version 2.0.2.
I reverted to version 2.0.1.
Now it works.

1 Like