Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connect to sslmode=require #38

Open
factormaarten opened this issue Mar 16, 2019 · 4 comments
Open

How to connect to sslmode=require #38

factormaarten opened this issue Mar 16, 2019 · 4 comments

Comments

@factormaarten
Copy link

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!

@WyriHaximus
Copy link
Contributor

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

@WyriHaximus
Copy link
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:

@WyriHaximus
Copy link
Contributor

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

@WyriHaximus
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants