Skip to content

How to connect to sslmode=require #38

Description

@factormaarten

Hi there,

I'm wondering how I can add ?sslmode=require to the library?

I've tried uncommenting this in Connection.php but it doesn't work unfortunately:

                // $ssl = new SSLRequest();
                // $stream->write($ssl->encodedMessage());

Thank you so much!

Activity

  1. WyriHaximus commented on Nov 8, 2022

    @WyriHaximus
    Contributor

    Same question, but looking at the code this might be a bit more work than that. /cc @mbonneau @davidwdan

  2. WyriHaximus commented on Nov 14, 2022

    @WyriHaximus
    Contributor

    Just got it working locally, it requires changes in both this package and in react/socket to work as the TLS encryption is added to the connection after an SSLRequest command is sent to the PG server and it responded back positively. On top of that, I probably going to add support for URI parsing to get the query out in an easy way. Will have a chat with @clue and how we can add support for enabling the encryption later on in react/socket because everything to do this is already there, except adding later than right away on the connection.

    I'll toss some more time at it now to get it working for now, and test it out in a project before I start creating PR's.

    Refs:

  3. WyriHaximus commented on Nov 14, 2022

    @WyriHaximus
    Contributor

    My comment on react/socket about this: reactphp/socket#89 (comment)

  4. WyriHaximus commented on Dec 2, 2022

    @WyriHaximus
    Contributor

    Opened the WIP PR for this side on it, opening the react/socket PR for it later this weekend: #52

  5. WyriHaximus commented on Mar 9, 2026

    @WyriHaximus
    Contributor

    FYI, this has landed through #52 in 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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