Compare commits

...

6 Commits

Author SHA1 Message Date
Ivan Chvets
3b7a24ea30 feat: Added reenroll to openapi.
Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2025-08-14 11:45:36 -04:00
Carsten Schafer
438309714f Merge pull request #418 from Telecominfraproject/WIFI-14953-add-entire-trust-chain-for-rtty
WIFI-14953 Add entire trust chain for rtty use
2025-08-06 11:00:04 -04:00
Carsten Schafer
a9130eeb75 Read from proper client cas file
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2025-08-06 09:13:04 -04:00
Carsten Schafer
33068fca9e Declare the variable
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2025-08-05 11:15:51 -04:00
Carsten Schafer
d329151f6c Fix typo
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2025-08-05 10:46:45 -04:00
Carsten Schafer
ec846006bb Add entire trust chain for rtty use
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2025-08-05 10:24:33 -04:00
3 changed files with 45 additions and 3 deletions

View File

@@ -1576,6 +1576,15 @@ components:
format: base64
description: This is a base64 encoded string of the certificate bundle (the current bundle .tar.gz file from the PKI portal)
ReenrollRequest:
type: object
properties:
serialNumber:
type: string
when:
type: integer
format: int64
PowerCycleRequest:
type: object
properties:
@@ -3056,6 +3065,32 @@ paths:
404:
$ref: '#/components/responses/NotFound'
/device/{serialNumber}/reenroll:
post:
tags:
- Commands
summary: Reenroll operational certificate for the device.
operationId: reenrollCertificate
parameters:
- in: path
name: serialNumber
schema:
type: string
required: true
requestBody:
description: Reenroll operational certificate for the device
content:
application/json:
schema:
$ref: '#/components/schemas/ReenrollRequest'
responses:
200:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/device/{serialNumber}/powercycle:
post:
tags:

View File

@@ -795,4 +795,4 @@ namespace OpenWifi {
return false;
}
} // namespace OpenWifi
} // namespace OpenWifi

View File

@@ -14,6 +14,7 @@
#include "nlohmann/json.hpp"
#include "Poco/NObserver.h"
#include <Poco/Net/Context.h>
#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<Poco::Crypto::X509Certificate> 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
} // namespace OpenWifi