Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
==================== DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved. Copyright 2011-2013 Tirasa. All rights reserved. The contents of this file are subject to the terms of the Common Development and Distribution License("CDDL") (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at https://oss.oracle.com/licenses/CDDL See the License for the specific language governing permissions and limitations under the License. When distributing the Covered Code, include this CDDL Header Notice in each file and include the License file at https://oss.oracle.com/licenses/CDDL. If applicable, add the following below this CDDL Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" ====================
 
 package org.connid.bundles.ad.util;
 
 
 public class TrustAllSocketFactory extends SSLSocketFactory {
 
     private static final Log LOG = Log.getLog(TrustAllSocketFactory.class);
 
     private SSLSocketFactory socketFactory;
 
     public TrustAllSocketFactory() {
         try {
             final SSLContext ctx = SSLContext.getInstance("TLS");
 
             ctx.init(
                     null,
                     new TrustManager[]{new TrustAllTrustManager()},
                     new SecureRandom());
 
              = ctx.getSocketFactory();
         } catch (Exception e) {
             .error(e"Error initializing SSL context");
         }
     }
 
     public static SocketFactory getDefault() {
         return new TrustAllSocketFactory();
     }
 
     @Override
     public String[] getDefaultCipherSuites() {
         return .getDefaultCipherSuites();
     }
 
     @Override
     public String[] getSupportedCipherSuites() {
         return .getSupportedCipherSuites();
     }
 
     @Override
     public Socket createSocket(
             final Socket socketfinal String stringfinal int ifinal boolean bln)
             throws IOException {
         return .createSocket(socketstringibln);
     }
 
     @Override
     public Socket createSocket(final String stringfinal int i)
             throws IOExceptionUnknownHostException {
         return .createSocket(stringi);
     }
 
     @Override
     public Socket createSocket(
             final String stringfinal int ifinal InetAddress iafinal int i1)
             throws IOExceptionUnknownHostException {
         return .createSocket(stringiiai1);
     }
 
     @Override
     public Socket createSocket(final InetAddress iafinal int i)
             throws IOException {
         return .createSocket(iai);
     }
 
     @Override
     public Socket createSocket(
             final InetAddress iafinal int ifinal InetAddress ia1final int i1)
            throws IOException {
        return .createSocket(iaiia1i1);
    }
New to GrepCode? Check out our FAQ X