Search in sources :

Example 6 with AsyncSSLEngineException

use of org.webpieces.ssl.api.AsyncSSLEngineException in project webpieces by deanhiller.

the class AsyncSSLEngine2Impl method beginHandshake.

@Override
public XFuture<Void> beginHandshake() {
    mem.compareSet(ConnectionState.NOT_STARTED, ConnectionState.CONNECTING);
    SSLEngine sslEngine = mem.getEngine();
    if (log.isTraceEnabled())
        log.trace(mem + "start handshake");
    try {
        sslEngine.beginHandshake();
    } catch (SSLException e) {
        throw new AsyncSSLEngineException(e);
    }
    return sendHandshakeMessage();
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) AsyncSSLEngine(org.webpieces.ssl.api.AsyncSSLEngine) AsyncSSLEngineException(org.webpieces.ssl.api.AsyncSSLEngineException) SSLException(javax.net.ssl.SSLException)

Example 7 with AsyncSSLEngineException

use of org.webpieces.ssl.api.AsyncSSLEngineException in project webpieces by deanhiller.

the class AsyncSSLEngine3Impl method feedPlainPacket.

@Override
public XFuture<Void> feedPlainPacket(ByteBuffer buffer) {
    SSLEngine engine = mem.getEngine();
    circularBuffer.add(new Action(Thread.currentThread().getName(), ActionEnum.FEED_PLAIN_START, engine));
    try {
        metrics.recordPlainBytesFromClient(buffer.remaining());
        return feedPlainPacketImpl(buffer);
    } catch (SSLException e) {
        throw new AsyncSSLEngineException(e);
    } finally {
        circularBuffer.add(new Action(Thread.currentThread().getName(), ActionEnum.FEED_PLAIN_END, engine));
    }
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) AsyncSSLEngine(org.webpieces.ssl.api.AsyncSSLEngine) AsyncSSLEngineException(org.webpieces.ssl.api.AsyncSSLEngineException) SSLException(javax.net.ssl.SSLException)

Aggregations

AsyncSSLEngineException (org.webpieces.ssl.api.AsyncSSLEngineException)7 SSLEngine (javax.net.ssl.SSLEngine)6 SSLException (javax.net.ssl.SSLException)6 AsyncSSLEngine (org.webpieces.ssl.api.AsyncSSLEngine)6 ByteBuffer (java.nio.ByteBuffer)3 SSLEngineResult (javax.net.ssl.SSLEngineResult)3 HandshakeStatus (javax.net.ssl.SSLEngineResult.HandshakeStatus)3 Status (javax.net.ssl.SSLEngineResult.Status)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 BufferPool (org.webpieces.data.api.BufferPool)1 ConnectionState (org.webpieces.ssl.api.ConnectionState)1 SslListener (org.webpieces.ssl.api.SslListener)1 ByteAckTracker (org.webpieces.util.acking.ByteAckTracker)1 XFuture (org.webpieces.util.futures.XFuture)1