0
0
IOT Protocolsdevops~10 mins

Certificate-based authentication in IOT Protocols - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a client certificate file for authentication.

IOT Protocols
client_cert = open('[1]', 'rb').read()
Drag options to blanks, or click blank then click option'
Aclient.crt
Bserver.crt
Cca.pem
Dclient.key
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing the private key file instead of the certificate file.
2fill in blank
medium

Complete the code to specify the CA certificate file for verifying the server.

IOT Protocols
ca_cert_path = '[1]'
Drag options to blanks, or click blank then click option'
Aserver.key
Bclient.crt
Cclient.key
Dca.pem
Attempts:
3 left
💡 Hint
Common Mistakes
Using the client certificate or key instead of the CA certificate.
3fill in blank
hard

Fix the error in the TLS context setup by completing the missing method call.

IOT Protocols
tls_context.load_cert_chain(certfile='[1]', keyfile='client.key')
Drag options to blanks, or click blank then click option'
Aca.pem
Bclient.crt
Cserver.crt
Dclient.key
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the CA certificate or key file as the certificate file.
4fill in blank
hard

Fill both blanks to create a dictionary with client certificate and key paths.

IOT Protocols
cert_info = {'cert': '[1]', 'key': '[2]'}
Drag options to blanks, or click blank then click option'
Aclient.crt
Bclient.key
Cserver.crt
Dca.pem
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up certificate and key file names.
5fill in blank
hard

Fill all three blanks to configure TLS with certificate, key, and CA files.

IOT Protocols
tls_config = {
  'certfile': '[1]',
  'keyfile': '[2]',
  'cafile': '[3]'
}
Drag options to blanks, or click blank then click option'
Aclient.crt
Bclient.key
Cca.pem
Dserver.key
Attempts:
3 left
💡 Hint
Common Mistakes
Using server key or wrong files for these keys.