Fixing API calls

This commit is contained in:
stephb9959
2021-07-14 07:17:25 -07:00
parent f82fdabc5c
commit 79c19c0c62
5 changed files with 7 additions and 4 deletions

View File

@@ -187,7 +187,8 @@ namespace uCentral {
}
}
std::string KeyFile = ConfigPath("ucentral.service.key");
AppKey_ = Poco::SharedPtr<Poco::Crypto::RSAKey>(new Poco::Crypto::RSAKey("", KeyFile, ""));
std::string KeyFilePassword = ConfigPath("ucentral.service.key.password" , "" );
AppKey_ = Poco::SharedPtr<Poco::Crypto::RSAKey>(new Poco::Crypto::RSAKey("", KeyFile, KeyFilePassword));
Cipher_ = CipherFactory_.createCipher(*AppKey_);
ID_ = Utils::GetSystemId();
if(!DebugMode_)

View File

@@ -117,7 +117,7 @@ Poco::Net::SecureServerSocket PropertiesFileServerEntry::CreateSecureSocket(Poco
auto Context = Poco::AutoPtr<Poco::Net::Context>(new Poco::Net::Context(Poco::Net::Context::TLS_SERVER_USE, P));
if(!key_file_password_.empty()) {
auto PassphraseHandler = Poco::SharedPtr<MyPrivateKeyPassphraseHandler>( new MyPrivateKeyPassphraseHandler(KeyFilePassword(),L));
auto PassphraseHandler = Poco::SharedPtr<MyPrivateKeyPassphraseHandler>( 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();

View File

@@ -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

View File

@@ -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

View File

@@ -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