Re: SSL Certificates in Windows 7 & Postgres 9.3

Поиск
Список
Период
Сортировка
От harpagornis
Тема Re: SSL Certificates in Windows 7 & Postgres 9.3
Дата
Msg-id 1418761245783-5830985.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: SSL Certificates in Windows 7 & Postgres 9.3  (harpagornis <shenlong@runbox.com>)
Ответы Re: SSL Certificates in Windows 7 & Postgres 9.3  (David G Johnston <david.g.johnston@gmail.com>)
Re: SSL Certificates in Windows 7 & Postgres 9.3  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: harpagornis
Дата:
Сообщение: Re: SSL Certificates in Windows 7 & Postgres 9.3
Следующее
От: David G Johnston
Дата:
Сообщение: Re: SSL Certificates in Windows 7 & Postgres 9.3