Postgres x509 tls certs

From UVOO Tech Wiki
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