Skip to content

Commit d5c8819

Browse files
committed
SAN updates
1 parent 0b919a0 commit d5c8819

2 files changed

Lines changed: 88 additions & 2 deletions

File tree

articles/iot-operations/discover-manage-assets/howto-configure-opc-ua-certificates-infrastructure.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,52 @@ Like the previous examples, you use a dedicated Kubernetes secret to store the c
295295
```
296296
297297
Now that the connector for OPC UA uses the enterprise certificate, don't forget to add the new certificate's public key to the trusted certificate lists of all OPC UA servers it needs to connect to.
298+
299+
## Configure certificate subject alternative names
300+
301+
The connector's self-signed certificate automatically includes the application URI and the local hostname in the Subject Alternative Name (SAN) extension. If OPC UA servers access the connector through other hostnames or IP addresses, you need to add those identities to the SAN. To learn more about SAN and when you need custom entries, see [Certificate subject alternative name](overview-opc-ua-connector-certificates-management.md#certificate-subject-alternative-name).
302+
303+
> [!NOTE]
304+
> This configuration only applies to the connector's self-generated certificate. If you use an enterprise grade certificate, configure the SAN entries when you generate that certificate externally. For more information, see [Configure an enterprise grade application instance certificate](#configure-an-enterprise-grade-application-instance-certificate).
305+
306+
To add custom DNS names, IP addresses, or both, add the `SubjectAlternativeDnsNames` and `SubjectAlternativeIpAddresses` properties to the connector's `SecurityPki` configuration in the `additionalConfiguration` field of the connector's deployment:
307+
308+
```json
309+
{
310+
"SecurityPki": {
311+
"SubjectName": "CN=aio-opc-opcuabroker",
312+
"ApplicationUri": "urn:microsoft.com:aio:opc:ua:broker",
313+
"SubjectAlternativeDnsNames": "opcua-connector.iot-ops.svc.cluster.local,opcua.contoso.com",
314+
"SubjectAlternativeIpAddresses": "192.168.1.100,10.0.0.50"
315+
}
316+
}
317+
```
318+
319+
The resulting certificate SAN includes the application URI, all specified DNS names and IP addresses, and the local hostname that the connector adds automatically.
320+
321+
### Regenerate the certificate with new SAN entries
322+
323+
If you change the SAN configuration on a running connector, regenerate the certificate to apply the new entries:
324+
325+
1. Update the configuration with the new SAN values.
326+
1. Delete the existing certificate from the PKI store:
327+
328+
```bash
329+
rm -rf -- /tmp/opcuabroker/pki/own/certs/* /tmp/opcuabroker/pki/own/private/*
330+
```
331+
332+
1. Restart the connector pod. The connector automatically generates a new certificate with the updated SAN entries.
333+
334+
To verify the new certificate contains the expected SAN entries, run the following command:
335+
336+
```bash
337+
openssl x509 -in /tmp/opcuabroker/pki/own/certs/your-cert-file.der -inform DER -text -noout | grep -A 10 "Subject Alternative Name"
338+
```
339+
340+
### Troubleshoot SAN validation failures
341+
342+
If an OPC UA server rejects connections with certificate hostname or IP validation errors:
343+
344+
1. Check the server's error message for the hostname or IP address it validated against.
345+
1. Add that hostname or IP address to the appropriate SAN configuration property (`SubjectAlternativeDnsNames` or `SubjectAlternativeIpAddresses`).
346+
1. Regenerate the certificate as described in the previous section.

articles/iot-operations/discover-manage-assets/overview-opc-ua-connector-certificates-management.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ The following diagram shows the sequence of events that occur when the connector
2828

2929
:::image type="content" source="media/overview-opc-ua-connector-certificates-management/mutual-trust.svg" alt-text="Diagram that summarizes the OPC UA connector connection handshake." border="false":::
3030

31-
<!-- ```mermaid
31+
<!--
32+
mermaid
3233
sequenceDiagram
3334
participant Connector as Connector for OPC UA
3435
participant OPCUA as OPC UA server
@@ -40,7 +41,7 @@ sequenceDiagram
4041
OPCUA->>Connector: Presents OPC UA server application instance certificate
4142
4243
Connector->>Connector: Validate OPC UA server certificate against<br>connector for OPC UA trusted certificates list<br>or trusted issuers list.
43-
``` -->
44+
-->
4445

4546
## Connector for OPC UA application instance certificate
4647

@@ -89,6 +90,42 @@ The default name for the `SecretProviderClass` custom resource that handles the
8990

9091
To learn how to manage the issuer certificates list, see [Configure the issuer certificates list](howto-configure-opc-ua-certificates-infrastructure.md#configure-the-issuer-certificates-list).
9192

93+
## Certificate subject alternative name
94+
95+
Subject Alternative Name (SAN) is an X.509 certificate extension that specifies additional identities for a certificate beyond the subject field. For OPC UA certificates, the SAN typically includes:
96+
97+
- **URI entries**: The OPC UA application URI, required by the OPC UA specification.
98+
- **DNS entries**: Hostnames and FQDNs where the application can be reached.
99+
- **IP entries**: IP addresses where the application can be reached.
100+
101+
The connector's self-signed certificate automatically includes the application URI and the local hostname. OPC UA servers validate that the client's certificate SAN contains the hostname or IP address used for the connection. If the SAN doesn't match, the server rejects the connection.
102+
103+
### When to configure custom SAN entries
104+
105+
Configure custom SAN entries when:
106+
107+
- The connector is accessed through multiple hostnames, for example `opcua.local` and `broker.contoso.com`.
108+
- The connector has multiple IP addresses across different network interfaces.
109+
- You use Kubernetes services or ingress that expose different DNS names.
110+
- You connect through a load balancer or proxy.
111+
- OPC UA servers reject connections because of a hostname or IP mismatch.
112+
113+
### SAN configuration properties
114+
115+
Add the following properties to the `SecurityPki` configuration section:
116+
117+
| Property | Type | Description |
118+
|----------|------|-------------|
119+
| `SubjectAlternativeDnsNames` | string | Comma-separated list of DNS names to include in the certificate SAN. |
120+
| `SubjectAlternativeIpAddresses` | string | Comma-separated list of IP addresses to include in the certificate SAN. |
121+
122+
DNS names can be hostnames, FQDNs, or Kubernetes service names and are case-insensitive. IP addresses must be valid IPv4 or IPv6 addresses. The connector automatically trims whitespace and removes empty entries.
123+
124+
> [!IMPORTANT]
125+
> Custom SAN entries only apply to self-generated certificates. If you provide a custom certificate through the `ApplicationCert` secret or specify an existing certificate through `Thumbprint`, the certificate already exists and its SAN can't be modified. Wildcard DNS names aren't supported in OPC UA certificates.
126+
127+
To learn how to configure custom SAN entries and regenerate the connector certificate, see [Configure certificate subject alternative names](howto-configure-opc-ua-certificates-infrastructure.md#configure-certificate-subject-alternative-names).
128+
92129
## Features supported
93130

94131
The following table shows the feature support level for authentication in the current version of the connector for OPC UA:

0 commit comments

Comments
 (0)