Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Oliver Jowett
Tom Lane wrote: Basically my point here is that the default "prefer" SSL mode effectively becomes "require" if the server has a root.crt. Ok, in the scenario where validation is important, clients should be using "require" anyway, so it's not an issue so long as libpq doesn't try to fall back to

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Tom Lane
Oliver Jowett <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I'm not sure if this is desirable. Should libpq try to fall back to a >> non-SSL-encrypted connection, instead? > Only if the server certificate validates, otherwise an active attacker > could intercept the SSL connection to force li

Re: [BUGS] More SSL questions..

2005-01-05 Thread Bruce Momjian
Tom Lane wrote: > "Matthew T. O'Connor" writes: > > Tom Lane wrote: > >> Does Windows even have a concept of home directory? What would be a > >> reasonable equivalent to ~/.postgresql/ ? > > > The versions of windows that the port supports (NT4, 2000, 2003, XP) do > > have home directories. >

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Oliver Jowett
Tom Lane wrote: BTW, as of CVS tip, if the server has a root.crt file and the client does not have any certificate files, the default behavior is that connections fail: $ psql -h localhost regression psql: could not open certificate file "/home/tgl/.postgresql/postgresql.crt": No such file or dire

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Tom Lane
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > I think it's only broken when you fiddle with certificates. Yeah, the commented-out stuff had to do with certificates, and would not be executed unless the server demands a client certificate (which only happens if the server has a root.crt file). B

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Magnus Hagander
> > > win32 hackers, anyone know why it's like this? > > > > Looking through the code, it seems that it's because > someone thought > > that breaking SSL would be easier than replacing the pqGetpwuid() > > calls that are used to find out the user's home directory. > > > > I think what happene

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Bruce Momjian
Tom Lane wrote: > I wrote: > > win32 hackers, anyone know why it's like this? > > Looking through the code, it seems that it's because someone thought > that breaking SSL would be easier than replacing the pqGetpwuid() calls > that are used to find out the user's home directory. > I think what h

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Tom Lane
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > Tom also wrote: >> Now that I look at it, there are several places that are depending on >> getenv("HOME") or getenv("USERPROFILE") (on Windows) as the meaning of >> "home directory". In particular ~/.pgpass is sought there, and psql >> also uses get

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-05 Thread Magnus Hagander
> >OK ... are you supposed to find it out by looking at the environment > >vars, or is there another API defined? > > > >I am planning to consolidate the platform dependency into a function > >defined like > > > > static bool pqGetHomeDirectory(char *buf, int bufsize) > > { > >

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread Andrew Dunstan
Matthew T. O'Connor wrote: Tom Lane wrote: If someone can whip up and test a WIN32 version of this, I'll take care of the rest. I can't do the coding, but I took a quick look at msdn and I think this is relevant: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platfo

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread Joshua D. Drake
Tom Lane wrote: I wrote: win32 hackers, anyone know why it's like this? Looking through the code, it seems that it's because someone thought that breaking SSL would be easier than replacing the pqGetpwuid() calls that are used to find out the user's home directory. Does Windows even have a concept

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread Matthew T. O'Connor
Tom Lane wrote: John R Pierce <[EMAIL PROTECTED]> writes: more fun. I just checked the environment of the postmaster service on a win2000 Pro system (using www.sysinternals.com's excellent Process Explorer tool, btw). HOME is not set. USERPROFILE is set to "C:\Documents and Settings\postg

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread John R Pierce
win2000 Pro system (using www.sysinternals.com's excellent Process Explorer tool, btw). HOME is not set. USERPROFILE is set to "C:\Documents and Settings\postgres"... For services that are running as 'NT AUTHORITY\SYSTEM', the profile is "C:\Documents and Settings\Default User" (and the USER

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread John R Pierce
Actually, the server doesn't depend on home directories in any way shape or form. The places that we are concerned about are on the client side, either in libpq or in psql. So what we have to think about is the environment that libpq might see. libpq could be called from a service, such as ineti

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread Tom Lane
John R Pierce <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Seems like we should be consistent about this --- either we trust $HOME >> or we don't. > more fun. I just checked the environment of the postmaster service on a > win2000 Pro system (using www.sysinternals.com's excellent Process Ex

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread John R Pierce
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: I think CSIDL_APPDDATA is probably the way to go, but one of the heavy Windows hitters will know better than I do. Now that I look at it, there are several places that are depending on getenv("HOME") or getenv("USERPROFILE") (on Windows)

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

2005-01-04 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > I think CSIDL_APPDDATA is probably the way to go, but one of the heavy > Windows hitters will know better than I do. Now that I look at it, there are several places that are depending on getenv("HOME") or getenv("USERPROFILE") (on Windows) as the meani

Re: [BUGS] More SSL questions..

2005-01-04 Thread Matthew T. O'Connor
Tom Lane wrote: OK ... are you supposed to find it out by looking at the environment vars, or is there another API defined? I am planning to consolidate the platform dependency into a function defined like static bool pqGetHomeDirectory(char *buf, int bufsize) { -- O

Re: [BUGS] More SSL questions..

2005-01-04 Thread Tom Lane
"Matthew T. O'Connor" writes: > Tom Lane wrote: >> Does Windows even have a concept of home directory? What would be a >> reasonable equivalent to ~/.postgresql/ ? > The versions of windows that the port supports (NT4, 2000, 2003, XP) do > have home directories. OK ... are you supposed to find

Re: [BUGS] More SSL questions..

2005-01-04 Thread Matthew T. O'Connor
Tom Lane wrote: I wrote: win32 hackers, anyone know why it's like this? Looking through the code, it seems that it's because someone thought that breaking SSL would be easier than replacing the pqGetpwuid() calls that are used to find out the user's home directory. Does Windows even have a

Re: [BUGS] More SSL questions..

2005-01-04 Thread Tom Lane
I wrote: > win32 hackers, anyone know why it's like this? Looking through the code, it seems that it's because someone thought that breaking SSL would be easier than replacing the pqGetpwuid() calls that are used to find out the user's home directory. Does Windows even have a concept of home dire

Re: [BUGS] More SSL questions..

2005-01-04 Thread T.J.
Yeah I already tried removing the ifdef's...oh BOY was it not happy :'( Tom Lane wrote: "T.J." <[EMAIL PROTECTED]> writes: Which leads me to my next question; that function client_cert_cb, does it ever get executed on windows? :) Um. Looks like someone ifdef'd it out :-(. In fact, if yo

Re: [BUGS] More SSL questions..

2005-01-04 Thread Tom Lane
"T.J." <[EMAIL PROTECTED]> writes: > Which leads me to my next question; that function client_cert_cb, does > it ever get executed on windows? :) Um. Looks like someone ifdef'd it out :-(. In fact, if you look through fe-secure.c, you'll see that just about all the SSL code is ifdef'd out on Wi

Re: [BUGS] More SSL questions..

2005-01-04 Thread T.J.
After some more screwing around, I'm not entirely certain windows is even trying to open my certs. After repeatedly trying to connect it seemed like I was getting an equal amount of the sslv3 and SSL SYSCALL errors, whether or not the certs were (where I thought?) windows was looking for them..

Re: [BUGS] More SSL questions..

2005-01-03 Thread Tom Lane
"T.J." <[EMAIL PROTECTED]> writes: > Not to my knowledge. By the way, for future reference on windows it > looks for the cert/key in the linux equivalent of > `pwd`/.postgresql/postgresql.crt/key, instead of > $HOME/.postgresql/postgresql.crt/key. Actually, it asks getpwuid() for the user's hom

Re: [BUGS] More SSL questions..

2005-01-03 Thread T.J.
Not to my knowledge. By the way, for future reference on windows it looks for the cert/key in the linux equivalent of `pwd`/.postgresql/postgresql.crt/key, instead of $HOME/.postgresql/postgresql.crt/key. Maybe you already knew this but I had to do testing to figure it out so hopefully that bit

Re: [BUGS] More SSL questions..

2005-01-03 Thread Bruce Momjian
Did we ever find the solution to this, or did anyone find the cause? --- T.J. wrote: > Having some problems (still, hehe) getting SSL to work properly on > windows in the new 8.0 (all vers) environment (where cert/key is re

[BUGS] More SSL questions..

2004-12-19 Thread T.J.
Having some problems (still, hehe) getting SSL to work properly on windows in the new 8.0 (all vers) environment (where cert/key is required). On the client side when not finding the certificate/key psql would report the SSL error sslv3 alert handshale failure. After I figured out where psql wa