diff options
author | chriszero <zerov83@gmail.com> | 2015-12-15 22:15:35 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-12-15 22:15:35 +0100 |
commit | 7b64bf5062f3eb6ddff5d7606e44367bd5077e4c (patch) | |
tree | 258cbbc0d4edbe3bcabf58c6dee495d19384ed14 /plex.cpp | |
parent | 135ed5d0ce1613f70f4b2ddcb9e8bca721ffca9e (diff) | |
download | vdr-plugin-plex-7b64bf5062f3eb6ddff5d7606e44367bd5077e4c.tar.gz vdr-plugin-plex-7b64bf5062f3eb6ddff5d7606e44367bd5077e4c.tar.bz2 |
Added SSL support, started support for remote
resources (servers). Browsing remote servers is
working. plex.tv login is mandatory.
Diffstat (limited to 'plex.cpp')
-rw-r--r-- | plex.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -7,6 +7,11 @@ #include "services.h" #include <libskindesignerapi/skindesignerapi.h> +#include <Poco/Net/SSLManager.h> +#include <Poco/SharedPtr.h> +#include <Poco/Net/Context.h> +#include <Poco/Net/AcceptCertificateHandler.h> +#include <Poco/Net/ConsoleCertificateHandler.h> ////////////////////////////////////////////////////////////////////////////// // cPlugin @@ -98,12 +103,31 @@ bool cMyPlugin::Start(void) */ bool cMyPlugin::Initialize(void) { + // Initialize SSL + { + using namespace Poco; + using namespace Poco::Net; + using Poco::Net::SSLManager; + using Poco::Net::Context; + using Poco::Net::AcceptCertificateHandler; + using Poco::Net::PrivateKeyPassphraseHandler; + using Poco::Net::InvalidCertificateHandler; + using Poco::Net::ConsoleCertificateHandler; + + //SharedPtr<PrivateKeyPassphraseHandler> pConsoleHandler = new PrivateKeyPassphraseHandler; + SharedPtr<InvalidCertificateHandler> pInvalidCertHandler = new AcceptCertificateHandler(false); + Context::Ptr pContext = new Poco::Net::Context( + Context::CLIENT_USE, "", "", "", Context::VERIFY_NONE, // VERIFY_NONE...?! + 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); + SSLManager::instance().initializeClient(NULL, pInvalidCertHandler, pContext); + } // First Startup? Save UUID SetupStore("UUID", Config::GetInstance().GetUUID().c_str()); plexclient::plexgdm::GetInstance().clientDetails(Config::GetInstance().GetUUID(), Config::GetInstance().GetHostname(), "3200", DESCRIPTION, VERSION); plexclient::plexgdm::GetInstance().Start(); plexclient::ControlServer::GetInstance().Start(); + plexclient::Plexservice::UpdateResources(); cPictureCache::GetInstance().Start(); return true; |