Identify if one of the outbound channel definitions has a factory that
implements
the SSLChannelFactory.
777897
private void determineIsSSLEnabled() {
        // Loop through each channel in the outbound chain represented by this
        // endpoint
        int i = 0;
        for (OutboundChannelDefinition def : this.outboundChannelDefs) {
            // Look for the SSL channel factory.
            if (SSLChannelFactory.class.isAssignableFrom(def.getOutboundFactory())) {
                // Found SSL channel factory.
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Found SSLChannelFactory interface: " + def.getOutboundFactory());
                }
                this.sslChannelIndex = i;
                break;
            }
            i++;
        }
    }
951654
private SSLSocketFactory defaultSslSocketFactory(X509TrustManager trustManager)
      throws NoSuchAlgorithmException, KeyManagementException {
    SSLContext sslContext = SSLContext.getInstance("TLS");
    sslContext.init(null, new TrustManager[] { trustManager }, null);

    return sslContext.getSocketFactory();
  }
886980
@Nonnull
    public static SSLSocketFactory getTrustAllSSLSocketFactory() {
        try {
            SSLContext sslContext = SSLContext.getInstance("SSL");

            sslContext.init(null, new TrustManager[]{new TrustAllX509TrustManager()}, null);
            return sslContext.getSocketFactory();
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalStateException(e);
        } catch (KeyManagementException e) {
            throw new IllegalStateException(e);
        }
    }
1063603
@Trivial
    public void unsetSslSupport(ServiceReference<ChannelFactoryProvider> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.entry(this, tc, "unsetSslSupport", new Object[] { ref.getProperty("type"), ref });
        }
        // see if its for the same service ref, if yes then destroy
        if (_sslFactoryProvider.getReference() == ref)
        {
            if (_isSSLChain) {
                if (_isChainStarted)
                    performAction(destroyChainAction);
            }

        }
        if (_sslFactoryProvider.unsetReference(ref)) {
            _isSSLEnabled = false;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "unsetSslSupport", _isSSLEnabled);
        }

    }
698139
@Nullable
    public static SSLSession findSslSession(@Nullable Channel channel) {
        if (channel == null) {
            return null;
        }

        final SslHandler sslHandler = channel.pipeline().get(SslHandler.class);
        return sslHandler != null ? sslHandler.engine().getSession() : null;
    }
409357
protected void configureSsl(SslContextFactory factory, Ssl ssl,
			SslStoreProvider sslStoreProvider) {
		factory.setProtocol(ssl.getProtocol());
		configureSslClientAuth(factory, ssl);
		configureSslPasswords(factory, ssl);
		factory.setCertAlias(ssl.getKeyAlias());
		if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
			factory.setIncludeCipherSuites(ssl.getCiphers());
			factory.setExcludeCipherSuites();
		}
		if (ssl.getEnabledProtocols() != null) {
			factory.setIncludeProtocols(ssl.getEnabledProtocols());
		}
		if (sslStoreProvider != null) {
			try {
				factory.setKeyStore(sslStoreProvider.getKeyStore());
				factory.setTrustStore(sslStoreProvider.getTrustStore());
			}
			catch (Exception ex) {
				throw new IllegalStateException("Unable to set SSL store", ex);
			}
		}
		else {
			configureSslKeyStore(factory, ssl);
			configureSslTrustStore(factory, ssl);
		}
	}
1164001
function getDefineFactory(defineExpr) {

    var args = defineExpr.arguments;
    var factoryAst = args[args.length - 1];

    if (factoryAst.type === SYNTAX.FunctionExpression
        || factoryAst.type === SYNTAX.ObjectExpression
        || factoryAst.type === SYNTAX.ArrayExpression
    ) {
        return factoryAst;
    }

    return false;
}
773936
public SSLSocketFactory getSSLSockectFactory() {

    SSLContext context = null;

    try {

      context = SSLContext.getInstance("TLS");

    } catch (NoSuchAlgorithmException e) {

      throw new VOMSError(e.getMessage(), e);
    }

    KeyManager[] keyManagers = new KeyManager[] { credential.getKeyManager() };

    X509TrustManager trustManager = SocketFactoryCreator
      .getSSLTrustManager(validator);

    TrustManager[] trustManagers = new TrustManager[] { trustManager };

    SecureRandom secureRandom = null;

    /* http://bugs.sun.com/view_bug.do?bug_id=6202721 */
    /*
     * Use new SecureRandom instead of SecureRandom.getInstance("SHA1PRNG") to
     * avoid unnecessary blocking
     */
    secureRandom = new SecureRandom();

    try {

      context.init(keyManagers, trustManagers, secureRandom);

    } catch (KeyManagementException e) {

      throw new VOMSError(e.getMessage(), e);
    }

    return context.getSocketFactory();
  }
476871
def get_manhole_factory(namespace, **passwords):
    

    realm = manhole_ssh.TerminalRealm()
    realm.chainedProtocolFactory.protocolFactory = (
        lambda _: EnhancedColoredManhole(namespace)
    )

    p = portal.Portal(realm)
    p.registerChecker(
        checkers.InMemoryUsernamePasswordDatabaseDontUse(**passwords)
    )
    return manhole_ssh.ConchFactory(p)
1133987
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def auth_filter(app):
        return Swauth(app, conf)
    return auth_filter
987496
@InterfaceAudience.Public
    public void allowSelfSignedSSLCertificates() {
        // SSLSocketFactory that bypasses certificate verification.
        try {
            setSSLSocketFactory(selfSignedSSLSocketFactory());
        } catch (GeneralSecurityException e) {
            throw new RuntimeException(e);
        }

        // HostnameVerifier that bypasses hotname verification
        setHostnameVerifier(ignoreHostnameVerifier());
    }
270704
public SSLSocketFactory createSslSocketFactory() {
        try {
            SSLContext sslContext = SSLContext.getInstance("TLS");
            sslContext.init(null, new TrustManager[]{this}, null);
            return sslContext.getSocketFactory();
        } catch (NoSuchAlgorithmException | KeyManagementException e) {
            throw new AssertionError(e);
        }
    }
737849
def provider_factory(factory=_sentinel, scope=NoneScope):
    '''
    
    '''
    if factory is _sentinel:
        return functools.partial(provider_factory, scope=scope)
    provider = Provider(factory, scope)
    return provider
440608
function matchesFactory(test) {
  return matches

  function matches(node) {
    var key

    for (key in test) {
      if (node[key] !== test[key]) {
        return false
      }
    }

    return true
  }
}
143585
@Reference(name = "sslSupport",
               service = ChannelFactoryProvider.class,
               policy = ReferencePolicy.DYNAMIC,
               policyOption = ReferencePolicyOption.GREEDY,
               cardinality = ReferenceCardinality.OPTIONAL,
               target = "(type=SSLChannel)")
    protected void setSslSupport(ServiceReference<ChannelFactoryProvider> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "enable ssl support " + ref.getProperty("type"), this);
        }
        sslFactoryProvider.setReference(ref);
        httpSecureChain.enable();

        if (endpointConfig != null) {
            // If this is post-activate, drive the update action
            performAction(updateAction);
        }
    }
59669
public boolean closeOutbound() throws SSLException {
        if (sslEngine == null || sslEngine.isOutboundDone()) {
            return false;
        }

        sslEngine.closeOutbound();

        createOutNetBuffer(0);
        SSLEngineResult result;
        for (;;) {
            result = sslEngine.wrap(emptyBuffer.buf(), outNetBuffer.buf());
            if (result.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) {
                outNetBuffer.capacity(outNetBuffer.capacity() << 1);
                outNetBuffer.limit(outNetBuffer.capacity());
            } else {
                break;
            }
        }

        if (result.getStatus() != SSLEngineResult.Status.CLOSED) {
            throw new SSLException("Improper close state: " + result);
        }
        outNetBuffer.flip();
        return true;
    }
384569
private void determineIsLocal() {
        // Loop through each channel in the outbound chain represented by this
        // endpoint
        int i = 0;
        for (OutboundChannelDefinition def : this.outboundChannelDefs) {
            if (LocalChannelFactory.class.isAssignableFrom(def.getOutboundFactory())) {
                // Found Local channel factory.
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Found LocalChannelFactory interface: " + def.getOutboundFactory());
                }
                this.localChannelIndex = i;
                break;
            }
            i++;
        }
    }