How to use the fabric-ca-client/lib/FabricCAServices._parseURL function in fabric-ca-client

To help you get started, we’ve selected a few fabric-ca-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / fabric-sdk-node / test / integration / fabric-ca-services-tests.js View on Github external
test('\n\n ** FabricCAClient: Test enroll With Static CSR **\n\n', (t) => {
	const endpoint = FabricCAServices._parseURL(fabricCAEndpoint);
	const client = new FabricCAClient({
		protocol: endpoint.protocol,
		hostname: endpoint.hostname,
		port: endpoint.port,
		tlsOptions: tlsOptions,
		caname: ORGS[userOrg].ca.name
	});

	return client.enroll(enrollmentID, enrollmentSecret, csr.toString())
		.then((enrollResponse) => {
			t.pass('Successfully invoked enroll API with enrollmentID \'' + enrollmentID + '\'');
			// check that we got back the expected certificate
			let subject;
			try {
				subject = X509.getSubject(FabricCAServices.normalizeX509(enrollResponse.enrollmentCert));
			} catch (err) {