Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {