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 Oct 4, 2023
1 parent 8cb6d58 commit 25ebd7f
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions src/RadiusEndpointUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,38 @@ namespace OpenWifi {
AuthConfig.set("servers",ServerArray);
PoolEntry.set("authConfig", AuthConfig);
RadiusPools.add(PoolEntry);
} else if(Endpoint.Type=="radius") {
} else if(Endpoint.Type=="radsec") {
PoolEntry.set("radsecPoolType","generic");
auto Servers = OpenRoaming_GlobalReach()->GetServers();
for(const auto &Server:Servers) {

Poco::JSON::Object AuthConfig;
AuthConfig.set("methodParameters", Poco::JSON::Array() );
AuthConfig.set("monitor", false );
AuthConfig.set("monitorMethod", "none" );
AuthConfig.set("strategy","random");
Poco::JSON::Array ServerArray;
int i=1;
for(const auto &Server:Endpoint.RadsecServers) {
Poco::JSON::Object InnerServer;
InnerServer.set("allowSelfSigned", false);
InnerServer.set("ignore", false);
InnerServer.set("name", fmt::format("Server {}",i));
InnerServer.set("ip", Server.Hostname);
InnerServer.set("radsecPort", Server.Port);
InnerServer.set("radsecCert", Utils::base64encode((const u_char *)Server.Certificate.c_str(), Server.Certificate.size()));
InnerServer.set("radsecKey", Utils::base64encode((const u_char *)Server.PrivateKey.c_str(), Server.PrivateKey.size()));
Poco::JSON::Array CertArray;
for(const auto & cert : Server.CaCerts) {
CertArray.add(Utils::base64encode((const u_char *)cert.c_str(), cert.size()));
}
InnerServer.set("radsecCacerts", CertArray);
InnerServer.set("radsecSecret","radsec");
i++;
ServerArray.add(InnerServer);
}
} else if(Endpoint.Type=="radsec") {
PoolEntry.set("radsecPoolType", "radsec");
AuthConfig.set("servers",ServerArray);
PoolEntry.set("authConfig", AuthConfig);
RadiusPools.add(PoolEntry);
} else if(Endpoint.Type=="radius") {
PoolEntry.set("radsecPoolType", "radius");
for (const auto &Server: Endpoint.RadsecServers) {

}
Expand Down

0 comments on commit 25ebd7f

Please sign in to comment.