<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal">Will someone please correct or confirm my assumption of the SCRAM-SHA-256 password file format for $HOME/.pgpass and $HOME/.pcppass files?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not sure if I should be using the password with the AES prefix outside of the pool_password file or not. For example in the .pgpass and/or .pcppass files.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$ pg_enc -k ~/.pgpoolkey -u postgres -p<o:p></o:p></p>
<p class="MsoNormal">db password:<o:p></o:p></p>
<p class="MsoNormal">trying to read key from file /var/lib/pgsql/.pgpoolkey<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>P1+l8j3GaTxzSBgcY1laEQ==<o:p></o:p></b></p>
<p class="MsoNormal">pool_passwd string: <b>AESP1+l8j3GaTxzSBgcY1laEQ==<o:p></o:p></b></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<p class="MsoNormal">My understanding (please correct me if I’m wrong), is that the pcp.conf file must use md5 encryption regardless of what your password_encryption in the DB is. The pool_password file (when using scram-sha-256 encryption) requires the string
it gets automatically (which includes the AES prefix) by the pg_enc command when providing the “-m” attribute.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, I’ve not been able to find anything documented for the password files. I’m pretty sure I’ve seen that if I were to use an encrypted password (scram-sha-256) in the pgpool.conf file, it must include the AES prefix.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In my testing I find that if the password in ~/.pgpass includes the AES prefix in the encrypted password, I get password authentication failed for user “postgres” when the system tries to start a replication slot.<o:p></o:p></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<p class="MsoNormal" style="line-height:15.0pt"><span lang="EN-US" style="font-size:12.0pt;color:black;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:15.0pt"><span lang="EN-US" style="font-size:12.0pt;color:black;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:15.0pt"><span lang="EN-US" style="font-size:12.0pt;color:black;mso-ligatures:none">Regards,<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:15.0pt"><b><span lang="EN-US" style="font-size:12.0pt;color:black;mso-ligatures:none"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="line-height:15.0pt"><b><span lang="EN-US" style="font-size:12.0pt;color:black;mso-ligatures:none">Todd Stein</span></b><span lang="EN-US" style="font-size:12.0pt;color:#58595B;mso-ligatures:none"><br>
OpsBridge Technical Success<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:15.0pt"><b><span lang="EN-US" style="font-size:14.0pt;mso-ligatures:none">OpenText<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:15.0pt"><span lang="EN-US" style="font-size:12.0pt;color:#58595B;mso-ligatures:none">(Cell)</span><span lang="EN-US" style="font-size:12.0pt;color:red;mso-ligatures:none">
</span><span lang="EN-US" style="font-size:12.0pt;mso-ligatures:none">+1 (941) 248-8752<span style="color:#58595B"><br>
</span><span style="color:#0179EF"><a href="mailto:tstein2@opentext.com"><span style="color:#0563C1">tstein2@opentext.com</span></a></span></span><span lang="EN-US" style="mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>