Skip to content

Commit

Permalink
[FAB-8451] Fixing certificates close to expire
Browse files Browse the repository at this point in the history
This change-set regenerates the certitificates
under fabric-sdk-java/cacerts.
The close to expire certificates under
/src/test/fixture/sdkintegration/e2e-2Orgs/tls
seems not used.

Change-Id: I32e9161836d9e4def55703d24309aed908864717
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Signed-off-by: Saad Karim <skarim@us.ibm.com>
  • Loading branch information
adecaro authored and Saad Karim committed Feb 23, 2018
1 parent a44c2aa commit cd93543
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
16 changes: 0 additions & 16 deletions cacerts/admincert.pem

This file was deleted.

15 changes: 0 additions & 15 deletions cacerts/cacert.pem

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -419,35 +419,6 @@ public void testLoadCACertsBytesBadInput() throws CryptoException {
crypto.loadCACertificatesAsBytes(null);
}

@Test
public void testLoadCACerts() {
try {
File certsFolder = new File("cacerts").getAbsoluteFile();
Collection<File> certFiles = FileUtils.listFiles(certsFolder, new String[] {"pem"}, false);
int numFiles = certFiles.size();
int numStore = crypto.getTrustStore().size();

BufferedInputStream bis;
ArrayList<byte[]> certBytesList = new ArrayList<>();
ArrayList<String> certIDs = new ArrayList<>();
byte[] certB;
for (File certFile : certFiles) {
certB = IOUtils.toByteArray(new FileInputStream(certFile));
certBytesList.add(certB);
bis = new BufferedInputStream(new ByteArrayInputStream(certB));
certIDs.add(Integer.toString(cf.generateCertificate(bis).hashCode()));
}
crypto.loadCACertificatesAsBytes(certBytesList);
assertEquals(crypto.getTrustStore().size(), numStore + numFiles);
for (String cID : certIDs) {
assertTrue(crypto.getTrustStore().containsAlias(cID));
}
} catch (KeyStoreException | CryptoException | IOException | CertificateException e) {
fail("testLoadCACerts should not have thrown exception. Error: " + e.getMessage());
e.printStackTrace();
}
}

@Test
public void testValidateNullCertificateByteArray() {
assertFalse(crypto.validateCertificate((byte[]) null));
Expand Down

0 comments on commit cd93543

Please # to comment.