-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Neo4J Quarkus can't be configured for SSL #19412
Comments
/cc @michael-simons |
Yep I did notice that too. I run it like this
and don't use the (This is not a theoretical advice, this is from https://neo4j-aura-quarkus-graphql.herokuapp.com, a Quarkus app running on Heroku against aura free). |
Thanks for the quick response! 👍 However, that doesn't work for me:
I've used:
Now, is this an Aura Free issue or another Quarkus configuration? |
Very welcome :) You are most likely not passing the driver instance created by Quarkus via the properties to Neo4j-OGM. Make sure you have an application scoped producer of a session factory like this: OGM will only use |
Oh wait, it's a bit worrying though… @injectives what could be the cause of:
Driver incompatibility? And if so, we doesn't it affect my setup? |
Interesting 🤔 Well, kind of, I have a CDI producer that emits a @Produces
SessionFactory produceSessionFactory() {
Configuration neoConfig = new Configuration.Builder()
.uri(databaseUri)
.credentials(username, password)
.useNativeTypes()
.build();
return new SessionFactory(neoConfig, PACKAGES);
} Switching to injecting the But yes, would be interesting to know. If I use above code in a manual test (without Quarkus) it also fails with the same exception... |
The quarkus provided driver does not call So do I understand correctly: You use quarkus properties injected into OGM properties? Not that it doesn't change anything here, I am just curious |
I've injected the @ApplicationScoped
public class SessionFactoryProducer {
public static final String[] PACKAGES = {"com.sebastian_daschner.coffee.beans.entity"};
@ConfigProperty(name = "quarkus.neo4j.uri")
String databaseUri;
@ConfigProperty(name = "quarkus.neo4j.authentication.username")
String username;
@ConfigProperty(name = "quarkus.neo4j.authentication.password")
String password;
@Produces
SessionFactory produceSessionFactory() {
Configuration neoConfig = new Configuration.Builder()
.uri(databaseUri)
.credentials(username, password)
.useNativeTypes()
.build();
return new SessionFactory(neoConfig, PACKAGES);
}
void disposeSessionFactory(@Disposes SessionFactory sessionFactory) {
sessionFactory.close();
}
} Btw, IDK if the native types might produce another issue if we just use the Quarkus-provided driver? :) |
Config makes sense. |
Btw are there some plans to fix this (the original issue with |
Failure to acquire a working connection towards a routing server. More details here: neo4j/neo4j-java-driver#986 (comment) |
Not sure if the Quarkus team can do anything here? @michael-simons maybe some adjustments in the doc are needed? I'll let you judge of that but if we can't do anything on our side, I would be in favor of closing the issue. |
Hello, is it still the official recommandation of Neo4J when we are using the Driver to create the SessionFactory? As reminder:
We are just facing the original issue "Failed to start application (with profile dev): org.neo4j.driver.exceptions.ClientException: Scheme neo4j+s is not configurable with manual encryption and trust settings" at the moment and I'm wondering if this recommandation is still the only one available. |
Hi @sandronm this is now mixing in OGM for good measures, right? The message you receive does happen as
-> Things fail. Please use This is how the config of the above mentioned app looks like: |
This adds dedicated support of Neo4j `neo4j+s` and `neo4j+ssc` URL schemes by skipping all other configuration of encryption settings as the underlying driver prevents configuration of encryption settings via url schema and explicit settings at the same time. Also adds a bit of documentation. This fixes quarkusio#19412.
I added a fix for this, @sandronm . Thanks for pushing it, tbh I find it annoying myself. |
This adds dedicated support of Neo4j `neo4j+s` and `neo4j+ssc` URL schemes by skipping all other configuration of encryption settings as the underlying driver prevents configuration of encryption settings via url schema and explicit settings at the same time. Also adds a bit of documentation. This fixes quarkusio#19412. Co-authored-by: Guillaume Smet <[email protected]>
Describe the bug
Using a database URI with encryption makes the application startup fail:
The issue is caused by a default "change" in the configuration in the
quarkus-neo4j
code inNeo4jDriverRecorder#configureSsl
, which causes the code inorg.neo4j.driver.internal.SecuritySettings
to override the defaults, regardless of what we put into our Quarkus properties file.Expected behavior
No response
Actual behavior
No response
How to Reproduce?
Start up Quarkus with any Neo4J instance that uses an encrypted connection, e.g. using Neo4J Aura Free and connect using the URI:
neo4j+s://xxxxxx123.databases.neo4j.io
Output of
uname -a
orver
No response
Output of
java -version
16
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.1.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
This issue might be resolved by just removing lines 119-125 in
Neo4jDriverRecorder
. The default config should work correctly then.The text was updated successfully, but these errors were encountered: