Skip to content

Commit c4f0f73

Browse files
authored
Merge pull request #2762 from OPCFoundation/master
Merge some fixes found during release testing
2 parents 30dd7a9 + cf2e788 commit c4f0f73

File tree

17 files changed

+79
-31
lines changed

17 files changed

+79
-31
lines changed

.azurepipelines/signlistDebug.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Stack\Opc.Ua.Core\bin\Debug\net472\Opc.Ua.Core.dll
44
Stack\Opc.Ua.Core\bin\Debug\net48\Opc.Ua.Core.dll
55
Stack\Opc.Ua.Core\bin\Debug\net6.0\Opc.Ua.Core.dll
66
Stack\Opc.Ua.Core\bin\Debug\net8.0\Opc.Ua.Core.dll
7-
Stack\Opc.Ua.Bindings.Https\bin\Debug\netcoreapp3.1\Opc.Ua.Bindings.Https.dll
7+
Stack\Opc.Ua.Bindings.Https\bin\Debug\netstandard2.0\Opc.Ua.Bindings.Https.dll
8+
Stack\Opc.Ua.Bindings.Https\bin\Debug\netstandard2.1\Opc.Ua.Bindings.Https.dll
89
Stack\Opc.Ua.Bindings.Https\bin\Debug\net472\Opc.Ua.Bindings.Https.dll
910
Stack\Opc.Ua.Bindings.Https\bin\Debug\net48\Opc.Ua.Bindings.Https.dll
1011
Stack\Opc.Ua.Bindings.Https\bin\Debug\net6.0\Opc.Ua.Bindings.Https.dll
@@ -22,6 +23,7 @@ Libraries\Opc.Ua.Client\bin\Debug\net48\Opc.Ua.Client.dll
2223
Libraries\Opc.Ua.Client\bin\Debug\net6.0\Opc.Ua.Client.dll
2324
Libraries\Opc.Ua.Client\bin\Debug\net8.0\Opc.Ua.Client.dll
2425
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\netstandard2.1\Opc.Ua.Client.ComplexTypes.dll
26+
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net462\Opc.Ua.Client.ComplexTypes.dll
2527
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net472\Opc.Ua.Client.ComplexTypes.dll
2628
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net48\Opc.Ua.Client.ComplexTypes.dll
2729
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net6.0\Opc.Ua.Client.ComplexTypes.dll

.azurepipelines/signlistRelease.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Stack\Opc.Ua.Core\bin\Release\net472\Opc.Ua.Core.dll
44
Stack\Opc.Ua.Core\bin\Release\net48\Opc.Ua.Core.dll
55
Stack\Opc.Ua.Core\bin\Release\net6.0\Opc.Ua.Core.dll
66
Stack\Opc.Ua.Core\bin\Release\net8.0\Opc.Ua.Core.dll
7-
Stack\Opc.Ua.Bindings.Https\bin\Release\netcoreapp3.1\Opc.Ua.Bindings.Https.dll
7+
Stack\Opc.Ua.Bindings.Https\bin\Release\netstandard2.0\Opc.Ua.Bindings.Https.dll
8+
Stack\Opc.Ua.Bindings.Https\bin\Release\netstandard2.1\Opc.Ua.Bindings.Https.dll
89
Stack\Opc.Ua.Bindings.Https\bin\Release\net472\Opc.Ua.Bindings.Https.dll
910
Stack\Opc.Ua.Bindings.Https\bin\Release\net48\Opc.Ua.Bindings.Https.dll
1011
Stack\Opc.Ua.Bindings.Https\bin\Release\net6.0\Opc.Ua.Bindings.Https.dll
@@ -22,6 +23,7 @@ Libraries\Opc.Ua.Client\bin\Release\net48\Opc.Ua.Client.dll
2223
Libraries\Opc.Ua.Client\bin\Release\net6.0\Opc.Ua.Client.dll
2324
Libraries\Opc.Ua.Client\bin\Release\net8.0\Opc.Ua.Client.dll
2425
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\netstandard2.1\Opc.Ua.Client.ComplexTypes.dll
26+
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net462\Opc.Ua.Client.ComplexTypes.dll
2527
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net472\Opc.Ua.Client.ComplexTypes.dll
2628
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net48\Opc.Ua.Client.ComplexTypes.dll
2729
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net6.0\Opc.Ua.Client.ComplexTypes.dll

Fuzzing/Encoders/Fuzz.Tests/Opc.Ua.Encoders.Fuzz.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
21+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
2222
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2323
<PackageReference Include="NUnit" Version="4.1.0" />
2424
<PackageReference Include="NUnit.Console" Version="3.18.1" />

Libraries/Opc.Ua.PubSub/Opc.Ua.PubSub.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</ItemGroup>
3737

