/** * Throw an SSLException with the specified message and cause. * Shorthand until a new SSLException constructor is added. * This method never returns. */ static void throwSSLException(String msg, Throwable cause) throws SSLException { SSLException e = new SSLException(msg); e.initCause(cause); throw e; }
/** * Throw an SSLException with the specified message and cause. * Shorthand until a new SSLException constructor is added. * This method never returns. */ static void throwSSLException(String msg, Throwable cause) throws SSLException { SSLException e = new SSLException(msg); e.initCause(cause); throw e; }
void changeWriteCiphers() throws SSLException { if (connectionState != cs_HANDSHAKE && connectionState != cs_RENEGOTIATE) { throw new SSLProtocolException( "State error, change cipher specs"); } // ... create compressor CipherBox oldCipher = writeCipher; try { writeCipher = handshaker.newWriteCipher(); writeMAC = handshaker.newWriteMAC(); } catch (GeneralSecurityException e) { // "can't happen" throw (SSLException)new SSLException ("Algorithm missing: ").initCause(e); } // See comment above. oldCipher.dispose(); // reset the flag of the first application record isFirstAppOutputRecord = true; }
private void changeReadCiphers() throws SSLException { if (connectionState != cs_HANDSHAKE && connectionState != cs_RENEGOTIATE) { throw new SSLProtocolException( "State error, change cipher specs"); } // ... create decompressor CipherBox oldCipher = readCipher; try { readCipher = handshaker.newReadCipher(); readMAC = handshaker.newReadMAC(); } catch (GeneralSecurityException e) { // "can't happen" throw (SSLException)new SSLException ("Algorithm missing: ").initCause(e); } /* * Dispose of any intermediate state in the underlying cipher. * For PKCS11 ciphers, this will release any attached sessions, * and thus make finalization faster. * * Since MAC's doFinal() is called for every SSL/TLS packet, it's * not necessary to do the same with MAC's. */ oldCipher.dispose(); }
new SSLException(msg).initCause(e);
SSLException ssle = new SSLException( "fatal SSLEngine condition"); ssle.initCause(cause); throw ssle;
private void writeNetBuffer() throws SSLException { // Check if any net data needed to be writen if (outNetBuffer == null || !outNetBuffer.hasRemaining()) { return; } AdaptiveByteBuffer writeBuffer = fetchOutNetBuffer(); sslHandshakeHandler.needWrite(getBytes(writeBuffer)); // loop while more writes required to complete handshake while (needToCompleteHandshake()) { try { handshake0(); } catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed."); newSsle.initCause(ssle); throw newSsle; } AdaptiveByteBuffer outNetBuffer = fetchOutNetBuffer(); if (outNetBuffer != null && outNetBuffer.hasRemaining()) { sslHandshakeHandler.needWrite(getBytes(writeBuffer)); } } }
if (!sslHandler.isHandshakeComplete()) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed."); newSsle.initCause(ssle); ssle = newSsle;
if (!sslHandler.isHandshakeComplete()) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed."); newSsle.initCause(ssle); ssle = newSsle;
} catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed."); newSsle.initCause(ssle); throw newSsle;
} catch (IOException e) { SSLException ex = new SSLException("Write problems"); ex.initCause(e); throw ex;
} catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed."); newSsle.initCause(ssle); throw newSsle;
SSLException newSsle = new SSLHandshakeException( "SSL handshake failed."); newSsle.initCause(ssle); throw newSsle;
SSLException newSsle = new SSLHandshakeException( "SSL handshake failed."); newSsle.initCause(ssle); throw newSsle;
SSLException newSSLE = new SSLHandshakeException( "SSL handshake failed."); newSSLE.initCause(ssle); throw newSSLE;
} catch (IOException e) { SSLException ex = new SSLException("readRecord"); ex.initCause(e); throw ex;
SSLException newSsle = new SSLHandshakeException( "SSL handshake failed."); newSsle.initCause(ssle); ssle = newSsle;
SSLException newSSLE = new SSLHandshakeException( "SSL handshake failed."); newSSLE.initCause(ssle); ssle = newSSLE;
SSLException newSsle = new SSLHandshakeException( "SSL handshake failed."); newSsle.initCause(ssle); ssle = newSsle;