Code example for SSLContext

Methods: getServerSocketFactory

0
  public SSLServerSocketFactory createSSLServerSocketFactory()
    throws GeneralSecurityException, IOException { 
    if (mode != Mode.SERVER) {
      throw new IllegalStateException("Factory is in CLIENT mode");
    } 
    return context.getServerSocketFactory();
  } 
 
  /** 
   * Returns a configured SSLSocketFactory. 
   * 
   * @return the configured SSLSocketFactory. 
   * @throws GeneralSecurityException thrown if the SSLSocketFactory could not 
   * be initialized. 
   * @throws IOException thrown if and IO error occurred while loading 
   * the server keystore. 
   */ 
  public SSLSocketFactory createSSLSocketFactory()
    throws GeneralSecurityException, IOException { 
    if (mode != Mode.CLIENT) {
Stop searching for code, let great code find you!  Add Codota to your java IDE