convertersystems / opc-ua-client

Visualize and control your enterprise using OPC Unified Architecture (OPC UA) and Visual Studio.
MIT License
403 stars 119 forks source link

Prevent exception when ServerCertificate is null #247

Closed chhuebner closed 1 year ago

chhuebner commented 1 year ago

When connecting to a server that has no certificate, ClientSessionChannel.OnOpenAsync throws an exception because it tries to read a certificate from an byte array that is null.

This PR ensures that we only read the certificate if the byte array is not null.

Fixes issue #246

awcullen commented 1 year ago

Thanks, Christian.