diff options
author | Jose <jose@zeroc.com> | 2016-11-24 21:31:26 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-11-24 21:31:26 +0100 |
commit | 64a9231b01a869bccd3585abeb9eec75d9697bcf (patch) | |
tree | 00b9d15949c5159dce8821339e458215570ff22a /cpp/src/IceSSL/WinRTEngine.cpp | |
parent | Port IceSSL/configuration test to UWP and fixes to UWP IceSSL implementation (diff) | |
download | ice-64a9231b01a869bccd3585abeb9eec75d9697bcf.tar.bz2 ice-64a9231b01a869bccd3585abeb9eec75d9697bcf.tar.xz ice-64a9231b01a869bccd3585abeb9eec75d9697bcf.zip |
UWP IceSSL implementation improvements
- Add support for IceSSL.CertFile
- Add support for IceSSL password prompt
Diffstat (limited to 'cpp/src/IceSSL/WinRTEngine.cpp')
-rwxr-xr-x | cpp/src/IceSSL/WinRTEngine.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cpp/src/IceSSL/WinRTEngine.cpp b/cpp/src/IceSSL/WinRTEngine.cpp index b2bbf069e34..b955c8ce4a1 100755 --- a/cpp/src/IceSSL/WinRTEngine.cpp +++ b/cpp/src/IceSSL/WinRTEngine.cpp @@ -52,8 +52,23 @@ WinRTEngine::initialize() // // Load client certificate // + const int passwordRetryMax = properties->getPropertyAsIntWithDefault("IceSSL.PasswordRetryMax", 3); + setPassword(properties->getProperty("IceSSL.Password")); + + string certFile = properties->getProperty("IceSSL.CertFile"); string findCert = properties->getProperty("IceSSL.FindCert"); - if(!findCert.empty()) + if(!certFile.empty()) + { + _certificate = make_shared<IceSSL::Certificate>(importPersonalCertificate( + certFile, + [this]() + { + return password(false); + }, + getPasswordPrompt != nullptr, + passwordRetryMax)); + } + else if(!findCert.empty()) { auto certs = findCertificates(properties->getPropertyWithDefault("IceSSL.CertStore", "My"), findCert); if(certs->Size == 0) |