Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions integrationtests/src/test/java/org/neo4j/bolt/BoltTlsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.neo4j.ssl.SslResource;
import org.neo4j.test.TestGraphDatabaseFactory;
import org.neo4j.test.rule.TestDirectory;
import org.neo4j.ssl.SupportsTls;

import static java.util.concurrent.TimeUnit.MINUTES;
import static org.junit.Assert.assertNotNull;
Expand Down Expand Up @@ -119,9 +120,9 @@ public static Object[] params()
new TestSetup( "TLSv1", "TLSv1.1", false ),
new TestSetup( "TLSv1.1", "TLSv1.2", false ),

new TestSetup( "TLSv1", "TLSv1", false ),
new TestSetup( "TLSv1.1", "TLSv1.1", false ),
new TestSetup( "TLSv1.2", "TLSv1.2", true ),
new TestSetup( "TLSv1", "TLSv1", SupportsTls.supportsTls_1_0() ),
new TestSetup( "TLSv1.1", "TLSv1.1", SupportsTls.supportsTls_1_1() ),
new TestSetup( "TLSv1.2", "TLSv1.2", SupportsTls.supportsTls_1_2() ),

new TestSetup( "SSLv3,TLSv1", "TLSv1.1,TLSv1.2", false ),
new TestSetup( "TLSv1.1,TLSv1.2", "TLSv1.1,TLSv1.2", true ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ public static Object[] params()
new TestSetup(
protocols( TLSv10 ).ciphers( NEW_CIPHER_A ),
protocols( TLSv10 ).ciphers( NEW_CIPHER_A ),
false, TLSv10, NEW_CIPHER_A ),
SupportsTls.supportsTls_1_0(), TLSv10, NEW_CIPHER_A ),
new TestSetup(
protocols( TLSv11 ).ciphers( OLD_CIPHER_A ),
protocols( TLSv11 ).ciphers( OLD_CIPHER_A ),
false, TLSv11, OLD_CIPHER_A ),
new TestSetup(
protocols( TLSv11 ).ciphers( NEW_CIPHER_A ),
protocols( TLSv11 ).ciphers( NEW_CIPHER_A ),
false, TLSv11, NEW_CIPHER_A ),
SupportsTls.supportsTls_1_1(), TLSv11, NEW_CIPHER_A ),
new TestSetup(
protocols( TLSv12 ).ciphers( NEW_CIPHER_A ),
protocols( TLSv12 ).ciphers( NEW_CIPHER_A ),
Expand Down Expand Up @@ -164,7 +164,7 @@ public static Object[] params()
new TestSetup(
protocols( TLSv11 ).ciphers( NEW_CIPHER_B, NEW_CIPHER_A ),
protocols( TLSv11 ).ciphers( NEW_CIPHER_C, NEW_CIPHER_A ),
false, TLSv11, NEW_CIPHER_A ),
SupportsTls.supportsTls_1_1(), TLSv11, NEW_CIPHER_A ),
new TestSetup(
protocols( TLSv12 ).ciphers( NEW_CIPHER_B, NEW_CIPHER_A ),
protocols( TLSv12 ).ciphers( NEW_CIPHER_C, NEW_CIPHER_A ),
Expand Down
62 changes: 62 additions & 0 deletions integrationtests/src/test/java/org/neo4j/ssl/SupportsTls.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2018-2020 "Graph Foundation,"
* Graph Foundation, Inc. [https://graphfoundation.org]
*
* This file is part of ONgDB Enterprise Edition. The included source
* code can be redistributed and/or modified under the terms of the
* GNU AFFERO GENERAL PUBLIC LICENSE Version 3
* (http://www.fsf.org/licensing/licenses/agpl-3.0.html) as found
* in the associated LICENSE.txt file.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*/
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.ssl;

public class SupportsTls
{
private static final String version = System.getProperty("java.version");
private static final boolean supportsLegacyTls = "11.0.11".compareTo(version) > 0;
private static final boolean supportsTls_1_3 = "1.8.0_263".compareTo(version) <= 0;

public static boolean supportsTls_1_0()
{
return supportsLegacyTls;
}

public static boolean supportsTls_1_1()
{
return supportsLegacyTls;
}

public static boolean supportsTls_1_2()
{
return true;
}

public static boolean supportsTls_1_3()
{
return supportsTls_1_3;
}
}
Loading