diff --git a/src/AP_WS_Server.cpp b/src/AP_WS_Server.cpp index 169a3c12..e37511b8 100644 --- a/src/AP_WS_Server.cpp +++ b/src/AP_WS_Server.cpp @@ -795,4 +795,4 @@ namespace OpenWifi { return false; } -} // namespace OpenWifi \ No newline at end of file +} // namespace OpenWifi diff --git a/src/rttys/RTTYS_server.cpp b/src/rttys/RTTYS_server.cpp index e71d34b0..31f89ba5 100644 --- a/src/rttys/RTTYS_server.cpp +++ b/src/rttys/RTTYS_server.cpp @@ -14,6 +14,7 @@ #include "nlohmann/json.hpp" #include "Poco/NObserver.h" +#include #include "Poco/Net/SocketNotification.h" #include "Poco/Net/NetException.h" #include "Poco/Net/WebSocketImpl.h" @@ -71,6 +72,7 @@ namespace OpenWifi { const auto &RootCas = MicroServiceConfigPath("ucentral.websocket.host.0.rootca", ""); const auto &Cas = MicroServiceConfigPath("ucentral.websocket.host.0.cas", ""); + const auto &ClientCasFile = MicroServiceConfigPath("ucentral.websocket.host.0.clientcas", ""); Poco::Net::Context::Params P; @@ -86,6 +88,7 @@ namespace OpenWifi { Poco::Crypto::X509Certificate Cert(CertFileName); Poco::Crypto::X509Certificate Root(RootCaFileName); Poco::Crypto::X509Certificate Issuing(IssuerFileName); + std::vector ClientCasCerts; Poco::Crypto::RSAKey Key("", KeyFileName, KeyPassword); DeviceSecureContext->useCertificate(Cert); @@ -93,7 +96,11 @@ namespace OpenWifi { DeviceSecureContext->addCertificateAuthority(Root); DeviceSecureContext->addChainCertificate(Issuing); DeviceSecureContext->addCertificateAuthority(Issuing); - DeviceSecureContext->addCertificateAuthority(Root); + ClientCasCerts = Poco::Net::X509Certificate::readPEM(ClientCasFile); + for (const auto &cert : ClientCasCerts) { + DeviceSecureContext->addChainCertificate(cert); + DeviceSecureContext->addCertificateAuthority(cert); + } DeviceSecureContext->enableSessionCache(true); DeviceSecureContext->setSessionCacheSize(0); DeviceSecureContext->setSessionTimeout(120); @@ -1117,4 +1124,4 @@ namespace OpenWifi { RTTYS_EndPoint::~RTTYS_EndPoint() { } -} // namespace OpenWifi \ No newline at end of file +} // namespace OpenWifi