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

Check server application Uri with the create session response #2731

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libraries/Opc.Ua.Client/ReverseConnectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
EventHandler<ConnectionWaitingEventArgs> onConnectionWaiting) :
this(endpointUrl, onConnectionWaiting)
{
ServerUri = X509Utils.GetApplicationUriFromCertificate(serverCertificate);
ServerUri = X509Utils.GetApplicationUrisFromCertificate(serverCertificate).FirstOrDefault();

Check warning on line 166 in Libraries/Opc.Ua.Client/ReverseConnectManager.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Client/ReverseConnectManager.cs#L166

Added line #L166 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need logic to pick the right one.

}

private Registration(
Expand Down
91 changes: 55 additions & 36 deletions Libraries/Opc.Ua.Client/Session/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,6 @@

if (requireEncryption)
{
ValidateServerCertificateApplicationUri(serverCertificate);
if (checkDomain)
{
m_configuration.CertificateValidator.Validate(serverCertificateChain, m_endpoint);
Expand Down Expand Up @@ -2417,24 +2416,24 @@
if (!successCreateSession)
{
base.CreateSession(
null,
clientDescription,
m_endpoint.Description.Server.ApplicationUri,
m_endpoint.EndpointUrl.ToString(),
sessionName,
clientNonce,
clientCertificateChainData != null ? clientCertificateChainData : clientCertificateData,
sessionTimeout,
(uint)MessageContext.MaxMessageSize,
out sessionId,
out sessionCookie,
out m_sessionTimeout,
out serverNonce,
out serverCertificateData,
out serverEndpoints,
out serverSoftwareCertificates,
out serverSignature,
out m_maxRequestMessageSize);
null,
clientDescription,
m_endpoint.Description.Server.ApplicationUri,
m_endpoint.EndpointUrl.ToString(),
sessionName,
clientNonce,
clientCertificateChainData != null ? clientCertificateChainData : clientCertificateData,
sessionTimeout,
(uint)MessageContext.MaxMessageSize,
out sessionId,
out sessionCookie,
out m_sessionTimeout,
out serverNonce,
out serverCertificateData,
out serverEndpoints,
out serverSoftwareCertificates,
out serverSignature,
out m_maxRequestMessageSize);
}

// save session id.
Expand All @@ -2456,6 +2455,8 @@

ValidateServerEndpoints(serverEndpoints);

ValidateServerCertificateApplicationUri(m_endpoint, serverCertificate);

ValidateServerSignature(serverCertificate, serverSignature, clientCertificateData, clientCertificateChainData, clientNonce);

HandleSignedSoftwareCertificates(serverSoftwareCertificates);
Expand Down Expand Up @@ -5352,26 +5353,44 @@
!String.IsNullOrEmpty(identityPolicy.SecurityPolicyUri);
}
}

