Author: eric
Date: Sat Dec 15 06:42:33 2012
New Revision: 1422194
URL: http://svn.apache.org/viewvc?rev=1422194&view=rev
Log:
Fix supportedCipherSuites not working for startTLS, patch provded by Phillip
Odam (PROTOCOLS-99)
Modified:
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java
Modified:
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java
URL:
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java?rev=1422194&r1=1422193&r2=1422194&view=diff
==============================================================================
---
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java
(original)
+++
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java
Sat Dec 15 06:42:33 2012
@@ -23,21 +23,20 @@ import javax.net.ssl.SSLContext;
/**
* This class should be used to setup encrypted protocol handling
- *
+ *
*/
public final class Encryption {
private final SSLContext context;
private final boolean starttls;
private final String[] enabledCipherSuites;
-
+
private Encryption(SSLContext context, boolean starttls, String[]
enabledCipherSuites) {
this.context = context;
this.starttls = starttls;
this.enabledCipherSuites = enabledCipherSuites;
}
-
/**
*
* @see #createStartTls(SSLContext, String[])
@@ -45,12 +44,14 @@ public final class Encryption {
public static Encryption createTls(SSLContext context) {
return createTls(context, null);
}
-
+
/**
- * Create a new {@link Encryption} which is TLS based and only allows the
given Ciphersuites
+ * Create a new {@link Encryption} which is TLS based and only allows the
+ * given Ciphersuites
*
* @param context
- * @param enabledCipherSuites or <code>null</code> if all Ciphersuites
should be allowed
+ * @param enabledCipherSuites
+ * or <code>null</code> if all Ciphersuites should be allowed
* @return enc
*/
public static Encryption createTls(SSLContext context, String[]
enabledCipherSuites) {
@@ -64,18 +65,20 @@ public final class Encryption {
public static Encryption createStartTls(SSLContext context) {
return createStartTls(context, null);
}
-
+
/**
- * Create a new {@link Encryption} which uses STARTTLS and only allows the
given Ciphersuites
+ * Create a new {@link Encryption} which uses STARTTLS and only allows the
+ * given Ciphersuites
*
* @param context
- * @param enabledCipherSuites or <code>null</code> if all Ciphersuites
should be allowed
+ * @param enabledCipherSuites
+ * or <code>null</code> if all Ciphersuites should be allowed
* @return enc
*/
public static Encryption createStartTls(SSLContext context, String[]
enabledCipherSuites) {
- return new Encryption(context, true, null);
+ return new Encryption(context, true, enabledCipherSuites);
}
-
+
/**
* Return the {@link SSLContext} to use
*
@@ -84,18 +87,20 @@ public final class Encryption {
public SSLContext getContext() {
return context;
}
-
+
/**
- * Return <code>true</code> if this {@link Encryption} should be used for
STARTTLS
+ * Return <code>true</code> if this {@link Encryption} should be used for
+ * STARTTLS
*
* @return starttls
*/
public boolean isStartTLS() {
return starttls;
}
-
+
/**
- * Return the Ciphersuites that are allowed for the {@link Encryption} or
<code>null</code> if all should be allowed
+ * Return the Ciphersuites that are allowed for the {@link Encryption} or
+ * <code>null</code> if all should be allowed
*
* @return ciphersuites
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]