Skip to content

Harden TLS: enable certificate verification and SNI in inet_client.c #8

Description

@fsoft72

Description

afc_inet_client_enable_ssl() creates the TLS context and connects, but the code around src/inet_client.c:656-718 never enables certificate verification and never sets SNI.

Impact

HTTPS / SMTPS / POP3S clients can accept untrusted certificates, and some modern virtual-hosted TLS endpoints may fail without SNI.

Suggested Fix

  • Call SSL_CTX_set_verify() with SSL_VERIFY_PEER
  • Load system CA roots
  • Check the verification result after the handshake
  • Set the hostname with SSL_set_tlsext_host_name() before SSL_connect()

Priority: High — security fix
Source: IMPROVEMENTS.md #1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions