Retrieving data over HTTPS (M5 Paper, but I think this is a generic question)



  • I'm sure this is basic but it's driving me crazy. I can retrieve data over wifi from an "http:" source with no problem. But I can't figure out how to access a URL over https.

    All the examples I can find online - for Arduino, ESp32, or M5 - seem to use http: URLs in their demos. I've found references to WifiClientSecure, but not a usable example. Evidently simply substituting it for WifiClient is not sufficient!

    The canvas.drawJpgUrl function works with an "https:" URL, so clearly there is no fundamental difficulty.

    Googling led me to this excellent library "Fetch": but alas the examples don't compile, a problem others have noted.

    Probably part of the problem is the number of different libraries with similar or even identical names, and different versions of the same library.

    Please can someone recommend the current best (or at least good!) library to use, and point me at a working example?

    Thanks in advance!



  • (I should add - as a temporary workaround I can access an https: resource by calling client.setInsecure(); but I'm looking for a proper solution.)



  • Hello @Hamnet

    the 'Fetch' library doesn't compile for me either. But I found this example from in the official Espressif github repository which compiles and runs fine.

    Thanks
    Felix



  • @felmue from what I have found, there seams to be an issue with https:// based access in Micropython and Arduino. Without knowing more I would guess it is to do with Certificates and security keys.



  • @felmue Thanks Felix, that got me over the hump! I think the issue was trying to convert my existing example directly.



  • This post is deleted!