help for esp8266 as an HTTPS-SSL page client
Posted: Thu Dec 17, 2020 6:17 pm
Greetings to all, I need help to send data to my website using php via the url:
pagina.com/lapagina.php?variable=data
the problem is that my website has SSL certification and there is no longer communication; I could make it work with fingerprint but this is renewed every 3 months which is not practical, I tried the examples of safe communication but I did not work any.
I leave the code I use with fingerprint.
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = ".......";
const char* password = "........";
String requestResult = "";
String requestResult1 = "";
void setup()
{
Serial.begin(115200);
delay(10);
// Conecta a la red wifi.
Serial.println();
Serial.print("Conectando con ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Conectado con WiFi.");
// Esta es tu IP
Serial.print("Esta es tu IP: ");
Serial.print(WiFi.localIP());
String completeURI = "https://www.pagina.com/lapagina.php?variable=data";
//send HTTP request
HTTPClient http;
http.begin(completeURI, "42dfb9904f978d2b9e7f41ec65032a910a91636a");
requestResult = http.GET();
requestResult1 = http.getString();
Serial.println(requestResult);
Serial.println(requestResult1);
}
void loop()
{
}
pagina.com/lapagina.php?variable=data
the problem is that my website has SSL certification and there is no longer communication; I could make it work with fingerprint but this is renewed every 3 months which is not practical, I tried the examples of safe communication but I did not work any.
I leave the code I use with fingerprint.
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = ".......";
const char* password = "........";
String requestResult = "";
String requestResult1 = "";
void setup()
{
Serial.begin(115200);
delay(10);
// Conecta a la red wifi.
Serial.println();
Serial.print("Conectando con ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Conectado con WiFi.");
// Esta es tu IP
Serial.print("Esta es tu IP: ");
Serial.print(WiFi.localIP());
String completeURI = "https://www.pagina.com/lapagina.php?variable=data";
//send HTTP request
HTTPClient http;
http.begin(completeURI, "42dfb9904f978d2b9e7f41ec65032a910a91636a");
requestResult = http.GET();
requestResult1 = http.getString();
Serial.println(requestResult);
Serial.println(requestResult1);
}
void loop()
{
}