-
Notifications
You must be signed in to change notification settings - Fork 59
Added SSL support #78
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
Conversation
Now can be used with Heroku, as heroku supports only SSL
@Mart-Bogdan have you signed the Eclipse CA ? |
@vietj I belive yes, I've made some PRs to one of your repos(if I remember correctly) . But that was quite a while, I do not remember exactly whole process. |
Hello, @vietj so this can be merged? |
Let me review it on Friday... sorry :/
Am 11.05.2017 13:48 schrieb "Bogdan Mart" <notifications@github.com>:
… Hello, @vietj <https://github.com/vietj> so this can be merged?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABr5uTKrDMJAEqawRdCNkSTEIEveQNnaks5r4vVugaJpZM4NVrbf>
.
|
@Narigo thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a test for this change?
* "queryTimeout" : <timeout-in-milliseconds> | ||
* "queryTimeout" : <timeout-in-milliseconds>, | ||
* "sslmode" : <"disable"|"prefer"|"require"|"verify-ca"|"verify-full">, | ||
* "sslrootcert" : <path to file with certificate> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sslMode
and sslRootCert
would be more appropriate names (maxPoolSize
and queryTimeout
are camel cased as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I won't change "verify-ca" and "verify-full" as it's direct values passed to underlying library.
Honestly, I didn't figured out how to run your tests. Can it be run without Docker? |
@Narigo database test connection is configured at this method But i'm still not sure how to test this functionality. |
Hello, @Narigo, what do you think? |
Hi @Mart-Bogdan and sorry for being so late with replies here. I try to check the code myself this week and get back to you on the weekend. If @pmlopes has time to have a look, especially regarding testing the SSL stuff, I guess we could use helpful input ;) |
I've tried to get this running but had trouble getting the environment to work. Maybe some docker expert could help us here? @cescoffier @vietj @pmlopes ? Two test cases like this should suffice, but I'm unsure how to get it into a test environment / set up that environment using docker: @Test
public void testCorrectSslConfiguration(TestContext context) {
Async async = context.async();
String path = getClass()
.getResource("/ssl-docker/server.crt")
.getPath();
System.out.println("Path = " + path);
JsonObject sslConfig = new JsonObject()
.put("sslMode", "require")
.put("sslRootCert", path);
client = createClient(vertx, sslConfig);
client.getConnection(sqlConnectionAsyncResult -> {
sqlConnectionAsyncResult.cause().printStackTrace();
context.assertTrue(sqlConnectionAsyncResult.succeeded());
conn = sqlConnectionAsyncResult.result();
conn.query("SELECT 1", ar -> {
if (ar.failed()) {
context.fail("Should not fail on ssl connection");
} else {
async.complete();
}
});
});
}
@Test
public void testWrongSslConfiguration(TestContext context) {
Async async = context.async();
client = createClient(vertx,
new JsonObject()
.put("host", System.getProperty("db.host", "localhost"))
.put("sslMode", "verify-ca")
.put("sslRootCert", "something-wrong.crt")
);
client.getConnection(sqlConnectionAsyncResult -> {
context.assertTrue(sqlConnectionAsyncResult.failed());
async.complete();
});
} I've created a folder I'm pretty sure I'm doing something wrong here, so help is highly appreciated... :) |
Hi there, I've managet to get Docler runing on my machine, and configured SSL image of postgreSQL. @vietj Would it be ok, if I change port numbers used for my-sql and postgre-sql? Currently default ones are being used, but that won't work if databases are installed on machine. I want to chage ports for both DBs in tests, and add second instance of postgre, with SSL. |
@Mart-Bogdan I finally came around fixing this. I've added tests and how to run the ssl docker stuff. I also rebased everything on the latest master, so I'll create a new PR for you to review the tests. |
I'll close this in favor of the rebased version with tests over here: #88 |
Added SSL support, see #43
Now can be used with Heroku, as heroku supports only SSL.