Code example for SSLEngine

Methods: getSessionsetUseClientMode

0
                * so no need to use host/port variant. 
                * 
                * The first call for a server is a NEED_UNWRAP. 
                */ 
            tlsEngine = tlsContext.createSSLEngine();
            tlsEngine.setUseClientMode(clientMode);
            SSLSession sslSession = tlsEngine.getSession();
 
            netBuffSize = sslSession.getPacketBufferSize();
            appBuffSize = sslSession.getApplicationBufferSize();
 
        } catch (KeyManagementException e) {
            Log.error("TLSHandler startup problem.\n" + "  SSLContext initialisation failed.", e);
        } catch (NoSuchAlgorithmException e) {
            Log.error("TLSHandler startup problem.\n" + "  The " + algorithm + " does not exist", e);
        } catch (IOException e) {
            Log.error("TLSHandler startup problem.\n" 
                    + "  the KeyStore or TrustStore does not exist", e);
        } 
    }