security: TLS does not verify server certificate when no CA is provided #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
src/shared/transport_tls.c,create_ssl_ctx()only enables peer certificate verification when a CA path is specified:Lines 66-75:
When
ca_pathis NULL (no--caflag),SSL_CTX_set_verifyis never called, meaning OpenSSL default isSSL_VERIFY_NONE. The client will:Additionally, the server never requests client certificates even when CA is set — only
SSL_VERIFY_PEERis used server-side, but withoutSSL_VERIFY_FAIL_IF_NO_PEER_CERT, unauthenticated clients can still connect.Fix: When
--cais provided, always setSSL_VERIFY_PEERon the client side. Consider settingSSL_VERIFY_FAIL_IF_NO_PEER_CERTfor server when CA is provided.Severity: critical