mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-02 19:57:49 +00:00
Compare commits
6 Commits
bug-WIFI-1
...
add_enroll
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b7a24ea30 | ||
|
|
438309714f | ||
|
|
a9130eeb75 | ||
|
|
33068fca9e | ||
|
|
d329151f6c | ||
|
|
ec846006bb |
@@ -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:
|
||||
|
||||
@@ -795,4 +795,4 @@ namespace OpenWifi {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace OpenWifi
|
||||
} // namespace OpenWifi
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user