|
18 | 18 | from secrets import DEVICE_ID
|
19 | 19 | from secrets import SECRET_KEY # noqa
|
20 | 20 |
|
21 |
| -KEY_PATH = "key.der" |
22 |
| -CERT_PATH = "cert.der" |
| 21 | +KEY_PATH = "key.der" # noqa |
| 22 | +CERT_PATH = "cert.der" # noqa |
23 | 23 |
|
24 | 24 |
|
25 | 25 | def on_switch_changed(client, value):
|
@@ -76,13 +76,15 @@ def wifi_connect():
|
76 | 76 | # ID, and the password is the secret key obtained from the IoT cloud when provisioning a device.
|
77 | 77 | client = ArduinoCloudClient(device_id=DEVICE_ID, username=DEVICE_ID, password=SECRET_KEY, sync_mode=False)
|
78 | 78 |
|
79 |
| - # Alternatively, the client also supports key and certificate-based authentication. To use this |
80 |
| - # mode, set "keyfile" and "certfile", and the CA certificate (if any) in "ssl_params". |
81 |
| - # Note that for MicroPython, the key and cert files must be stored in DER format on the filesystem. |
| 79 | + # Alternatively, the client supports key and certificate-based authentication. To use this |
| 80 | + # mode, set "keyfile" and "certfile", and specify the CA certificate (if any) in "ssl_params". |
| 81 | + # Secure elements, which can be used to store the key and certificate, are also supported. |
| 82 | + # To use secure elements, provide the key and certificate URIs (in provider:token format) and |
| 83 | + # set the token's PIN (if applicable). For example: |
82 | 84 | # client = ArduinoCloudClient(
|
83 | 85 | # device_id=DEVICE_ID,
|
84 | 86 | # ssl_params={
|
85 |
| - # "keyfile": KEY_PATH, "certfile": CERT_PATH, "cadata": CADATA, |
| 87 | + # "pin": "1234", "keyfile": KEY_PATH, "certfile": CERT_PATH, "cadata": CADATA, |
86 | 88 | # "verify_mode": ssl.CERT_REQUIRED, "server_hostname" : "iot.arduino.cc"
|
87 | 89 | # },
|
88 | 90 | # sync_mode=False,
|
|
0 commit comments