001/*-------------------------------------------------------------------------+
002|                                                                          |
003| Copyright 2005-2011 The ConQAT Project                                   |
004|                                                                          |
005| Licensed under the Apache License, Version 2.0 (the "License");          |
006| you may not use this file except in compliance with the License.         |
007| You may obtain a copy of the License at                                  |
008|                                                                          |
009|    http://www.apache.org/licenses/LICENSE-2.0                            |
010|                                                                          |
011| Unless required by applicable law or agreed to in writing, software      |
012| distributed under the License is distributed on an "AS IS" BASIS,        |
013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
014| See the License for the specific language governing permissions and      |
015| limitations under the License.                                           |
016+-------------------------------------------------------------------------*/
017package org.conqat.lib.commons.net;
018
019import java.security.cert.X509Certificate;
020
021import javax.net.ssl.X509TrustManager;
022
023/**
024 * A simple implementation of {@link X509TrustManager} that simple trusts every
025 * certificate.
026 * 
027 * @author deissenb
028 */
029public class TrustAllCertificatesManager implements X509TrustManager {
030
031        @Override
032        public X509Certificate[] getAcceptedIssuers() {
033                return new X509Certificate[0];
034        }
035
036        /** Does nothing. */
037        @Override
038        public void checkServerTrusted(X509Certificate[] certs, String authType) {
039                // Nothing to do
040        }
041
042        /** Does nothing. */
043        @Override
044        public void checkClientTrusted(X509Certificate[] certs, String authType) {
045                // Nothing to do
046        }
047
048}