-
Notifications
You must be signed in to change notification settings - Fork 95
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
A way to pass SSL mode to the Vertx pgClient #1108
Comments
@guy1699 I'm working on #1059 with the intent on capturing all valid properties on a URL, including for PostgreSQL. Vertx sql clients provide db-specific URL parsing ( see PgConnectionUriParser ). By leveraging vertx (and tweaking their parsers for general properties) we'll should have what you need. |
Thanks, @blafond , when are you expecting to have it ready, is there a PR already? Is it means that only Postgres verify request from the pgClient but not vice versa, is this a security risk, how do you see it? A solution for passing PgConnectOptions properties:
|
Thx for the input. I think my fix will require a tweak to Vertx SQL client parsers. Created issue: #1115 |
Isn't this a Vert.x issue? In Hibernate Reactive we allow passing a custom configuration using @blafond Is there anything we need to do on the Hibernate Reactive front? Or this is going to be solved by #1059? |
@DavideD, can you describe how to use a custom pool with |
It's different because you would have to implement |
But I'm not sure why we have the property considering that |
What property, how one implementation of |
The only use case I can think of for 2 is Multitenancy (we have an example in our test cases: ReactiveMultitenantTest). Otherwise I wouldn't recommend to use option 2 if 1 is enough. These properties are there so that users can have a workaround if Hibernate Reactive doesn't offer a solution for a particular use case. Using one or the other depends by the use case. |
@guy1699 The PR for #1059 includes changes that utilize the vertx sql client and the Unfortunately, the number of supported PG connection options is currently limited and an issue is logged: #1115 |
This will be fixed by #864 |
For better visibility adding solution for other to find public class PgClientPoolConfiguration extends DefaultSqlClientPoolConfiguration {
private static String HIBERNATE_VERTX_PGSQL_SSL = "hibernate.vertx.pgsql.ssl";
private static String HIBERNATE_VERTX_PGSQL_SSL_MODE = "hibernate.vertx.pgsql.ssl.mode";
private boolean ssl;
private String sslMode;
@Override
public void configure(Map configuration) {
super.configure(configuration);
ssl = ConfigurationHelper.getBoolean(HIBERNATE_VERTX_PGSQL_SSL, configuration);
sslMode = ConfigurationHelper.getString(HIBERNATE_VERTX_PGSQL_SSL_MODE, configuration);
}
@Override
public SqlConnectOptions connectOptions(URI uri) {
SqlConnectOptions sqlConnectOptions = super.connectOptions(uri);
PgConnectOptions pgConnectOptions = new PgConnectOptions(sqlConnectOptions);
if (ssl) {
pgConnectOptions.setSsl(true);
pgConnectOptions.setTrustAll(true);
pgConnectOptions.setSslMode(SslMode.of(sslMode));
}
return pgConnectOptions;
}
} |
@pendula95 , I've create a separate issue to update the documentaion with this: #1866 |
Today there is no way to pass SSL mode by property or URL param when using Postgres.
Correct me if I'm wrong, the only client available is Vertx and it is using
io.vertx.pgclient.PgConnectOptions
.The constructor of PgConnectOptions does not inherit the SSL mode from the SqlConnectOptions which Hibernate sends.
https://github.com/eclipse-vertx/vertx-sql-client/blob/352e8da205598ffd9730ef36891dbc28ff544e53/vertx-pg-client/src/main/java/io/vertx/pgclient/PgConnectOptions.java#L139
The DefaultSqlConnectOptions also does not seem to have an option for SSL to be configured, is that correct?
The text was updated successfully, but these errors were encountered: