Skip to content

Commit c0de150

Browse files
Merge pull request #300991 from PatAltimore/patricka-freshness2
Freshness review
2 parents 2df9d9b + 60b828f commit c0de150

File tree

1 file changed

+41
-52
lines changed

1 file changed

+41
-52
lines changed

articles/iot-edge/how-to-create-test-certificates.md

Lines changed: 41 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Create test certificates and learn how to install them on an Azure
44
author: PatAltimore
55

66
ms.author: patricka
7-
ms.date: 06/03/2024
7+
ms.date: 06/06/2025
88
ms.topic: concept-article
99
ms.service: azure-iot-edge
1010
services: iot-edge
@@ -14,18 +14,18 @@ services: iot-edge
1414

1515
[!INCLUDE [iot-edge-version-all-supported](includes/iot-edge-version-all-supported.md)]
1616

17-
IoT Edge devices require certificates for secure communication between the runtime, the modules, and any downstream devices.
18-
If you don't have a certificate authority to create the required certificates, you can use demo certificates to try out IoT Edge features in your test environment.
19-
This article describes the functionality of the certificate generation scripts that IoT Edge provides for testing.
17+
IoT Edge devices need certificates for secure communication between the runtime, the modules, and any downstream devices.
18+
If you don't have a certificate authority to create the required certificates, use demo certificates to try out IoT Edge features in your test environment.
19+
This article explains the certificate generation scripts that IoT Edge provides for testing.
2020

2121
> [!WARNING]
22-
> These certificates expire in 30 days, and should not be used in any production scenario.
22+
> These certificates expire in 30 days, and you shouldn't use them in any production scenario.
2323
24-
You can create certificates on any machine and then copy them over to your IoT Edge device, or generate the certificates directly on the IoT Edge device.
24+
Create certificates on any machine and then copy them to your IoT Edge device, or generate the certificates directly on the IoT Edge device.
2525

2626
## Prerequisites
2727

28-
A development machine with Git installed.
28+
Use a development machine that has Git installed.
2929

3030
## Download test certificate scripts and set up working directory
3131

@@ -34,18 +34,18 @@ This section provides instructions for preparing the scripts to run on your comp
3434

3535
# [Windows](#tab/windows)
3636

37-
To create demo certificates on a Windows device, you need to install OpenSSL and then clone the generation scripts and set them up to run locally in PowerShell.
37+
To create demo certificates on a Windows device, install OpenSSL, then clone the generation scripts and set them up to run locally in PowerShell.
3838

3939
#### Install OpenSSL
4040

41-
Install OpenSSL for Windows on the machine that you're using to generate the certificates.
42-
If you already have OpenSSL installed on your Windows device, ensure that openssl.exe is available in your PATH environment variable.
41+
Install OpenSSL for Windows on the device you use to generate the certificates.
42+
If OpenSSL is already installed, make sure that openssl.exe is available in your PATH environment variable.
4343

44-
There are several ways to install OpenSSL, including the following options:
44+
You can install OpenSSL in different ways:
4545

