Maybe I’m missing something obvious but I am trying to set up a kong community server which connects to a postgres cluster that has SSL enabled. I have tried all the kong settings but I keep getting the error “Error: attempt to index local ‘ssl’ (a nil value)” when I try to run the migrations. Based on what I see the error is because it tries to get the SSL socket which returns nothing: ” Failed to create SSL object from socket: u.peer.connection.ssl is nil, context: ngx.timer”
I have set the following settings:
database = postgres
pg_host = hostname.domain.com
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 = ca-certificate.ca-bundle
pg_ssl_verify = on
pg_ssl_required = on
pg_ssl_version = tlsv1_3
lua_ssl_trusted_certificate = system,ca-certificate.ca-bundle
lua_ssl_verify_depth = 1
I have disabled most pg_ssl settings and tried with only “pg_ssl” on to run it with basics but I get the same error with every combination.
To verify connectivity to the database I’ve connected using the psql command:
PGSSLMODE=verify-full PGSSLROOTCERT=ca-certificate.ca-bundle psql -h host.domain.com -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
anyone have any ideas or encountered this before?
Thanks!
BingBing is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.