use of org.neo4j.ssl.config.SslPolicyLoader in project neo4j by neo4j.
the class SslPolicyLoaderTest method shouldThrowIfPolicyNameDoesNotExist.
@Test
void shouldThrowIfPolicyNameDoesNotExist() {
// given
SslPolicyConfig policyConfig = SslPolicyConfig.forScope(TESTING);
Config config = newBuilder().set(neo4j_home, home.toAbsolutePath()).set(policyConfig.base_directory, Path.of("certificates/default")).build();
SslPolicyLoader sslPolicyLoader = SslPolicyLoader.create(config, NullLogProvider.getInstance());
// when
assertThrows(IllegalArgumentException.class, () -> sslPolicyLoader.getPolicy(BOLT));
}
use of org.neo4j.ssl.config.SslPolicyLoader in project neo4j by neo4j.
the class SslPolicyLoaderTest method shouldReturnNullPolicyIfNullRequested.
@Test
void shouldReturnNullPolicyIfNullRequested() {
// given
SslPolicyLoader sslPolicyLoader = SslPolicyLoader.create(Config.defaults(), NullLogProvider.getInstance());
// when
SslPolicy sslPolicy = sslPolicyLoader.getPolicy(null);
// then
assertNull(sslPolicy);
}
use of org.neo4j.ssl.config.SslPolicyLoader in project neo4j by neo4j.
the class SslPolicyLoaderTest method shouldLoadBaseCryptographicObjects.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void shouldLoadBaseCryptographicObjects(boolean ignoreDotfiles) throws Exception {
// when
SslPolicyLoader sslPolicyLoader = createSslPolicyLoader(ignoreDotfiles);
// then
SslPolicy sslPolicy = sslPolicyLoader.getPolicy(TESTING);
assertPolicyValid(sslPolicy);
}
Aggregations