Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5wQ5-0003yp-9Q for pgsql-admin@arkaria.postgresql.org; Mon, 18 Mar 2019 17:51:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5wQ3-0001Ux-Sx for pgsql-admin@arkaria.postgresql.org; Mon, 18 Mar 2019 17:51:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5wQ3-0001O9-FD for pgsql-admin@lists.postgresql.org; Mon, 18 Mar 2019 17:51:27 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5wQ0-0003LM-S7 for pgsql-admin@lists.postgresql.org; Mon, 18 Mar 2019 17:51:27 +0000 Received: by mail-wr1-x435.google.com with SMTP id d17so18077986wre.10 for ; Mon, 18 Mar 2019 10:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:thread-index :content-language; bh=35mrAcc6wakc2GbYzr14Yz4sEmwNNzuKClGgiVHAAco=; b=WPgjAZbNyizdMVjE40e2ShEbREKV1bmTBXGCl7qsTWsGVuqp9bAqEY1O4XZGPObjhB Q/yBLKDGsUUO1nfwiLtXfbnUPPh9zp2TgmmWun7Mad5whRMKJu8XOZE2QRfUK0FtL0Uk 8rw6dWPK7k0Ea+pmmkrmmf1uU4Uq+r4ZXiHgdDrzSoZMJVf2KkS99Q0631d77cQSPveb y62I8+pOhUz36xGg+v4aI/0cyhkO0GFFyk4ZjGuF8RpnbVrE23iVv9J/ms1yTvbW4kwW xVq/CkAedqpAgZMc1sfPdbkwGTzLP1p1rWtCCKUMEaoIEsq46QgZS9zwTwKpR5H+N2rL 43Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=35mrAcc6wakc2GbYzr14Yz4sEmwNNzuKClGgiVHAAco=; b=i+l+U7WLWykqdGI+CNhdSDToBTZLszM5jyOF/E/jCFv7xeWcTEj/qPXZhuS4v7BVhO kGti37oSCxNb7WrInaM9NsNiRt+4F5MXzQ6KyZNz+3A1XkvMLhDMykzYlPz4iKgzWIH+ VfST0W7i9i+XvIVUmzq/JqVHXB0PKa4ySpRYzRdymhZkQ/q3rF7fOBhY8BOJjfB8hiMr oaA6rGiH9itvW1j3EARp1A+sRn8y7ZpjkpzEh6Y/eQ7IlN3TeM+3Gc5ZwQHJETazr1kR zLAhRMAcNtzT+Kox4o8j9RN7U1QRkT6rC+lm/lP8UYe3FhasuxTHdYSERsOwm1VbRdBa pvBA== X-Gm-Message-State: APjAAAUfwkgGlLQjCHPh6K4dD0SZ0yHN2GLuLcUpjo7QdG1xVJnZXyQ7 lHkcnrLoAD7rqLJr3Coe24hE8ci4 X-Google-Smtp-Source: APXvYqxRpRO3XDRTAGOTyYYFZdz4cR2c60NGa/j68azjd0XXuPq/Alaog2l9VKaNUZCuMd6FPeQGXQ== X-Received: by 2002:adf:eb85:: with SMTP id t5mr13275145wrn.168.1552931483004; Mon, 18 Mar 2019 10:51:23 -0700 (PDT) Received: from LAPTOPE7EH7MDP (167.221-30-62.static.virginmediabusiness.co.uk. [62.30.221.167]) by smtp.gmail.com with ESMTPSA id 26sm16780870wmg.42.2019.03.18.10.51.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 10:51:22 -0700 (PDT) From: "Mark Williams" To: Subject: PostgreSQL SSL specifying certificate paths Date: Mon, 18 Mar 2019 17:51:19 -0000 Message-ID: <008001d4ddb3$31b5f5c0$9521e140$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0081_01D4DDB3.31B5F5C0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdTdsU4AZOnhfQyaRfq9gNkCaP8+2w== Content-Language: en-gb List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0081_01D4DDB3.31B5F5C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I have had a problem previously connecting to PostgreSQL using Firedac. I managed to get this working, but then a recent update of Rad Studio has somehow changed the way that it passes through the cert file paths. I think this was to address an issue I raised about path delimiters being stripped away. To overcome the problem I was specifying the paths as follows: sslmode=verify-ca sslrootcert=C:\\ProgramData\\MWC\\Viewer\\Certs\\root.crt sslcert=C:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.crt sslkey=C:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.key. The new version of FireDac seems to be inserting escape characters itself so that it is passing through the "ConnInfo" as: sslmode='verify-ca sslrootcert=C:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\root.crt sslcert=C:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\postgresql.crt sslkey=C:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\postgresql.key' Which is producing a Postgre error of: ERROR: invalid sslmode value: "verify-ca sslrootcert=C:\\ProgramData\\MWC\\Viewer\\Certs\\root.crt sslcert=C:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.crt sslkey=C:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.key Naturally, I recoded so that I specified non-escaped windows paths and received the following error: ERROR: invalid sslmode value: "verify-ca sslrootcert=C:\ProgramData\MWC\Viewer\Certs\root.crt sslcert=C:\ProgramData\MWC\Viewer\Certs\postgresql.crt sslkey=C:\ProgramData\MWC\Viewer\Certs\postgresql.key I then tried forward slashes: sslmode='verify-ca sslrootcert=C:/ProgramData/MWC/Viewer/Certs/root.crt sslcert=C:/ProgramData/MWC/Viewer/Certs/postgresql.crt sslkey=C:/ProgramData/MWC/Viewer/Certs/postgresql.key' And got the error: ERROR: invalid sslmode value: "verify-ca sslrootcert=C:/ProgramData/MWC/Viewer/Certs/root.crt sslcert=C:/ProgramData/MWC/Viewer/Certs/postgresql.crt sslkey=C:/ProgramData/MWC/Viewer/Certs/postgresql.key I tried double forward slashes to no avail and then I tried Linux paths or at least what in my almost non-existent Linux experience I think is a Linus path: sslmode='verify-ca sslrootcert=/C/ProgramData//MWC/Viewer/Certs/root.crt sslcert=/C/ProgramData/MWC/Viewer/Certs/postgresql.crt sslkey=/C/ProgramData/MWC/Viewer/Certs/postgresql.key' And got the error: ERROR: invalid sslmode value: "verify-ca sslrootcert=/C/ProgramData//MWC/Viewer/Certs/root.crt sslcert=/C/ProgramData/MWC/Viewer/Certs/postgresql.crt sslkey=/C/ProgramData/MWC/Viewer/Certs/postgresql.key Is anybody able to show me in what format the conninfo parameter of PostgreSQL expects to receive a Windows path please? Thanks Mark __ ------=_NextPart_000_0081_01D4DDB3.31B5F5C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have had a problem previously connecting to = PostgreSQL using Firedac. I managed to get this working, but then a = recent update of Rad Studio has somehow changed the way that it passes = through the cert file paths. I think this was to address an issue I = raised about path delimiters being stripped away.

 

