Search Postgresql Archives

Re: SSL Certificates in Windows 7 & Postgres 9.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Trying to connect via psql, I looked at the documentation and around the web,
but could not find the right syntax for including all the SSL connection
variables on the psql command line.  I tried using the URL-type psql
command, variations of this:
--------------------------------------------------------------
psql postgresql://localhost:5432/mydb?sslmode=require?sslcert=postgresql.crt
--------------------------------------------------------------
I wasn't sure if the question mark is supposed to precede each variable
(sslmode, sslcert, etc.)?
Since I could not get that syntax right, then I tried connecting with psql
the other way:
---------------------------------------------------------------
psql dbname=dbname user=my_role sslmode=verify-full sslcert=postgresql.crt
sslkey=postgresql.key sslrootcert=root.crt
----------------------------------------------------------------
The console output was:
"Warning command-line argument sslmode=verify-full ignored"
"Warning command-line argument sslcert=postgresql.crt ignored"
"Warning command-line argument sslkey=postgresql.key ignored"
"Warning command-line argument sslrootcert=root.crt ignored"
----------------------------------------------------------------
After lots of typing, and getting nowhere with either of those two methods,
I edited pg_env.bat to this:
------------------------------------------------------------
@SET PATH="C:\Program Files\PostgreSQL\9.3\bin";%PATH%
@SET PGDATA=D:\PostgresDat
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGSSLCERT=D:\POSTGRESDAT\POSTGRESQL.CRT
@SET PGSSLKEY=D:\POSTGRESDAT\POSTGRESQL.KEY
@SET PGSSLROOTCERT=D:\POSTGRESDAT\ROOT.CRT
@SET PGSSLMODE=VERIFY-CA
@SET PGLOCALEDIR=C:\Program Files\PostgreSQL\9.3\share\locale
----------------------------------------------------------------
Then, I tried psql again, with fewer variables, like this: 'psql -d dbname
-U my_role'.  The console output was this:
----------------------------------------------------------------
Sever closed the connection unexpectedly.  This probably means the server
terminated abnormally before or while processing the request.
----------------------------------------------------------------
The pg_log had this:
the database system is starting up
autovacuum launcher started
connection requires a valid client certificate
no pg_hba.conf entry for host "127.0.0.1", user "SYSTEM", database
"postgres", SSL off
connection requires a valid client certificate
connection requires a valid client certificate
----------------------------------------------------------------
Any suggestions as to the correct psql syntax for connecting with SSL? 
Thank you.




--
View this message in context: http://postgresql.nabble.com/SSL-Certificates-in-Windows-7-Postgres-9-3-tp5830749p5830985.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux