From 79c19c0c62f58ff013cb2f97d45d772fe66fcbf0 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Wed, 14 Jul 2021 07:17:25 -0700 Subject: [PATCH] Fixing API calls --- src/MicroService.cpp | 3 ++- src/SubSystemServer.cpp | 4 ++-- ucentralfms.properties | 1 + ucentralfms.properties.aws | 2 +- ucentralfms.properties.priv | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/MicroService.cpp b/src/MicroService.cpp index cbf7716..5e411b4 100644 --- a/src/MicroService.cpp +++ b/src/MicroService.cpp @@ -187,7 +187,8 @@ namespace uCentral { } } std::string KeyFile = ConfigPath("ucentral.service.key"); - AppKey_ = Poco::SharedPtr(new Poco::Crypto::RSAKey("", KeyFile, "")); + std::string KeyFilePassword = ConfigPath("ucentral.service.key.password" , "" ); + AppKey_ = Poco::SharedPtr(new Poco::Crypto::RSAKey("", KeyFile, KeyFilePassword)); Cipher_ = CipherFactory_.createCipher(*AppKey_); ID_ = Utils::GetSystemId(); if(!DebugMode_) diff --git a/src/SubSystemServer.cpp b/src/SubSystemServer.cpp index dfee0d4..68f783d 100644 --- a/src/SubSystemServer.cpp +++ b/src/SubSystemServer.cpp @@ -117,7 +117,7 @@ Poco::Net::SecureServerSocket PropertiesFileServerEntry::CreateSecureSocket(Poco auto Context = Poco::AutoPtr(new Poco::Net::Context(Poco::Net::Context::TLS_SERVER_USE, P)); if(!key_file_password_.empty()) { - auto PassphraseHandler = Poco::SharedPtr( new MyPrivateKeyPassphraseHandler(KeyFilePassword(),L)); + auto PassphraseHandler = Poco::SharedPtr( new MyPrivateKeyPassphraseHandler(key_file_password_,L)); Poco::Net::SSLManager::instance().initializeServer(PassphraseHandler, nullptr,Context); } @@ -142,7 +142,7 @@ Poco::Net::SecureServerSocket PropertiesFileServerEntry::CreateSecureSocket(Poco Context->addCertificateAuthority(Issuing); } - Poco::Crypto::RSAKey Key("", key_file_, ""); + Poco::Crypto::RSAKey Key("", key_file_, key_file_password_); Context->usePrivateKey(Key); SSL_CTX *SSLCtx = Context->sslContext(); diff --git a/ucentralfms.properties b/ucentralfms.properties index 07c09c9..c951db0 100644 --- a/ucentralfms.properties +++ b/ucentralfms.properties @@ -28,6 +28,7 @@ ucentral.internal.restapi.host.0.key.password = mypassword # Generic section that all microservices must have # ucentral.service.key = $UCENTRALFMS_ROOT/certs/restapi-key.pem +ucentral.service.key.password = mypassword ucentral.system.data = $UCENTRALFMS_ROOT/data ucentral.system.debug = false ucentral.system.uri.private = https://localhost:17004 diff --git a/ucentralfms.properties.aws b/ucentralfms.properties.aws index dce3735..3988022 100644 --- a/ucentralfms.properties.aws +++ b/ucentralfms.properties.aws @@ -28,6 +28,7 @@ ucentral.internal.restapi.host.0.key.password = mypassword # Generic section that all microservices must have # ucentral.service.key = $UCENTRALFMS_ROOT/certs/restapi-key.pem +ucentral.service.key.password = mypassword ucentral.system.data = $UCENTRALFMS_ROOT/data ucentral.system.debug = false ucentral.system.uri.private = https://localhost:17004 @@ -45,7 +46,6 @@ s3.secret = ****************************************** s3.key = *************************** s3.retry = 60 s3.bucket.uri = ucentral-ap-firmware.s3.amazonaws.com -manifestnotification.key = 61a50cb02a1fa4af5e89e8d556629e91bc2274b7e8bb8eaf4339e8c18d5931d4 ############################# # Generic information for all micro services diff --git a/ucentralfms.properties.priv b/ucentralfms.properties.priv index 2dcf748..8dcb256 100644 --- a/ucentralfms.properties.priv +++ b/ucentralfms.properties.priv @@ -28,6 +28,7 @@ ucentral.internal.restapi.host.0.key.password = mypassword # Generic section that all microservices must have # ucentral.service.key = $UCENTRALFMS_ROOT/certs/restapi-key.pem +ucentral.service.key.password = mypassword ucentral.system.data = $UCENTRALFMS_ROOT/data ucentral.system.debug = false ucentral.system.uri.private = https://localhost:17004