Skip to content

ESP32 SSL connection with error connect(): start_ssl_client: -1 #141

@maxdd

Description

@maxdd

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Use https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/blob/master/examples/SecureWrite/SecureWrite.ino
  2. Set client.setInsecure(true);
  3. Set an InfluxDB server with SSL connection

Expected behavior:
Serial should report Serial.print("Connected to InfluxDB: ");

Actual behavior:
Serial is reporting Serial.print("InfluxDB connection failed: ");

3.758 [D] Validating connection to https://192.168.1.23:8086/health
[V][HTTPClient.cpp:239] beginInternal(): url: https://192.168.1.23:8086/health
[D][HTTPClient.cpp:287] beginInternal(): host: 192.168.1.23 port: 8086 url: /health
[D][HTTPClient.cpp:573] sendRequest(): request type: 'GET' redirCount: 0

[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 277628
[E][WiFiClientSecure.cpp:127] connect(): start_ssl_client: -1
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[D][HTTPClient.cpp:1112] connect(): failed connect to 192.168.1.23:8086
[W][HTTPClient.cpp:1411] returnError(): error(-1): connection refused
3.815 [E] Error - connection refused
[D][HTTPClient.cpp:394] disconnect(): tcp is closed

connection refused

Specifications:

  • Library Version: last on github
  • InfluxDB Version: 2 (latest as of today)
  • Board/ESP chip: ESP32 DevKit C
  • Device Arduino SDK version: Platformio 3.1.0 bundle

What im noticing is that WiFiClientSecure::setInsecure() is not called which might lead start_ssl_client(...) to return -1 due to NULLs condition.

EDIT:
There seems to be an issue with INIT_MODE=setup and TLS certificates which is not starting up the influxdb server.
This could be the reason why i'm getting the error above.
I'll check in few days to report any update

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions