Skip to content

Conversation

@moticless
Copy link
Collaborator

@moticless moticless commented Dec 9, 2025

Key Features

  • TLS/SSL connections with server certificate verification
  • Mutual TLS authentication with client certificates
  • Flexible configuration: CA certs, custom ciphers, SNI support
  • New API: RdbxSSLConfig structure for TLS configuration
  • CLI support: Added --tls, --cacert, --cert, --key, and related flags
  • Build flag: BUILD_TLS=yes to enable (optional, backward compatible)
  • Enhanced hostname resolution (IPv4/IPv6 support)
  • Cheerful colors for runtests

Implementation Highlights

  • Extended RDBX_createRespToRedisTcp() with optional SSL config parameter
  • SSL wrapper around socket I/O operations
  • New error codes for TLS-specific failures
  • Comprehensive test suite (test_rdb_to_redis_tls.c)
  • Automated cert generation for testing
  • CI/CD integration

Closes: #39 , #59

Redis 5.0 doesn't support TLS (added in 6.0), causing CI failures
with 'Bad directive' error for tls-port configuration.
MSG_NOSIGNAL is Linux-specific and not available on macOS/BSD.
- Define MSG_NOSIGNAL as 0 on platforms that don't support it
- Use SO_NOSIGPIPE socket option on macOS/BSD to prevent SIGPIPE

This fixes the compilation error on macOS:
  error: use of undeclared identifier 'MSG_NOSIGNAL'
On macOS, OpenSSL installed via Homebrew is in a non-standard location,
causing compilation failures when BUILD_TLS=yes:
  fatal error: 'openssl/ssl.h' file not found

Changes:
- CI: Install OpenSSL via brew when TLS is enabled on macOS
- Makefiles: Auto-detect OpenSSL in Homebrew locations
  - Checks /opt/homebrew/opt/openssl (Apple Silicon)
  - Checks /usr/local/opt/openssl (Intel)
  - Adds appropriate -I and -L flags when found
- Updated: src/ext/Makefile, src/cli/Makefile, examples/Makefile

This follows the same pattern used by the hiredis dependency.
@moticless moticless merged commit 83b7852 into redis:main Dec 10, 2025
14 checks passed
@moticless moticless deleted the tls-support branch December 10, 2025 14:44
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.

Not support IPV6 address.

2 participants