Appearance
Secure Connections for ybsql (libpq)
Assuming you are using the default locations, you can test the basic connection using a ybsql
login command like this:
ybsql "sslmode=<ssl_mode> host=<hostname> dbname=<dbname> user=<username>"
For example, from a Linux command prompt:
$ ybsql "sslmode=prefer host=yb007.nyc.yellowbrick.io dbname=yellowbrick user=yellowbrick"
You should be prompted for your password and a secure connection will be attempted.
Example: ybsql on Windows (verify-ca, using a non-default root cert)
You can precede the libpq
connection string with options such as -c
to execute a command. For example, this connection runs a query against the sys.session
view and returns the secure details for the session:
ybsql -c "select secure_details from sys.session where process_id = pg_backend_pid()"
"sslmode=verify-ca sslrootcert=/ybd/star.nyc.yellowbrick.io.pem host=yb007.nyc.yellowbrick.io dbname=yellowbrick user=yellowbrick"
...
secure_details
----------------------------------------------
TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384/256 bits
(1 row)
Parent topic:Secure Connections for ODBC/JDBC Clients and ybsql