Class WolfSSLEngineHelper


  • public class WolfSSLEngineHelper
    extends java.lang.Object
    This is a helper function to account for similar methods between SSLSocket and SSLEngine. This class wraps a new WOLFSSL object that is created. All methods are protected or private because this class should only be used internally.
    Author:
    wolfSSL
    • Constructor Detail

      • WolfSSLEngineHelper

        protected WolfSSLEngineHelper​(WolfSSLSession ssl,
                                      WolfSSLAuthStore store,
                                      com.wolfssl.provider.jsse.WolfSSLParameters params)
                               throws WolfSSLException
        Always creates a new session
        Parameters:
        ssl - WOLFSSL session
        store - main auth store holding session tables and managers
        params - default parameters to use on connection
        Throws:
        WolfSSLException - if an exception happens during session creation
      • WolfSSLEngineHelper

        protected WolfSSLEngineHelper​(WolfSSLSession ssl,
                                      WolfSSLAuthStore store,
                                      com.wolfssl.provider.jsse.WolfSSLParameters params,
                                      int port,
                                      java.lang.String hostname)
                               throws WolfSSLException
        Allows for new session and resume session by default
        Parameters:
        ssl - WOLFSSL session
        store - main auth store holding session tables and managers
        params - default parameters to use on connection
        port - port number as hint for resume
        hostname - hostname as hint for resume and for default SNI
        Throws:
        WolfSSLException - if an exception happens during session resume
    • Method Detail

      • setHostAndPort

        protected void setHostAndPort​(java.lang.String hostname,
                                      int port)
      • getAllCiphers

        protected java.lang.String[] getAllCiphers()
      • getCiphers

        protected java.lang.String[] getCiphers()
      • setCiphers

        protected void setCiphers​(java.lang.String[] suites)
                           throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • setProtocols

        protected void setProtocols​(java.lang.String[] p)
                             throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • getProtocols

        protected java.lang.String[] getProtocols()
      • getAllProtocols

        protected java.lang.String[] getAllProtocols()
      • setUseClientMode

        protected void setUseClientMode​(boolean mode)
                                 throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • getUseClientMode

        protected boolean getUseClientMode()
      • setNeedClientAuth

        protected void setNeedClientAuth​(boolean need)
      • getNeedClientAuth

        protected boolean getNeedClientAuth()
      • setWantClientAuth

        protected void setWantClientAuth​(boolean want)
      • getWantClientAuth

        protected boolean getWantClientAuth()
      • setEnableSessionCreation

        protected void setEnableSessionCreation​(boolean flag)
      • getEnableSessionCreation

        protected boolean getEnableSessionCreation()
      • setUseSessionTickets

        protected void setUseSessionTickets​(boolean flag)
      • setAlpnProtocols

        protected void setAlpnProtocols​(byte[] alpnProtos)
      • getAlpnSelectedProtocol

        protected byte[] getAlpnSelectedProtocol()
      • initHandshake

        protected void initHandshake()
                              throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • doHandshake

        protected int doHandshake​(int isSSLEngine)
                           throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • saveSession

        protected void saveSession()
        Saves session on connection close for resumption