ตัวอย่างสมบูรณ์ — ต้องมีใบรับรองและกุญแจก่อนเริ่ม
โค้ดจาก tesaiot/developer-hub (Apache-2.0) · commit d2ed42c · main.c
join_path(crt, sizeof(crt), certs_dir, FILE_CLIENT_CERT);
join_path(key, sizeof(key), certs_dir, FILE_CLIENT_KEY);
if (!(file_exists(crt) && file_exists(key))) {
fprintf(stderr, "mTLS requires client_cert.pem "
"and client_key.pem in %s\n", certs_dir);
return 1;
}