aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/NoCheckX509TrustManager.java
blob: 5cd4fb4c8297f681a02b1be01314e14233b1bc5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright (C) 2016, 2020 JGit contributors
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Contributors:
 *    Saša Živkov 2016 - initial API
 *    Thomas Wolf 2020 - extracted from HttpSupport
 */
package org.eclipse.jgit.transport.http;

import java.security.cert.X509Certificate;

import javax.net.ssl.X509TrustManager;

/**
 * A {@link X509TrustManager} that doesn't verify anything. Can be used for
 * skipping SSL checks.
 *
 * @since 5.11
 */
public class NoCheckX509TrustManager implements X509TrustManager {

	@Override
	public X509Certificate[] getAcceptedIssuers() {
		return null;
	}

	@Override
	public void checkClientTrusted(X509Certificate[] certs,
			String authType) {
		// no check
	}

	@Override
	public void checkServerTrusted(X509Certificate[] certs,
			String authType) {
		// no check
	}
}