ssl connection has been closed unexpectedly

Dieter Maurer dieter at handshake.de
Sun Nov 29 13:30:46 EST 2020


Shaozhong SHI wrote at 2020-11-28 23:29 +0000:
>I keep getting the following error when I use engine =
>create_engine(logging in details to postgres)
>df.to_sql('table_name', and etc.)
>
>
>OperationalError: (psycopg2.OperationalError) SSL connection has been
>closed unexpectedly

SSL works as follows: a "normal" connection is opened to
the specified "communication port". After that, an "SSL handshake"
sets up encryption for the following communication over the channel.
In your case, the "SSL handshake" was aborted by the communication
partner closing the connection.

You might get errors like this if the connected "port" is
not prepared for SSL connections.

Check the Postgres server configuration and your connection
parameters. It the specified communication port SSL aware?
If so, look whether there is helpful information in the Postgres
log file.


More information about the Python-list mailing list