@Test public void testMultiplePortsSSL() throws Exception { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, new TrustManager[]{new X509TrustManager() { @Override public void checkClientTrusted(X509Certificate[] certs, String s) { } @Override public void checkServerTrusted(X509Certificate[] certs, String s) { } @Override public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } } }, null); SocketFactory socketFactory = sslContext.getSocketFactory(); Context context = new Context(); context.put("ssl", "true"); context.put("keystore", "src/test/resources/server.p12"); context.put("keystore-password", "password"); context.put("keystore-type", "PKCS12"); MultiportSyslogTCPSource source = new MultiportSyslogTCPSource(); Channel channel = new MemoryChannel(); List<Event> channelEvents = new ArrayList<>(); int numPorts = 10; List<Integer> portList = testNPorts(source, channel, channelEvents, numPorts, null, getSSLEventSender(socketFactory), context); processEvents(channelEvents, numPorts, portList); source.stop(); }
@Override public void stop() { logger.info("Stopping {}...", this); acceptor.unbind(); acceptor.dispose(); sourceCounter.stop(); super.stop(); logger.info("{} stopped. Metrics: {}", this, sourceCounter); }
MultiportSyslogTCPSource extends SslContextAwareAbstractSource implements
        EventDrivenSource, Configurable, BatchSizeSupported { @Override public void stop() { logger.info("Stopping {}...", this); acceptor.unbind(); acceptor.dispose(); sourceCounter.stop(); super.stop(); logger.info("{} stopped. Metrics: {}", this, sourceCounter); } }
MultiportSyslogTCPSource extends SslContextAwareAbstractSource implements
        EventDrivenSource, Configurable, BatchSizeSupported { @Override public void stop() { logger.info("Stopping {}...", this); acceptor.unbind(); acceptor.dispose(); sourceCounter.stop(); super.stop(); logger.info("{} stopped. Metrics: {}", this, sourceCounter); } MultiportSyslogTCPSource(); }
MultiportSyslogTCPSource extends SslContextAwareAbstractSource implements
        EventDrivenSource, Configurable, BatchSizeSupported { @Override public void stop() { logger.info("Stopping {}...", this); acceptor.unbind(); acceptor.dispose(); sourceCounter.stop(); super.stop(); logger.info("{} stopped. Metrics: {}", this, sourceCounter); } MultiportSyslogTCPSource(); @Override void configure(Context context); @Override void start(); @Override void stop(); @Override String toString(); @Override long getBatchSize(); }
MultiportSyslogTCPSource extends SslContextAwareAbstractSource implements
        EventDrivenSource, Configurable, BatchSizeSupported { @Override public void stop() { logger.info("Stopping {}...", this); acceptor.unbind(); acceptor.dispose(); sourceCounter.stop(); super.stop(); logger.info("{} stopped. Metrics: {}", this, sourceCounter); } MultiportSyslogTCPSource(); @Override void configure(Context context); @Override void start(); @Override void stop(); @Override String toString(); @Override long getBatchSize(); static final Logger logger; }