logback-android/src/main/java/ch/qos/logback/core/net/ssl/SSLContextFactoryBean.java
public SSLContext createContext(ContextAware context) throws NoSuchProviderException,
      NoSuchAlgorithmException, KeyManagementException,
      UnrecoverableKeyException, KeyStoreException, CertificateException {

    SSLContext sslContext = getProvider() != null ?
        SSLContext.getInstance(getProtocol(), getProvider())
        : SSLContext.getInstance(getProtocol());

    context.addInfo("SSL protocol '" + sslContext.getProtocol()
        + "' provider '" + sslContext.getProvider() + "'");

    KeyManager[] keyManagers = createKeyManagers(context);
    TrustManager[] trustManagers = createTrustManagers(context);
    SecureRandom secureRandom = createSecureRandom(context);
    sslContext.init(keyManagers, trustManagers, secureRandom);
    return sslContext;
  }
public SSLContext createContext(ContextAware context) throws NoSuchProviderException,
      NoSuchAlgorithmException, KeyManagementException,
      UnrecoverableKeyException, KeyStoreException, CertificateException {

    SSLContext sslContext = getProvider() != null ?
        SSLContext.getInstance(getProtocol(), getProvider())
        : SSLContext.getInstance(getProtocol());

    context.addInfo("SSL protocol '" + sslContext.getProtocol()
        + "' provider '" + sslContext.getProvider() + "'");

    KeyManager[] keyManagers = createKeyManagers(context);
    TrustManager[] trustManagers = createTrustManagers(context);
    SecureRandom secureRandom = createSecureRandom(context);
    sslContext.init(keyManagers, trustManagers, secureRandom);
    return sslContext;
  }
public SSLContext createContext ( ContextAware context ) throws NoSuchProviderException , NoSuchAlgorithmException , KeyManagementException , UnrecoverableKeyException , KeyStoreException , CertificateException { SSLContext sslContext = getProvider ( ) != null ? SSLContext . getInstance ( getProtocol ( ) , getProvider ( ) ) : SSLContext . getInstance ( getProtocol ( ) ) ; context . addInfo ( "SSL protocol '" + sslContext . getProtocol ( ) + "' provider '" + sslContext . getProvider ( ) + "'" ) ; KeyManager [ ] keyManagers = createKeyManagers ( context ) ; TrustManager [ ] trustManagers = createTrustManagers ( context ) ; SecureRandom secureRandom = createSecureRandom ( context ) ; sslContext . init ( keyManagers , trustManagers , secureRandom ) ; return sslContext ; }
Creates a new {@link SSLContext} using the receiver's configuration.
@param context context for status messages
@return {@link SSLContext} object
@throws NoSuchProviderException if a provider specified for one of the
JCA or JSSE components utilized in creating the context is not
known to the platform
@throws NoSuchAlgorithmException if a JCA or JSSE algorithm, protocol,
or type name specified for one of the context's components is not
known to a given provider (or platform default provider for the
component)
@throws KeyManagementException if an error occurs in creating a
{@link KeyManager} for the context
@throws UnrecoverableKeyException if a private key needed by a
{@link KeyManager} cannot be obtained from a key store
@throws KeyStoreException if an error occurs in reading the
contents of a key store
@throws CertificateException if an error occurs in reading the
contents of a certificate
Creates a new {