4646
* **Easier:** Download and install any [third-party OpenSSL binaries](https://wiki.openssl.org/index.php/Binaries), for example, from [OpenSSL on SourceForge](https://sourceforge.net/projects/openssl/). Add the full path to openssl.exe to your PATH environment variable.
4747

48-
* **Recommended:** Download the OpenSSL source code and build the binaries on your machine by yourself or via [vcpkg](https://github.com/Microsoft/vcpkg). The instructions listed below use vcpkg to download source code, compile, and install OpenSSL on your Windows machine with easy steps.
48+
* **Recommended:** Download the OpenSSL source code and build the binaries on your device, or use [vcpkg](https://github.com/Microsoft/vcpkg). The following instructions use vcpkg to download source code, compile, and install OpenSSL on your Windows device.
4949

5050
1. Navigate to a directory where you want to install vcpkg. Follow the instructions to download and install [vcpkg](https://github.com/Microsoft/vcpkg).
5151

@@ -60,17 +60,16 @@ There are several ways to install OpenSSL, including the following options:
6060
#### Prepare scripts in PowerShell
6161
6262
The Azure IoT Edge git repository contains scripts that you can use to generate test certificates.
63-
In this section, you clone the IoT Edge repo and execute the scripts.
63+
In this section, you clone the IoT Edge repository and execute the scripts.
6464
65-
1. Open a PowerShell window in administrator mode.
66-
67-
2. Clone the IoT Edge git repo, which contains scripts to generate demo certificates. Use the `git clone` command or [download the ZIP](https://github.com/Azure/iotedge/archive/master.zip).
65+
1. Open PowerShell in administrator mode.
66+
2. Clone the IoT Edge git repository, which has scripts to generate demo certificates. Use the `git clone` command or [download the ZIP](https://github.com/Azure/iotedge/archive/master.zip).
6867
6968
```powershell
7069
git clone https://github.com/Azure/iotedge.git
7170
```
7271

73-
2. Create a directory in which you want to work and copy the certificate scripts there. All certificate and key files will be created in this directory.
72+
3. Create a directory and copy the certificate scripts there. All certificate and key files are created in this directory.
7473

7574
```powershell
7675
mkdir wrkdir
@@ -79,24 +78,25 @@ In this section, you clone the IoT Edge repo and execute the scripts.
7978
cp ..\iotedge\tools\CACertificates\ca-certs.ps1 .
8079
```
8180

82-
If you downloaded the repo as a ZIP, then the folder name is `iotedge-master` and the rest of the path is the same.
81+
If you downloaded the repository as a ZIP, the folder name is `iotedge-master` and the rest of the path is the same.
8382

84-
3. Enable PowerShell to run the scripts.
83+
3. Set the PowerShell execution policy to run the scripts.
8584

8685
```powershell
8786
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
8887
```
8988

90-
4. Bring the functions used by the scripts into PowerShell's global namespace.
89+
4. Import the functions used by the scripts into PowerShell's global namespace.
9190

9291
```powershell
9392
. .\ca-certs.ps1
9493
```
9594

96-
The PowerShell window will display a warning that the certificates generated by this script are only for testing purposes, and should not be used in production scenarios.
95+
The PowerShell window shows a warning that the certificates generated by this script are only for testing, and shouldn't be used in production scenarios.
9796

9897
5. Verify that OpenSSL has been installed correctly and make sure that there won't be name collisions with existing certificates. If there are problems, the script output should describe how to fix them on your system.
9998

99+
100100
```powershell
101101
Test-CACertsPrerequisites
102102
```
@@ -105,13 +105,13 @@ In this section, you clone the IoT Edge repo and execute the scripts.
105105

106106
To create demo certificates on a Linux device, you need to clone the generation scripts and set them up to run locally in bash.
107107

108-
1. Clone the IoT Edge git repo, which contains scripts to generate demo certificates.
108+
1. Clone the IoT Edge git repository, which contains scripts to generate demo certificates.
109109

110110
```bash
111111
git clone https://github.com/Azure/iotedge.git
112112
```
113113

114-
2. Create a directory in which you want to work and copy the certificate scripts there. All certificate and key files will be created in this directory.
114+
2. Create a directory and copy the certificate scripts there. All certificate and key files are created in this directory.
115115

116116
```bash
117117
mkdir wrkdir
@@ -120,58 +120,47 @@ To create demo certificates on a Linux device, you need to clone the generation
120120
cp ../iotedge/tools/CACertificates/certGen.sh .
121121
```
122122

123-
<!--
124-
4. Configure OpenSSL to generate certificates using the provided script.
125-
126-
```bash
127-
chmod 700 certGen.sh
128-
```
129-
-->
130-
131123
---
132124

133125
## Create root CA certificate
134126

135-
Run this script to generate a root CA that is required for each step in this article.
127+
Run this script to generate a root CA certificate. You need this certificate for each step in this article.
136128

137-
The root CA certificate is used to make all the other demo certificates for testing an IoT Edge scenario.
138-
You can keep using the same root CA certificate to make demo certificates for multiple IoT Edge or downstream devices.
129+
Use the root CA certificate to create other demo certificates for testing an IoT Edge scenario. You can use the same root CA certificate to create demo certificates for multiple IoT Edge or downstream devices.
139130

140-
If you already have one root CA certificate in your working folder, don't create a new one.
141-
The new root CA certificate will overwrite the old, and any downstream certificates made from the old one will stop working.
142-
If you want multiple root CA certificates, be sure to manage them in separate folders.
131+
If you already have a root CA certificate in your working folder, don't create a new one. Creating a new root CA certificate overwrites the old one, and any downstream certificates created from the old certificate stop working. If you need multiple root CA certificates, manage them in separate folders.
143132

144133
# [Windows](#tab/windows)
145134

146-
1. Navigate to the working directory `wrkdir` where you placed the certificate generation scripts.
135+
1. Go to the working directory `wrkdir` where you put the certificate generation scripts.
147136

148-
1. Create the root CA certificate and have it sign one intermediate certificate. The certificates are all placed in your working directory.
137+
1. Create the root CA certificate and sign one intermediate certificate. The certificates are placed in your working directory.
149138

150139
```powershell
151140
New-CACertsCertChain rsa
152141
```
153142

154-
This script command creates several certificate and key files, but when articles ask for the **root CA certificate**, use the following file:
143+
This script creates several certificate and key files. When articles ask for the **root CA certificate**, use this file:
155144

156145
`certs\azure-iot-test-only.root.ca.cert.pem`
157146

158147
# [Linux](#tab/linux)
159148

160-
1. Navigate to the working directory `wrkdir` where you placed the certificate generation scripts.
149+
1. Go to the working directory `wrkdir` where you put the certificate generation scripts.
161150

162151
1. Create the root CA certificate and one intermediate certificate.
163152

164153
```bash
165154
./certGen.sh create_root_and_intermediate
166155
```
167156

168-
This script command creates several certificate and key files, but when articles ask for the **root CA certificate**, use the following file:
157+
This script creates several certificate and key files. When articles ask for the **root CA certificate**, use this file:
169158

170-
`certs/azure-iot-test-only.root.ca.cert.pem`
159+
`certs/azure-iot-test-only.root.ca.cert.pem`
171160

172161
---
173162

174-
This certificate is required before you can create more certificates for your IoT Edge devices and downstream devices as described in the next sections.
163+
You need this certificate before you create more certificates for your IoT Edge devices and downstream devices, as described in the next sections.
175164

176165
## Create identity certificate for the IoT Edge device
177166

@@ -183,15 +172,15 @@ Device identity certificates go in the **Provisioning** section of the config fi
183172

184173
# [Windows](#tab/windows)
185174

186-
1. Navigate to the working directory `wrkdir` that has the certificate generation scripts and root CA certificate.
175+
1. Go to the working directory `wrkdir` that has the certificate generation scripts and root CA certificate.
187176

188177
1. Create the IoT Edge device identity certificate and private key with the following command:
189178

190179
```powershell
191180
New-CACertsEdgeDeviceIdentity "<device-id>"
192181
```
193182
194-
The name that you pass in to this command is the device ID for the IoT Edge device in IoT Hub.
183+
The name you enter for this command is the device ID for the IoT Edge device in IoT Hub.
195184
196185
1. The new device identity command creates several certificate and key files:
197186
@@ -225,21 +214,21 @@ Device identity certificates go in the **Provisioning** section of the config fi
225214
226215
## Create Edge CA certificates
227216
228-
These certificates are required for **gateway scenarios** because the Edge CA certificate is how the IoT Edge device verifies its identity to downstream devices. You can skip this section if you're not connecting any downstream devices to IoT Edge.
217+
You need these certificates for **gateway scenarios** because the Edge CA certificate lets the IoT Edge device verify its identity to downstream devices. Skip this section if you aren't connecting any downstream devices to IoT Edge.
229218
230-
The **Edge CA** certificate is also responsible for creating certificates for modules running on the device, but IoT Edge runtime can create temporary certificates if Edge CA isn't configured. Edge CA certificates go in the **Edge CA** section of the `config.toml` file on the IoT Edge device. To learn more, see [Understand how Azure IoT Edge uses certificates](iot-edge-certs.md).
219+
The **Edge CA** certificate also creates certificates for modules running on the device, but the IoT Edge runtime can create temporary certificates if Edge CA isn't set up. Place Edge CA certificates in the **Edge CA** section of the `config.toml` file on the IoT Edge device. To learn more, see [Understand how Azure IoT Edge uses certificates](iot-edge-certs.md).
231220
232221
# [Windows](#tab/windows)
233222
234223
1. Navigate to the working directory `wrkdir` that has the certificate generation scripts and root CA certificate.
235224
236-
2. Create the IoT Edge CA certificate and private key with the following command. Provide a name for the CA certificate. The name passed to the **New-CACertsEdgeDevice** command should *not* be the same as the hostname parameter in the config file or the device's ID in IoT Hub.
225+
2. Create the IoT Edge CA certificate and private key with the following command. Enter a name for the CA certificate. Don't use the same name as the hostname parameter in the config file or the device's ID in IoT Hub for the **New-CACertsEdgeDevice** command.
237226
238227
```powershell
239228
New-CACertsEdgeDevice "<CA cert name>"
240229
```
241230

242-
3. This command creates several certificate and key files. The following certificate and key pair need to be copied over to an IoT Edge device and referenced in the config file:
231+
3. This command creates several certificate and key files. Copy the following certificate and key pair to the IoT Edge device and reference them in the config file:
243232

244233
* `certs\iot-edge-device-<CA cert name>-full-chain.cert.pem`
245234
* `private\iot-edge-device-<CA cert name>.key.pem`
@@ -249,13 +238,13 @@ The **Edge CA** certificate is also responsible for creating certificates for mo
249238

250239
1. Navigate to the working directory that has the certificate generation scripts and root CA certificate.
251240

252-
2. Create the IoT Edge CA certificate and private key with the following command. Provide a name for the CA certificate. The name passed to the **create_edge_device_ca_certificate** command should *not* be the same as the hostname parameter in the config file or the device's ID in IoT Hub.
241+
2. Create the IoT Edge CA certificate and private key with the following command. Enter a name for the CA certificate. Don't use the same name as the hostname parameter in the config file or the device's ID in IoT Hub for the **create_edge_device_ca_certificate** command.
253242

254243
```bash
255244
./certGen.sh create_edge_device_ca_certificate "<CA cert name>"
256245
```
257246

258-
3. This script command creates several certificate and key files. The following certificate and key pair need to be copied over to an IoT Edge device and referenced in the config file:
247+
3. This script command creates several certificate and key files. Copy the following certificate and key pair to the IoT Edge device and reference them in the config file:
259248

260249
* `certs/iot-edge-device-ca-<CA cert name>-full-chain.cert.pem`
261250
* `private/iot-edge-device-ca-<CA cert name>.key.pem`

0 commit comments

Comments
 (0)