That's working now - I thought I was getting errors when I tried that earlier, turns out the errors were from elsewhere.
What I still can't get working is SSL with NIO, if I enable NIO it hangs in the call to connect.
@Test
public void testSsl() throws Throwable {
char[] trustPassphrase = "password".toCharArray();
KeyStore tks = KeyStore.getInstance("JKS");
InputStream tustKeyStoreStream = this.getClass().getResourceAsStream("/ssl-server/localhost-test-rabbit-store");
tks.load(tustKeyStoreStream, trustPassphrase);
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
tmf.init(tks);
SSLContext c = SSLContext.getInstance("TLSv1.3");
c.init(null, tmf.getTrustManagers(), null);
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
factory.setPort(5671);
factory.useNio();
factory.useSslProtocol(c);
Connection conn = factory.newConnection();
assertNotNull(conn);
conn.close();
}
That test passes if I remove the call to useNio().
Is that a known issue?
Thanks again.