How to detect an end of stream properly, when TLS PSK encryption is used?
问题 I have prepared a simple TLS PSK client test case based on MockPSKTlsClient by Bouncy Castle. In the main method I call: public static void main(String[] args) throws IOException { SecureRandom random = new SecureRandom(); TlsPSKIdentity identity = new BasicTlsPSKIdentity("Client_identity", Hex.decode("1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A")); Socket socket = new Socket(InetAddress.getLocalHost(), 12345); TlsClientProtocol proto = new TlsClientProtocol(socket.getInputStream(), socket