public class SecureSessionTest extends DevApiBaseTestCase
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
clientKeyStorePassword |
(package private) java.lang.String |
clientKeyStorePath |
(package private) java.lang.String |
clientKeyStoreUrl |
(package private) java.lang.String |
sslFreeBaseUrl |
(package private) java.util.Properties |
sslFreeTestProperties |
(package private) java.lang.String |
trustStorePassword |
(package private) java.lang.String |
trustStorePath |
(package private) java.lang.String |
trustStoreUrl |
dbCharset, dbCollation, schema, sessionbaseUrl, DEFAULT_METADATA_CHARSET, fact, isSetForXTests, testHostInfo, testProperties| Constructor and Description |
|---|
SecureSessionTest() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
allowsRsa(Session sess) |
private void |
assertTlsVersion(Session sess,
java.lang.String expectedTlsVersion) |
private void |
assertUser(java.lang.String user,
Session sess) |
private java.lang.String |
getHighestCommonTlsVersion(Session sess) |
void |
setupSecureSessionTest() |
void |
teardownSecureSessionTest() |
void |
testAuthMechanisms()
Tests that PLAIN, MYSQL41, SHA256_MEMORY, and EXTERNAL authentication mechanisms.
|
void |
testBug23597281()
Tests fix for Bug#23597281, GETNODESESSION() CALL WITH SSL PARAMETERS RETURNS CJCOMMUNICATIONSEXCEPTION
|
void |
testBug25494338()
Tests fix for Bug#25494338, ENABLEDSSLCIPHERSUITES PARAMETER NOT WORKING AS EXPECTED WITH X-PLUGIN.
|
void |
testBug26227653()
Tests fix for Bug#26227653, WL#10528 DIFF BEHAVIOUR WHEN SYSTEM PROP JAVAX.NET.SSL.TRUSTSTORETYPE IS SET
The actual bug is: if wrong system-wide SSL settings are provided, the session should not fail if 'xdevapi.ssl-mode=REQUIRED'.
|
void |
testBug27629553()
Tests fix for Bug#27629553, NPE FROM GETSESSION() FOR SSL CONNECTION WHEN NO PASSWORD PASSED.
|
void |
testFallbackToSystemKeyStore()
Tests connection property 'xdevapi.fallback-to-system-keystore' behavior.
|
void |
testFallbackToSystemTrustStore()
Tests connection property 'xdevapi.fallback-to-system-truststore' behavior.
|
void |
testNonSecureSession()
Tests non-secure
Sessions created via URL and properties map. |
void |
testSecureSessionDefaultAndRequired()
Tests secure
Sessions created via URL and properties map. |
void |
testSecureSessionDefaultAndRequiredWithSystemPropsPresent()
Tests secure
Sessions created via URL and properties map, with the SSL system properties also defined. |
void |
testSecureSessionMissingTrustStore()
Tests exception thrown on missing truststore for a secure
Session. |
void |
testSecureSessionVerifyServerCertificate()
Tests secure
Sessions created via URL and properties map, verifying server certificate. |
void |
testSecureSessionVerifyServerCertificateIdentity()
Tests secure
Sessions created via URL and properties map, verifying server certificate. |
void |
testSecureSessionVerifyServerCertificateIdentityFailure()
Tests exception thrown on verifying server certificate identity failure.
|
void |
testSecureSessionVerifyServerCertificateUsingSystemProps()
Tests secure
Sessions created via URL and properties map combined with SSL system properties, verifying server certificate. |
void |
testTLSv1_2()
Tests TLSv1.2
|
void |
testTLSVersionRemoval()
Tests WL#14805, Remove support for TLS 1.0 and 1.1.
|
void |
testTSLConflictingOptions()
Tests WL#14835, Align TLS option checking across connectors
|
void |
testXdevapiSslConnectionOptions()
Tests that given SSL/TLS related session properties values are processed as expected.
|
void |
testXdevapiTlsVersionsAndCiphersuites() |
assertNonSecureSession, assertPreparedStatementsCount, assertPreparedStatementsCountsAndId, assertPreparedStatementsStatusCounts, assertSecureSession, assertSecureSession, buildString, count_data, destroyTestSession, dropCollection, getPreparedStatementExecutionsCount, getPreparedStatementId, getPreparedStatementsCount, getPreparedStatementsCount, getPreparedStatementsCount, getPrepDeallocateCount, getPrepExecuteCount, getPrepPrepareCount, getThreadId, isMysqlRunningLocally, isServerRunningOnWindows, makeParam, makeParam, makeParam, setupTestSession, sqlUpdate, supportsTestCertificates, supportsTLSv1_2assertSessionStatusEquals, assertSessionStatusNotEquals, assertThrows, assertThrows, assertThrows, assertThrows, createAuthenticatedTestProtocol, createTempTestCollection, createTestProtocol, createTestSchema, createTestSession, dropTempTestCollection, getEncodedTestHost, getTestDatabase, getTestHost, getTestPassword, getTestPort, getTestUser, mysqlVersionMeetsMinimum, mysqlVersionMeetsMinimumfinal java.lang.String trustStoreUrl
final java.lang.String trustStorePath
final java.lang.String trustStorePassword
final java.lang.String clientKeyStoreUrl
final java.lang.String clientKeyStorePath
final java.lang.String clientKeyStorePassword
final java.util.Properties sslFreeTestProperties
java.lang.String sslFreeBaseUrl
@BeforeEach public void setupSecureSessionTest()
@AfterEach public void teardownSecureSessionTest()
@Test public void testNonSecureSession()
Sessions created via URL and properties map.@Test public void testSecureSessionDefaultAndRequired()
Sessions created via URL and properties map. This is the default if no ssl-mode is provided.@Test public void testSecureSessionDefaultAndRequiredWithSystemPropsPresent()
Sessions created via URL and properties map, with the SSL system properties also defined.@Test public void testSecureSessionVerifyServerCertificate()
Sessions created via URL and properties map, verifying server certificate.@Test public void testSecureSessionVerifyServerCertificateUsingSystemProps()
Sessions created via URL and properties map combined with SSL system properties, verifying server certificate.@Test @Disabled(value="requires a certificate with CN=<host_name> equals to the host name in the test URL") public void testSecureSessionVerifyServerCertificateIdentity()
Sessions created via URL and properties map, verifying server certificate.
This test would pass if the server certificate had "CN=@Test public void testSecureSessionMissingTrustStore()
Session.@Test public void testSecureSessionVerifyServerCertificateIdentityFailure()
@Test
public void testAuthMechanisms()
throws java.lang.Throwable
java.lang.Throwable@Test
public void testTLSv1_2()
throws java.lang.Exception
java.lang.Exceptionprivate boolean allowsRsa(Session sess)
private void assertUser(java.lang.String user,
Session sess)
private void assertTlsVersion(Session sess, java.lang.String expectedTlsVersion)
private java.lang.String getHighestCommonTlsVersion(Session sess) throws java.lang.Exception
java.lang.Exception@Test public void testBug25494338()
@Test public void testBug23597281()
@Test public void testBug26227653()
@Test public void testBug27629553()
@Test
public void testXdevapiTlsVersionsAndCiphersuites()
throws java.lang.Exception
java.lang.Exception@Test
public void testXdevapiSslConnectionOptions()
throws java.lang.Exception
java.lang.Exception@Test
public void testFallbackToSystemTrustStore()
throws java.lang.Exception
java.lang.Exception@Test
public void testFallbackToSystemKeyStore()
throws java.lang.Exception
java.lang.Exception@Test
public void testTLSVersionRemoval()
throws java.lang.Exception
java.lang.Exception@Test
public void testTSLConflictingOptions()
throws java.lang.Exception
java.lang.Exception