espressif / esp-protocols

Collection of ESP-IDF components related to networking protocols
165 stars 115 forks source link

feat(websocket): Expanded example to demonstrate the transfer over TLS (IDFGH-11681) #506

Closed gabsuren closed 4 months ago

david-cermak commented 4 months ago

As mentioned in the comments, I'd suggest using server side verification (always), optionally adding client side verification (mutual authentication).

I think for user's perspective it would be useful to see these two additional configs: 1) TLS with server side verification only (using some public ws server if available) 2) Mutual authentication -- with self signed certificates

gabsuren commented 4 months ago

@david-cermak thank you for the review. I've updated the example with the following changes:

  1. The server now always checks the client's certificates ssl_context.verify_mode = ssl.CERT_REQUIRED.
  2. Both client and server now perform mutual authentication using self-signed certificates.
  3. The client bypasses server certificate verification by enabling CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y. But, it uses public and private keys, allowing the server to authenticate the client's identity through its certificates

Please let me know if this adjustment looks ok for you

gabsuren commented 4 months ago

Updated : Modified the example to have a two configurations