Skip site navigation (1) Skip section navigation (2)

SSL cert client authentication

From: Gleb Kouzmenko <gk(at)abra(dot)ru>
To: pgsql-patches(at)postgresql(dot)org
Subject: SSL cert client authentication
Date: 2006-11-17 08:58:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
I propose to authenticate client via verification of its SSL certificate.


Recent versions of PostgreSQL database server can verify client's SSL
certificate (via server's root.crt now).
Server gets 'subject' line of verified client certificate
( in src/backend/libpq/be-secure.c:open_server_SSL ),
stores it in port->peer_dn, and never uses it after that.

We can treat this verification as some kind of IDENT authentication method.
The idea is to use client's 'subject' as ident-username key during ident
map lookup.



hostssl all koug      0/0  ident sslcert
hostssl all dba       0/0  ident sslcert


sslcert "/C=RU/ST=Tmutarakan/O=Kremlin/CN=Gleb
Kouzmenko/emailAddress=undisclosed(at)domain(dot)org" koug
sslcert "/C=RU/ST=Tmutarakan/O=Kremlin/CN=Gleb
Kouzmenko/emailAddress=undisclosed(at)domain(dot)org" dba

Client that have valid certificate with this 'subject' line can make
secure connection
to database server as koug or dba - without having IDENT server on his


It becomes impossible to use ssl connection and IDENT via TCP/IP
protocol at the same time.
I think it's positive consequence of the method proposed.
It's rather strange to rely on insecure IDENT via TCP/IP for
authentication of secured connection.

Only one function src/backend/libpq/hba.c:authident should be modified.
Patch attached has been made for 8.2beta3.
Same modification of authident has been tested against 8.1.5 too.

Gleb Kouzmenko

Attachment: postgresql-sslauth.8.2beta3.patch
Description: text/x-patch (1.5 KB)

pgsql-patches by date

Next:From: Simon RiggsDate: 2006-11-17 09:40:12
Subject: Re: [HACKERS] Extended protocol logging
Previous:From: Mario WeilguniDate: 2006-11-17 08:50:33
Subject: Re: Cast null to int4 upgrading from Version 7.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group