Use this API to create sslcrl resources.
184590
public static base_responses create(nitro_service client, sslcrl resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			sslcrl createresources[] = new sslcrl[resources.length];
			for (int i=0;i<resources.length;i++){
				createresources[i] = new sslcrl();
				createresources[i].cacertfile = resources[i].cacertfile;
				createresources[i].cakeyfile = resources[i].cakeyfile;
				createresources[i].indexfile = resources[i].indexfile;
				createresources[i].revoke = resources[i].revoke;
				createresources[i].gencrl = resources[i].gencrl;
				createresources[i].password = resources[i].password;
			}
			result = perform_operation_bulk_request(client, createresources,"create");
		}
		return result;
	}
370106
public static base_response add(nitro_service client, sslcipher resource) throws Exception {
		sslcipher addresource = new sslcipher();
		addresource.ciphergroupname = resource.ciphergroupname;
		addresource.ciphgrpalias = resource.ciphgrpalias;
		return addresource.add_resource(client);
	}
1050666
protected SSLSocketFactory createSSLSocketFactoryWithTrustManagers(TrustManager[] trustManagers) throws KeystoreException {

		logger.debug("Creating SSLSocketFactory");
		// Get a KeyManager and initialize it 
		try {
			KeyStore keystore = getKeystore();
			KeyManagerFactory kmf = KeyManagerFactory.getInstance(ALGORITHM);
			try {
				char[] password = KeystoreManager.getKeystorePasswordForSSL(server);
				kmf.init(keystore, password);
			} catch (Exception e) {
				e = KeystoreManager.wrapKeystoreException(e);
				throw e;
			}

			// Get the SSLContext to help create SSLSocketFactory			
			SSLContext sslc = SSLContext.getInstance(PROTOCOL);
			sslc.init(kmf.getKeyManagers(), trustManagers, null);

			return sslc.getSocketFactory();
		} catch (Exception e) {
			throw new KeystoreException("Keystore exception: " + e.getMessage(), e);
		}
	}
400898
private static void setupSsl(Configuration conf) {
    Configuration sslConf = new Configuration(false);
    sslConf.addResource(conf.get("dfs.https.client.keystore.resource",
        "ssl-client.xml"));
    System.setProperty("javax.net.ssl.trustStore", sslConf.get(
        "ssl.client.truststore.location", ""));
    System.setProperty("javax.net.ssl.trustStorePassword", sslConf.get(
        "ssl.client.truststore.password", ""));
    System.setProperty("javax.net.ssl.trustStoreType", sslConf.get(
        "ssl.client.truststore.type", "jks"));
    System.setProperty("javax.net.ssl.keyStore", sslConf.get(
        "ssl.client.keystore.location", ""));
    System.setProperty("javax.net.ssl.keyStorePassword", sslConf.get(
        "ssl.client.keystore.password", ""));
    System.setProperty("javax.net.ssl.keyPassword", sslConf.get(
        "ssl.client.keystore.keypassword", ""));
    System.setProperty("javax.net.ssl.keyStoreType", sslConf.get(
        "ssl.client.keystore.type", "jks"));
  }
8410
public void init() throws SSLException {
        if (sslEngine != null) {
            // We already have a SSL engine created, no need to create a new one
            return;
        }

        InetSocketAddress peer = (InetSocketAddress) session
                .getAttribute(SslFilter.PEER_ADDRESS);
        
        // Create the SSL engine here
        if (peer == null) {
            sslEngine = sslContext.createSSLEngine();
        } else {
            sslEngine = sslContext.createSSLEngine(peer.getHostName(), peer.getPort());
        }
        
        // Initialize the engine in client mode if necessary
        sslEngine.setUseClientMode(parent.isUseClientMode());

        // Initialize the different SslEngine modes
        if (parent.isWantClientAuth()) {
            sslEngine.setWantClientAuth(true);
        }

        if (parent.isNeedClientAuth()) {
            sslEngine.setNeedClientAuth(true);
        }

        if (parent.getEnabledCipherSuites() != null) {
            sslEngine.setEnabledCipherSuites(parent.getEnabledCipherSuites());
        }

        if (parent.getEnabledProtocols() != null) {
            sslEngine.setEnabledProtocols(parent.getEnabledProtocols());
        }

        // TODO : we may not need to call this method...
        sslEngine.beginHandshake();
        
        
        handshakeStatus = sslEngine.getHandshakeStatus();

        handshakeComplete = false;
        initialHandshakeComplete = false;
        writingEncryptedData = false;
    }
854969
private function createKeys()
    {
        //Create Can Keys
        shuffle(Devbr\Can::$base);
        shuffle(Devbr\Can::$extra_base);
        file_put_contents($this->configKeyPath.'can.key', implode(Devbr\Can::$base)."\n".implode(Devbr\Can::$extra_base));

        $SSLcnf = [];
        $dn = [];

        //get configurations
        include $this->configKeyPath.'openssl.config.php';

        // Generate a new private (and public) key pair
        $privkey = openssl_pkey_new($SSLcnf);

        // Generate a certificate signing request
        $csr = openssl_csr_new($dn, $privkey, $SSLcnf);

        // You will usually want to create a self-signed certificate at this
        // point until your CA fulfills your request.
        // This creates a self-signed cert that is valid for 365 days
        $sscert = openssl_csr_sign($csr, null, $privkey, 365, $SSLcnf);

        //CERTIFICADO
        openssl_csr_export_to_file($csr, $this->configKeyPath.'certificate.crt', false);

        //CERTIFICADO AUTO-ASSINADO
        openssl_x509_export_to_file($sscert, $this->configKeyPath.'self_signed_certificate.cer', false);

        //CHAVE PRIVADA (private.pem)
        openssl_pkey_export_to_file($privkey, $this->configKeyPath.'private.key', null, $SSLcnf);

        //CHAVE PÚBLICA (public.key)
        file_put_contents($this->configKeyPath.'public.key', openssl_pkey_get_details($privkey)['key']);
    }
376502
static public function generate()
    {
        if (! extension_loaded('openssl')) {
            throw new \RuntimeException("Can only generate a remote desktop certificate when OpenSSL PHP extension is installed.");
        }
        
        // Generate a new private (and public) key pair
        $config = array(
            'config' => __DIR__ . '/../Resources/config/openssl.cnf'
        );
        $privkey = openssl_pkey_new($config);
        
        // Generate a certificate signing request
        $dn = array(
            "commonName" => "AzureDistributionBundle for Symfony Tools"
        );
        $csr = openssl_csr_new($dn, $privkey, $config);
        $sscert = openssl_csr_sign($csr, null, $privkey, 365, $config);
        
        return new self($privkey, $sscert);
    }
772850
protected SSLServerSocketFactory createFactory() 
    	throws Exception
    {
        SSLContext context;
        if (_provider == null) {
			context = SSLContext.getInstance(_protocol);
		} else {
			context = SSLContext.getInstance(_protocol, _provider);
		}

        KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(_algorithm);        
        KeyStore keyStore = KeyStore.getInstance(_keystoreType);
        keyStore.load(Resource.newResource(_keystore).getInputStream(), _password.toString().toCharArray());
        keyManagerFactory.init(keyStore,_keypassword.toString().toCharArray());
        
        context.init(keyManagerFactory.getKeyManagers(), null, new java.security.SecureRandom());

        return context.getServerSocketFactory();
    }
855272
public static sslwrapkey[] get(nitro_service service) throws Exception{
		sslwrapkey obj = new sslwrapkey();
		sslwrapkey[] response = (sslwrapkey[])obj.get_resources(service);
		return response;
	}
658539
private static RestClient buildRestClient(List<InetSocketTransportAddress> hosts, int threadCount, boolean sslEnabled,
      String keyStoreType, String keyStoreFilePassword, String identityFilepath, String trustStoreType,
      String trustStoreFilePassword, String cacertsFilepath) throws Exception {


    HttpHost[] httpHosts = new HttpHost[hosts.size()];
    String scheme = sslEnabled?"https":"http";
    for (int h = 0; h < httpHosts.length; h++) {
      InetSocketTransportAddress host = hosts.get(h);
      httpHosts[h] = new HttpHost(host.getAddress(), host.getPort(), scheme);
    }

    RestClientBuilder builder = RestClient.builder(httpHosts);

    if (sslEnabled) {
      log.info("ssl configuration: trustStoreType = {}, cacertsFilePath = {}", trustStoreType, cacertsFilepath);
      KeyStore truststore = KeyStore.getInstance(trustStoreType);
      FileInputStream trustInputStream = new FileInputStream(cacertsFilepath);
      try {
        truststore.load(trustInputStream, trustStoreFilePassword.toCharArray());
      }
      finally {
        trustInputStream.close();
      }
      SSLContextBuilder sslBuilder = SSLContexts.custom().loadTrustMaterial(truststore, null);

      log.info("ssl key configuration: keyStoreType = {}, keyFilePath = {}", keyStoreType, identityFilepath);

      KeyStore keystore = KeyStore.getInstance(keyStoreType);
      FileInputStream keyInputStream = new FileInputStream(identityFilepath);
      try {
        keystore.load(keyInputStream, keyStoreFilePassword.toCharArray());
      }
      finally {
        keyInputStream.close();
      }
      sslBuilder.loadKeyMaterial(keystore, keyStoreFilePassword.toCharArray());

      final SSLContext sslContext = sslBuilder.build();
      builder = builder.setHttpClientConfigCallback(httpAsyncClientBuilder -> httpAsyncClientBuilder
          // Set ssl context
          .setSSLContext(sslContext).setSSLHostnameVerifier(new NoopHostnameVerifier())
          // Configure number of threads for clients
          .setDefaultIOReactorConfig(IOReactorConfig.custom().setIoThreadCount(threadCount).build()));
    } else {
      builder = builder.setHttpClientConfigCallback(httpAsyncClientBuilder -> httpAsyncClientBuilder
          // Configure number of threads for clients
          .setDefaultIOReactorConfig(IOReactorConfig.custom().setIoThreadCount(threadCount).build()));
    }

    // Configure timeouts
    builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder
        .setConnectionRequestTimeout(0)); // Important, otherwise the client has spurious timeouts

    return builder.build();
  }
