• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

How to Connect ESP8266 to IFTTT with HTTPS using certificate?

Q&A Forum › How to Connect ESP8266 to IFTTT with HTTPS using certificate?
0 Vote Up Vote Down
William Lucid asked 5 years ago

Video :  #232 How to secure our devices using SSL (ESP8266, ESP32, Tutorial) by Andreas Spiess; was inspiration for my attempt at using IFTTT service Maker channel, webHooks to send Android SMS triggered by ESP8266.

Project compiles with no error.  Does not connect to host; with the message “Unable to connect TCP socket.”  Checked Norton firewall, port 443 is open in NF.  Using “Open Port Tool” to check if port is actually open; port shows closed.  Totally confused since web browser handles HTTPS requests okay.  I can trigger the webHook event from the webHooks documentation web page.  Xfinity is my ISP; “XFi” portal shows port 443 is correctly forwarded.

Exporting certicate/s is new to me.  Do you have anything on using HTTPS and Root Certificate/s?

 

Best Regards,

William

7 Answers
0 Vote Up Vote Down
William Lucid answered 5 years ago

Believe port 443 is closed until certificate is  validated.  This appears to be the case when using ESP32, “WiFiClientSecure.ino” example sketch; port opened allowing connection to server in the example sketch.  “Open Port Tool” web tool showed Port 443 was still closed; prior to running “WiFiClientSecure.ino sketch.  Then after running sketch; Port 443 OPT showed closed again…

Project uses IFTT, Maker channel with webhooks to send a SMS text; alerting that the sump pit water level is critcally high.

“https://maker.ifttt.com/trigger/HIGHWATER/with/key/mykey,”  “mykey” is my private key; this is the URL that triggers the SMS cellphone text.

If I export certificate for this URL it is valid only for one month; need a valid certificate for a longer time period, perhaps a year.

William

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Hello William, unfortunately that’s the problem with certificates… They will expire and you’ll have to update the ESP code with the new issued certificate. (that’s why I haven’t posted a tutorial on that subject, because I don’t think it will be a good option for a long term application).

My question is: do you really need HTTPS for that application? Encrypting your request is only useful, if you are afraid that someone can access your network (where your ESP is connected to) and potentially sniff all your requests. If your ESP is on a “safe” network, you can pretty much make HTTP requests to other services.

NOTE: the ESP32 has the WifiClientSecure library. So, if your ESP32 is the client, there’s no need for a certificate. A certificate is used to be sure that the client is connected to the right server. The certificate is recommended but not needed for the https connection itself.

You could use this next sketch to make HTTPS POST requests to IFTTT with your ESP32 (without certificate):

  • https://gist.github.com/RuiSantosdotme/911e9cf50c04d2922da25cb26edb20ec

For the ESP8266, you’ll need to use at least a fingerprint:

  • https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino

I hope that helps!

Rui

0 Vote Up Vote Down
William Lucid answered 5 years ago

Thank you Rui, that information from your answer will be of use.  I was able to find a longer lasting certificate (good until Sept 2037!.)  I created a short video of the process I used in exporting the certificate.  Sorry I did not narrate the video…

Retrieve and export Certificate for HTTPS

Reference: https://www.youtube.com/watch?v=Wm1xKj4bKsY
#232 How to secure our devices using SSL (ESP8266, ESP32, Tutorial)
Andreas Spiess   There is a link below  Mr. Spiess’s video for github; for ESP32.ESP8266 sketches and python modules to convert certificate format.

Thank you Rui.
William

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Thank you so much for sharing! That’s a great solution, we’ll definitely try to create a guide on HTTPS in a near future. 
Regards,
Rui Santos

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Thank you William for sharing this resource and I’m glad you found this great solution. I’ll definitely work on a future project using this concept.
Regards,
Rui

0 Vote Up Vote Down
William Lucid answered 5 years ago

Thank you Rui.

Detailed steps to obtain SSL Certificate.

William

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Thanks for sharing that document! It’s going to be very helpful 🙂

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.