List of usage examples for javax.net.ssl SSLSession getPacketBufferSize
public int getPacketBufferSize();
From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java
private String wrapHandshake() throws AuthenticationException { final ByteBuffer src = allocateOutBuffer(); src.flip();/* ww w . j a va 2 s . c om*/ final SSLEngine sslEngine = getSSLEngine(); final SSLSession sslSession = sslEngine.getSession(); // Needs to be twice the size as there may be two wraps during handshake. // Primitive and inefficient solution, but it works. final ByteBuffer dst = ByteBuffer.allocate(sslSession.getPacketBufferSize() * 2); while (sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_WRAP) { wrap(src, dst); } dst.flip(); return encodeBase64(dst); }
From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java
private String wrap(final ByteBuffer src) throws AuthenticationException { final SSLEngine sslEngine = getSSLEngine(); final SSLSession sslSession = sslEngine.getSession(); final ByteBuffer dst = ByteBuffer.allocate(sslSession.getPacketBufferSize()); wrap(src, dst);//from www . j av a2 s . co m dst.flip(); return encodeBase64(dst); }