Skip to content

SSL support for SQL session storage #2030

Closed
@janneskruse

Description

@janneskruse

Issue summary

The "shopify-app-session-storage-postgresql" doesn't allow to pass SSL options for sending a valid CA certificate or at least setting rejectunauthorized for testing.

I created a working modified version of the package here, for anyone struggling with this too: https://github.com/janneskruse/shopify-app-session-storage-postgresql_modified.
Feel free to use it. To set your CA certificate, follow the instructions in the Readme.

Expected behavior

You should be able to pass a valid CA certificate for secure connections to your database. Currently nothing is passed in the pg.Pool connection.
I modified it to use:
this.pool = new pg.Pool({
host: this.dbUrl.hostname,
user: decodeURIComponent(this.dbUrl.username),
password: decodeURIComponent(this.dbUrl.password),
database: this.getDatabase(),
port: Number(this.dbUrl.port),
ssl: this.sslOptions ? {
rejectUnauthorized: this.sslOptions.rejectUnauthorized ?? true,
ca: ca,
} : undefined,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions