Skip to content

Commit

Permalink
Update UWP hello demo SSL client configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Jan 11, 2017
1 parent 6b31e43 commit a2c84a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cpp/Ice/uwp/hello/client/MainPage.xaml.cpp
Expand Up @@ -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<void()> call, const shared_ptr<Ice::Connection>&)
{
Expand Down Expand Up @@ -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.");
});
Expand Down
8 changes: 2 additions & 6 deletions cpp/Ice/uwp/hello/client/README.md
Expand Up @@ -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

Expand All @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj
Expand Up @@ -177,6 +177,9 @@
<None Include="..\..\..\..\..\certs\cacert.der">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="..\..\..\..\..\certs\client.p12">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="client_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="README.md" />
Expand Down
1 change: 1 addition & 0 deletions cpp/Ice/uwp/hello/client/hello.client.uwp.vcxproj.filters
Expand Up @@ -120,6 +120,7 @@
<None Include="..\..\..\..\..\certs\cacert.der" />
<None Include="client_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="..\..\..\..\..\certs\client.p12" />
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml" />
Expand Down

0 comments on commit a2c84a3

Please sign in to comment.