How to connect to an ssl server using the sntp protocol on ESP8266?

Wootenhuber361
Posts: 1
Joined: Sat Jan 16, 2021 9:21 pm

How to connect to an ssl server using the sntp protocol on ESP8266?

Postby Wootenhuber361 » Sat Jan 16, 2021 9:28 pm

I use an ESP8266 with a C-language esp-open-sdk.
In order to get the timestamp, I have tried to use this code, but it always fails – I only get 0:
the timezone(2);
Name(0, 'fr.pool.ntp.org') of sntp- setserver();
sntp datum();
timer = sntp get time timetranscription();
os printf("time : percent d and percent s\n"timestyle, sntp get real time(timestyle));
I try to connect to a Server to make a https request, as you might have understand, (I'm using the functions espconn secure_***) but it's not working every time.
It may be due to the time (the certificate cannot be genuine.

Post BY: Assignment Help

Her Mary
Posts: 486
Joined: Mon Oct 27, 2014 11:09 am

Re: How to connect to an ssl server using the sntp protocol on ESP8266?

Postby Her Mary » Tue Jan 19, 2021 10:16 am


ChrisGreenwalty
Posts: 1
Joined: Fri Feb 12, 2021 2:26 pm
Contact:

Re: How to connect to an ssl server using the sntp protocol on ESP8266?

Postby ChrisGreenwalty » Fri Feb 12, 2021 2:30 pm

You need to mlaunch openssl then you need to enter the following command

Code: Select all

genrsa -out key.txt 1024
rsa -in key.txt -out key.txt
req -sha256 -new -nodes -key key.txt -out cert.csr -subj '/C=RO/ST=B/L=Bucharest/O=OneTransistor [RO]/OU=OneTransistor/CN=esp8266.local' -addext subjectAltName=DNS:esp8266.local
x509 -req -sha256 -days 365 -in cert.csr -signkey key.txt -out cert.txt


I hope that this will resolve your problem.

By: assignment help

Who is online

Users browsing this forum: No registered users and 4 guests