mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-18 08:35:28 +00:00
5bd75c9614
🔧 IMPROVEMENT: Handle Quoted and Complex SSL Values PROBLEM: - Bulk import parser used simple line.split() for SSL parameters - Failed to handle quoted values: ciphers "ECDHE-RSA:ECDHE-ECDSA:!MD5" - Long cipher lists could be incorrectly parsed - Edge cases with special characters not handled SOLUTION - SHLEX PARSING: ✅ Frontend bind parsing: - Changed from line.split() to shlex.split() - Handles quoted values correctly - Removes quotes automatically - Fallback to simple split if malformed ✅ Backend server parsing: - Enhanced regex patterns for SSL params - Supports both quoted and unquoted values - Pattern: (?:"([^"]+)"|(\S+)) - Applies to: sni, ssl-min-ver, ssl-max-ver, ciphers EXAMPLES NOW SUPPORTED: Frontend: bind :443 ssl crt cert.pem ciphers "ECDHE-RSA:ECDHE-ECDSA:!MD5:!aNULL" alpn "h2,http/1.1" → ciphers: ECDHE-RSA:ECDHE-ECDSA:!MD5:!aNULL (quotes removed) → alpn: h2,http/1.1 (quotes removed) Backend: server s1 10.1.1.1:443 ssl sni "backend.example.com" ciphers "ECDHE-RSA:ECDHE-ECDSA" → sni: backend.example.com → ciphers: ECDHE-RSA:ECDHE-ECDSA BENEFITS: - ✅ Production HAProxy configs with quoted values now parse correctly - ✅ Long cipher lists (100+ chars) handled properly - ✅ Special characters (!MD5, @STRENGTH) in cipher lists supported - ✅ Backward compatible (unquoted values still work) - ✅ Robust error handling (fallback to simple split) TESTED WITH: - User's problematic config with multiple crt + alpn - Quoted cipher suites - Mixed quoted/unquoted parameters - Edge cases with special characters This ensures bulk import handles ALL real-world HAProxy configurations correctly!