sslutils

A Postgres extension for managing SSL certificates through SQL

Overview

PackageVersionCategoryLicenseLanguage
sslutils1.4SECPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
7410sslutilsNoYesNoYesNoNo-
Relatedsslinfo pgsodium pgsmcrypto pgcryptokey pgcrypto pg_tde passwordcheck_cracklib supautils

no pg15,14 on el9, no pg18 on el8

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.41817161514sslutils-
RPMPIGSTY1.41817161514sslutils_$v-
DEBPIGSTY1.41817161514postgresql-$v-sslutils-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
d13.x86_64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
d13.aarch64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
u22.x86_64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
u22.aarch64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
u24.x86_64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
u24.aarch64
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4
PIGSTY 1.4

Build

You can build the RPM / DEB packages for sslutils using pig build:

pig build pkg sslutils         # build RPM / DEB packages

Install

You can install sslutils directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install sslutils;          # Install for current active PG version
pig ext install -y sslutils -v 18  # PG 18
pig ext install -y sslutils -v 17  # PG 17
pig ext install -y sslutils -v 16  # PG 16
pig ext install -y sslutils -v 15  # PG 15
pig ext install -y sslutils -v 14  # PG 14
dnf install -y sslutils_18       # PG 18
dnf install -y sslutils_17       # PG 17
dnf install -y sslutils_16       # PG 16
dnf install -y sslutils_15       # PG 15
dnf install -y sslutils_14       # PG 14
apt install -y postgresql-18-sslutils   # PG 18
apt install -y postgresql-17-sslutils   # PG 17
apt install -y postgresql-16-sslutils   # PG 16
apt install -y postgresql-15-sslutils   # PG 15
apt install -y postgresql-14-sslutils   # PG 14

Create Extension:

CREATE EXTENSION sslutils;

Usage

sslutils: Manage SSL certificates through SQL

sslutils is a PostgreSQL extension for managing SSL certificates through SQL commands. It provides functions to generate, inspect, and manage SSL/TLS certificates directly within the database.

CREATE EXTENSION sslutils;

Functions

The extension provides SQL functions for SSL certificate management:

FunctionDescription
openssl_rsa_generate_key(bits int)Generate an RSA private key
openssl_rsa_key_to_csr(key text, cn text, ...)Generate a Certificate Signing Request
openssl_csr_to_crt(csr text, ca_key text, ca_crt text)Sign a CSR to produce a certificate
openssl_rsa_generate_crl(ca_key text, ca_crt text)Generate a Certificate Revocation List
ssl_is_init_fn()Check if SSL is initialized
ssl_get_cipher_fn()Get current SSL cipher
ssl_get_version_fn()Get current SSL version

Typical Workflow

-- Generate a CA private key
SELECT openssl_rsa_generate_key(2048);

-- Create a self-signed CA certificate
-- Generate server key and CSR
-- Sign the CSR with the CA

This extension is useful for automating SSL certificate provisioning in managed PostgreSQL environments.


Last Modified 2026-03-12: add pg extension catalog (95749bf)