Supporting Windows SChannel as OpenSSL replacement

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Andreas Karlsson <andreas(at)proxel(dot)se>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Supporting Windows SChannel as OpenSSL replacement
Date: 2014-06-24 01:20:32
Message-ID: CAMkU=1zVY8_ednvm39Abf8BAYbPQyAhtTAY2RkDxNYZd8VXv9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 11, 2014 at 7:51 AM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
wrote:
>
>
> I did again the refactoring you did back in 2006, patch attached. One
thing
> I did differently: I moved the raw, non-encrypted, read/write functions to
> separate functions: pqsecure_raw_read and pqsecure_raw_write. Those
> functions encapsulate the SIGPIPE handling. The OpenSSL code implements a
> custom BIO, which calls to pqsecure_raw_read/write to do the low-level
I/O.
> Similarly in the server-side, there are be_tls_raw_read and
pg_tls_raw_write
> functions, which do the prepare_for_client_read()/client_read_ended()
dance,
> so that the SSL implementation doesn't need to know about that.

I've tried your 0001 patch, reflecting this refactoring, on Linux and it
caused 'make check' to hang at 'starting postmaster'.

The hang seems to be in:

/tmp_check/install//home/jjanes/pgsql/test_ssl/bin/psql -X postgres

with a backtrace of:

#0 0x0000003550edf2f8 in __poll (fds=0x7fff610cbd50, nfds=1, timeout=-1)
at ../sysdeps/unix/sysv/linux/poll.c:83
#1 0x00007fcf372035b1 in pqSocketPoll (conn=0x2317770, forRead=1,
forWrite=0, end_time=-1) at fe-misc.c:1122
#2 pqSocketCheck (conn=0x2317770, forRead=1, forWrite=0, end_time=-1) at
fe-misc.c:1064
#3 0x00007fcf37203630 in pqWaitTimed (forRead=<value optimized out>,
forWrite=<value optimized out>, conn=0x2317770, finish_time=<value
optimized out>)
at fe-misc.c:996
#4 0x00007fcf371fe632 in connectDBComplete (conn=0x2317770) at
fe-connect.c:1498
#5 0x00007fcf371ff27f in PQconnectdbParams (keywords=<value optimized
out>, values=<value optimized out>, expand_dbname=<value optimized out>)
at fe-connect.c:462
#6 0x0000000000411bb5 in main (argc=<value optimized out>,
argv=0x7fff610cc038) at startup.c:219

The make check never times out, like it usually does when something gets
stalled.

That was on CentOS 6.5 patched up to date, but OpenSuSE 13.1 gives the same
hang.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-24 01:25:26 Re: ALTER TABLESPACE MOVE command tag tweak
Previous Message Robert Haas 2014-06-24 01:16:32 Re: autovacuum scheduling starvation and frenzy