File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 18
18
print ("WiFi secrets are kept in secrets.py, please add them there!" )
19
19
raise
20
20
21
- # Get device certificate and private key from a certificates.py file
21
+ # Get device certificate
22
22
try :
23
- from certificates import DEVICE_CERT , DEVICE_KEY
23
+ with open ("aws_cert.pem.crt" , "rb" ) as f :
24
+ DEVICE_CERT = f .read ()
24
25
except ImportError :
25
- print ("Certificate and private key data is kept in certificates.py, \
26
- please add them there!" )
26
+ print ("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem." )
27
+ raise
28
+
29
+ # Get device private key
30
+ try :
31
+ with open ("private.pem.key" , "rb" ) as f :
32
+ DEVICE_KEY = f .read ()
33
+ except ImportError :
34
+ print ("Certificate (private.pem.key) not found on CIRCUITPY filesystem." )
27
35
raise
28
36
29
37
# If you are using a board with pre-defined ESP32 Pins:
Original file line number Diff line number Diff line change 18
18
print ("WiFi secrets are kept in secrets.py, please add them there!" )
19
19
raise
20
20
21
- # Get device certificate and private key from a certificates.py file
21
+ # Get device certificate
22
22
try :
23
- from certificates import DEVICE_CERT , DEVICE_KEY
23
+ with open ("aws_cert.pem.crt" , "rb" ) as f :
24
+ DEVICE_CERT = f .read ()
24
25
except ImportError :
25
- print ("Certificate and private key data is kept in certificates.py, \
26
- please add them there!" )
26
+ print ("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem." )
27
+ raise
28
+
29
+ # Get device private key
30
+ try :
31
+ with open ("private.pem.key" , "rb" ) as f :
32
+ DEVICE_KEY = f .read ()
33
+ except ImportError :
34
+ print ("Certificate (private.pem.key) not found on CIRCUITPY filesystem." )
27
35
raise
28
36
29
37
# If you are using a board with pre-defined ESP32 Pins:
You can’t perform that action at this time.
0 commit comments