Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-7831
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Sep 15, 2023
1 parent 904d034 commit 98db7f1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/RADSEC_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace OpenWifi {
inline void run() final {
Poco::Thread::trySleep(5000);
std::uint64_t LastStatus = 0;
auto RadSecKeepAlive = MicroServiceConfigGetInt("radsec.keepalive", 10000000000);
auto RadSecKeepAlive = 10 ; // MicroServiceConfigGetInt("radsec.keepalive", 10000000000);
while (TryAgain_) {
if (!Connected_) {
LastStatus = Utils::Now();
Expand Down Expand Up @@ -205,11 +205,9 @@ namespace OpenWifi {
"cZqmBNVNN3DBjIb4anug7F+FnYOQF36ua6MLBeGn3aKxvu1aO+hjPg==\n"
"-----END CERTIFICATE-----\n"};

DBGLINE
std::ofstream ofs{OpenRoamingRootCertFile_.path().c_str(),std::ios_base::trunc|std::ios_base::out|std::ios_base::binary};
ofs << OpenRoamingRootCert;
ofs.close();
DBGLINE

/* system(fmt::format("cat {} >{}", CertFile_.path(), Combined.path()).c_str());
system(fmt::format("echo \"\n\" >> {}",Combined.path()).c_str());
Expand All @@ -223,34 +221,29 @@ namespace OpenWifi {
Poco::AutoPtr<Poco::Net::Context>(new Poco::Net::Context(
Poco::Net::Context::TLS_CLIENT_USE, ""));

DBGLINE
if (Server_.allowSelfSigned) {
SecureContext->setSecurityLevel(Poco::Net::Context::SECURITY_LEVEL_NONE);
SecureContext->enableExtendedCertificateVerification(false);
}

DBGLINE
// Poco::Crypto::X509Certificate OpenRoamingRootCertX509(OpenRoamingRootCertFile_.path());
// SecureContext->addCertificateAuthority(OpenRoamingRootCertX509);

DBGLINE

/* for (const auto &ca : CaCertFiles_) {
Poco::Crypto::X509Certificate cert(ca->path());
SecureContext->addChainCertificate(cert);
}
*/

DBGLINE
SecureContext->usePrivateKey(Poco::Crypto::RSAKey("",KeyFile_.path(),""));
SecureContext->useCertificate(Poco::Crypto::X509Certificate(CertFile_.path()));
SecureContext->addCertificateAuthority(Poco::Crypto::X509Certificate(OpenRoamingRootCertFile_.path()));
SecureContext->addChainCertificate(Poco::Crypto::X509Certificate(Intermediate0.path()));
SecureContext->addChainCertificate(Poco::Crypto::X509Certificate(Intermediate1.path()));
SecureContext->enableExtendedCertificateVerification(false);
SecureContext->setSessionCacheSize(0);

Socket_ = std::make_unique<Poco::Net::SecureStreamSocket>(SecureContext);
DBGLINE

Poco::Net::SocketAddress Destination(Server_.ip, Server_.port);

Expand Down

0 comments on commit 98db7f1

Please sign in to comment.