summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorJakob Ovrum <>2019-01-19 17:36:14 +0100
committerJakob Ovrum <>2019-01-19 17:36:14 +0100
commit0cea67ee706d73acbd07a48e5d3b758ba016c1a8 (patch)
tree0cc41bb5ac232d8be06606cfc3350473c95d8de5 /src/output
parent1fa99da3c254a6a641bdf4eca35d781281c4c268 (diff)
shout output plugin: add support for TLS
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/ShoutOutputPlugin.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx
index df9df58e4..81ba5fe42 100644
--- a/src/output/plugins/ShoutOutputPlugin.cxx
+++ b/src/output/plugins/ShoutOutputPlugin.cxx
@@ -141,6 +141,25 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
protocol = SHOUT_PROTOCOL_HTTP;
}
+ unsigned tls;
+ value = block.GetBlockValue("tls");
+ if (value != nullptr) {
+ if (0 == strcmp(value, "disabled"))
+ tls = SHOUT_TLS_DISABLED;
+ else if(0 == strcmp(value, "auto"))
+ tls = SHOUT_TLS_AUTO;
+ else if(0 == strcmp(value, "auto_no_plain"))
+ tls = SHOUT_TLS_AUTO_NO_PLAIN;
+ else if(0 == strcmp(value, "rfc2818"))
+ tls = SHOUT_TLS_RFC2818;
+ else if(0 == strcmp(value, "rfc2817"))
+ tls = SHOUT_TLS_RFC2817;
+ else
+ throw FormatRuntimeError("invalid shout TLS option \"%s\"", value);
+ } else {
+ tls = SHOUT_TLS_DISABLED;
+ }
+
if (shout_set_host(shout_conn, host) != SHOUTERR_SUCCESS ||
shout_set_port(shout_conn, port) != SHOUTERR_SUCCESS ||
shout_set_password(shout_conn, passwd) != SHOUTERR_SUCCESS ||
@@ -151,6 +170,7 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
shout_set_format(shout_conn, shout_format)
!= SHOUTERR_SUCCESS ||
shout_set_protocol(shout_conn, protocol) != SHOUTERR_SUCCESS ||
+ shout_set_tls(shout_conn, tls) != SHOUTERR_SUCCESS ||
shout_set_agent(shout_conn, "MPD") != SHOUTERR_SUCCESS)
throw std::runtime_error(shout_get_error(shout_conn));