Skip to content

Commit d1ea95f

Browse files
committed
Fix: Updated default config and parsing to reflect existance of <tls-context>
1 parent 42a9d82 commit d1ea95f

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

conf/icecast.xml.in

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,6 @@
282282
the status page
283283
-->
284284
<alias source="/" destination="/status.xsl"/>
285-
<!-- The certificate file needs to contain both public and private part.
286-
Both should be PEM encoded.
287-
<tls-certificate>@pkgdatadir@/icecast.pem</tls-certificate>
288-
-->
289285
</paths>
290286

291287
<logging>
@@ -311,6 +307,17 @@
311307
</changeowner>
312308
-->
313309

310+
<tls-context>
311+
<!-- The certificate file containng public and optionally private key.
312+
Must be PEM encoded.
313+
<tls-certificate>@pkgdatadir@/icecast.pem</tls-certificate>
314+
-->
315+
<!-- The private key if not contained in <tls-certificate>.
316+
Must be PEM encoded.
317+
<tls-key>@pkgdatadir@/icecast.key</tls-key>
318+
-->
319+
</tls-context>
320+
314321
<!-- It is generally helpful to set a PRNG seed, what seed to set depends on your OS. -->
315322
<!-- Useful on all operating systems is a seed file for Icecast to update.
316323
This should be at some location that is (semi-)permanent such as /var/lib or /var/cache

src/cfgfile.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,8 +2625,12 @@ static void _parse_paths(xmlDocPtr doc,
26252625
configuration->allowfile = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
26262626
} else if (xmlStrcmp(node->name, XMLSTR("tls-certificate")) == 0 ||
26272627
xmlStrcmp(node->name, XMLSTR("ssl-certificate")) == 0) {
2628+
2629+
__found_bad_tag(configuration, node, BTR_OBSOLETE, "Use a <tls-certificate> in <tls-context>.");
2630+
26282631
if (__check_node_impl(node, "generic") != 0) {
26292632
ICECAST_LOG_WARN("Node %s uses unsupported implementation.", node->name);
2633+
__found_bad_tag(configuration, node, BTR_INVALID, NULL);
26302634
continue;
26312635
}
26322636

@@ -2635,8 +2639,12 @@ static void _parse_paths(xmlDocPtr doc,
26352639
configuration->tls_context.cert_file = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
26362640
} else if (xmlStrcmp(node->name, XMLSTR("tls-allowed-ciphers")) == 0 ||
26372641
xmlStrcmp(node->name, XMLSTR("ssl-allowed-ciphers")) == 0) {
2642+
2643+
__found_bad_tag(configuration, node, BTR_OBSOLETE, "Use a <tls-allowed-cipherse> in <tls-context>.");
2644+
26382645
if (__check_node_impl(node, "openssl") != 0) {
26392646
ICECAST_LOG_WARN("Node %s uses unsupported implementation.", node->name);
2647+
__found_bad_tag(configuration, node, BTR_INVALID, NULL);
26402648
continue;
26412649
}
26422650

@@ -2785,6 +2793,7 @@ static void _parse_tls_context(xmlDocPtr doc,
27852793
if (xmlStrcmp(node->name, XMLSTR("tls-certificate")) == 0) {
27862794
if (__check_node_impl(node, "generic") != 0) {
27872795
ICECAST_LOG_WARN("Node %s uses unsupported implementation.", node->name);
2796+
__found_bad_tag(configuration, node, BTR_INVALID, NULL);
27882797
continue;
27892798
}
27902799

@@ -2794,6 +2803,7 @@ static void _parse_tls_context(xmlDocPtr doc,
27942803
} else if (xmlStrcmp(node->name, XMLSTR("tls-key")) == 0) {
27952804
if (__check_node_impl(node, "generic") != 0) {
27962805
ICECAST_LOG_WARN("Node %s uses unsupported implementation.", node->name);
2806+
__found_bad_tag(configuration, node, BTR_INVALID, NULL);
27972807
continue;
27982808
}
27992809

@@ -2803,6 +2813,7 @@ static void _parse_tls_context(xmlDocPtr doc,
28032813
} else if (xmlStrcmp(node->name, XMLSTR("tls-allowed-ciphers")) == 0) {
28042814
if (__check_node_impl(node, "openssl") != 0) {
28052815
ICECAST_LOG_WARN("Node %s uses unsupported implementation.", node->name);
2816+
__found_bad_tag(configuration, node, BTR_INVALID, NULL);
28062817
continue;
28072818
}
28082819

0 commit comments

Comments
 (0)