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

From: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.5: Can't connect with PGSSLMODE=require on Windows
Date: 2015-09-28 20:08:56
Message-ID: CAEB4t-PMbn=B5HsfQybAH=wXwxNHY=MkJ6fX4PuMQpBvuVfwTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 Windows WSAGetLastError() instead of errno, preprocessor
SOCK_ERRNO handle it gracefully. PFA patch, it resolve the issue i.e.

C:\PG\postgresql\pg_with_openssl_inst_v1_patch>bin\psql.exe -d postgres -h
> 172.16.141.210
> psql (9.5alpha2)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384,
> bits: 256, compression: off)
> Type "help" for help.
> postgres=# select version();
> version
> -----------------------------------------------------------------
> PostgreSQL 9.5alpha2, compiled by Visual C++ build 1800, 64-bit
> (1 row)

Regards,
Muhammad Asif Naeem

On Thu, Sep 24, 2015 at 5:12 PM, Thom Brown <thom(at)linux(dot)com> wrote:

> On 23 September 2015 at 13:10, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
> >
> >
> > On Wed, Sep 23, 2015 at 2:15 AM, Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
> >>
> >> On Tue, Sep 22, 2015 at 11:23 AM, Andrew Dunstan <andrew(at)dunslane(dot)net>
> >> 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.
> >
> >
> > That's not cool. I have added this problem in the list of open items for
> > 9.5.
>
> This appears that it might be related to the version of OpenSSL that's
> been packaged with PostgreSQL 9.5 alpha 2. When swapping this out for
> the version that's shipped with 9.4, it works. I don't have the
> specific OpenSSL versions to hand, but I'll report back anything as I
> learn more.
>
> --
> Thom
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

Attachment Content-Type Size
win_ssl_issue_v1.patch application/octet-stream 460 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-09-28 20:34:34 Re: Rename withCheckOptions to insertedCheckClauses
Previous Message Stephen Frost 2015-09-28 19:50:49 Re: row_security GUC, BYPASSRLS