KVS WebRTC signaling doesn't verify TLS server cert (v1 netio.c) — patch it, or should we move to v2 (kvs_webrtc_v2_mmf)?

SDK version: Ameba FreeRTOS Pro2 SDK (AmebaPro2 / RTL8735B), release 9.6_r

Issue:
In the v1 KVS WebRTC example (kvs_webrtc_mmf, using lib_amazon’s amazon-kinesis-video-streams-webrtc-sdk-c), the signaling connection — both the WSS channel (wss_api.c) and REST calls (http_api.c) — connects via NetIo_connect() in netio.c. When no CA/cert/key is passed (which is always the case here), it falls back to:
mbedtls_ssl_conf_authmode(&conf, MBEDTLS_SSL_VERIFY_OPTIONAL);
with no mbedtls_ssl_conf_ca_chain() call, and no mbedtls_ssl_get_verify_result() check anywhere. So the connection is encrypted but doesn’t verify it’s actually talking to AWS — a MITM with a fake cert would go undetected. The CA cert that AppCredential.c’s searchSslCert() loads is stored but never actually applied to this connection.

What I’ve also found: the SDK ships a newer kvs_webrtc_v2_mmf example using a different stack (transport_mbedtls.c) that does verify properly (real CA chain, VERIFY_REQUIRED, hostname/SNI). But it’s not a drop-in — its own readme requires fetching the actual library source from a separate repo (fetch_aws_lib.sh), which isn’t vendored yet, and its whole architecture (SDP/jitter-buffer/SRTP handling now done in app code, different signaling/peer-connection API) looks like a much bigger rewrite than a patch.

Questions:

  1. Is the v1 netio.c gap already known/fixed in a later release than 9.6_r?
  2. Is v1 (kvs_webrtc_mmf) still meant to be usable/supported going forward, or is v2 the intended replacement for new production designs?
  3. If we just patch v1’s netio.c ourselves (add CA-only verification for NetIo_connect, or switch the signaling calls to a verifying connect variant), is that a safe/sane approach, or is there a reason AWS/Realtek didn’t already do that (e.g. some KVS-specific reason wss_api.c/http_api.c avoid strict verification)?

Basically: should we patch what we have, or is moving to v2 the actual expectation going forward? Any guidance on which path is intended for production use would help.

:waving_hand: Thanks for posting!

For documentation, SDK resources, FAQs, and community guidelines, please visit: here

For commercial users, if you would like to have dedicated technical support or to connect with us, please fill in the Private User Form

Happy building with Ameba!


:waving_hand: 感謝您的分享!

如需查閱技術文件、SDK 資源、常見問題及社群指南,請參考: 這裡

若您是商業用戶,希望獲得專屬技術支援或與我們聯繫,請填寫 Private User Form (商業用戶表單)

祝您使用 Ameba 開發順利!