![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi, I was reading the post for BUG # 1321 (Date: Tue, 16 Nov 2004 13:30:33 -0700) the error "sslv3 alert handshake failure" that i have encountered now. I have postgreSQL 8.0.1 and have OpenSSL 0.9.7a. I have read through the documentation and a few other sites. PG_HBA.CONF ---------------------- local all all trust host all all 127.0.0.1 255.255.255.255 trust host all all 192.168.0.0/16 trust hostssl dbm all 192.168.200.201 255.255.255.255 md5 SERVER -------------- (Fedora Core 2) Database =DBM, owner=dbmuser I have done the following steps: (a) openssl req -new -text -out server.req (b) openssl rsa -in privkey.pem -out server.key (c) rm privkey.pem (d) openssl req -x509 -in server.req -text -key server.key -out server.crt (e) chmod og-rwx server.key Above steps were from the documentation for 8.0. I tested the communication to a remote machine (hostssl'ed with md5 in pg_hba.conf) and the data (when viewed on ethereal) was encrypted. (f) ln -s server.crt root.crt (g) ln -s server.key root.key Now i have [root.crt, root.key, server.crt, server.key, server.req] files in /usr/local/pgsql/data (which is my $PGDATA) which are owned by "chown postgres ostgres".CLIENT ------------ psql -d dbm -c 'select * from hosts;' -U postgres -h 192.168.200.201 Here's where i am stuck. I created the directory ~/.postgresql as it never existed on remote machine (Fedora core 3) as user root. I have tried stopping and restarting the postmaster. I have following Questions: (a) How do i create the ~/.postgresql/postgresql.crt and ~/.postgresql/postgresql.key files (not sure about the commands)? (b) Where do i get the ~/.postgresql/root.crt from? (c) Is there anything else i am missing thats not in document or that i need to know? thanks, vish (Vishal Saberwal) ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
#3
| |||
| |||
|
|
Vishal, =20 I can't recall but I think if you use 8.0.3 the error would offer more explanation. Bug 1321 was related to SSL support on windows. The error you are getting isn't a bug. It's basically telling you it can't find the postgresql.key and postgresql.crt. =20 For creating SSL certs I've always used the MySQL example at http://dev.mysql.com/doc/mysql/en/se...ate-certs.html =20 You can ignore the last part about setting up my.cnf. Instead of doing the "replace ./demoCA $DIR -- $DIR/openssl.cnf" as they suggest just manually open your openssl.cnf file and change the ./demoCA to the location of your openssl.cnf file. =20 Once finished rename some files: =20 cacert.pem =3D> root.crt cakey.pem =3D> root.key server-key.pem =3D> server.key server-cert.pem =3D> server.crt client-key.pem =3D> postgresql.key client-cert.pem =3D> postgresql.crt =20 Place the postgresql.* files into the ~/.postgresql directory on the client side. =20 So that answers a). =20 b) The client shouldn't be looking for root.crt =20 c) That should do it. If you have any more questions feel free to email me off the list and I'll see what else ya need help with. =20 T.J. =20 vishal saberwal wrote: =20 hi, I was reading the post for BUG # 1321 (Date: Tue, 16 Nov 2004 13:30:33 -0700) the error "sslv3 alert handshake failure" that i have encountered now. I have postgreSQL 8.0.1 and have OpenSSL 0.9.7a. I have read through the documentation and a few other sites. PG_HBA.CONF ---------------------- local all all trust host all all 127.0.0.1 255.255.255.255 trust host all all 192.168.0.0/16 trust hostssl dbm all 192.168.200.201 255.255.255.255 md5 SERVER -------------- (Fedora Core 2) Database =3DDBM, owner=3Ddbmuser I have done the following steps: (a) openssl req -new -text -out server.req (b) openssl rsa -in privkey.pem -out server.key (c) rm privkey.pem (d) openssl req -x509 -in server.req -text -key server.key -out server.c= rt (e) chmod og-rwx server.key Above steps were from the documentation for 8.0. I tested the communication to a remote machine (hostssl'ed with md5 in pg_hba.conf) and the data (when viewed on ethereal) was encrypted. (f) ln -s server.crt root.crt (g) ln -s server.key root.key Now i have [root.crt, root.key, server.crt, server.key, server.req] files in /usr/local/pgsql/data (which is my $PGDATA) which are owned by "chown postgres ostgres".CLIENT ------------ psql -d dbm -c 'select * from hosts;' -U postgres -h 192.168.200.201 Here's where i am stuck. I created the directory ~/.postgresql as it never existed on remote machine (Fedora core 3) as user root. I have tried stopping and restarting the postmaster. I have following Questions: (a) How do i create the ~/.postgresql/postgresql.crt and ~/.postgresql/postgresql.key files (not sure about the commands)? (b) Where do i get the ~/.postgresql/root.crt from? (c) Is there anything else i am missing thats not in document or that i need to know? thanks, vish (Vishal Saberwal) ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster =20 =20 |
#4
| |||
| |||
|
|
Vishal, =20 No it's definitely not the query or the lan. From the fact that the server started up with those files in the data directory suggests that the problem does not lie on the server, either. And as you have shown the client files seem to be in order, as well. Which leaves one of two possibilities. Since upgrading the server is not possible my next question I guess would be regarding the client. Are they running 8.0.1 as well? Would it be possible to upgrade the client to 8.0.3? I'm not certain, but I could swear they made a couple changes before 8.0.2 regarding the SSL stuff (specifically in regards to the client). =20 T.J. |
#5
| |||
| |||
|
|
LOG: could not accept SSL connection: peer did not return a certificate |
#6
| |||
| |||
|
|
But, Management requires me to use 8.0.1 (on both servers and clients) as our total infrastructure and coding is based on it ... Is there a patch I can apply to 8.0.1 so that I could install same version on all clients and servers ... |
#7
| |||
| |||
|
|
vishal saberwal <vishalsaberwal (AT) gmail (DOT) com> writes: But, Management requires me to use 8.0.1 (on both servers and clients) as our total infrastructure and coding is based on it ... Is there a patch I can apply to 8.0.1 so that I could install same version on all clients and servers ... =20 There's not really going to be a whole lot of sympathy around here for people who refuse to adopt a point update. =20 regards, tom lane |
#8
| |||
| |||
|
|
I agree with what you said ... They considered 8.0.1 as a stable version they can rely on (but i believe i can propose a change now after this SSL fix in 8.0.3) ... |
#9
| |||
| |||
|
|
vishal saberwal <vishalsaberwal (AT) gmail (DOT) com> writes: I agree with what you said ... They considered 8.0.1 as a stable version they can rely on (but i believe i can propose a change now after this SSL fix in 8.0.3) ... =20 Well, actually, I just looked through the CVS logs, and I do not see any changes related to SSL between 8.0.1 and 8.0.3; the only significant changes in libpq at all were fixes to make Kerberos work on Windows. =20 So I'm wondering if the 8.0.3 update was irrelevant, and the important point was just to get the client-side key files installed correctly. =20 As far as fighting with your management goes, you might want to wait a week and then lean on them to update to 8.0.4, instead. There are a couple of data-loss risks fixed for 8.0.4. =20 regards, tom lane |
#10
| |||
| |||
|
|
Guess i can stay on 8.0.1 until we get 8.0.4 ... (is it right for me to ask what data-loss you are talking about) ... |
![]() |
| Thread Tools | |
| Display Modes | |
| |