Use this API to create sslcertreq.
6436
public static base_response create(nitro_service client, sslcertreq resource) throws Exception {
		sslcertreq createresource = new sslcertreq();
		createresource.reqfile = resource.reqfile;
		createresource.keyfile = resource.keyfile;
		createresource.fipskeyname = resource.fipskeyname;
		createresource.keyform = resource.keyform;
		createresource.pempassphrase = resource.pempassphrase;
		createresource.countryname = resource.countryname;
		createresource.statename = resource.statename;
		createresource.organizationname = resource.organizationname;
		createresource.organizationunitname = resource.organizationunitname;
		createresource.localityname = resource.localityname;
		createresource.commonname = resource.commonname;
		createresource.emailaddress = resource.emailaddress;
		createresource.challengepassword = resource.challengepassword;
		createresource.companyname = resource.companyname;
		return createresource.perform_operation(client,"create");
	}
541130
def http_request
      if http_proxy
        http_request = http_proxy.new(url.host, url.port)
      else
        http_request = Net::HTTP.new(url.host, url.port)
      end
      
      # enable SSL/TLS
      if url.scheme == 'https'
        require 'net/https'
        require 'openssl'
        Error::Connection.extend_classes!
        
        http_request.use_ssl = true
        
        if options[:tls_verify] or options[:verify_ssl]
          if http_request.respond_to?(:enable_post_connection_check=)
            http_request.enable_post_connection_check = true
          end
          # from http://curl.haxx.se/ca/cacert.pem
          http_request.ca_file = options[:tls_ca_file] || File.expand_path('../../../support/cacert.pem', __FILE__)
          http_request.verify_mode = OpenSSL::SSL::VERIFY_PEER
        else
          http_request.verify_mode = OpenSSL::SSL::VERIFY_NONE
        end
        
        if options[:tls_key_and_certificate_file]
          key_and_certificate       = File.read(options[:tls_key_and_certificate_file])
          options[:tls_key]         = OpenSSL::PKey::RSA.new(key_and_certificate)
          options[:tls_certificate] = OpenSSL::X509::Certificate.new(key_and_certificate)
        end
        
        if options[:tls_key] and options[:tls_certificate]
          http_request.key  = options[:tls_key]
          http_request.cert = options[:tls_certificate]
        elsif options[:tls_key] || options[:tls_certificate]
          raise ArgumentError, "Please specify both the certificate and private key (:tls_key and :tls_certificate)"
        end
      end
      
      if @configure_block
        @configure_block.call(http_request)
      end
      
      http_request
    end
162864
def makeSocket(self, timeout=1):
        """"""
        plain_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        if hasattr(plain_socket, 'settimeout'):
            plain_socket.settimeout(timeout)

        wrapped_socket = ssl.wrap_socket(
            plain_socket,
            ca_certs=self.ca_certs,
            cert_reqs=self.reqs,
            keyfile=self.keyfile,
            certfile=self.certfile
        )
        wrapped_socket.connect((self.host, self.port))

        return wrapped_socket
350285
public function withSSLCert($sslCert, $sslKey)
    {
        $this->sslCert = $sslCert;
        $this->sslKey = $sslKey;

        return $this;
    }
402815
public static base_response link(nitro_service client, sslcertkey resource) throws Exception {
		sslcertkey linkresource = new sslcertkey();
		linkresource.certkey = resource.certkey;
		linkresource.linkcertkeyname = resource.linkcertkeyname;
		return linkresource.perform_operation(client,"link");
	}
1350618
private OCSPReq createRequest(
      SFPair<Certificate, Certificate> pairIssuerSubject)
  {
    Certificate issuer = pairIssuerSubject.left;
    Certificate subject = pairIssuerSubject.right;
    OCSPReqBuilder gen = new OCSPReqBuilder();
    try
    {
      DigestCalculator digest = new SHA1DigestCalculator();
      X509CertificateHolder certHolder = new X509CertificateHolder(issuer.getEncoded());
      CertificateID certId = new CertificateID(
          digest, certHolder, subject.getSerialNumber().getValue());
      gen.addRequest(certId);
      return gen.build();
    }
    catch (OCSPException | IOException ex)
    {
      throw new RuntimeException("Failed to build a OCSPReq.");
    }
  }
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");
	}
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");
	}
