Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ssl connection has been closed unexpectedly

166 views
Skip to first unread message

Shaozhong SHI

unread,
Nov 28, 2020, 6:30:14 PM11/28/20
to
Hi,

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

(Background on this error at: http://sqlalche.me/e/13/e3q8)
OperationalError: (psycopg2.OperationalError) SSL connection has been
closed unexpectedly

Can anyone shed any light on this?

Regards,

David

Dieter Maurer

unread,
Nov 29, 2020, 1:31:28 PM11/29/20
to
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.

Dan Stromberg

unread,
Nov 29, 2020, 4:29:49 PM11/29/20
to
What happens if you execute this from a shell prompt on a system with
openssl installed?
openssl s_client -connect host.com:443

(replacing host.com with your server's hostname and 443 with your port of
interest)


On Sat, Nov 28, 2020 at 3:30 PM Shaozhong SHI <shisha...@gmail.com>
wrote:

> Hi,
>
> 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
>
> (Background on this error at: http://sqlalche.me/e/13/e3q8)
> OperationalError: (psycopg2.OperationalError) SSL connection has been
> closed unexpectedly
>
> Can anyone shed any light on this?
>
> Regards,
>
> David
> --
> https://mail.python.org/mailman/listinfo/python-list
>
0 new messages