Skip to content

Commit

Permalink
Drop support for old tntnet versions: SSL/TLS support is no more opti…
Browse files Browse the repository at this point in the history
…onal.

LIVE can be compiled only with versions of tntnet which support
SSL/TLS connections.
  • Loading branch information
Dieter Hametner committed Feb 10, 2015
1 parent 531e0e3 commit 6791ce3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
14 changes: 1 addition & 13 deletions setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ using namespace std;

Setup::Setup():
m_serverPort( 8008 ),
#if TNT_SSL_SUPPORT
m_serverSslPort( 8443 ),
m_serverSslCert(),
m_serverSslKey(),
#endif
m_lastChannel( 0 ),
m_screenshotInterval( 1000 ),
m_useAuth( 1 ),
Expand Down Expand Up @@ -62,11 +60,9 @@ bool Setup::ParseCommandLine( int argc, char* argv[] )
{ "ip", required_argument, NULL, 'i' },
{ "log", required_argument, NULL, 'l' },
{ "epgimages", required_argument, NULL, 'e' },
#if TNT_SSL_SUPPORT
{ "sslport", required_argument, NULL, 's' },
{ "cert", required_argument, NULL, 'c' },
{ "key", required_argument, NULL, 'k' },
#endif
{ 0 }
};

Expand All @@ -77,37 +73,31 @@ bool Setup::ParseCommandLine( int argc, char* argv[] )
case 'i': m_serverIps.push_back( optarg ); break;
case 'l': m_tntnetloglevel = optarg; break;
case 'e': m_epgimagedir = optarg; break;
#if TNT_SSL_SUPPORT
case 's': m_serverSslPort = atoi( optarg ); break;
case 'c': m_serverSslCert = optarg; break;
case 'k': m_serverSslKey = optarg; break;
#endif
default: return false;
}
}

return CheckServerPort() &&
#if TNT_SSL_SUPPORT
CheckServerSslPort() &&
#endif
CheckServerIps();
}

char const* Setup::CommandLineHelp() const
{
if ( m_helpString.empty() ) {
ostringstream builder;
builder << " -p PORT, --port=PORT use PORT to listen for incoming connections\n"
builder << " -p PORT, --port=PORT use PORT to listen for incoming connections\n"
" (default: " << m_serverPort << ")\n"
<< " -i IP, --ip=IP bind server only to specified IP, may appear\n"
" multiple times\n"
" (default: 0.0.0.0)\n"
#if TNT_SSL_SUPPORT
<< " -s PORT, --sslport=PORT use PORT to listen for incoming ssl connections\n"
" (default: " << m_serverSslPort << ")\n"
<< " -c CERT, --cert=CERT full path to a custom ssl certificate file\n"
<< " -k KEY, --key=KEY full path to a custom ssl certificate key file\n"
#endif
<< " -l level, --log=level log level for tntnet (values: WARN, ERROR, INFO, DEBUG, TRACE)\n"
<< " -e <dir>, --epgimages=<dir> directory for epgimages\n";
m_helpString = builder.str();
Expand Down Expand Up @@ -153,7 +143,6 @@ bool Setup::CheckServerPort()
return true;
}

#if TNT_SSL_SUPPORT
bool Setup::CheckServerSslPort()
{
if ( m_serverSslPort <= 0 || m_serverSslPort > numeric_limits< uint16_t >::max() ) {
Expand All @@ -163,7 +152,6 @@ bool Setup::CheckServerSslPort()
}
return true;
}
#endif

namespace {
struct IpValidator
Expand Down
6 changes: 0 additions & 6 deletions setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ class Setup

// commandline
int GetServerPort() const { return m_serverPort; }
#if TNT_SSL_SUPPORT
int GetServerSslPort() const { return m_serverSslPort; }
std::string GetServerSslCert() const { return m_serverSslCert; }
std::string GetServerSslKey() const { return m_serverSslKey; }
#endif
IpList const& GetServerIps() const { return m_serverIps; }
// vdr-setup
int GetLastChannel() const { return m_lastChannel == 0 ? std::numeric_limits< int >::max() : m_lastChannel; }
Expand Down Expand Up @@ -108,12 +106,10 @@ class Setup
mutable std::string m_helpString;
// commandline options
int m_serverPort;
#if TNT_SSL_SUPPORT
int m_serverSslPort;
std::string m_serverSslCert;
std::string m_serverSslKey;
static std::string m_configDirectory;
#endif
IpList m_serverIps;
std::string m_epgimagedir;

Expand Down Expand Up @@ -145,9 +141,7 @@ class Setup

bool CheckServerPort();
bool CheckServerIps();
#if TNT_SSL_SUPPORT
bool CheckServerSslPort();
#endif
};

Setup& LiveSetup();
Expand Down
2 changes: 0 additions & 2 deletions tntconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ namespace vdrlive {
}
}

#if TNT_SSL_SUPPORT
int s_port = LiveSetup().GetServerSslPort();
string s_cert = LiveSetup().GetServerSslCert();
string s_key = LiveSetup().GetServerSslKey();
Expand All @@ -253,7 +252,6 @@ namespace vdrlive {
else {
esyslog( "[live] ERROR: Unable to load cert/key (%s/%s): %s", s_cert.c_str(), s_key.c_str(), strerror( errno ) );
}
#endif // TNT_SSL_SUPPORT
}

TntConfig const& TntConfig::Get()
Expand Down
3 changes: 0 additions & 3 deletions tntfeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
// an other change in the structure of the version string was needed then only
// this file needs to be adapted.

// SSL-Support works from tntnet version 1.6.1 onwards.
#define TNT_SSL_SUPPORT (TNTVERSION >= 16100)

// Query params without boolean parameter
#define TNT_QUERYPARAMS_NO_BOOL (TNTVERSION >= 22000)

Expand Down

0 comments on commit 6791ce3

Please sign in to comment.