Encrypted streams / TLS support (https)

I realized I can not add an encrypted stream to playlist, so if there is no different option (http stream) I have to use some different player.


Not tested:

Index: io_curl.c =================================================================== --- io_curl.c (revision 2961) +++ io_curl.c (working copy) @@ -258,6 +258,7 @@ void io_curl_open (struct io_stream *s, const char curl_easy_setopt (s->curl.handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt (s->curl.handle, CURLOPT_FAILONERROR, 1); curl_easy_setopt (s->curl.handle, CURLOPT_MAXREDIRS, 15); + curl_easy_setopt (s->curl.handle, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt (s->curl.handle, CURLOPT_HTTP200ALIASES, s->curl.http200_aliases); curl_easy_setopt (s->curl.handle, CURLOPT_HTTPHEADER,

There's still some sort of url validation happening

$ mocp -l https://example.com/stream FATAL_ERROR: No files added - no sound files on command line!

Or "Not a valid URL" if URL was added via curses GUI

And in playlist parser also

Maybe try:

Index: files.c =================================================================== --- files.c (revision 2961) +++ files.c (working copy) @@ -85,6 +85,7 @@ void files_cleanup () inline int is_url (const char *str) { return !strncasecmp (str, "http://", sizeof ("http://") - 1) + || !strncasecmp (str, "https://", sizeof ("https://") - 1) || !strncasecmp (str, "ftp://", sizeof ("ftp://") - 1); }

Yes, now it works. Strange thing it hasn't been done earlier, with such a simple patch.

I see ugly hack. :-)

Does it work without the first patch, though?

Yes, it does