Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-29 Thread Tom Lane
Asif Naeem writes: > Thank you Tom. The issue seems not reproducible anymore with latest PG95 > source code (commit 60fcee9e5e77dc748a9787fae34328917683b95e) Windows build Thanks for testing! I've marked this issue resolved in the 9.5 open-items list. regards, tom lane

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-29 Thread Asif Naeem
Thank you Tom. The issue seems not reproducible anymore with latest PG95 source code (commit 60fcee9e5e77dc748a9787fae34328917683b95e) Windows build i.e. C:\PG\postgresql\pg95_with_openssl>bin\psql.exe -d postgres -h > 172.16.141.232 > psql (9.5alpha2) > WARNING: Console code page (437) differs fr

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Tom Lane
Thom Brown writes: > With 9.5 alpha 2 on Windows 8 (64-bit), trying to require SSL results > in a blocking error: I've pushed a patch for this; can you verify it on Windows? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Tom Lane
Andres Freund writes: > We now probably could remove > * XXX OpenSSL 1.0.1e considers many more errcodes than just EINTR as reasons > * to retry; do we need to adopt their logic for that? > since we now actually check for more tahn just EINTR. Well, that comment is cloned from the backend which

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Andres Freund
On 2015-09-28 17:28:48 -0400, Tom Lane wrote: > > What I do find curious is that afaics before 680513ab79 the code also > > looked at errno, not SOCK_ERRNO. And apparently things worked back then? > > No; AFAICS, before that commit, libpq did not use a custom BIO at all. > That commit cloned the

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Tom Lane
Andres Freund writes: > On 2015-09-28 16:57:24 -0400, Tom Lane wrote: >> Great detective work! But if that's broken, then surely the identical >> code in my_sock_write is as well; and the reassignment to errno at the >> bottom of my_sock_read needs to be SOCK_ERRNO_SET(); and why doesn't >> my_so

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Tom Lane
I wrote: > ... and the reassignment to errno at the > bottom of my_sock_read needs to be SOCK_ERRNO_SET(); and why doesn't > my_sock_write have a reassignment at all? Comparison to the backend versions of these routines, which have been through quite a few releases, suggests that the reassignment

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Andres Freund
On 2015-09-28 16:57:24 -0400, Tom Lane wrote: > Asif Naeem writes: > > I have spent sometime to investigate the issue, it is reproduciable. In > > case of Windows, when pqsecure_raw_read() function error code > > WSAEWOULDBLOCK (EWOULDBLOCK) when no data queued to be read from the non > > blocking

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Tom Lane
Asif Naeem writes: > I have spent sometime to investigate the issue, it is reproduciable. In > case of Windows, when pqsecure_raw_read() function error code > WSAEWOULDBLOCK (EWOULDBLOCK) when no data queued to be read from the non > blocking socket there is a need to log retry flag. Related error

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Alvaro Herrera
Asif Naeem wrote: > I have spent sometime to investigate the issue, it is reproduciable. In > case of Windows, when pqsecure_raw_read() function error code > WSAEWOULDBLOCK (EWOULDBLOCK) when no data queued to be read from the non > blocking socket there is a need to log retry flag. Related error c

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-28 Thread Asif Naeem
I have spent sometime to investigate the issue, it is reproduciable. In case of Windows, when pqsecure_raw_read() function error code WSAEWOULDBLOCK (EWOULDBLOCK) when no data queued to be read from the non blocking socket there is a need to log retry flag. Related error code can be retrieved via W

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-24 Thread Thom Brown
On 23 September 2015 at 13:10, Michael Paquier wrote: > > > On Wed, Sep 23, 2015 at 2:15 AM, Robert Haas wrote: >> >> On Tue, Sep 22, 2015 at 11:23 AM, Andrew Dunstan >> wrote: >> > "git bisect" is your friend. >> >> Yeah, but finding someone who has a working Windows build environment >> and a

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-23 Thread Michael Paquier
On Wed, Sep 23, 2015 at 2:15 AM, Robert Haas wrote: > On Tue, Sep 22, 2015 at 11:23 AM, Andrew Dunstan > wrote: > > "git bisect" is your friend. > > Yeah, but finding someone who has a working Windows build environment > and a lot of time to run this down is my enemy. We're trying, but if > any

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-22 Thread Robert Haas
On Tue, Sep 22, 2015 at 11:23 AM, Andrew Dunstan wrote: > "git bisect" is your friend. Yeah, but finding someone who has a working Windows build environment and a lot of time to run this down is my enemy. We're trying, but if anyone else has a clue, that would be much appreciated. -- Robert Ha

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-22 Thread Andrew Dunstan
On 09/22/2015 10:57 AM, Robert Haas wrote: On Tue, Sep 22, 2015 at 9:54 AM, Thom Brown wrote: Hi, With 9.5 alpha 2 on Windows 8 (64-bit), trying to require SSL results in a blocking error: pg_hba.conf: hostssl postgres postgres 0.0.0.0/0 trust postgresql.conf: ssl=on C:\Program F

Re: [HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-22 Thread Robert Haas
On Tue, Sep 22, 2015 at 9:54 AM, Thom Brown wrote: > Hi, > > With 9.5 alpha 2 on Windows 8 (64-bit), trying to require SSL results > in a blocking error: > > pg_hba.conf: > hostssl postgres postgres 0.0.0.0/0 trust > > postgresql.conf: > ssl=on > > > C:\Program Files\PostgreSQL\9.5\bin>SET

[HACKERS] 9.5: Can't connect with PGSSLMODE=require on Windows

2015-09-22 Thread Thom Brown
Hi, With 9.5 alpha 2 on Windows 8 (64-bit), trying to require SSL results in a blocking error: pg_hba.conf: hostssl postgres postgres 0.0.0.0/0 trust postgresql.conf: ssl=on C:\Program Files\PostgreSQL\9.5\bin>SET PGSSLMODE=require C:\Program Files\PostgreSQL\9.5\bin>psql.exe -p 5432