Fix sslsni boolean to integer conversion for libpq compatibility
The sslsni connection parameter was being stored as a boolean (true/false) in the database, but libpq expects integer values (1/0) for this parameter. When a boolean value was passed to libpq, it resulted in SSL connection failures with 'unexpected eof while reading' errors. This fix converts boolean connection parameters (sslcompression, sslsni) to integers when creating the connection string in server_manager.py, ensuring libpq receives the expected integer format. Fixes connection issues when using PGSSLSNI=1 with PostgreSQL 14+ servers.pull/9521/head
parent
74c8b2d0a1
commit
402ddafa2a
|
|
@ -690,6 +690,10 @@ WHERE db.oid = {0}""".format(did))
|
|||
if key == 'hostaddr' and self.use_ssh_tunnel:
|
||||
continue
|
||||
|
||||
# Convert boolean connection parameters to integer for libpq compatibility
|
||||
if key in ('sslcompression', 'sslsni'):
|
||||
value = 1 if value else 0
|
||||
|
||||
dsn_args[key] = value
|
||||
display_dsn_args[key] = orig_value if with_complete_path else \
|
||||
value
|
||||
|
|
|
|||
Loading…
Reference in New Issue