Skip to content

feat: add SetCipherList to override TLS 1.2 cipher list - #200

Open
freitasjca wants to merge 1 commit into
winddriver:masterfrom
freitasjca:feat/set-cipher-list
Open

feat: add SetCipherList to override TLS 1.2 cipher list#200
freitasjca wants to merge 1 commit into
winddriver:masterfrom
freitasjca:feat/set-cipher-list

Conversation

@freitasjca

@freitasjca freitasjca commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • Adds SetCipherList(const ACipherList: string) as a virtual; abstract method on TCrossSslSocketBase
  • Implements it in TCrossOpenSslSocket via SSL_CTX_set_cipher_list, wrapped in the existing BeginTlsConfigUpdate/EndTlsConfigUpdate pair
  • Empty string is a no-op (leaves the context default untouched)
  • An unrecognised cipher string raises ESsl at call site rather than silently falling back

Motivation

Some deployments need to restrict TLS 1.2 to a custom cipher list (e.g. to comply with FIPS or PCI-DSS profiles) without forking the library. SetCipherList exposes the already-bound SSL_CTX_set_cipher_list through the public API.

Notes

  • TLS 1.3 cipher suites are controlled separately by SSL_CTX_set_ciphersuites (not changed here)
  • The existing SSL_CTX_set_cipher_list binding in Net.OpenSSL.pas is reused — no new import needed
  • Follows the same pattern as SetCertificate, SetPrivateKey, and AddCACertificate

Add an abstract SetCipherList method to TCrossSslSocketBase and
implement it in TCrossOpenSslSocket via SSL_CTX_set_cipher_list.

Empty string is a no-op. An unrecognised cipher string (no matching
ciphers) raises ESsl at call time rather than silently falling back
to the context default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant