001/*
002 * Copyright 2011 The Kuali Foundation.
003 * 
004 * Licensed under the Educational Community License, Version 1.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl1.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.ole.pdp.util;
017
018import java.security.cert.CertificateException;
019import java.security.cert.X509Certificate;
020
021import javax.net.ssl.X509TrustManager;
022
023/**
024 * A simple implementation of X509TrustManager which bypass any server certificate.
025 * This implementation can be used for known trusted HTTPS URLs that don't require authentication.
026 */
027public class HttpsTrustManager implements X509TrustManager {
028
029    public HttpsTrustManager() { 
030    }
031
032    public void checkClientTrusted(X509Certificate chain[], String authType) throws CertificateException {
033    }
034
035    public void checkServerTrusted(X509Certificate chain[], String authType) throws CertificateException {
036    }
037
038    public X509Certificate[] getAcceptedIssuers() {
039        return new X509Certificate[0];
040    }
041
042}