To overcome = the problem I was specifying the paths as follows:

 

sslmode=3Dverify-ca = sslrootcert=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\root.crt = sslcert=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.crt = sslkey=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.key.<= /p>

 

The = new version of FireDac seems to be inserting escape characters itself so = that it is passing through the “ConnInfo” = as:

 

sslmode=3D'verify-ca = sslrootcert=3DC:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\root.crt = sslcert=3DC:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\postgresql.crt = sslkey=3DC:\\\\ProgramData\\\\MWC\\\\Viewer\\\\Certs\\\\postgresql.key'

 

Which is producing a Postgre error = of:

 

ERROR: invalid sslmode = value: "verify-ca = sslrootcert=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\root.crt = sslcert=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.crt = sslkey=3DC:\\ProgramData\\MWC\\Viewer\\Certs\\postgresql.key

 

Naturally, I recoded so that I specified non-escaped = windows paths and received the following error:

 

ERROR: invalid sslmode value: = "verify-ca sslrootcert=3DC:\ProgramData\MWC\Viewer\Certs\root.crt = sslcert=3DC:\ProgramData\MWC\Viewer\Certs\postgresql.crt = sslkey=3DC:\ProgramData\MWC\Viewer\Certs\postgresql.key

 

I then tried = forward slashes:

 

sslmode=3D'verify-ca = sslrootcert=3DC:/ProgramData/MWC/Viewer/Certs/root.crt = sslcert=3DC:/ProgramData/MWC/Viewer/Certs/postgresql.crt = sslkey=3DC:/ProgramData/MWC/Viewer/Certs/postgresql.key'

 

And got the = error:

 

ERROR: invalid sslmode = value: "verify-ca = sslrootcert=3DC:/ProgramData/MWC/Viewer/Certs/root.crt = sslcert=3DC:/ProgramData/MWC/Viewer/Certs/postgresql.crt = sslkey=3DC:/ProgramData/MWC/Viewer/Certs/postgresql.key

 

I tried = double forward slashes to no avail and then I tried Linux paths or at = least what in my almost non-existent Linux experience I think is a Linus = path:

 

sslmode=3D'verify-ca = sslrootcert=3D/C/ProgramData//MWC/Viewer/Certs/root.crt = sslcert=3D/C/ProgramData/MWC/Viewer/Certs/postgresql.crt = sslkey=3D/C/ProgramData/MWC/Viewer/Certs/postgresql.key'

 

And got the = error:

 

ERROR: invalid sslmode = value: "verify-ca = sslrootcert=3D/C/ProgramData//MWC/Viewer/Certs/root.crt = sslcert=3D/C/ProgramData/MWC/Viewer/Certs/postgresql.crt = sslkey=3D/C/ProgramData/MWC/Viewer/Certs/postgresql.key

 

Is anybody = able to show me in what format the conninfo parameter of PostgreSQL = expects to receive a Windows path please?

 

Thanks

 

Mark

 

 

__

 

------=_NextPart_000_0081_01D4DDB3.31B5F5C0--