List of usage examples for javax.net.ssl SSLSession getApplicationBufferSize
public int getApplicationBufferSize();
From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java
private ByteBuffer allocateOutBuffer() { final SSLEngine sslEngine = getSSLEngine(); final SSLSession sslSession = sslEngine.getSession(); return ByteBuffer.allocate(sslSession.getApplicationBufferSize()); }
From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java
private void unwrapHandshake(final String inputString) throws MalformedChallengeException { final SSLEngine sslEngine = getSSLEngine(); final SSLSession sslSession = sslEngine.getSession(); final ByteBuffer src = decodeBase64(inputString); final ByteBuffer dst = ByteBuffer.allocate(sslSession.getApplicationBufferSize()); while (sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP) { unwrap(src, dst);//from www .j a v a 2s .c o m } }
From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java
private ByteBuffer unwrap(final String inputString) throws MalformedChallengeException { final SSLEngine sslEngine = getSSLEngine(); final SSLSession sslSession = sslEngine.getSession(); final ByteBuffer src = decodeBase64(inputString); final ByteBuffer dst = ByteBuffer.allocate(sslSession.getApplicationBufferSize()); unwrap(src, dst);//from w ww . ja v a 2 s .co m dst.flip(); return dst; }