Skip to content

Commit 402ddaf

Browse files
authored
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.
1 parent 74c8b2d commit 402ddaf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

web/pgadmin/utils/driver/psycopg3/server_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ def create_connection_string(self, database, user, password=None):
690690
if key == 'hostaddr' and self.use_ssh_tunnel:
691691
continue
692692

693+
# Convert boolean connection parameters to integer for libpq compatibility
694+
if key in ('sslcompression', 'sslsni'):
695+
value = 1 if value else 0
696+
693697
dsn_args[key] = value
694698
display_dsn_args[key] = orig_value if with_complete_path else \
695699
value

0 commit comments

Comments
 (0)