875577
def _init_ssl(self):
        

        if not have_openssl:
            raise ImportError('SSL sockets have been disabled due to missing requirement: pyopenssl.')

        try:
            ctx = SSL.Context(SSL.TLSv1_METHOD)

            if isinstance(self.ssl_key, crypto.PKey):
                ctx.use_privatekey(self.ssl_key)
            else:
                ctx.use_privatekey_file(self.ssl_key)

            if isinstance(self.ssl_certificate, crypto.X509):
                ctx.use_certificate(self.ssl_certificate)
            else:
                ctx.use_certificate_file(self.ssl_certificate)

            if isinstance(self.ssl_ca, crypto.X509):
                store = ctx.get_cert_store()
                store.add_cert(self.ssl_ca)
            else:
                ctx.load_verify_locations(self.ssl_ca, None)

            verify_method = SSL.VERIFY_PEER
            if (self._ssl_allow_self_signed):
                verify_method = SSL.VERIFY_NONE

            ctx.set_verify(verify_method, self._verify_ssl_callback)

            self._device = SSL.Connection(ctx, self._device)

        except SSL.Error as err:
            raise CommError('Error setting up SSL connection.', err)
203153
public SslContext createHttpTLSContextForClient() throws SSLException {
        SslProvider provider = SslProvider.JDK;
        SslContext certsSslContext = clientContextBuilderWithCerts(provider).build();
        int sessionTimeout = sslConfig.getSessionTimeOut();
        if (sessionTimeout > 0) {
            certsSslContext.sessionContext().setSessionTimeout(sessionTimeout);
        }
        return certsSslContext;
    }
121669
def _create_ssl_context(cfg):
        
        ctx = ssl.SSLContext(cfg.ssl_version)
        ctx.load_cert_chain(cfg.certfile, cfg.keyfile)
        ctx.verify_mode = cfg.cert_reqs
        if cfg.ca_certs:
            ctx.load_verify_locations(cfg.ca_certs)
        if cfg.ciphers:
            ctx.set_ciphers(cfg.ciphers)
        return ctx
668442
public static base_response change(nitro_service client, sslcertkey resource) throws Exception {
		sslcertkey updateresource = new sslcertkey();
		updateresource.certkey = resource.certkey;
		updateresource.cert = resource.cert;
		updateresource.key = resource.key;
		updateresource.password = resource.password;
		updateresource.fipskey = resource.fipskey;
		updateresource.inform = resource.inform;
		updateresource.passplain = resource.passplain;
		updateresource.nodomaincheck = resource.nodomaincheck;
		return updateresource.perform_operation(client,"update");
	}
1271354
public static sslcertkey get(nitro_service service, String certkey) throws Exception{
		sslcertkey obj = new sslcertkey();
		obj.set_certkey(certkey);
		sslcertkey response = (sslcertkey) obj.get_resource(service);
		return response;
	}
