Commit cd4994ca authored by Dave Cridland's avatar Dave Cridland

Merge pull request #558 from guusdk/master

Prevent occasional failure of CheckChainTrustedTest
parents e464bb87 3ed99368
...@@ -267,6 +267,10 @@ public class OpenfireX509TrustManager implements X509TrustManager ...@@ -267,6 +267,10 @@ public class OpenfireX509TrustManager implements X509TrustManager
// This exception generally isn't very helpful. This block attempts to print more debug information. // This exception generally isn't very helpful. This block attempts to print more debug information.
try try
{ {
Log.debug( "** Accepted Issuers (trust anchors, \"root CA's\"):" );
for ( X509Certificate acceptedIssuer : acceptedIssuers) {
Log.debug( " - " + acceptedIssuer.getSubjectDN() + "/" + acceptedIssuer.getIssuerDN() );
}
Log.debug( "** Chain to be validated:" ); Log.debug( "** Chain to be validated:" );
Log.debug( " length: " + chain.length ); Log.debug( " length: " + chain.length );
for (int i=0; i<chain.length; i++) { for (int i=0; i<chain.length; i++) {
......
...@@ -41,7 +41,7 @@ public class KeystoreTestUtils ...@@ -41,7 +41,7 @@ public class KeystoreTestUtils
private static final Provider PROVIDER = new BouncyCastleProvider(); private static final Provider PROVIDER = new BouncyCastleProvider();
private static final Object BEGIN_CERT = "-----BEGIN CERTIFICATE-----"; private static final Object BEGIN_CERT = "-----BEGIN CERTIFICATE-----";
private static final Object END_CERT = "-----END CERTIFICATE-----"; private static final Object END_CERT = "-----END CERTIFICATE-----";
static static
{ {
// Add the BC provider to the list of security providers // Add the BC provider to the list of security providers
...@@ -164,9 +164,9 @@ public class KeystoreTestUtils ...@@ -164,9 +164,9 @@ public class KeystoreTestUtils
private static X509Certificate generateTestCertificate( final boolean isValid, final KeyPair issuerKeyPair, final KeyPair subjectKeyPair, int indexAwayFromEndEntity) throws Exception private static X509Certificate generateTestCertificate( final boolean isValid, final KeyPair issuerKeyPair, final KeyPair subjectKeyPair, int indexAwayFromEndEntity) throws Exception
{ {
// Issuer and Subject // Issuer and Subject.
final X500Name subject = new X500Name( "CN=MyName" + subjectKeyPair.getPublic().hashCode() ); final X500Name subject = new X500Name( "CN=" + Base64.encodeBytes( subjectKeyPair.getPublic().getEncoded(), Base64.URL_SAFE ) );
final X500Name issuer = new X500Name( "CN=MyName" + issuerKeyPair.getPublic().hashCode() ); final X500Name issuer = new X500Name( "CN=" + Base64.encodeBytes( issuerKeyPair.getPublic().getEncoded(), Base64.URL_SAFE ) );
// Validity // Validity
final Date notBefore; final Date notBefore;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment