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
// This exception generally isn't very helpful. This block attempts to print more debug information.
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( " length: " + chain.length );
for (int i=0; i<chain.length; i++) {
......
......@@ -41,7 +41,7 @@ public class KeystoreTestUtils
private static final Provider PROVIDER = new BouncyCastleProvider();
private static final Object BEGIN_CERT = "-----BEGIN CERTIFICATE-----";
private static final Object END_CERT = "-----END CERTIFICATE-----";
static
{
// Add the BC provider to the list of security providers
......@@ -164,9 +164,9 @@ public class KeystoreTestUtils
private static X509Certificate generateTestCertificate( final boolean isValid, final KeyPair issuerKeyPair, final KeyPair subjectKeyPair, int indexAwayFromEndEntity) throws Exception
{
// Issuer and Subject
final X500Name subject = new X500Name( "CN=MyName" + subjectKeyPair.getPublic().hashCode() );
final X500Name issuer = new X500Name( "CN=MyName" + issuerKeyPair.getPublic().hashCode() );
// Issuer and Subject.
final X500Name subject = new X500Name( "CN=" + Base64.encodeBytes( subjectKeyPair.getPublic().getEncoded(), Base64.URL_SAFE ) );
final X500Name issuer = new X500Name( "CN=" + Base64.encodeBytes( issuerKeyPair.getPublic().getEncoded(), Base64.URL_SAFE ) );
// Validity
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