82759
@SuppressWarnings("unchecked")
	public static SSLContext createSSLContext(String trustedNamesGroupKey) throws IOException {
        SSLContext sslContext = null;
        KeyManager[] keyManagers = null;
        Map<String, Object> tlsMap = (Map<String, Object>)ClientConfig.get().getMappedConfig().get(TLS);
        if(tlsMap != null) {
            try {
                // load key store for client certificate if two way ssl is used.
                Boolean loadKeyStore = (Boolean) tlsMap.get(LOAD_KEY_STORE);
                if (loadKeyStore != null && loadKeyStore) {
                    String keyStoreName = (String)tlsMap.get(KEY_STORE);
                    String keyStorePass = (String)ClientConfig.get().getSecretConfig().get(SecretConstants.CLIENT_KEYSTORE_PASS);
                    String keyPass = (String)ClientConfig.get().getSecretConfig().get(SecretConstants.CLIENT_KEY_PASS);
                    KeyStore keyStore = loadKeyStore(keyStoreName, keyStorePass.toCharArray());
                    KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                    keyManagerFactory.init(keyStore, keyPass.toCharArray());
                    keyManagers = keyManagerFactory.getKeyManagers();
                }
            } catch (NoSuchAlgorithmException | UnrecoverableKeyException | KeyStoreException e) {
                throw new IOException("Unable to initialise KeyManager[]", e);
            }

            TrustManager[] trustManagers = null;
            try {
                // load trust store, this is the server public key certificate
                // first check if javax.net.ssl.trustStore system properties is set. It is only necessary if the server
                // certificate doesn't have the entire chain.
                Boolean loadTrustStore = (Boolean) tlsMap.get(LOAD_TRUST_STORE);
                if (loadTrustStore != null && loadTrustStore) {
                    String trustStoreName = System.getProperty(TRUST_STORE_PROPERTY);
                    String trustStorePass = System.getProperty(TRUST_STORE_PASSWORD_PROPERTY);
                    if (trustStoreName != null && trustStorePass != null) {
                        if(logger.isInfoEnabled()) logger.info("Loading trust store from system property at " + Encode.forJava(trustStoreName));
                    } else {
                        trustStoreName = (String) tlsMap.get(TRUST_STORE);
                        trustStorePass = (String)ClientConfig.get().getSecretConfig().get(SecretConstants.CLIENT_TRUSTSTORE_PASS);
                        if(logger.isInfoEnabled()) logger.info("Loading trust store from config at " + Encode.forJava(trustStoreName));
                    }
                    if (trustStoreName != null && trustStorePass != null) {
                        KeyStore trustStore = loadKeyStore(trustStoreName, trustStorePass.toCharArray());
                        TLSConfig tlsConfig = TLSConfig.create(tlsMap, trustedNamesGroupKey);

                        TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                        trustManagerFactory.init(trustStore);
                        trustManagers = ClientX509ExtendedTrustManager.decorate(trustManagerFactory.getTrustManagers(), tlsConfig);
                    }
                }
            } catch (NoSuchAlgorithmException | KeyStoreException e) {
                throw new IOException("Unable to initialise TrustManager[]", e);
            }

            try {
                sslContext = SSLContext.getInstance("TLS");
                sslContext.init(keyManagers, trustManagers, null);
            } catch (NoSuchAlgorithmException | KeyManagementException e) {
                throw new IOException("Unable to create and initialise the SSLContext", e);
            }
        } else {
            logger.error("TLS configuration section is missing in client.yml");
        }

        return sslContext;
    }
704289
protected function createClient()
    {
        $client = new MultiCurl();

        $credentials     = $this->getCredentials();
        $isAuthenticated = $credentials instanceof SSLCertificate;

        $client->setVerifyPeer($isAuthenticated);

        if ($isAuthenticated) {
            $client->setOption(CURLOPT_SSLCERT, $credentials->getCertificatePassPhrase());
            $client->setOption(CURLOPT_SSLCERTPASSWD, $credentials->getCertificatePassPhrase());
        }

        $this->serviceClient = new Browser($client);

        return $this;
    }
1269131
function newClientStub() {
    // First create the appropriate TLS certs with dgraph cert:
    //     $ dgraph cert
    //     $ dgraph cert -n localhost
    //     $ dgraph cert -c user
    const rootCaCert = fs.readFileSync(path.join(__dirname, 'tls', 'ca.crt'));
    const clientCertKey = fs.readFileSync(path.join(__dirname, 'tls', 'client.user.key'));
    const clientCert = fs.readFileSync(path.join(__dirname, 'tls', 'client.user.crt'));
    return new dgraph.DgraphClientStub(
        "localhost:9080",
        grpc.credentials.createSsl(rootCaCert, clientCertKey, clientCert));
}
110113
public static SSLContext createDefaultSSlContext() throws SSLInitializationException {
    try {
      final SSLContext sslcontext = SSLContext.getInstance(SSL_CONTEXT_TYPE_DEFAULT);
      sslcontext.init(null, null, null);
      return sslcontext;
    }
    catch (NoSuchAlgorithmException ex) {
      throw new SSLInitializationException(ex.getMessage(), ex);
    }
    catch (KeyManagementException ex) {
      throw new SSLInitializationException(ex.getMessage(), ex);
    }
  }