Commit 34286d24 authored by daryl herzmann's avatar daryl herzmann

Merge pull request #232 from dwd/fix-everything-3.10

Address current problems in 3.10
parents ad6fb662 46e87630
...@@ -162,15 +162,27 @@ public class NIOConnection implements Connection { ...@@ -162,15 +162,27 @@ public class NIOConnection implements Connection {
} }
public byte[] getAddress() throws UnknownHostException { public byte[] getAddress() throws UnknownHostException {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getAddress(); try {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getAddress();
} catch (NullPointerException e) {
throw new UnknownHostException();
}
} }
public String getHostAddress() throws UnknownHostException { public String getHostAddress() throws UnknownHostException {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getHostAddress(); try {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getHostAddress();
} catch (NullPointerException e) {
throw new UnknownHostException();
}
} }
public String getHostName() throws UnknownHostException { public String getHostName() throws UnknownHostException {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getHostName(); try {
return ((InetSocketAddress) ioSession.getRemoteAddress()).getAddress().getHostName();
} catch (NullPointerException e) {
throw new UnknownHostException();
}
} }
public Certificate[] getLocalCertificates() { public Certificate[] getLocalCertificates() {
...@@ -435,7 +447,7 @@ public class NIOConnection implements Connection { ...@@ -435,7 +447,7 @@ public class NIOConnection implements Connection {
// good // good
filter.setWantClientAuth(true); filter.setWantClientAuth(true);
} }
ioSession.getFilterChain().addAfter(EXECUTOR_FILTER_NAME, TLS_FILTER_NAME, filter); ioSession.getFilterChain().addBefore(EXECUTOR_FILTER_NAME, TLS_FILTER_NAME, filter);
ioSession.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE, Boolean.TRUE); ioSession.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE, Boolean.TRUE);
if (!clientMode) { if (!clientMode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment