Skip to content

Can't specify CA Certificate with WifiClientSecure #210

Closed
@bkgoodman

Description

@bkgoodman

I am following the Arduino (ESP32) WiFiClientSecure example code - and trying to connect while specifying a CA Certificate, such as:

client.connect(server, 443, test_ca_cert, test_client_cert, test_client_key)

(test_client_cert and test_client_key are NULL pointers). If test_ca_cert is a NULL pointer, the SSL connection is fine.

If I try to specify my own test_ca_cert, I always get:

CA cert: mbedtls_x509_crt_parse returned -0x2180 (which is an error code for "invalid format")

I have tried a multitude of things for the test_ca_cert such as a string with the PEM formatted cleartext (base64 encoded?) certificate, and a raw byte array of the DER certificate. Nothing seems to work.

Is this broken? Has it ever worked? (or been tested) There are no documented examples (that I could find).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions