use of org.jetbrains.idea.svn.networking.SSLProtocolExceptionParser in project intellij-community by JetBrains.
the class SSLExceptionParserTest method testRealLifeCase.
@Test
public void testRealLifeCase() throws Exception {
final String original = "handshake alert: unrecognized_name";
final SSLProtocolException exception = new SSLProtocolException(original);
final SSLProtocolExceptionParser parser = new SSLProtocolExceptionParser(exception.getMessage());
parser.parse();
final String message = parser.getParsedMessage();
System.out.println(message);
Assert.assertNotSame(original, message);
}
use of org.jetbrains.idea.svn.networking.SSLProtocolExceptionParser in project intellij-community by JetBrains.
the class SvnKitDebugLogger method handleSpecificSSLExceptions.
private void handleSpecificSSLExceptions(Throwable th) {
final long time = System.currentTimeMillis();
if ((time - myPreviousTime) <= ourErrorNotificationInterval) {
return;
}
if (th instanceof SSLHandshakeException) {
// not trusted certificate exception is not the problem, just part of normal behaviour
if (th.getCause() instanceof SVNSSLUtil.CertificateNotTrustedException) {
myLog.info(th);
return;
}
myPreviousTime = time;
String info = SSLExceptionsHelper.getAddInfo();
info = info == null ? "" : " (" + info + ") ";
if (th.getCause() instanceof CertificateException) {
PopupUtil.showBalloonForActiveFrame("Subversion: " + info + th.getCause().getMessage(), MessageType.ERROR);
} else {
final String postMessage = "\nPlease check Subversion SSL settings (Settings | Version Control | Subversion | Network)\n" + "Maybe you should specify SSL protocol manually - SSLv3 or TLSv1";
PopupUtil.showBalloonForActiveFrame("Subversion: " + info + th.getMessage() + postMessage, MessageType.ERROR);
}
} else if (th instanceof SSLProtocolException) {
final String message = th.getMessage();
if (!StringUtil.isEmptyOrSpaces(message)) {
myPreviousTime = time;
String info = SSLExceptionsHelper.getAddInfo();
info = info == null ? "" : " (" + info + ") ";
final SSLProtocolExceptionParser parser = new SSLProtocolExceptionParser(message);
parser.parse();
final String errMessage = "Subversion: " + info + parser.getParsedMessage();
PopupUtil.showBalloonForActiveFrame(errMessage, MessageType.ERROR);
}
}
}
Aggregations