OPCFoundation / UA-.NETStandard-Samples

Other
261 stars 185 forks source link

Private key is no longer exportable from x509 certificatestore on Windows #644

Open sveinfolkeson opened 1 week ago

sveinfolkeson commented 1 week ago

Type of issue

Current Behavior

In earlier versions of OPC Foundation framework the private keys where exportable but now it is not possible to export them. When I try to connect to an UA Server with a GDS certificate to X509 LocalComputer/UA Applications, generated by version 1.5.374.78, I get the error message : 10/16/2024 09:50:36.992 Trying to add certificate to cache with invalid private key. 10/16/2024 09:50:37.007 Trying to add certificate to cache with invalid private key. 10/16/2024 09:50:37.070 Unexpected error in '(null)'. BadConfigurationError 'Cannot access certificate private key. Subject=CN=xxxx, DC=yy.yy.yy.yyy'

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS: Win 11
- Environment:
- Runtime: .NET Framework 4.8
- Nuget Version: 1.5.374.78
- Component: UA GDS Client
- Server:
- Client:

Anything else?

No response

mregen commented 1 week ago

Hi @sveinfolkeson, maybe it is related also to this issue: https://github.com/OPCFoundation/UA-.NETStandard/issues/2765 Thanks for the report, we are investigating.