Postgres x509 tls certs

From UVOO Tech Wiki
Revision as of 19:26, 12 June 2022 by Busk (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

https://dba.stackexchange.com/questions/36416/what-is-the-best-way-to-store-x509-certificate-in-postgresql-database

CREATE OR REPLACE FUNCTION issuer(x509table) returns text 
LANGUAGE SQL IMMUTABLE AS $$
    select issuer_cn FROM extract_x509info($1.x509data);
$$;

This can then be found by

SELECT x.issuer FROM x509table x;  --works

Auth - https://www.postgresql.org/docs/current/auth-cert.html