protected void raiseAlert(short alertLevel, short alertDescription, String message, Throwable cause) throws IOException { getPeer().notifyAlertRaised(alertLevel, alertDescription, message, cause); byte[] error = new byte[2]; error[0] = (byte)alertLevel; error[1] = (byte)alertDescription; safeWriteRecord(ContentType.alert, error, 0, 2); }
protected void raiseAlertWarning(short alertDescription, String message) throws IOException { getPeer().notifyAlertRaised(AlertLevel.warning, alertDescription, message, null); byte[] alert = new byte[]{ (byte)AlertLevel.warning, (byte)alertDescription }; safeWriteRecord(ContentType.alert, alert, 0, 2); }
protected void raiseAlertFatal(short alertDescription, String message, Throwable cause) throws IOException { getPeer().notifyAlertRaised(AlertLevel.fatal, alertDescription, message, cause); byte[] alert = new byte[]{ (byte)AlertLevel.fatal, (byte)alertDescription }; try { recordStream.writeRecord(ContentType.alert, alert, 0, 2); } catch (Exception e) { // We are already processing an exception, so just ignore this } }
protected void handleAlertMessage(short alertLevel, short alertDescription) throws IOException { getPeer().notifyAlertReceived(alertLevel, alertDescription); if (alertLevel == AlertLevel.warning) { handleAlertWarningMessage(alertDescription); } else { handleFailure(); throw new TlsFatalAlertReceived(alertDescription); } }
short description = tmp[1]; getPeer().notifyAlertReceived(level, description);
getPeer().notifyHandshakeComplete();
getPeer().notifyHandshakeComplete();