You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NoCheckX509TrustManager.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2016, 2020 JGit contributors
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. *
  10. * Contributors:
  11. * Saša Živkov 2016 - initial API
  12. * Thomas Wolf 2020 - extracted from HttpSupport
  13. */
  14. package org.eclipse.jgit.transport.http;
  15. import java.security.cert.X509Certificate;
  16. import javax.net.ssl.X509TrustManager;
  17. /**
  18. * A {@link X509TrustManager} that doesn't verify anything. Can be used for
  19. * skipping SSL checks.
  20. *
  21. * @since 5.11
  22. */
  23. public class NoCheckX509TrustManager implements X509TrustManager {
  24. @Override
  25. public X509Certificate[] getAcceptedIssuers() {
  26. return null;
  27. }
  28. @Override
  29. public void checkClientTrusted(X509Certificate[] certs,
  30. String authType) {
  31. // no check
  32. }
  33. @Override
  34. public void checkServerTrusted(X509Certificate[] certs,
  35. String authType) {
  36. // no check
  37. }
  38. }