Unix Technical Forum

SSL and USER_CERT_FILE round 2

This is a discussion on SSL and USER_CERT_FILE round 2 within the pgsql Hackers forums, part of the PostgreSQL category; --> Adding "sslkey" and "sslcert" to the PQconnectdb connection string. After some discussion, I think it is more appropriate to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2008, 01:43 PM
pgsql@mohawksoft.com
 
Posts: n/a
Default SSL and USER_CERT_FILE round 2

Adding "sslkey" and "sslcert" to the PQconnectdb connection string.

After some discussion, I think it is more appropriate to add the key/cert
file for SSL into the connect string. For example:

PQconnectdb("host=foo dbname=bar sslmode=require
sslkey=/opt/myapp/share/keys/client.key
sslcert=/opt/myapp/share/keys/client.crt");


Any comments?




--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 01:43 PM
Andrew Dunstan
 
Posts: n/a
Default Re: SSL and USER_CERT_FILE round 2



pgsql@mohawksoft.com wrote:
> Adding "sslkey" and "sslcert" to the PQconnectdb connection string.
>
> After some discussion, I think it is more appropriate to add the key/cert
> file for SSL into the connect string. For example:
>
> PQconnectdb("host=foo dbname=bar sslmode=require
> sslkey=/opt/myapp/share/keys/client.key
> sslcert=/opt/myapp/share/keys/client.crt");
>
>
> Any comments?
>
>


I think if you're going to provide for these then you should also
provide for the CA cert and CRL.

Otherwise, it seems sensible.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 01:43 PM
pgsql@mohawksoft.com
 
Posts: n/a
Default Re: SSL and USER_CERT_FILE round 2

>
>
> pgsql@mohawksoft.com wrote:
>> Adding "sslkey" and "sslcert" to the PQconnectdb connection string.
>>
>> After some discussion, I think it is more appropriate to add the
>> key/cert
>> file for SSL into the connect string. For example:
>>
>> PQconnectdb("host=foo dbname=bar sslmode=require
>> sslkey=/opt/myapp/share/keys/client.key
>> sslcert=/opt/myapp/share/keys/client.crt");
>>
>>
>> Any comments?
>>
>>

>
> I think if you're going to provide for these then you should also
> provide for the CA cert and CRL.
>
> Otherwise, it seems sensible.


I thought about that, but the root and crl are for the server, and that
makes sense that the keys would be in the server directory. The server
needs to protect its data against clients wishing to connect. The client
on the other hand, needs to access one or more postgresql servers.

It makes sense that the server keys and credentials be hard coded to its
protected data directory, while the client needs the ability to have
multiple keys.

Think of it this way, a specific lock only takes one key while a person
needs to carry multiple keys on a ring.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-16-2008, 01:43 PM
Andrew Dunstan
 
Posts: n/a
Default Re: SSL and USER_CERT_FILE round 2



pgsql@mohawksoft.com wrote:
>>
>> I think if you're going to provide for these then you should also
>> provide for the CA cert and CRL.
>>
>> Otherwise, it seems sensible.
>>

>
> I thought about that, but the root and crl are for the server, and that
> makes sense that the keys would be in the server directory. The server
> needs to protect its data against clients wishing to connect. The client
> on the other hand, needs to access one or more postgresql servers.
>
> It makes sense that the server keys and credentials be hard coded to its
> protected data directory, while the client needs the ability to have
> multiple keys.
>
> Think of it this way, a specific lock only takes one key while a person
> needs to carry multiple keys on a ring.
>



This is completely wrong. Why do you think your web browser has CA keys
embedded in it? So it can know which server keys to trust. As
documented, if a CA certificate set is present on the libpq client, the
client will only trust server keys signed with a chain starting from
that set.

CA certificates and CRLs can in general be used on both sides of an SSL
connection, and we make explicit provision for them on both sides.

See http://www.postgresql.org/docs/curre...libpq-ssl.html

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:48 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com