3838
<ItemGroup>
39-
<PackageReference Include="MQTTnet" Version="4.3.6.1152" />
39+
<PackageReference Include="MQTTnet" Version="4.3.7.1207" />
4040
<PackageReference Include="System.Net.NetworkInformation" Version="4.3.0" />
4141
</ItemGroup>
4242

Stack/Opc.Ua.Bindings.Https/Stack/Https/HttpsTransportListener.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1515
using System.IO;
1616
using System.Net;
1717
using System.Security.Authentication;
18+
using System.Security.Cryptography;
1819
using System.Security.Cryptography.X509Certificates;
1920
using System.Threading;
2021
using System.Threading.Tasks;
@@ -262,17 +263,29 @@ public void Start()
262263
{
263264
Startup.Listener = this;
264265
m_hostBuilder = new WebHostBuilder();
266+
267+
// prepare the server TLS certificate
268+
var serverCertificate = m_serverCertificate;
269+
#if NETCOREAPP3_1_OR_GREATER || NETSTANDARD2_1 || NET472_OR_GREATER || NET5_0_OR_GREATER
270+
try
271+
{
272+
// Create a copy of the certificate with the private key on platforms
273+
// which default to the ephemeral KeySet. Also a new certificate must be reloaded.
274+
// If the key fails to copy, its probably a non exportable key from the X509Store.
275+
// Then we can use the original certificate, the private key is already in the key store.
276+
serverCertificate = X509Utils.CreateCopyWithPrivateKey(m_serverCertificate, false);
277+
}
278+
catch (CryptographicException ce)
279+
{
280+
Utils.LogTrace("Copy of the private key for https was denied: {0}", ce.Message);
281+
}
282+
#endif
283+
265284
var httpsOptions = new HttpsConnectionAdapterOptions() {
266285
CheckCertificateRevocation = false,
267286
ClientCertificateMode = ClientCertificateMode.NoCertificate,
268287
// note: this is the TLS certificate!
269-
#if NETCOREAPP3_1_OR_GREATER || NETSTANDARD2_1 || NET472_OR_GREATER || NET5_0_OR_GREATER
270-
// Create a copy of the certificate with the private key on platforms
271-
// which default to the ephemeral KeySet.
272-
ServerCertificate = X509Utils.CreateCopyWithPrivateKey(m_serverCertificate, false)
273-
#else
274-
ServerCertificate = m_serverCertificate
275-
#endif
288+
ServerCertificate = serverCertificate,
276289
};
277290

278291
#if NET462

Stack/Opc.Ua.Core/Security/Certificates/CertificateIdentifier.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,14 @@ public async Task<X509Certificate2> LoadPrivateKeyEx(ICertificatePasswordProvide
170170
var certificateStoreIdentifier = new CertificateStoreIdentifier(this.StorePath, this.StoreType, false);
171171
using (ICertificateStore store = certificateStoreIdentifier.OpenStore())
172172
{
173-
if (store.SupportsLoadPrivateKey)
173+
if (store?.SupportsLoadPrivateKey == true)
174174
{
175175
string password = passwordProvider?.GetPassword(this);
176176
m_certificate = await store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password).ConfigureAwait(false);
177177
return m_certificate;
178178
}
179179
}
180+
return null;
180181
}
181182
return await Find(true).ConfigureAwait(false);
182183
}
@@ -202,6 +203,11 @@ public async Task<X509Certificate2> Find(bool needPrivateKey)
202203
var certificateStoreIdentifier = new CertificateStoreIdentifier(StorePath, false);
203204
using (ICertificateStore store = certificateStoreIdentifier.OpenStore())
204205
{
206+
if (store == null)
207+
{
208+
return null;
209+
}
210+
205211
X509Certificate2Collection collection = await store.Enumerate().ConfigureAwait(false);
206212

207213
certificate = Find(collection, m_thumbprint, m_subjectName, needPrivateKey);

Tests/Opc.Ua.Client.ComplexTypes.Tests/Opc.Ua.Client.ComplexTypes.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1111
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1212
<PackageReference Include="NUnit" Version="4.1.0" />
1313
<PackageReference Include="NUnit.Console" Version="3.18.1" />

Tests/Opc.Ua.Client.Tests/Opc.Ua.Client.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1313
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1414
<PackageReference Include="NUnit" Version="4.1.0" />
1515
<PackageReference Include="NUnit.Console" Version="3.18.1" />

Tests/Opc.Ua.Configuration.Tests/Opc.Ua.Configuration.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1212
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1313
<PackageReference Include="NUnit" Version="4.1.0" />
1414
<PackageReference Include="NUnit.Console" Version="3.18.1" />

Tests/Opc.Ua.Core.Tests/Opc.Ua.Core.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
14-
<PackageReference Include="Moq" Version="4.20.70" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
14+
<PackageReference Include="Moq" Version="4.20.72" />
1515
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1616
<PackageReference Include="NUnit" Version="4.1.0" />
1717
<PackageReference Include="NUnit.Console" Version="3.18.1" />

0 commit comments

Comments
 (0)