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

Improve user experience with SSL #698

Merged
merged 3 commits into from
Feb 3, 2019
Merged

Improve user experience with SSL #698

merged 3 commits into from
Feb 3, 2019

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jan 31, 2019

This PR is on top of #691 so this one should be merged first.

Only the last 3 commits should be reviewed.

I'm also pretty sure it will conflict with David's config stuff so I'll rebase accordingly once it's in.

Fixes #454 .

@gsmet gsmet requested review from FroMage and dmlloyd January 31, 2019 21:08
@@ -302,13 +312,14 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
command.add("-J-D" + propertyName + "=" + propertyValue);
}
}

enableSslNative = properties.getProperty("shamrock.ssl.native") != null ? Boolean.parseBoolean(properties.getProperty("shamrock.ssl.native"))
: false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration is pushed here via native-image.properties.


import org.jboss.builder.item.MultiBuildItem;

public final class ExtensionSslNativeSupportBuildItem extends MultiBuildItem {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name could be improved, suggestions, welcome.

Obviously, if we end up using a separate extension to push that, we won't need the extension name anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now.

poolConfiguration.connectionFactoryConfiguration().jdbcProperty("useSSL", "false");
break;
default:
log.warning("Agroal does not support disabling SSL for driver " + driver.getName());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class does not use JBoss Logging, we need to fix that. Will create a separate issue.

break;
case "com.mysql.jdbc.Driver":
poolConfiguration.connectionFactoryConfiguration().jdbcProperty("useSSL", "false");
break;
Copy link
Member Author

@gsmet gsmet Jan 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have the JDBC drivers push some support for that via build items instead of having specific code here.

I have some plans for that but it will have to wait.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we can do this later (not a lot later though ;) ).


// Indicates that this extension would like the SSL support to be enabled
sslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(FeatureBuildItem.AGROAL));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I push a build item here. @dmlloyd apparently, you preferred having a separate extension do that. I thought having the extensions requiring this could be helpful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all drivers support SSL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of the TCP based drivers do, probably all of them now that SSL is becoming the norm.

In the end, I think I would make it something coming from the driver extension but that's for another day. My plan is to have a build item for JDBC drivers that would be consumed by the Agroal extension but that's for another day.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is OK for now. We can come back to this later and come up with something fancy that can handle JDK, NSS, OpenSSL, etc.

@FroMage
Copy link
Member

FroMage commented Feb 1, 2019

LGTM.

@gsmet
Copy link
Member Author

gsmet commented Feb 1, 2019

Rebased.

@gsmet gsmet changed the title [DO NOT MERGE] Improve user experience with SSL Improve user experience with SSL Feb 1, 2019
Copy link
Member

@dmlloyd dmlloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(deleted)


import org.jboss.builder.item.MultiBuildItem;

public final class ExtensionSslNativeSupportBuildItem extends MultiBuildItem {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now.


// Indicates that this extension would like the SSL support to be enabled
sslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(FeatureBuildItem.AGROAL));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is OK for now. We can come back to this later and come up with something fancy that can handle JDK, NSS, OpenSSL, etc.

break;
case "com.mysql.jdbc.Driver":
poolConfiguration.connectionFactoryConfiguration().jdbcProperty("useSSL", "false");
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we can do this later (not a lot later though ;) ).

@dmlloyd
Copy link
Member

dmlloyd commented Feb 1, 2019

Ah, nevermind, carry on :)

@gsmet gsmet mentioned this pull request Feb 1, 2019
Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@gsmet gsmet added this to the 0.8.0 milestone Feb 1, 2019
@gsmet gsmet merged commit 156a856 into quarkusio:master Feb 3, 2019
@jilani97
Copy link

Is there a guide on how we now can connect to Postgres with SSL with quarkus? Im using the vertx quickstart for this.

maxandersen pushed a commit to maxandersen/quarkus that referenced this pull request Nov 5, 2022
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

Successfully merging this pull request may close these issues.

Support SSL in the REST client
4 participants