Postgres with SSL not working kong community Rocky Linux 9

I’m trying to set up Kong community with an SSL connection to postgres but I keep getting the error “Error: attempt to index local ‘ssl’ (a nil value)” which seems to occur because no SSL object is returned from the socket. I’ve tried to set all the ssl settings and only with pg_ssl = on but I keep getting the same error. Anyone have any ideas?

Full tried settings:

database = postgres
pg_host =
pg_port = 5432
pg_user = kong                
pg_password = <kong password>
pg_database = kong
pg_ssl = on
pg_ssl_cert = certificate.crt
pg_ssl_cert_key = certificate.key
pg_ssl_ca_cert =
pg_ssl_verify = on
pg_ssl_required = on
pg_ssl_version = tlsv1_3
lua_ssl_trusted_certificate = system,
lua_ssl_verify_depth = 1

I can connect to postgres with SSL if I do it manually:

PGSSLMODE=verify-full psql -h -U kong    -W -d kong

SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
    Type "help" for help.

kong=# \q

Any help is appreciated :slight_smile: