[HACKERS] Error-like LOG when connecting with SSL for password authentication - Mailing list pgsql-hackers

From Michael Paquier
Subject [HACKERS] Error-like LOG when connecting with SSL for password authentication
Date
Msg-id CAB7nPqSfyVV42Q2acFo=vrvF2gxoZAMJLAPq3S3KkjhZAYi7aw@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] Error-like LOG when connecting with SSL for password authentication  (Vaishnavi Prabakaran <vaishnaviprabakaran@gmail.com>)
Re: [HACKERS] Error-like LOG when connecting with SSL for passwordauthentication  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Hi all,

When attempting to connect using password authentication through SSL,
the backend will complain in its log with the following entry before
calling sendAuthRequest(), which asks the client for a password:
LOG:  could not receive data from client: Connection reset by peer

After a short talk with Heikki, it seems that be_tls_read() complains
on SSL_ERROR_ZERO_RETURN, which is documented here:
https://wiki.openssl.org/index.php/Manual:SSL_get_error(3)
The TLS/SSL connection has been closed. If the protocol version is SSL
3.0 or TLS 1.0, this result code is returned only if a closure alert
has occurred in the protocol, i.e. if the connection has been closed
cleanly. Note that in this case SSL_ERROR_ZERO_RETURN does not
necessarily indicate that the underlying transport has been closed.

As this is a clean shutdown of the SSL connection, shouldn't
be_tls_read() return 0 to the caller instead of -1? This would map
with what the non-SSL code path does for raw reads.

This is basically harmless, but the error message is confusing I
think, and there is no equivalent for the non-SSL code path.

Attached is an idea of patch.
Thoughts?
-- 
Michael

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Partition-wise join for join between (declaratively)partitioned tables
Next
From: Magnus Hagander
Date:
Subject: Re: [HACKERS] Fix a typo in hash.c