ESP8266 (Nodemcu) and MQTT secured port (8883)

Hello! I am trying to connect esp8266 with MQTT secured connection (port 8883). But the problem is I am unable to find the certificates which needed to be uploaded in programing. for example .der and.ca file. From where I downloaded these certificates.

Wich kind of SO are you using?
You can use OpenSSL for example with a command like this:

openssl s_client -showcerts -servername www.example.com -connect www.example.com:443

// Set client certificate
if (wifiClient.loadCertificate(cert))
Serial.println("cert loaded");
else
Serial.println("cert not loaded");

// Load client private key file from SPIFFS
File private_key = SPIFFS.open("/dem_ca.cer", "r"); //replace espkey.der with your uploaded file name
if (!private_key) {
Serial.println("Failed to open private cert file");
}
else
Serial.println("Success to open private cert file");

delay(1000);

// Set client private key
if (wifiClient.loadPrivateKey(private_key))
Serial.println("private key loaded");
else
Serial.println("private key not loaded");

// Load CA file from SPIFFS
File ca = SPIFFS.open("/ca.der", "r"); //replace ca.der with your uploaded file name
if (!ca) {
Serial.println("Failed to open ca ");
}
else
Serial.println("Success to open ca");
delay(1000);

I am talking about these certificates

You can save certificate of websites directly with browser both in binary and base64 format.
But, if you open base64 files with a text editor you will see exactly the output like with openssl command (useful for example if service has no webserver interface).

From where to download or copy the text in certificate as I am unable to copy from image.

Thos image is just from a "random" website, I don't know wich server are you trying to connect.

Fo how-to download with a browser, watch this video https://www.youtube.com/watch?v=p52bppYEguE

I am trying to connect with MQTT server. For that I needed certificates

There are dozens of public MQTT servers, not to mention that it could be one you have installed on your local network.

If you don't specify which server, what can we know about it?

I am using amazon "active Mq server". If you know their certificates kindly share

Amazon provides the certificates.

No amazon doesn't provide certificates

I got my certificates from Amazon when I used AWS. Where else would I get them from?

Consider, would Google be generating Amazon security certificates?

Will you please read documentation on how to set up the MQ service?

Consider these words:

And these words:

What are AWS Credentials?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.