mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
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:
parent
161ee862f5
commit
9dab9eb762
@ -31,6 +31,7 @@ import org.jboss.netty.handler.ssl.SslHandler;
|
|||||||
|
|
||||||
import javax.net.ssl.SSLEngine;
|
import javax.net.ssl.SSLEngine;
|
||||||
import javax.net.ssl.SSLParameters;
|
import javax.net.ssl.SSLParameters;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ public class SecurityNettyTransport extends NettyTransport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onException(Channel channel, Exception e) {
|
protected void onException(Channel channel, Exception e) throws IOException {
|
||||||
if (isNotSslRecordException(e)) {
|
if (isNotSslRecordException(e)) {
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
logger.trace("received plaintext traffic on a encrypted channel, closing connection {}", e, channel);
|
logger.trace("received plaintext traffic on a encrypted channel, closing connection {}", e, channel);
|
||||||
|
@ -16,6 +16,7 @@ import org.elasticsearch.common.settings.Settings;
|
|||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.transport.MockTcpTransportPlugin;
|
||||||
import org.elasticsearch.xpack.security.InternalClient;
|
import org.elasticsearch.xpack.security.InternalClient;
|
||||||
import org.elasticsearch.xpack.security.Security;
|
import org.elasticsearch.xpack.security.Security;
|
||||||
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
||||||
@ -177,11 +178,8 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getMockPlugins() {
|
protected boolean addMockTransportService() {
|
||||||
Set<Class<? extends Plugin>> plugins = new HashSet<>(super.getMockPlugins());
|
return false; // security has its own transport service
|
||||||
plugins.remove(MockTransportService.TestPlugin.class); // security has its own transport service
|
|
||||||
plugins.remove(AssertingLocalTransport.TestPlugin.class); // security has its own transport
|
|
||||||
return plugins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -355,10 +353,6 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|||||||
return internalCluster().getInstance(InternalClient.class);
|
return internalCluster().getInstance(InternalClient.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected InternalClient internalClient(String node) {
|
|
||||||
return internalCluster().getInstance(InternalClient.class, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SecurityClient securityClient() {
|
protected SecurityClient securityClient() {
|
||||||
return securityClient(client());
|
return securityClient(client());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user