ESP32 Secure connection failed

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:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
//_, /////_
__/ v1.0.1 on ESP32

[2675] Connecting to
[2896] Secure connection failed
[7676] Connecting to
[7876] Secure connection failed
[12677] Connecting to
[12880] Secure connection failed

• Hardware model + communication type: ESP32 via WiFi
• Smartphone OS: Android
• Blynk server:
• 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

// 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

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

void loop()
  // 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?


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