Commit 4437950b authored by Tom Evans's avatar Tom Evans

Cleanup connection logging, etc.

Also remove dependency for sun.security.provider.* package
parent fbe74c8e
...@@ -497,7 +497,7 @@ public class SocketConnection implements Connection { ...@@ -497,7 +497,7 @@ public class SocketConnection implements Connection {
writer.flush(); writer.flush();
} }
catch (Exception e) { catch (Exception e) {
Log.error("Failed to deliver stream close tag: " + e.getMessage()); Log.debug("Failed to deliver stream close tag: " + e.getMessage());
} }
// Register that we finished sending data on the connection // Register that we finished sending data on the connection
......
package org.jivesoftware.openfire.keystore; package org.jivesoftware.openfire.keystore;
import java.io.File;
import java.io.FileOutputStream;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.bouncycastle.jce.X509Principal; import org.bouncycastle.jce.X509Principal;
import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.x509.X509V3CertificateGenerator; import org.bouncycastle.x509.X509V3CertificateGenerator;
...@@ -8,17 +28,6 @@ import org.junit.After; ...@@ -8,17 +28,6 @@ import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import sun.security.provider.X509Factory;
import java.io.File;
import java.io.FileOutputStream;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.*;
import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
import java.util.*;
/** /**
* Unit tests that verify the functionality of {@link TrustStoreConfig}. * Unit tests that verify the functionality of {@link TrustStoreConfig}.
...@@ -28,6 +37,8 @@ import java.util.*; ...@@ -28,6 +37,8 @@ import java.util.*;
public class TrustStoreConfigTest public class TrustStoreConfigTest
{ {
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 END_CERT = "-----END CERTIFICATE-----";
static static
{ {
...@@ -94,9 +105,9 @@ public class TrustStoreConfigTest ...@@ -94,9 +105,9 @@ public class TrustStoreConfigTest
private static String toPEM( X509Certificate certificate ) throws Exception { private static String toPEM( X509Certificate certificate ) throws Exception {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append( X509Factory.BEGIN_CERT ).append( '\n' ); sb.append( BEGIN_CERT ).append( '\n' );
sb.append( Base64.encodeBytes( certificate.getEncoded() ) ).append( '\n' ); sb.append( Base64.encodeBytes( certificate.getEncoded() ) ).append( '\n' );
sb.append( X509Factory.END_CERT).append( '\n' ); sb.append( END_CERT).append( '\n' );
return sb.toString(); return sb.toString();
} }
......
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