supabase / postgres

Unmodified Postgres with some useful plugins

Home Page:https://supabase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression: SSL errors from pg_net and wrappers after upgrading from 15.1.0.41 to 15.1.0.42-rc2 and beyond

grschafer opened this issue · comments

Bug report

Describe the bug

On supabase CLI 1.38.3, I could make requests with wrappers and pg_net successfully. On later CLI versions, all requests give an SSL error. I narrowed this down a bit further and the issue appears on public.ecr.aws/supabase/postgres:15.1.0.42-rc2 and later versions, but not on public.ecr.aws/supabase/postgres:15.1.0.41.

Related issues:

To Reproduce

Working version (using supabase/postgres:15.1.0.41):

docker run --rm -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=/var/run/postgresql -e LC_ALL=C.UTF-8 public.ecr.aws/supabase/postgres:15.1.0.41

# in separate terminal
docker exec -it postgres-test psql -h localhost -U supabase_admin postgres
postgres=# create extension pg_net;
CREATE EXTENSION
postgres=# select net.http_post(url:='https://httpbin.org/post', body:='{}'::jsonb);
 http_post 
-----------
         1
(1 row)

postgres=# table net._http_response ;
-- this last command shows the response as expected (wide table with content, headers, 200 status code, etc.)

Broken version (using supabase/postgres:15.1.0.42-rc2):

docker run --rm -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=/var/run/postgresql -e LC_ALL=C.UTF-8 public.ecr.aws/supabase/postgres:15.1.0.42-rc2

# in separate terminal
docker exec -it postgres-test psql -h localhost -U supabase_admin postgres
postgres=# create extension pg_net;
CREATE EXTENSION
postgres=# select net.http_post(url:='https://httpbin.org/post', body:='{}'::jsonb);
 http_post 
-----------
         1
(1 row)

postgres=# table net._http_response ;
 id | status_code | content_type | headers | content | timed_out |                     error_msg                     |            created            
----+-------------+--------------+---------+---------+-----------+---------------------------------------------------+-------------------------------
  1 |             |              |         |         |           | SSL peer certificate or SSH remote key was not OK | 2023-03-02 23:13:34.910201+00
(1 row)

Expected behavior

I hope pg_net and wrappers can make requests successfully, as they did in previous versions.

System information

  • OS: Ubuntu 22.04
  • Docker: 23.0.1