OPCFoundation / UA-.NET-Legacy

OPC Foundation Unified Architecture .NET Reference Implementations
332 stars 297 forks source link

Server doesn't load correct application certificate #143

Open MD-V opened 7 years ago

MD-V commented 7 years ago

https://github.com/OPCFoundation/UA-.NET/blob/09fc41442d9d1493b194e3649c8b2337b4d2ae02/Stack/Core/Security/Certificates/DirectoryCertificateStore.cs#L421

This line should be replaced with:

if (subjectName.Contains("=") || !certificate.Subject.Equals("CN=" + subjectName))

Server was first started with subjectName = "Example-Server" --> Example-Server cert is created. Afterwards I start the Server with subjectName = "Example" --> Example-Server cert is loaded. I expected that it generates a new cert ("Example").