@Test public void startTlsShouldReturnTrueWhenServerSupportsIt() throws Exception { server = createServer(createProtocol(Optional.empty()), Encryption.createStartTls(BogusSslContextFactory.getServerContext())); smtpsClient = createClient(); server.bind(); InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress(); smtpsClient.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort()); smtpsClient.sendCommand("EHLO localhost"); boolean execTLS = smtpsClient.execTLS(); assertThat(execTLS).isTrue(); }
@Test public void startTlsShouldReturnTrueWhenServerSupportsIt() throws Exception { server = createServer(createProtocol(Optional.empty()), Encryption.createStartTls(BogusSslContextFactory.getServerContext())); smtpsClient = createClient(); server.bind(); InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress(); smtpsClient.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort()); smtpsClient.sendCommand("EHLO localhost"); boolean execTLS = smtpsClient.execTLS(); assertThat(execTLS).isTrue(); }