481448
private ServerConnector createSSLConnector() {
        SslContextFactory sslContextFactory = new SslContextFactory();
        sslContextFactory.setKeyStorePath(m_keystore);
        sslContextFactory.setKeyStorePassword(m_keystorepassword);
        sslContextFactory.setTrustStorePath(m_truststore);
        sslContextFactory.setTrustStorePassword(m_truststorepassword);
        sslContextFactory.setNeedClientAuth(m_clientauthentication);
        sslContextFactory.setIncludeCipherSuites(m_tls_cipher_suites);

        HttpConfiguration http_config = new HttpConfiguration();
        http_config.setSecureScheme("https");
        HttpConfiguration https_config = new HttpConfiguration(http_config);
        https_config.addCustomizer(new SecureRequestCustomizer());
        SslConnectionFactory sslConnFactory = new SslConnectionFactory(sslContextFactory, "http/1.1");
        HttpConnectionFactory httpConnFactory = new HttpConnectionFactory(https_config);
        ServerConnector sslConnector = new ServerConnector(m_jettyServer, sslConnFactory, httpConnFactory);
        return sslConnector;
    }
291399
public static base_response add(nitro_service client, sslcrl resource) throws Exception {
		sslcrl addresource = new sslcrl();
		addresource.crlname = resource.crlname;
		addresource.crlpath = resource.crlpath;
		addresource.inform = resource.inform;
		addresource.refresh = resource.refresh;
		addresource.cacert = resource.cacert;
		addresource.method = resource.method;
		addresource.server = resource.server;
		addresource.url = resource.url;
		addresource.port = resource.port;
		addresource.basedn = resource.basedn;
		addresource.scope = resource.scope;
		addresource.interval = resource.interval;
		addresource.day = resource.day;
		addresource.time = resource.time;
		addresource.binddn = resource.binddn;
		addresource.password = resource.password;
		addresource.binary = resource.binary;
		return addresource.add_resource(client);
	}
1265042
public static void establishSSLContext(HttpClient client, int port, LibertyServer server) {
        establishSSLContext(client, port, server, null, null, null, null, "TLSv1.2");
    }
1110473
public function buildCurlClient()
    {
        //
        // Use PHP Native cURL because the various Soap clients (BeSimple,
        // PHP native SoapClient) can't handle the WSDL file.
        //
        $this->curl = curl_init($this->getEndPoint());

        $sslCertificate = $this->getSslCertificate();
        $sslKey         = $this->getSslKey();
        $sslKeyPassword = $this->getSslKeyPassword();
        $userName       = $this->getUsername();
        $password       = $this->getPassword();
        $headers        = $this->getHeaders();

        // configuring cURL not to verify the server certificate
        curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);

        // setting the path where cURL can find the client certificate
        curl_setopt($this->curl, CURLOPT_SSLCERT, $sslCertificate);

        // setting the path where cURL can find the client certificate’s
        // private key
        curl_setopt($this->curl, CURLOPT_SSLKEY, $sslKey);

        // setting the key password
        curl_setopt($this->curl, CURLOPT_SSLKEYPASSWD, $sslKeyPassword);

        // setting the request type to POST
        curl_setopt($this->curl, CURLOPT_POST, 1);

        // setting the content type
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);

        // setting the authorization method to BASIC
        curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

        // supplying your credentials
        curl_setopt($this->curl, CURLOPT_USERPWD, $userName . ':' . $password);

        // telling cURL to return the HTTP response body as operation result
        // value when calling curl_exec
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);

        return $this->curl;
    }
223197
@Nullable
	public static SSLContext createRestClientSSLContext(Configuration config) throws Exception {
		final RestSSLContextConfigMode configMode;
		if (isRestSSLAuthenticationEnabled(config)) {
			configMode = RestSSLContextConfigMode.MUTUAL;
		} else {
			configMode = RestSSLContextConfigMode.CLIENT;
		}

		return createRestSSLContext(config, configMode);
	}
1134563
public static base_response create(nitro_service client, sslwrapkey resource) throws Exception {
		sslwrapkey createresource = new sslwrapkey();
		createresource.wrapkeyname = resource.wrapkeyname;
		createresource.password = resource.password;
		createresource.salt = resource.salt;
		return createresource.perform_operation(client,"create");
	}
711302
public static base_response create(nitro_service client, sslfipskey resource) throws Exception {
		sslfipskey createresource = new sslfipskey();
		createresource.fipskeyname = resource.fipskeyname;
		createresource.modulus = resource.modulus;
		createresource.exponent = resource.exponent;
		return createresource.perform_operation(client,"create");
	}