} catch (Exception e) { Throwable rootCause = ExceptionUtils.getRootCause(e);
final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); auditLog.logBadHeaders(request, task.getAction(), task); log.error(exception);
private void logExplanation(Exception e) { if (ExceptionUtils.findMsg(e, "not contain valid private key") != null) { log.error("Your keystore or PEM does not contain a key. " + "If you specified a key password, try removing it. " + "If you did not specify a key password, perhaps you need to if the key is in fact password-protected. " + "Maybe you just confused keys and certificates."); } if (ExceptionUtils.findMsg(e, "not contain valid certificates") != null) { log.error("Your keystore or PEM does not contain a certificate. Maybe you confused keys and certificates."); } }
public static Throwable findMsg(final Throwable e, String msg) { if(e == null) { return null; } if(e.getMessage() != null && e.getMessage().contains(msg)) { return e; } final Throwable cause = e.getCause(); if(cause == null) { return null; } return findMsg(cause, msg); }
return effectiveLicense; return createOrGetTrial("Unable to verify license due to "+ExceptionUtils.getRootCause(e));
final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); log.error(exception); auditLog.logBadHeaders(request); final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); log.error(exception); auditLog.logBadHeaders(request);
Assert.fail(); } catch (Exception e) { Throwable root = ExceptionUtils.getRootCause(e); e.printStackTrace(); Assert.assertTrue(root.getMessage().contains("Wrong user in scroll context"));
protected void checkRequest(final RestRequest request, final RestChannel channel) { if(SSLRequestHelper.containsBadHeader(threadContext, "_sg_ssl_")) { final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); errorHandler.logError(exception, request, 1); throw exception; } try { if(SSLRequestHelper.getSSLInfo(settings, configPath, request, null) == null) { logger.error("Not an SSL request"); throw new ElasticsearchSecurityException("Not an SSL request", RestStatus.INTERNAL_SERVER_ERROR); } } catch (SSLPeerUnverifiedException e) { logger.error("No client certificates found but such are needed (SG 8)."); errorHandler.logError(e, request, 0); throw ExceptionsHelper.convertToElastic(e); } } }
Assert.fail(); } catch (Exception e) { Throwable root = ExceptionUtils.getRootCause(e); e.printStackTrace(); Assert.assertTrue(root.getMessage().contains("Wrong user in scroll context"));
final Exception exception = ExceptionUtils.createBadHeaderException(); channel.sendResponse(exception); throw exception;
public static Throwable getRootCause(final Throwable e) { if(e == null) { return null; } final Throwable cause = e.getCause(); if(cause == null) { return e; } return getRootCause(cause); }
final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); auditLog.logBadHeaders(request, task.getAction(), task); log.error(exception);
log.debug("Unable to validate CRL: "+ExceptionsHelper.stackTrace(e)); log.warn("Unable to validate CRL: "+ExceptionUtils.getRootCause(e));
final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); log.error(exception); auditLog.logBadHeaders(request); final ElasticsearchException exception = ExceptionUtils.createBadHeaderException(); log.error(exception); auditLog.logBadHeaders(request);
} catch (Exception e) { Throwable rootCause = ExceptionUtils.getRootCause(e);
Assert.fail(); } catch (Exception e1) { Throwable e = ExceptionUtils.getRootCause(e1); if(allowOpenSSL) { Assert.assertTrue(e.toString(), e.toString().contains("no cipher match"));
return effectiveLicense; return createOrGetTrial("Unable to verify license due to "+ExceptionUtils.getRootCause(e));
Assert.fail(); } catch (CertificateException e) { Assert.assertTrue(ExceptionUtils.getRootCause(e) instanceof CertificateRevokedException);
validator.validate(certsToValidate.toArray(new X509Certificate[0])); } catch (CertificateException e) { Assert.fail(ExceptionsHelper.stackTrace(ExceptionUtils.getRootCause(e)));
Assert.fail(); } catch (CertificateException e) { Assert.assertTrue(ExceptionUtils.getRootCause(e) instanceof CertificateRevokedException);