Re: postgresql connection failed - could not encrypt

Michael Pope <[email protected]> Mon, 25 Sep 2023 14:47:39 +1000
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6124158426396481216==
Content-Type: multipart/alternative;
 boundary="------------7l7jbY7MywxAFdb0xV3onJUh"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------7l7jbY7MywxAFdb0xV3onJUh
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Mike,

I got it working, it was due to using PostgreSQL v15 for the client to a 
PostgreSQL v9 server. I've changed the docker image now to use 
PostgreSQL v11 client and it works great.

So now you can use the docker image to compile 4GL with a postgresql 
database. I've also included a sample docker-compose.yml file to get 
people started (refer https://github.com/map7/docker-aubit4gl)

Docker image: https://hub.docker.com/r/map7/aubit4gl

Regards,

*Michael Pope*
On 22/9/23 16:51, Mike Aubury wrote:
> We connect using ecpg, can you connect with a simple esql/c program?
>
> On Fri, 22 Sept 2023, 05:40 Michael Pope, <[email protected]> wrote:
>
>     Hi,
>
>     When I compile my 4gl file I get an error 'could not encrypt'
>
>
>     Compile command
>
>     $ 4glpc with_db.4gl -o with_db
>
>
>     Error
>     database pais_legacy
>
>     MAIN
>     |_^
>     | Error at line 11, character 3
>     | Could not connect to database pais_legacy (connection to server
>     at "127.0.0.1", port 5432 failed: could not encrypt) (MAIN)
>
>
>     I can access the 'pais_legacy' on the command line manually and
>     see the tables;
>
>     $ psql -h 127.0.0.1 -U postgres pais_legacy
>
>
>     I've set the following environment variables;
>
>           - A4GL_UI=TUI
>           - A4GL_DBDATE="DMY4"
>           - A4GL_SQLTYPE=pg8
>           - PG_DATABASE=pais_legacy
>           - PG_PORT=5432
>           - PG_HOST=127.0.0.1
>           - PG_USER=postgres
>           - PG_PASSWORD=<my password>
>
>     What am I missing here?
>
>
>     -- 
>     Regards,
>
>     *Michael Pope*
>
>     _______________________________________________
>     Aubit4gl-discuss mailing list
>     [email protected]
>     https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
--------------7l7jbY7MywxAFdb0xV3onJUh
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Mike,</p>
    <p>I got it working, it was due to using PostgreSQL v15 for the
      client to a PostgreSQL v9 server. I've changed the docker image
      now to use PostgreSQL v11 client and it works great.</p>
    <p>So now you can use the docker image to compile 4GL with a
      postgresql database. I've also included a sample
      docker-compose.yml file to get people started (refer
      <a class="moz-txt-link-freetext" href="https://github.com/map7/docker-aubit4gl">https://github.com/map7/docker-aubit4gl</a>)</p>
    <p>Docker image: <a class="moz-txt-link-freetext" href="https://hub.docker.com/r/map7/aubit4gl">https://hub.docker.com/r/map7/aubit4gl</a><br>
    </p>
    <div class="moz-signature">
      <div class="moz-cite-prefix">
        <div>Regards,</div>
        <div><br>
        </div>
        <div><b>Michael Pope</b><br>
        </div>
        On 22/9/23 16:51, Mike Aubury wrote:<br>
      </div>
    </div>
    <blockquote type="cite"
cite="mid:CAGAq4WF6mbSA9tbCpQD7ye8De1owWyz0SShJxgXR--TOkYDZAg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">We connect using ecpg, can you connect with a
        simple esql/c program? </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, 22 Sept 2023, 05:40
          Michael Pope, &lt;<a href="mailto:[email protected]"
            moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div>
            <p>Hi,</p>
            <p>When I compile my 4gl file I get an error 'could not
              encrypt'</p>
            <p><br>
            </p>
            <p>Compile command</p>
            <p>$ 4glpc with_db.4gl -o with_db<br>
            </p>
            <p><br>
            </p>
            <p>Error<br>
              <font face="monospace">database pais_legacy<br>
                <br>
                MAIN<br>
                |_^<br>
                | Error at line 11, character 3<br>
                | Could not connect to database pais_legacy (connection
                to server at "127.0.0.1", port 5432 failed: could not
                encrypt) (MAIN)<br>
              </font></p>
            <p><br>
            </p>
            <p>I can access the 'pais_legacy' on the command line
              manually and see the tables;<br>
            </p>
            <p>$ psql -h 127.0.0.1 -U postgres pais_legacy</p>
            <p><br>
            </p>
            <p>I've set the following environment variables;</p>
            <p>      - A4GL_UI=TUI<br>
                    - A4GL_DBDATE="DMY4"<br>
                    - A4GL_SQLTYPE=pg8<br>
                    - PG_DATABASE=pais_legacy<br>
                    - PG_PORT=5432<br>
                    - PG_HOST=127.0.0.1<br>
                    - PG_USER=postgres<br>
                    - PG_PASSWORD=&lt;my password&gt;<br>
              <br>
            </p>
            <p>What am I missing here?<br>
            </p>
            <p><br>
            </p>
            <div>-- <br>
              <div dir="ltr">
                <div>Regards,</div>
                <div><br>
                </div>
                <div><b>Michael Pope</b></div>
                <br>
              </div>
            </div>
          </div>
          _______________________________________________<br>
          Aubit4gl-discuss mailing list<br>
          <a href="mailto:[email protected]"
            target="_blank" rel="noreferrer" moz-do-not-send="true"
            class="moz-txt-link-freetext">[email protected]</a><br>
          <a
            href="https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss"
            rel="noreferrer noreferrer" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss</a><br>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>

--------------7l7jbY7MywxAFdb0xV3onJUh--


--===============6124158426396481216==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6124158426396481216==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

--===============6124158426396481216==--