From a2c84a3308ae96f06b4eea0831915f366f4b05a3 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 11 Jan 2017 17:44:59 +0100 Subject: [PATCH] Update UWP hello demo SSL client configuration --- cpp/Ice/uwp/hello/client/MainPage.xaml.cpp | 5 ++++- cpp/Ice/uwp/hello/client/README.md | 8 ++------ cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj | 3 +++ cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cpp/Ice/uwp/hello/client/MainPage.xaml.cpp b/cpp/Ice/uwp/hello/client/MainPage.xaml.cpp index a5045b71f..a1c2b7777 100644 --- a/cpp/Ice/uwp/hello/client/MainPage.xaml.cpp +++ b/cpp/Ice/uwp/hello/client/MainPage.xaml.cpp @@ -26,10 +26,13 @@ using namespace Windows::UI::Xaml::Navigation; MainPage::MainPage() { InitializeComponent(); + Ice::registerIceSSL(); mode->SelectedIndex = 0; Ice::InitializationData id; id.properties = Ice::createProperties(); id.properties->setProperty("Ice.Plugin.IceDiscovery", "1"); // Enable the IceDiscovery plugin + id.properties->setProperty("IceSSL.CertFile", "ms-appx:///client.p12"); + id.properties->setProperty("IceSSL.Password", "password"); id.dispatcher = [=](function call, const shared_ptr&) { @@ -334,7 +337,7 @@ void hello::MainPage::flush_Click(Platform::Object^ sender, Windows::UI::Xaml::R print(os.str()); } }, - [=](bool) + [=](bool) { print("Flushed batch requests."); }); diff --git a/cpp/Ice/uwp/hello/client/README.md b/cpp/Ice/uwp/hello/client/README.md index f453bc13a..b4e7ba0de 100644 --- a/cpp/Ice/uwp/hello/client/README.md +++ b/cpp/Ice/uwp/hello/client/README.md @@ -5,7 +5,8 @@ works with the UWP hello server as well as the Ice/hello servers provided by other language mappings, such as C++, C#, Java and Python. Note that if you use the UWP server, this server cannot run on same machine as -the client due to UWP restrictions. +the client due to UWP restrictions, SSL secure connections are also not supported +with UWP servers. ## Running the demo @@ -16,11 +17,6 @@ or right click on the project and select `Debug -> Start new instance`. ### SSL -The Ice ssl transport for UWP currently does not support client-side -authentication. In order to successfully connect with SSL, you need to edit -the hello server configuration file (`config.server`) and uncomment the -`IceSSL.VerifyPeer=0` property. - If you run the hello client and server on different computers or devices, you also need to regenerate the server certificate to ensure the certificate common name is set to the address used by the client to connect to the server. diff --git a/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj b/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj index 6f1feb901..577d9a850 100644 --- a/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj +++ b/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj @@ -177,6 +177,9 @@ true + + true + diff --git a/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters b/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters index c102d8b7c..96ccf7e53 100644 --- a/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters +++ b/cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters @@ -120,6 +120,7 @@ +