Skip to content

Commit db90cc3

Browse files
committed
Metadata and links updated, minor Acrolinx fixes to improve score
1 parent df73a8a commit db90cc3

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

articles/iot-hub/tutorial-x509-test-certs.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: SoniaLopezBravo
77
ms.service: azure-iot-hub
88
services: iot-hub
99
ms.topic: tutorial
10-
ms.date: 04/10/2024
10+
ms.date: 03/27/2025
1111
ms.author: sonialopez
1212
ms.custom: [mvc, 'Role: Cloud Development']
1313
#Customer intent: As a developer, I want to create and use X.509 certificates to authenticate my devices on an IoT hub for testing purposes.
@@ -17,10 +17,10 @@ ms.custom: [mvc, 'Role: Cloud Development']
1717

1818
You can use X.509 certificates to authenticate devices to your IoT hub. For production environments, we recommend that you purchase an X.509 CA certificate from a professional certificate services vendor. You can then issue certificates within your organization from an internal, self-managed certificate authority (CA) chained to the purchased CA certificate as part of a comprehensive public key infrastructure (PKI) strategy. For more information about getting an X.509 CA certificate from a professional certificate services vendor, see the [Get an X.509 CA certificate](iot-hub-x509ca-overview.md#get-an-x509-ca-certificate) section of [Authenticate devices using X.509 CA certificates](iot-hub-x509ca-overview.md).
1919

20-
However, creating your own self-managed, private CA that uses an internal root CA as the trust anchor is adequate for testing environments. A self-managed private CA with at least one subordinate CA chained to your internal root CA, with client certificates for your devices that are signed by your subordinate CAs, allows you to simulate a recommended production environment.
20+
However, creating your own self-managed, private CA that uses an internal root CA as the trust anchor is adequate for testing environments. A self-managed private CA with at least one subordinate CA chained to your internal root CA, with client certificates for your devices signed by your subordinate CAs, allows you to simulate a recommended production environment.
2121

2222
>[!IMPORTANT]
23-
>We do not recommend the use of self-signed certificates for production environments. This tutorial is presented for demonstration purposes only.
23+
>We don't recommend the use of self-signed certificates for production environments. This tutorial is presented for demonstration purposes only.
2424
2525
The following tutorial uses [OpenSSL](https://www.openssl.org/) and the [OpenSSL Cookbook](https://www.feistyduck.com/library/openssl-cookbook/online/ch-openssl.html) to describe how to accomplish the following tasks:
2626

@@ -44,7 +44,7 @@ The following tutorial uses [OpenSSL](https://www.openssl.org/) and the [OpenSSL
4444
* An [OpenSSL](https://www.openssl.org/) installation. On Windows, your installation of Git includes an installation of OpenSSL. You can access OpenSSL from the Git Bash prompt. To verify that OpenSSL is installed, open a Git Bash prompt and enter `openssl version`.
4545

4646
> [!NOTE]
47-
> Unless you're familiar with OpenSSL and already have it installed on your Windows machine, we recommend using OpenSSL from the Git Bash prompt. Alternatively, you can choose to download the source code and build OpenSSL. To learn more, see the [OpenSSL Downloads](https://www.openssl.org/source/) page. Or, you can download OpenSSL pre-built from a third-party. To learn more, see the [OpenSSL wiki](https://wiki.openssl.org/index.php/Binaries). Microsoft makes no guarantees about the validity of packages downloaded from third-parties. If you do choose to build or download OpenSSL make sure that the OpenSSL binary is accessible in your path and that the `OPENSSL_CNF` environment variable is set to the path of your *openssl.cnf* file.
47+
> Unless you're familiar with OpenSSL and it's already installed on your Windows machine, we recommend using OpenSSL from the Git Bash prompt. Alternatively, you can choose to download the source code and build OpenSSL. To learn more, see the [OpenSSL Downloads](https://www.openssl.org/source/) page. Or, you can download OpenSSL prebuilt from a non-Microsoft partner. To learn more, see the [OpenSSL wiki](https://wiki.openssl.org/index.php/Binaries). Microsoft makes no guarantees about the validity of packages downloaded from third-parties. If you do choose to build or download OpenSSL, make sure that the OpenSSL binary is accessible in your path and that the `OPENSSL_CNF` environment variable is set to the path of your *openssl.cnf* file.
4848
4949
## Create a root CA
5050

@@ -165,7 +165,7 @@ You must first create an internal root certificate authority (CA) and a self-sig
165165
1. In the Git Bash window, run the following command to generate a certificate signing request (CSR) in the `rootca` directory and a private key in the `rootca/private` directory. For more information about the OpenSSL `req` command, see the [openssl-req](https://www.openssl.org/docs/man3.1/man1/openssl-req.html) manual page in OpenSSL documentation.
166166

167167
> [!NOTE]
168-
> Even though this root CA is for testing purposes and won't be exposed as part of a public key infrastructure (PKI), we recommend that you do not copy or share the private key.
168+
> we recommend that you don't copy or share the private key even though this root CA is for testing purposes and isn't exposed as part of a public key infrastructure (PKI).
169169

170170
# [Windows](#tab/windows)
171171

@@ -189,7 +189,7 @@ You must first create an internal root certificate authority (CA) and a self-sig
189189
-----
190190
```
191191
192-
Confirm that the CSR file, `rootca.csr`, is present in the `rootca` directory and the private key file, `rootca.key`, is present in the `private` subdirectory before continuing.
192+
Confirm that the CSR file, `rootca.csr`, is present in the `rootca` directory. Then, confirm that the private key file, `rootca.key`, is present in the `private` subdirectory before continuing.
193193
194194
1. In the Git Bash window, run the following command to create a self-signed root CA certificate. The command applies the `ca_ext` configuration file extensions to the certificate. These extensions indicate that the certificate is for a root CA and can be used to sign certificates and certificate revocation lists (CRLs). For more information about the OpenSSL `ca` command, see the [openssl-ca](https://www.openssl.org/docs/man3.1/man1/openssl-ca.html) manual page in OpenSSL documentation.
195195
@@ -222,14 +222,14 @@ You must first create an internal root certificate authority (CA) and a self-sig
222222
223223
1 out of 1 certificate requests certified, commit? [y/n]
224224
Write out database with 1 new entries
225-
Data Base Updated
225+
Database updated
226226
```
227227
228228
After OpenSSL updates the certificate database, confirm that both the certificate file, `rootca.crt`, is present in the `rootca` directory and the PEM certificate (.pem) file for the certificate is present in the `rootca/certs` directory. The file name of the .pem file matches the serial number of the root CA certificate.
229229
230230
## Create a subordinate CA
231231
232-
After you've created your internal root CA, you should create a subordinate CA to use as an *intermediate CA* with which to sign client certificates for your devices. In theory, you don't need to create a subordinate CA; you can upload your root CA certificate to your IoT hub and sign client certificates directly from your root CA. However, using a subordinate CA as an intermediate CA to sign client certificates more closely simulates a recommended production environment, in which your root CA is kept offline. You can also use a subordinate CA to sign another subordinate CA, which in turn can sign another subordinate CA, and so on. Using subordinate CAs to sign other subordinate CAs creates a hierarchy of intermediate CAs as part of a *certificate chain of trust.* In a production environment, the certificate chain of trust allows a delegation of trust towards signing devices. For more information about signing devices into a certificate chain of trust, see [Authenticate devices using X.509 CA certificates](iot-hub-x509ca-overview.md#sign-devices-into-the-certificate-chain-of-trust).
232+
After you create your internal root CA, you should create a subordinate CA to use as an *intermediate CA* with which to sign client certificates for your devices. In theory, you don't need to create a subordinate CA; you can upload your root CA certificate to your IoT hub and sign client certificates directly from your root CA. However, using a subordinate CA as an intermediate CA to sign client certificates more closely simulates a recommended production environment, in which your root CA is kept offline. You can also use a subordinate CA to sign another subordinate CA, which in turn can sign another subordinate CA, and so on. Using subordinate CAs to sign other subordinate CAs creates a hierarchy of intermediate CAs as part of a *certificate chain of trust.* In a production environment, the certificate chain of trust allows a delegation of trust towards signing devices. For more information about signing devices into a certificate chain of trust, see [Authenticate identities with X.509 certificates](iot-hub-x509ca-overview.md#sign-devices-into-the-certificate-chain-of-trust).
233233
234234
Similar to your root CA, the files used to create and maintain your subordinate CA are stored in a folder structure and initialized as part of this process. Perform the following steps to:
235235
@@ -246,7 +246,7 @@ Similar to your root CA, the files used to create and maintain your subordinate
246246
247247
1. In the Git Bash window, run the following commands, one at a time.
248248
249-
This step creates a directory structure and support files for the subordinate CA similar to the folder structure and files created for the root CA in the previous section.
249+
This step creates a directory structure and support files for the subordinate CA that is similar to the folder structure and files created for the root CA in the previous section.
250250
251251
```bash
252252
mkdir subca
@@ -262,7 +262,7 @@ Similar to your root CA, the files used to create and maintain your subordinate
262262
263263
As with the configuration file for your test root CA, this file provides OpenSSL with the values needed to configure your test subordinate CA. You can create multiple subordinate CAs, for managing testing scenarios or environments.
264264
265-
For more information about the syntax of OpenSSL configuration files, see the [config](https://www.openssl.org/docs/manmaster/man5/config.html) master manual page in OpenSSL documentation.
265+
For more information about the syntax of OpenSSL configuration files, see the [config](https://docs.openssl.org/master/man5/config/) master manual page in OpenSSL documentation.
266266
267267
```bash
268268
[default]
@@ -354,7 +354,7 @@ Similar to your root CA, the files used to create and maintain your subordinate
354354
-----
355355
```
356356
357-
Confirm that the CSR file `subca.csr` is present in the subordinate CA directory and the private key file `subca.key` is present in the `private` subdirectory before continuing.
357+
Confirm that the CSR file `subca.csr` is present in the subordinate CA directory. Then, confirm that the private key file `subca.key` is present in the `private` subdirectory before continuing.
358358
359359
1. In the Git Bash window, run the following command to create a subordinate CA certificate in the subordinate CA directory. The command applies the `sub_ca_ext` configuration file extensions to the certificate. These extensions indicate that the certificate is for a subordinate CA and can also be used to sign certificates and certificate revocation lists (CRLs). Unlike the root CA certificate, this certificate isn't self-signed. Instead, the subordinate CA certificate is signed with the root CA certificate, establishing a certificate chain similar to what you would use for a public key infrastructure (PKI). The subordinate CA certificate is then used to sign client certificates for testing your devices.
360360
@@ -387,10 +387,10 @@ Similar to your root CA, the files used to create and maintain your subordinate
387387
388388
1 out of 1 certificate requests certified, commit? [y/n]
389389
Write out database with 1 new entries
390-
Data Base Updated
390+
Database updated
391391
```
392392
393-
After OpenSSL updates the certificate database, confirm that the certificate file `subca.crt` is present in the subordinate CA directory and that the PEM certificate (.pem) file for the certificate is present in the `rootca/certs` directory. The file name of the .pem file matches the serial number of the subordinate CA certificate.
393+
After OpenSSL updates the certificate database, confirm that the certificate file `subca.crt` is present in the subordinate CA directory. Then, confirm that the PEM certificate (.pem) file for the certificate is present in the `rootca/certs` directory. The file name of the .pem file matches the serial number of the subordinate CA certificate.
394394
395395
## Register your subordinate CA certificate to your IoT hub
396396
@@ -414,7 +414,7 @@ Your uploaded subordinate CA certificate is shown with its status set to **Verif
414414
415415
## Create a client certificate for a device
416416
417-
After you've created your subordinate CA, you can create client certificates for your devices. The files and folders created for your subordinate CA are used to store the CSR, private key, and certificate files for your client certificates.
417+
After you created your subordinate CA, you can create client certificates for your devices. The files and folders created for your subordinate CA are used to store the CSR, private key, and certificate files for your client certificates.
418418
419419
The client certificate must have the value of its Subject Common Name (CN) field set to the value of the device ID that is used when registering the corresponding device in Azure IoT Hub.
420420
@@ -469,7 +469,7 @@ Perform the following steps to:
469469
470470
```
471471
472-
Confirm that the CSR file is present in the subordinate CA directory and the private key file is present in the `private` subdirectory before continuing. For more information about the formats of the CSR and private key files, see [X.509 certificates](reference-x509-certificates.md#certificate-formats).
472+
Confirm that the CSR file is present in the subordinate CA directory. Then, confirm that the private key file is present in the `private` subdirectory before continuing. For more information about the formats of the CSR and private key files, see [X.509 certificates](reference-x509-certificates.md#certificate-formats).
473473
474474
1. In the Git Bash window, run the following command, replacing the device name placeholders with the same name you used in the previous steps.
475475
@@ -504,13 +504,13 @@ Perform the following steps to:
504504
505505
1 out of 1 certificate requests certified, commit? [y/n]
506506
Write out database with 1 new entries
507-
Data Base Updated
507+
Database updated
508508
```
509509
510-
After OpenSSL updates the certificate database, confirm that the certificate file for the client certificate is present in the subordinate CA directory and that the PEM certificate (.pem) file for the client certificate is present in the *certs* subdirectory of the subordinate CA directory. The file name of the .pem file matches the serial number of the client certificate.
510+
After OpenSSL updates the certificate database, confirm that the certificate file for the client certificate is present in the subordinate CA directory. Then, confirm that the PEM certificate (.pem) file for the client certificate is present in the *certs* subdirectory of the subordinate CA directory. The file name of the .pem file matches the serial number of the client certificate.
511511
512512
## Next steps
513513
514-
You can register your device with your IoT hub for testing the client certificate that you've created for that device. For more information about registering a device, see [Create and manage device identities](create-connect-device.md).
514+
You can register your device with your IoT hub for testing the client certificate that you created for that device. For more information about registering a device, see [Create and manage device identities](create-connect-device.md).
515515
516516
If you have multiple related devices to test, you can use the Azure IoT Hub Device Provisioning Service to provision multiple devices in an enrollment group. For more information about using enrollment groups in the Device Provisioning Service, see [Tutorial: Provision multiple X.509 devices using enrollment groups](../iot-dps/tutorial-custom-hsm-enrollment-group-x509.md).

0 commit comments

Comments
 (0)