Skip to content

Commit 3f0b2a4

Browse files
Merge pull request #232374 from KennedyDMSFT/US61440-2
IoT Hub: Combine remaining cert tutorials
2 parents 6086a58 + 61cc585 commit 3f0b2a4

16 files changed

+641
-588
lines changed

articles/iot-hub/.openpublishing.redirection.iot-hub.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,22 +1270,37 @@
12701270
},
12711271
{
12721272
"source_path_from_root": "/articles/iot-hub/tutorial-x509-certificates.md",
1273-
"redirect_url": "/azure/iot-hub/reference-x509-certificates",
1273+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
12741274
"redirect_document_id": true
12751275
},
12761276
{
12771277
"source_path_from_root": "/articles/iot-hub/tutorial-x509-introduction.md",
1278-
"redirect_url": "/azure/iot-hub/tutorial-x509-prove-possession",
1278+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
1279+
"redirect_document_id": false
1280+
},
1281+
{
1282+
"source_path_from_root": "/articles/iot-hub/tutorial-x509-openssl.md",
1283+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
1284+
"redirect_document_id": false
1285+
},
1286+
{
1287+
"source_path_from_root": "/articles/iot-hub/tutorial-x509-prove-possession.md",
1288+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
12791289
"redirect_document_id": false
12801290
},
12811291
{
12821292
"source_path_from_root": "/articles/iot-hub/tutorial-x509-self-sign.md",
1283-
"redirect_url": "/azure/iot-hub/reference-x509-certificates",
1293+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
12841294
"redirect_document_id": false
12851295
},
12861296
{
12871297
"source_path_from_root": "/articles/iot-hub/tutorial-x509-scripts.md",
1288-
"redirect_url": "/azure/iot-hub/tutorial-x509-openssl",
1298+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
1299+
"redirect_document_id": false
1300+
},
1301+
{
1302+
"source_path_from_root": "/articles/iot-hub/tutorial-x509-test-certificate.md",
1303+
"redirect_url": "/azure/iot-hub/tutorial-x509-test-certs",
12891304
"redirect_document_id": false
12901305
},
12911306
{

articles/iot-hub/TOC.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,9 @@
4242
- name: Data visualization in Power BI
4343
displayName: Stream Analytics
4444
href: iot-hub-live-data-visualization-in-power-bi.md
45-
- name: Use X.509 certificates
46-
items:
47-
- name: Use OpenSSL to create test certificates
48-
displayName: X.509 certificates, root CA
49-
href: tutorial-x509-openssl.md
50-
- name: Upload and verify CA certificates
51-
displayName: root certification authority (CA), verify certificate, manual verification, verification code, certificate signing request (CSR)
52-
href: tutorial-x509-prove-possession.md
53-
- name: Test certificate authentication
54-
displayName: X.509 certificates
55-
href: tutorial-x509-test-certificate.md
45+
- name: Create and upload certificates for testing
46+
displayName: X.509 certificates, root certificate authority (CA), verify certificate, certificate signing request (CSR)
47+
href: tutorial-x509-test-certs.md
5648
- name: Concepts
5749
items:
5850
- name: IoT Hub concepts overview

articles/iot-hub/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ landingContent:
7272
linkLists:
7373
- linkListType: tutorial
7474
links:
75-
- text: Use X.509 certificates to authenticate
76-
url: tutorial-x509-prove-possession.md
75+
- text: Create and upload certificates for testing
76+
url: tutorial-x509-test-certs.md
7777
- linkListType: concept
7878
links:
7979
- text: Security best practices

articles/iot-hub/iot-hub-dev-guide-sas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ The result, which would grant access to read all device identities, would be:
266266

267267
### Supported X.509 certificates
268268

269-
You can use any X.509 certificate to authenticate a device with IoT Hub by uploading either a certificate thumbprint or a certificate authority (CA) to Azure IoT Hub. To learn more, see [Device Authentication using X.509 CA Certificates](iot-hub-x509ca-overview.md). For information about how to upload and verify a certificate authority with your IoT hub, see [Set up X.509 security in your Azure IoT hub](./tutorial-x509-prove-possession.md).
269+
You can use any X.509 certificate to authenticate a device with IoT Hub by uploading either a certificate thumbprint or a certificate authority (CA) to Azure IoT Hub. To learn more, see [Device Authentication using X.509 CA Certificates](iot-hub-x509ca-overview.md). For information about how to upload and verify a certificate authority with your IoT hub for testing, see [Tutorial: Create and upload certificates for testing](tutorial-x509-test-certs.md).
270270

271271
### Enforcing X.509 authentication
272272

articles/iot-hub/iot-hub-tls-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ After a successful TLS handshake, IoT Hub can authenticate a device using a symm
128128

129129
## Mutual TLS support
130130

131-
Mutual TLS authentication ensures that the client _authenticates_ the server (IoT Hub) certificate and the server (IoT Hub) _authenticates_ the [X.509 client certificate or X.509 thumbprint](tutorial-x509-prove-possession.md). _Authorization_ is performed by IoT Hub after _authentication_ is complete.
131+
Mutual TLS authentication ensures that the client _authenticates_ the server (IoT Hub) certificate and the server (IoT Hub) _authenticates_ the [X.509 client certificate or X.509 thumbprint](tutorial-x509-test-certs.md#create-a-client-certificate-for-a-device). _Authorization_ is performed by IoT Hub after _authentication_ is complete.
132132

133133
For AMQP and MQTT protocols, IoT Hub requests a client certificate in the initial TLS handshake. If one is provided, IoT Hub _authenticates_ the client certificate and the client _authenticates_ the IoT Hub certificate. This process is called mutual TLS authentication. When IoT Hub receives an MQTT connect packet or an AMQP link opens, IoT Hub performs _authorization_ for the requesting client and determines if the client requires X.509 authentication. If mutual TLS authentication was completed and the client is authorized to connect as the device, it is allowed. However, if the client requires X.509 authentication and client authentication was not completed during the TLS handshake, then IoT Hub rejects the connection.
134134

articles/iot-hub/iot-hub-x509-certificate-concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ To learn more about the fields that make up an X.509 certificate, see [X.509 cer
121121

122122
If you're already familiar with X.509 certificates, and you want to generate test versions that you can use to authenticate to your IoT hub, see the following articles:
123123

124-
* [Tutorial: Use OpenSSL to create test certificates](tutorial-x509-openssl.md)
124+
* [Tutorial: Create and upload certificates for testing](tutorial-x509-test-certs.md)
125125
* If you want to use self-signed certificates for testing, see the [Create a self-signed certificate](reference-x509-certificates.md#create-a-self-signed-certificate) section of [X.509 certificates](reference-x509-certificates.md).
126126

127127
>[!IMPORTANT]
128128
>We recommend that you use certificates signed by an issuing Certificate Authority (CA), even for testing purposes. Never use self-signed certificates in production.
129129
130-
If you have a root CA certificate or subordinate CA certificate and you want to upload it to your IoT hub, you must verify that you own that certificate. For more information, see [Tutorial: Upload and verify a CA certificate to IoT Hub](tutorial-x509-prove-possession.md).
130+
If you have a root CA certificate or subordinate CA certificate and you want to upload it to your IoT hub, you must verify that you own that certificate. For more information, see [Tutorial: Create and upload certificates for testing](tutorial-x509-test-certs.md).

articles/iot-hub/iot-hub-x509ca-overview.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ The X.509 CA feature enables device authentication to IoT Hub using a certificat
2828

2929
The X.509 CA certificate is at the top of the chain of certificates for each of your devices. You may purchase or create one depending on how you intend to use it.
3030

31-
For production environments, we recommend that you purchase an X.509 CA certificate from a public root certificate authority. Purchasing a CA certificate has the benefit of the root CA acting as a trusted third party to vouch for the legitimacy of your devices. Consider this option if your devices are part of an open IoT network where they interact with third-party products or services.
31+
For production environments, we recommend that you purchase an X.509 CA certificate from a professional certificate services provider. Purchasing a CA certificate has the benefit of the root CA acting as a trusted third party to vouch for the legitimacy of your devices. Consider this option if your devices are part of an open IoT network where they interact with third-party products or services.
3232

33-
You may also create a self-signed X.509 CA for experimentation or for use in closed IoT networks.
33+
You may also create a self-signed X.509 CA certificate for testing purposes. For more information about creating certificates for testing, see [Create and upload certificates for testing](tutorial-x509-test-certs.md).
3434

35-
Regardless of how you obtain your X.509 CA certificate, make sure to keep its corresponding private key secret and protected always. This precaution is necessary for building trust in the X.509 CA authentication.
35+
>[!NOTE]
36+
>We do not recommend the use of self-signed certificates for production environments.
3637
37-
Learn how to [create a self-signed CA certificate](https://github.com/Azure/azure-iot-sdk-c/blob/master/tools/CACertificates/CACertificateOverview.md), which you can use for testing.
38+
Regardless of how you obtain your X.509 CA certificate, make sure to keep its corresponding private key secret and protected always. This precaution is necessary for building trust in the X.509 CA authentication.
3839

3940
## Sign devices into the certificate chain of trust
4041

@@ -52,9 +53,9 @@ Register your X.509 CA certificate to IoT Hub, which uses it to authenticate you
5253

5354
The upload process entails uploading a file that contains your certificate. This file should never contain any private keys.
5455

55-
The proof of possession step involves a cryptographic challenge and response process between you and IoT Hub. Given that digital certificate contents are public and therefore susceptible to eavesdropping, IoT Hub has to verify that you really own the CA certificate. It does so by generating a random challenge that you sign with the CA certificate's corresponding private key. If you kept the private key secret and protected as recommended, then only you possess the knowledge to complete this step. Secrecy of private keys is the source of trust in this method. After signing the challenge, you complete this step by uploading a file containing the results.
56+
The proof of possession step involves a cryptographic challenge and response process between you and IoT Hub. Given that digital certificate contents are public and therefore susceptible to eavesdropping, IoT Hub has to verify that you really own the CA certificate. You can choose to either automatically or manually verify ownership. For manual verification, Azure IoT Hub generates a random challenge that you sign with the CA certificate's corresponding private key. If you kept the private key secret and protected as recommended, then only you possess the knowledge to complete this step. Secrecy of private keys is the source of trust in this method. After signing the challenge, you complete this step and manually verify your certificate by uploading a file containing the results.
5657

57-
Learn how to [register your CA certificate](./tutorial-x509-prove-possession.md)
58+
Learn how to [register your CA certificate](tutorial-x509-test-certs.md#register-your-subordinate-ca-certificate-to-your-iot-hub).
5859

5960
## Create a device on IoT Hub
6061

@@ -68,8 +69,6 @@ With your X.509 CA certificate registered and devices signed into a certificate
6869

6970
A successful device connection to IoT Hub completes the authentication process and is also indicative of a proper setup. Every time a device connects, IoT Hub renegotiates the TLS session and verifies the device’s X.509 certificate.
7071

71-
Learn how to [complete this device connection step](./tutorial-x509-prove-possession.md).
72-
7372
## Revoke a device certificate
7473

7574
IoT Hub doesn't check certificate revocation lists from the certificate authority when authenticating devices with certificate-based authentication. If you have a device that needs to be blocked from connecting to IoT Hub because of a potentially compromised certificate, you should disable the device in the identity registry. For more information, see [Disable or delete a device in an IoT hub](./iot-hub-create-through-portal.md#disable-or-delete-a-device-in-an-iot-hub).
42.8 KB
Loading
18.3 KB
Loading

articles/iot-hub/reference-x509-certificates.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,58 @@ You can use [OpenSSL](https://www.openssl.org/) to create self-signed certificat
187187
openssl x509 -in {CrtFile} -noout -fingerprint
188188
```
189189

190+
### Verify certificate manually after upload
191+
192+
When you upload your root certificate authority (CA) certificate or subordinate CA certificate to your IoT hub, you can choose to automatically verify the certificate. If you didn't choose to automatically verify your certificate during upload, your certificate is shown with its status set to **Unverified**. You must perform the following steps to manually verify your certificate.
193+
194+
1. Select the certificate to view the **Certificate Details** dialog.
195+
196+
1. Select **Generate Verification Code** in the dialog.
197+
198+
:::image type="content" source="media/reference-x509-certificates/certificate-details.png" alt-text="Screenshot showing the certificate details dialog.":::
199+
200+
1. Copy the verification code to the clipboard. You must use this verification code as the certificate subject in subsequent steps. For example, if the verification code is `75B86466DA34D2B04C0C4C9557A119687ADAE7D4732BDDB3`, add that as the subject of your certificate as shown in the next step.
201+
202+
1. There are three ways to generate a verification certificate:
203+
204+
- If you're using the PowerShell script supplied by Microsoft, run `New-CACertsVerificationCert "<verification code>"` to create a certificate named `VerifyCert4.cer`, replacing `<verification code>` with the previously generated verification code. For more information, see [Managing test CA certificates for samples and tutorials](https://github.com/Azure/azure-iot-sdk-c/blob/main/tools/CACertificates/CACertificateOverview.md) in the GitHub repository for the [Azure IoT Hub Device SDK for C](https://github.com/Azure/azure-iot-sdk-c).
205+
206+
- If you're using the Bash script supplied by Microsoft, run `./certGen.sh create_verification_certificate "<verification code>"` to create a certificate named verification-code.cert.pem, replacing `<verification code>` with the previously generated verification code. For more information, see [Managing test CA certificates for samples and tutorials](https://github.com/Azure/azure-iot-sdk-c/blob/main/tools/CACertificates/CACertificateOverview.md) in the GitHub repository for the Azure IoT Hub Device SDK for C.
207+
208+
- If you're using OpenSSL to generate your certificates, you must first generate a private key, then generate a certificate signing request (CSR) file. In the following example, replace `<verification code>` with the previously generated verification code:
209+
210+
```bash
211+
openssl genpkey -out pop.key -algorithm RSA -pkeyopt rsa_keygen_bits:2048
212+
213+
openssl req -new -key pop.key -out pop.csr
214+
215+
-----
216+
Country Name (2 letter code) [XX]:.
217+
State or Province Name (full name) []:.
218+
Locality Name (eg, city) [Default City]:.
219+
Organization Name (eg, company) [Default Company Ltd]:.
220+
Organizational Unit Name (eg, section) []:.
221+
Common Name (eg, your name or your server hostname) []:<verification code>
222+
Email Address []:
223+
224+
Please enter the following 'extra' attributes
225+
to be sent with your certificate request
226+
A challenge password []:
227+
An optional company name []:
228+
```
229+
230+
Then, create a certificate using the appropriate configuration file for either the root CA or the subordinate CA, and the CSR file. The following example demonstrates how to use OpenSSL to create the certificate from a root CA configuration file and the CSR file.
231+
232+
```bash
233+
openssl ca -config rootca.conf -in pop.csr -out pop.crt -extensions client_ext
234+
```
235+
236+
For more information, see [Tutorial - Create and upload certificates for testing](tutorial-x509-test-certs.md).
237+
238+
1. Select the new certificate in the **Certificate Details** view.
239+
240+
1. After the certificate uploads, select **Verify**. The certificate status should change to **Verified**.
241+
190242
## For more information
191243

192244
For more information about X.509 certificates and how they're used in IoT Hub, see the following articles:

0 commit comments

Comments
 (0)