/// <summary>
/// Validates the ServerCertificate ApplicationUri to match the ApplicationUri of the Endpoint for an open call (Spec Part 4 5.4.1)
/// Validates the ServerCertificate ApplicationUri to match the ApplicationUri
/// of the Endpoint (Spec Part 4 5.4.1) returned by the CreateSessionResponse.
/// Ensure the endpoint was matched in <see cref="ValidateServerEndpoints"/>
/// with the applicationUri of the server description before the validation.
/// </summary>
private void ValidateServerCertificateApplicationUri(
X509Certificate2 serverCertificate)
private static void ValidateServerCertificateApplicationUri(ConfiguredEndpoint endpoint, X509Certificate2 serverCertificate)
{
var applicationUri = m_endpoint?.Description?.Server?.ApplicationUri;
//check is only neccessary if the ApplicatioUri is specified for the Endpoint
if (string.IsNullOrEmpty(applicationUri))
if (serverCertificate != null)
{
throw ServiceResultException.Create(
StatusCodes.BadSecurityChecksFailed,
"No ApplicationUri is specified for the server in the EndpointDescription.");
}
string certificateApplicationUri = X509Utils.GetApplicationUriFromCertificate(serverCertificate);
if (!string.Equals(certificateApplicationUri, applicationUri, StringComparison.Ordinal))
{
throw ServiceResultException.Create(
StatusCodes.BadSecurityChecksFailed,
"Server did not return a Certificate matching the ApplicationUri specified in the EndpointDescription.");
var applicationUri = endpoint?.Description?.Server?.ApplicationUri;

// check that an ApplicatioUri is specified for the Endpoint
if (string.IsNullOrEmpty(applicationUri))
{
throw ServiceResultException.Create(
StatusCodes.BadSecurityChecksFailed,
"Server did not return an ApplicationUri in the EndpointDescription.");

Check warning on line 5374 in Libraries/Opc.Ua.Client/Session/Session.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Client/Session/Session.cs#L5372-L5374

Added lines #L5372 - L5374 were not covered by tests
}

bool noMatch = true;
var certificateApplicationUris = X509Utils.GetApplicationUrisFromCertificate(serverCertificate);
foreach (var certificateApplicationUri in certificateApplicationUris)
{
if (string.Equals(certificateApplicationUri, applicationUri, StringComparison.Ordinal))
{
noMatch = false;
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not noMatch = certificateApplicationUris .Where(x => String.Equals(certificateApplicationUri, applicationUri, StringComparison.Ordinal).Any()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you never know what Linq is up to...


if (noMatch)
{
throw ServiceResultException.Create(
StatusCodes.BadSecurityChecksFailed,
mregen marked this conversation as resolved.
Show resolved Hide resolved
"Server did not return the ApplicationUri in the EndpointDescription that is used in the server certificate.");

Check warning on line 5392 in Libraries/Opc.Ua.Client/Session/Session.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Client/Session/Session.cs#L5390-L5392

Added lines #L5390 - L5392 were not covered by tests
}
}
}

Expand Down Expand Up @@ -5538,7 +5557,7 @@
}
}

// find the matching description (TBD - check domains against certificate).
// find the matching description (TBD - check domains and application URI against certificate).
bool found = false;

var foundDescription = FindMatchingDescription(serverEndpoints, m_endpoint.Description, true);
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Opc.Ua.Client/Session/SessionAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public async Task OpenAsync(

if (requireEncryption)
{
ValidateServerCertificateApplicationUri(serverCertificate);
if (checkDomain)
{
await m_configuration.CertificateValidator.ValidateAsync(serverCertificateChain, m_endpoint, ct).ConfigureAwait(false);
Expand Down Expand Up @@ -201,6 +200,8 @@ public async Task OpenAsync(

ValidateServerEndpoints(serverEndpoints);

ValidateServerCertificateApplicationUri(m_endpoint, serverCertificate);

ValidateServerSignature(serverCertificate, serverSignature, clientCertificateData, clientCertificateChainData, clientNonce);

HandleSignedSoftwareCertificates(serverSoftwareCertificates);
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Opc.Ua.Configuration/ApplicationInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ private async Task<bool> CheckApplicationInstanceCertificateAsync(
}

// check uri.
string applicationUri = X509Utils.GetApplicationUriFromCertificate(certificate);
string applicationUri = X509Utils.GetApplicationUrisFromCertificate(certificate).FirstOrDefault();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a better way to pick the right one.

if (String.IsNullOrEmpty(applicationUri))
{
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Opc.Ua.Gds.Client.Common/CertificateWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using Opc.Ua.Security.Certificates;
Expand Down Expand Up @@ -213,7 +214,7 @@
{
try
{
return X509Utils.GetApplicationUriFromCertificate(Certificate);
return X509Utils.GetApplicationUrisFromCertificate(Certificate).FirstOrDefault();

Check warning on line 217 in Libraries/Opc.Ua.Gds.Client.Common/CertificateWrapper.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Gds.Client.Common/CertificateWrapper.cs#L217

Added line #L217 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a better way to pick the right one.

}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
/// Creates an extension from ASN.1 encoded data.
/// </summary>
public X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)
: this(encodedExtension.Oid, encodedExtension.RawData, critical)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 88 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(AsnEncodedData encodedExtension, bool critical)', validate parameter 'encodedExtension' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)
{
}

Expand Down Expand Up @@ -113,12 +113,28 @@
/// <param name="applicationUri">The application Uri</param>
/// <param name="domainNames">The domain names. DNS Hostnames, IPv4 or IPv6 addresses</param>
public X509SubjectAltNameExtension(
string applicationUri,

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-PubSub

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Client.ComplexTypes

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Security.Certificates

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Client

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)

Check warning on line 116 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Change the type of parameter 'applicationUri' of method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' from 'string' to 'System.Uri', or provide an overload to 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string, IEnumerable<string>)' that allows 'applicationUri' to be passed as a 'System.Uri' object (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054)
IEnumerable<string> domainNames)
{
Oid = new Oid(SubjectAltName2Oid, kFriendlyName);
Critical = false;
Initialize(applicationUri, domainNames);
Initialize(new string[] { applicationUri }, domainNames);

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 121 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(string applicationUri, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)
RawData = Encode();
m_decoded = true;
}

/// <summary>
/// Build the Subject Alternative name extension (for OPC UA application certs).
/// </summary>
/// <param name="applicationUris">The application Uri</param>
/// <param name="domainNames">The domain names. DNS Hostnames, IPv4 or IPv6 addresses</param>
public X509SubjectAltNameExtension(
IEnumerable<string> applicationUris,
IEnumerable<string> domainNames)
{
Oid = new Oid(SubjectAltName2Oid, kFriendlyName);
Critical = false;
Initialize(applicationUris, domainNames);

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Core

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client.ComplexTypes

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Configuration

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-macOS-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Security.Certificates

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Gds

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-PubSub

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Server

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-ubuntu-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-Client

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'domainNames' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check warning on line 137 in Libraries/Opc.Ua.Security.Certificates/Extensions/X509SubjectAltNameExtension.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

In externally visible method 'X509SubjectAltNameExtension.X509SubjectAltNameExtension(IEnumerable<string> applicationUris, IEnumerable<string> domainNames)', validate parameter 'applicationUris' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)
RawData = Encode();
m_decoded = true;
}
Expand Down Expand Up @@ -402,14 +418,17 @@
/// <summary>
/// Initialize the Subject Alternative name extension.
/// </summary>
/// <param name="applicationUri">The application Uri</param>
/// <param name="applicationUris">The application Uris</param>
/// <param name="generalNames">The general names. DNS Hostnames, IPv4 or IPv6 addresses</param>
private void Initialize(string applicationUri, IEnumerable<string> generalNames)
private void Initialize(IEnumerable<string> applicationUris, IEnumerable<string> generalNames)
{
var uris = new List<string>();
var domainNames = new List<string>();
var ipAddresses = new List<string>();
uris.Add(applicationUri);
foreach (string applicationUri in applicationUris)
{
uris.Add(applicationUri);
}
foreach (string generalName in generalNames)
{
switch (Uri.CheckHostName(generalName))
Expand Down
42 changes: 26 additions & 16 deletions Libraries/Opc.Ua.Server/Server/StandardServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,23 +380,33 @@

if (context.SecurityPolicyUri != SecurityPolicies.None)
{
string certificateApplicationUri = X509Utils.GetApplicationUriFromCertificate(parsedClientCertificate);

// verify if applicationUri from ApplicationDescription matches the applicationUri in the client certificate.
if (!String.IsNullOrEmpty(certificateApplicationUri) &&
!String.IsNullOrEmpty(clientDescription.ApplicationUri) &&
certificateApplicationUri != clientDescription.ApplicationUri)
// verify if applicationUri from ApplicationDescription matches the applicationUris in the client certificate.
if (!String.IsNullOrEmpty(clientDescription.ApplicationUri))
{
// report the AuditCertificateDataMismatch event for invalid uri
ServerInternal?.ReportAuditCertificateDataMismatchEvent(parsedClientCertificate, null, clientDescription.ApplicationUri, StatusCodes.BadCertificateUriInvalid);
bool noMatch = true;
var certificateApplicationUris = X509Utils.GetApplicationUrisFromCertificate(parsedClientCertificate);
foreach (var certificateApplicationUri in certificateApplicationUris)
{
if (!String.IsNullOrEmpty(certificateApplicationUri) && certificateApplicationUri == clientDescription.ApplicationUri)
{
noMatch = false;
break;
}
}

throw ServiceResultException.Create(
StatusCodes.BadCertificateUriInvalid,
"The URI specified in the ApplicationDescription {0} does not match the URI in the Certificate: {1}.",
clientDescription.ApplicationUri, certificateApplicationUri);
}
if (noMatch)
{
// report the AuditCertificateDataMismatch event for invalid uri
ServerInternal?.ReportAuditCertificateDataMismatchEvent(parsedClientCertificate, null, clientDescription.ApplicationUri, StatusCodes.BadCertificateUriInvalid);

throw ServiceResultException.Create(
StatusCodes.BadCertificateUriInvalid,
"The URI specified in the ApplicationDescription {0} does not match the URIs in the Certificate.",
clientDescription.ApplicationUri);

Check warning on line 405 in Libraries/Opc.Ua.Server/Server/StandardServer.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Server/Server/StandardServer.cs#L402-L405

Added lines #L402 - L405 were not covered by tests
}

CertificateValidator.Validate(clientCertificateChain);
CertificateValidator.Validate(clientCertificateChain);
}
}
}
catch (Exception e)
Expand Down Expand Up @@ -2327,7 +2337,7 @@
{
client.RegisterServer(requestHeader, m_registrationInfo);
}

m_registeredWithDiscoveryServer = m_registrationInfo.IsOnline;
return true;
}
Expand Down Expand Up @@ -3082,7 +3092,7 @@
// attempt graceful shutdown the server.
try
{

if (m_maxRegistrationInterval > 0 && m_registeredWithDiscoveryServer)
{
// unregister from Discovery Server if registered before
Expand Down
4 changes: 2 additions & 2 deletions Stack/Opc.Ua.Core/Security/Certificates/CertificateFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ public static byte[] CreateSigningRequest(
}
}

string applicationUri = X509Utils.GetApplicationUriFromCertificate(certificate);
var applicationUris = X509Utils.GetApplicationUrisFromCertificate(certificate);

// Subject Alternative Name
var subjectAltName = new X509SubjectAltNameExtension(applicationUri, domainNames);
var subjectAltName = new X509SubjectAltNameExtension(applicationUris, domainNames);
request.CertificateExtensions.Add(new X509Extension(subjectAltName, false));

using (RSA rsa = certificate.GetRSAPrivateKey())
Expand Down
20 changes: 20 additions & 0 deletions Stack/Opc.Ua.Core/Security/Certificates/X509Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
/// </summary>
/// <param name="certificate">The certificate.</param>
/// <returns>The application URI.</returns>
[Obsolete("Use GetApplicationUrisFromCertificate instead. The certificate may contain more than one Uri.")]
public static string GetApplicationUriFromCertificate(X509Certificate2 certificate)
{
// extract the alternate domains from the subject alternate name extension.
Expand All @@ -140,6 +141,25 @@
return string.Empty;
}

/// <summary>
/// Extracts the application URIs specified in the certificate.
/// </summary>
/// <param name="certificate">The certificate.</param>
/// <returns>The application URIs.</returns>
public static IReadOnlyList<string> GetApplicationUrisFromCertificate(X509Certificate2 certificate)
{
// extract the alternate domains from the subject alternate name extension.
X509SubjectAltNameExtension alternateName = X509Extensions.FindExtension<X509SubjectAltNameExtension>(certificate);

// get the application uris.
if (alternateName != null && alternateName.Uris != null)
{
return alternateName.Uris;
}

return new List<string>();

Check warning on line 160 in Stack/Opc.Ua.Core/Security/Certificates/X509Utils.cs

View check run for this annotation

Codecov / codecov/patch

Stack/Opc.Ua.Core/Security/Certificates/X509Utils.cs#L160

Added line #L160 was not covered by tests
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return an empty string to be backward compatible?

}

/// <summary>
/// Check if certificate has an application urn.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Stack/Opc.Ua.Core/Stack/Server/ServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@
// assign a unique identifier if none specified.
if (String.IsNullOrEmpty(configuration.ApplicationUri))
{
configuration.ApplicationUri = X509Utils.GetApplicationUriFromCertificate(InstanceCertificate);
configuration.ApplicationUri = X509Utils.GetApplicationUrisFromCertificate(InstanceCertificate).FirstOrDefault();

Check warning on line 1408 in Stack/Opc.Ua.Core/Stack/Server/ServerBase.cs

View check run for this annotation

Codecov / codecov/patch

Stack/Opc.Ua.Core/Stack/Server/ServerBase.cs#L1408

Added line #L1408 was not covered by tests

if (String.IsNullOrEmpty(configuration.ApplicationUri))
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Opc.Ua.Gds.Tests/X509TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static void VerifySignedApplicationCert(ApplicationTestData testApp, byte
Assert.True(domainNames.Contains(domainName, StringComparer.OrdinalIgnoreCase));
}
Assert.True(subjectAlternateName.Uris.Count == 1);
var applicationUri = X509Utils.GetApplicationUriFromCertificate(signedCert);
var applicationUri = X509Utils.GetApplicationUrisFromCertificate(signedCert).FirstOrDefault();
Assert.True(testApp.ApplicationRecord.ApplicationUri == applicationUri);
}
}
Expand Down
Loading