[Icecast-dev] icecast 2.3.2 generated buildm3u don't support authenticated streaming via https
Peter Bieringer
pb at bieringer.de
Wed Dec 23 03:55:16 PST 2009
Hi,
I've setup'ed an HTTPS only icecast streaming server with
authentication. After login to the stream, I still get an m3u file
containing the HTTP url, e.g.:
http://user:pass@icecast-server:8000/stream.ogg
Expected:
https://user:pass@icecast-server:8001/stream.ogg
Test:
$ curl --insecure
'https://icecast-server:8001/admin/buildm3u?username=user&password=pass&mount=%2Fstream.ogg'
http://user:pass@icecast-server:8000/stream.ogg
Looks like this is caused by too-much hardcoding in
icecast-2.3.2/src/admin.c:
static void command_buildm3u(client_t *client, const char *mount)
{
const char *username = NULL;
const char *password = NULL;
ice_config_t *config;
COMMAND_REQUIRE(client, "username", username);
COMMAND_REQUIRE(client, "password", password);
client->respcode = 200;
config = config_get_config();
snprintf (client->refbuf->data, PER_CLIENT_REFBUF_SIZE,
"HTTP/1.0 200 OK\r\n"
"Content-Type: audio/x-mpegurl\r\n"
"Content-Disposition = attachment; filename=listen.m3u\r\n\r\n"
"http://%s:%s@%s:%d%s\r\n",
username,
password,
config->hostname,
config->port,
mount
);
Looks like config->hostname, config->port and "http" should be retrieved
better from request instead from config.
I hope this can be extended easily.
BTW: vlc plays HTTPS streams without any problem, if the CA from the
server cert is stored at $HOME/.local/share/vlc/ssl/certs/ (Fedora 12)
and the URL is manually specified.
Regards,
Peter
More information about the Icecast-dev
mailing list