Followup from elastic/elasticsearchelastic/elasticsearch#19332

Added missing IOException and simplified filtering out mock transports
for security integration tests.

Relates to elastic/elasticseachelastic/elasticsearch#19332

Original commit: elastic/x-pack-elasticsearch@8a5c015c3d
This commit is contained in:
Simon Willnauer 2016-07-11 12:16:53 +02:00
parent 161ee862f5
commit 9dab9eb762
2 changed files with 5 additions and 10 deletions

View File

@ -31,6 +31,7 @@ import org.jboss.netty.handler.ssl.SslHandler;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.List;
@ -111,7 +112,7 @@ public class SecurityNettyTransport extends NettyTransport {
}
@Override
protected void onException(Channel channel, Exception e) {
protected void onException(Channel channel, Exception e) throws IOException {
if (isNotSslRecordException(e)) {
if (logger.isTraceEnabled()) {
logger.trace("received plaintext traffic on a encrypted channel, closing connection {}", e, channel);

View File

@ -16,6 +16,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.transport.MockTcpTransportPlugin;
import org.elasticsearch.xpack.security.InternalClient;
import org.elasticsearch.xpack.security.Security;
import org.elasticsearch.xpack.security.authc.support.SecuredString;
@ -177,11 +178,8 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
}
@Override
protected Collection<Class<? extends Plugin>> getMockPlugins() {
Set<Class<? extends Plugin>> plugins = new HashSet<>(super.getMockPlugins());
plugins.remove(MockTransportService.TestPlugin.class); // security has its own transport service
plugins.remove(AssertingLocalTransport.TestPlugin.class); // security has its own transport
return plugins;
protected boolean addMockTransportService() {
return false; // security has its own transport service
}
@Override
@ -355,10 +353,6 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
return internalCluster().getInstance(InternalClient.class);
}
protected InternalClient internalClient(String node) {
return internalCluster().getInstance(InternalClient.class, node);
}
protected SecurityClient securityClient() {
return securityClient(client());
}