-
Notifications
You must be signed in to change notification settings - Fork 13.3k
can't load x509 certificates #2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Certificate should be in DER format. Could you please upload the one you have tried somewhere and post a link? |
Also, please enable debug output (Core+SSL) and add |
Thanks for the fast reply: WiFi connected Here is the zip with certs and the complete sketch |
I have checked with der format. if(espClient.loadCertificate(ca)) with
if (espClient.loadCACert(ca, ca.size())) with
|
Ah, this is a regression I think... Previously you were able to load certs before calling |
And downgraded version still doesn't handshake =/ |
I think this bug is caused in upgrade to axtls v2. 0.0, here: igrr/axtls-8266#19 |
Not exactly. The bug was added to WiFiClientSecure, axTLS is okay. |
Hi all... Just wondering if the bug already solved? I think I also encounter the same thing, I am able to load the file from FFS, however it is not able to load the certificate in WifiSecureClient. Thank you for the help.
OUTPUT: WiFi connected |
The WiFiClientSecure just create a SSLContext in https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp#L315 when you call _connectSSL. To load the certificates before connect, it should create a SSLContext in loadCACert or loadCertificate or loadPrivateKey.... and verify when called _connectSSL if it has already been created. |
PR #3271 has the fix for this issue. |
i am getting this error Success to open private cert file |
Hi @igrr Also what is difference in use setCACert and setCACert_P? |
xxd -i -a <filename>
…On Mon, Aug 27, 2018, 2:52 PM chegewara, ***@***.***> wrote:
Hi @igrr <https://github.com/igrr>
sorry for bothering with such trivial question, but how to convert pem or
der certificate to array like in this example:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/HTTPSRequestCACert/CACert.ino
Also what is difference in use setCACert and setCACert_P?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2470 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABSUGxqsGDWF4iLVAP52jMj23mVQIJl5ks5uVD_lgaJpZM4Jy2XN>
.
|
@chadouming thanks a lot |
What is difference in use setCACert and setCACert_P? |
Hello, I was having the same issue and finally solved it by using
|
in my arduino IDE at tools menu, there is no spiffs flash size to upload the skecth, is it the problem? //-----pzem define-----// #include <PubSubClient.h> const char* AWS_endpoint = "xxxxx-ats.iot.ap-southeast-1.amazonaws.com"; //MQTT broker ip void callback(char* topic, byte* payload, unsigned int length) { } WiFiClientSecure espClient; void setup() { espClient.setBufferSizes(512, 512); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { Serial.println(""); //Initialize File system // Load certificate file delay(1000); if (espClient.loadCertificate(cert)) // Load private key file delay(1000); if (espClient.loadPrivateKey(private_key)) // Load CA file delay(1000); if(espClient.loadCACert(ca)) Serial.print("Heap: "); Serial.println(ESP.getFreeHeap()); void loop() { //-----pzem-----//
delay(10); output |
@tianmanik
You also need to select FileSystem Size of your CHip in order to upload data to SPIFFS. Look at the following image for Flash Sizes: For more information kindly refer to the ESP8266 Filesystem Documentation at following link: |
Work fine for me, over a board ESP8266 : Wemos D1 R1 For this test, I use https://www.httpcs.com/fr/convertisseur-ssl to convert the AWS IoT Certificated to ".DER" file
|
Basic Infos
Hardware
Hardware: ESP-12
Core Version: git
Description
I am trying use a x509 certificate to connect with a TLS1.2 host, but in if(espClient.loadCertificate(ca)) I get Success to open ca file and not loaded
I have tried with PEM and DER formats
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: dio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
I am trying use a x509 certificate to connect with a TLS1.2 host, but in if(espClient.loadCertificate(ca)) I get Success to open ca file and not loaded
I have tried with PEM and DER formats
The text was updated successfully, but these errors were encountered: