Improve notifyHandshakeComplete in test
@@ -152,8 +152,10 @@ public void notifyHandshakeComplete() throws IOException
System.out.println("Client ALPN: " + protocolName.getUtf8Decoding());
}
- TlsSession newSession = context.getResumableSession();
+ TlsSession newSession = context.getSession();
if (newSession != null)
+ {
+ if (newSession.isResumable())
{
byte[] newSessionID = newSession.getSessionID();
String hex = Hex.toHexString(newSessionID);
@@ -165,15 +167,19 @@ public void notifyHandshakeComplete() throws IOException
else
{
System.out.println("Client established session: " + hex);
+ }
+
+ this.session = newSession;
+ }
byte[] tlsServerEndPoint = context.exportChannelBinding(ChannelBinding.tls_server_end_point);
+ if (null != tlsServerEndPoint)
+ {
System.out.println("Client 'tls-server-end-point': " + hex(tlsServerEndPoint));
}
byte[] tlsUnique = context.exportChannelBinding(ChannelBinding.tls_unique);
System.out.println("Client 'tls-unique': " + hex(tlsUnique));
-
- this.session = newSession;
}
}
