0
0
Microservicessystem_design~10 mins

Mutual TLS between services in Microservices - Interactive Code Practice

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

Complete the code to specify the protocol used for secure communication between services.

Microservices
protocol = "[1]"
Drag options to blanks, or click blank then click option'
Ahttp
Bftp
Chttps
Dsmtp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'http' which is not secure.
Confusing with other protocols like FTP or SMTP.
2fill in blank
medium

Complete the code to load the client certificate for mutual TLS authentication.

Microservices
client_cert = load_certificate("[1]")
Drag options to blanks, or click blank then click option'
Aclient.crt
Broot.crt
Cca.crt
Dserver.crt
Attempts:
3 left
💡 Hint
Common Mistakes
Using the server certificate instead of client certificate.
Using CA or root certificates which are for verification, not client identity.
3fill in blank
hard

Fix the error in the code to enable mutual TLS by setting the correct verification mode.

Microservices
ssl_context.verify_mode = ssl.CERT_[1]
Drag options to blanks, or click blank then click option'
ANONE
BOPTIONAL
CIGNORE
DREQUIRED
Attempts:
3 left
💡 Hint
Common Mistakes
Setting verify_mode to NONE or IGNORE disables client verification.
OPTIONAL allows clients without certificates, which is not mutual TLS.
4fill in blank
hard

Fill both blanks to configure the server to load the CA certificate and enable client certificate verification.

Microservices
ssl_context.load_verify_locations("[1]")
ssl_context.verify_mode = ssl.CERT_[2]
Drag options to blanks, or click blank then click option'
Aca.pem
Bclient
CREQUIRED
DOPTIONAL
Attempts:
3 left
💡 Hint
Common Mistakes
Using client certificate file instead of CA certificate file.
Setting verify_mode to OPTIONAL disables strict client verification.
5fill in blank
hard

Fill all three blanks to create a secure client connection with mutual TLS by specifying client cert, key, and CA cert files.

Microservices
connection = create_tls_connection(client_cert="[1]", client_key="[2]", ca_cert="[3]")
Drag options to blanks, or click blank then click option'
Aclient.pem
Bclient.key
Cca.pem
Dserver.pem
Attempts:
3 left
💡 Hint
Common Mistakes
Using server.pem instead of client.pem for client certificate.
Omitting the client key or CA certificate.