earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
1.99k stars 433 forks source link

[Feature request] HTTPS support #628

Open rebane2001 opened 1 year ago

rebane2001 commented 1 year ago

At the moment this library can only play content from insecure HTTP sources, but it'd be awesome to see it play HTTPS as well since HTTPS-only sources are becoming more and more common.

I got HTTPS to work for myself by using WiFiClientSecure in AudioFileSourceHTTPStream.h and setting the right root ca (or you can do client.setInsecure()) in AudioFileSourceHTTPStream.cpp. I imagine this isn't the best way to go about things, hence the issue and not a PR, but it works great for me.

Perhaps it could also make sense to instead let the user provide their own WiFiClient along the lines of file = new AudioFileSourceHTTPStream(URL, client); so that the user can use their own WiFiClientSecure and root ca instead of delegating this to the audio library.

positron96 commented 10 months ago

Huh, so that's why I couldn't play https streams...