Skip to content

Commit

Permalink
Fix more VPN-related test issues on Windows
Browse files Browse the repository at this point in the history
Fixed a couple of additional unit test failures that occur on
Windows as a result of a quirk with the Ping Identity VPN.
  • Loading branch information
dirmgr committed Apr 26, 2022
1 parent a529157 commit b501047
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6610,19 +6610,19 @@ public void testMaxConnections()
}
catch (final LDAPException e)
{
assertEquals(unHandler.getNotificationCount(), 2);
// This was expected.
}


// Closed all the remaining connections.
for (final LDAPConnection c : connList)
finally
{
c.close();
}
connList.clear();

// Closed all the remaining connections.
for (final LDAPConnection c : connList)
{
c.close();
}
connList.clear();

ds.shutDown(true);
ds.shutDown(true);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,10 @@ public void testSSLSocketVerifiers()

cfg.setListenerConfigs(
InMemoryListenerConfig.createLDAPConfig("LDAP",
InetAddress.getLocalHost(), 0,
InetAddress.getByName("127.0.0.1"), 0,
serverSSLUtil.createSSLSocketFactory()),
InMemoryListenerConfig.createLDAPSConfig("LDAPS",
InetAddress.getLocalHost(), 0,
InetAddress.getByName("127.0.0.1"), 0,
serverSSLUtil.createSSLServerSocketFactory(),
clientSSLUtil.createSSLSocketFactory()));

Expand All @@ -1158,8 +1158,7 @@ public void testSSLSocketVerifiers()
opts.getSSLSocketVerifier() instanceof TrustAllSSLSocketVerifier);

LDAPConnection conn = new LDAPConnection(
clientSSLUtil.createSSLSocketFactory(), opts,
ds.getListenAddress("LDAPS").getHostAddress(),
clientSSLUtil.createSSLSocketFactory(), opts, "127.0.0.1",
ds.getListenPort("LDAPS"));
assertNotNull(conn.getRootDSE());
assertTrue(TrustAllSSLSocketVerifier.getInstance().verify("127.0.0.1",
Expand All @@ -1168,9 +1167,7 @@ public void testSSLSocketVerifiers()
"disallowed.example.com", conn.getSSLSession()));
conn.close();

conn = new LDAPConnection(opts,
ds.getListenAddress("LDAP").getHostAddress(),
ds.getListenPort("LDAP"));
conn = new LDAPConnection(opts, "127.0.0.1", ds.getListenPort("LDAP"));
assertNotNull(conn.getRootDSE());
assertResultCodeEquals(conn,
new StartTLSExtendedRequest(clientSSLUtil.createSSLSocketFactory()),
Expand Down Expand Up @@ -1226,18 +1223,15 @@ public void testSSLSocketVerifiers()


conn = new LDAPConnection(clientSSLUtil.createSSLSocketFactory(), opts,
ds.getListenAddress("LDAPS").getHostAddress(),
ds.getListenPort("LDAPS"));
"127.0.0.1", ds.getListenPort("LDAPS"));
assertNotNull(conn.getRootDSE());
assertTrue(new HostNameSSLSocketVerifier(true).verify("127.0.0.1",
conn.getSSLSession()));
assertFalse(new HostNameSSLSocketVerifier(true).verify(
"disallowed.example.com", conn.getSSLSession()));
conn.close();

conn = new LDAPConnection(opts,
ds.getListenAddress("LDAP").getHostAddress(),
ds.getListenPort("LDAP"));
conn = new LDAPConnection(opts, "127.0.0.1", ds.getListenPort("LDAP"));
assertNotNull(conn.getRootDSE());
assertResultCodeEquals(conn,
new StartTLSExtendedRequest(clientSSLUtil.createSSLSocketFactory()),
Expand Down

0 comments on commit b501047

Please sign in to comment.