Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDS: fix Application unregistration in SQL DB for Winforms Server & fix private key storage in Pull Model GDS Client #598

Merged
8 changes: 4 additions & 4 deletions ComIOP/Common/UA COM Interop Library.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -265,13 +265,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions ComIOP/Wrapper/ServerWrapper/UA COM Server Wrapper.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -140,7 +140,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions Samples/Client.Net4/UA Sample Client.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -138,7 +138,7 @@
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Bindings.Https">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Client/Opc.Ua.SampleClient.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -189,4 +189,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
8 changes: 4 additions & 4 deletions Samples/ClientControls.Net4/UA Client Controls.csproj
Expand Up @@ -1015,16 +1015,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions Samples/ClientControls/Opc.Ua.Client.Controls.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -290,4 +290,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
4 changes: 2 additions & 2 deletions Samples/Controls.Net4/UA Sample Controls.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -708,7 +708,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
22 changes: 8 additions & 14 deletions Samples/GDS/Client/Controls/ApplicationCertificateControl.cs
Expand Up @@ -93,8 +93,7 @@ public ApplicationCertificateControl()
}
else if (!String.IsNullOrEmpty(application.CertificateStorePath))
{
CertificateIdentifier id = new CertificateIdentifier
{
CertificateIdentifier id = new CertificateIdentifier {
StorePath = application.CertificateStorePath
};
id.StoreType = CertificateStoreIdentifier.DetermineStoreType(id.StorePath);
Expand Down Expand Up @@ -125,8 +124,7 @@ public ApplicationCertificateControl()
{
Uri url = new Uri(disoveryUrl);

CertificateIdentifier id = new CertificateIdentifier()
{
CertificateIdentifier id = new CertificateIdentifier() {
StoreType = CertificateStoreType.X509Store,
StorePath = "CurrentUser\\UA_MachineDefault",
SubjectName = "CN=" + url.DnsSafeHost
Expand Down Expand Up @@ -216,11 +214,10 @@ private async Task RequestNewCertificatePullMode(object sender, EventArgs e)
NodeId requestId = null;
if (!string.IsNullOrEmpty(m_application.CertificateStorePath))
{
CertificateIdentifier id = new CertificateIdentifier
{
CertificateIdentifier id = new CertificateIdentifier {
StoreType = CertificateStoreIdentifier.DetermineStoreType(m_application.CertificateStorePath),
StorePath = m_application.CertificateStorePath,
SubjectName = m_application.CertificateSubjectName.Replace("localhost", Utils.GetHostName())
SubjectName = Utils.ReplaceDCLocalhost(m_application.CertificateSubjectName)
};
m_certificate = await id.Find(true);
if (m_certificate != null &&
Expand All @@ -245,7 +242,7 @@ private async Task RequestNewCertificatePullMode(object sender, EventArgs e)
m_application.ApplicationId,
NodeId.Null,
NodeId.Null,
m_application.CertificateSubjectName.Replace("localhost", Utils.GetHostName()),
Utils.ReplaceDCLocalhost(m_application.CertificateSubjectName),
domainNames,
"PFX",
m_certificatePassword);
Expand Down Expand Up @@ -316,15 +313,14 @@ private async void CertificateRequestTimer_Tick(object sender, EventArgs e)

if (!String.IsNullOrEmpty(m_application.CertificateStorePath) && !String.IsNullOrEmpty(m_application.CertificateSubjectName))
{
CertificateIdentifier cid = new CertificateIdentifier()
{
CertificateIdentifier cid = new CertificateIdentifier() {
StorePath = m_application.CertificateStorePath,
StoreType = CertificateStoreIdentifier.DetermineStoreType(m_application.CertificateStorePath),
SubjectName = m_application.CertificateSubjectName.Replace("localhost", Utils.GetHostName())
SubjectName = Utils.ReplaceDCLocalhost(m_application.CertificateSubjectName)
};

// update store
using (var store = CertificateStoreIdentifier.OpenStore(m_application.CertificateStorePath))
using (ICertificateStore store = CertificateStoreIdentifier.OpenStore(m_application.CertificateStorePath, false))
{
// if we used a CSR, we already have a private key and therefore didn't request one from the GDS
// in this case, privateKey is null
Expand All @@ -347,8 +343,6 @@ private async void CertificateRequestTimer_Tick(object sender, EventArgs e)
newCert = new X509Certificate2(privateKeyPFX, string.Empty, X509KeyStorageFlags.Exportable);
newCert = CertificateFactory.Load(newCert, true);
}

// bugbug: private key is not saved to store
await store.Add(newCert);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Samples/GDS/Client/GlobalDiscoveryClient.csproj
Expand Up @@ -139,10 +139,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Client.Common">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
Expand Down
Expand Up @@ -217,10 +217,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Client.Common">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/GDS/ConsoleServer/NetCoreGlobalDiscoveryServer.csproj
Expand Up @@ -14,8 +14,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common" Version="1.5.374.27" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.27" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.36" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions Samples/GDS/Server/GlobalDiscoveryServer.csproj
Expand Up @@ -235,10 +235,10 @@
<Version>6.4.4</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions Samples/GDS/Server/SqlApplicationsDatabase.cs
Expand Up @@ -169,6 +169,11 @@ public override void UnregisterApplication(NodeId applicationId)
entities.CertificateRequests.Remove(entry);
}

foreach (var entry in new List<CertificateStore>(result.CertificateStores))
{
entities.CertificateStores.Remove(entry);
}

foreach (var entry in new List<ApplicationName>(result.ApplicationNames))
{
entities.ApplicationNames.Remove(entry);
Expand Down
2 changes: 1 addition & 1 deletion Samples/Opc.Ua.Sample/Opc.Ua.Sample.csproj
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.373.121" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions Samples/Server.Net4/UA Sample Server.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -146,7 +146,7 @@
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Bindings.Https">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Server/Opc.Ua.SampleServer.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -185,4 +185,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
6 changes: 3 additions & 3 deletions Samples/ServerControls.Net4/UA Server Controls.csproj
Expand Up @@ -148,13 +148,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.374.27</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions Workshop/Aggregation/Client/Aggregation Client.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -134,7 +134,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Expand Up @@ -48,9 +48,9 @@
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.Debug" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.Debug" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.374.36" />
</ItemGroup>
</Otherwise>
</Choose>
Expand Down
10 changes: 5 additions & 5 deletions Workshop/Aggregation/Server/Aggregation Server.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -129,16 +129,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Expand Up @@ -215,7 +215,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Expand Up @@ -178,7 +178,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Workshop/Boiler/Client/Boiler Client.csproj
Expand Up @@ -141,7 +141,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion Workshop/Boiler/Server/Boiler Server.csproj
Expand Up @@ -139,7 +139,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>1.5.373.121</Version>
<Version>1.5.374.36</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
Expand Down