Use default parameters wherever possible to initialize SSLContexts
This commit is contained in:
parent
2e477b87c2
commit
d5ad5a47ac
@ -58,9 +58,7 @@ public class SecureChatSslContextFactory {
|
|||||||
|
|
||||||
// Initialize the SSLContext to work with our key managers.
|
// Initialize the SSLContext to work with our key managers.
|
||||||
serverContext = SSLContext.getInstance(PROTOCOL);
|
serverContext = SSLContext.getInstance(PROTOCOL);
|
||||||
serverContext.init(
|
serverContext.init(kmf.getKeyManagers(), null, null);
|
||||||
kmf.getKeyManagers(),
|
|
||||||
SecureChatTrustManagerFactory.getTrustManagers(), null);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Failed to initialize the server-side SSLContext", e);
|
"Failed to initialize the server-side SSLContext", e);
|
||||||
@ -68,8 +66,7 @@ public class SecureChatSslContextFactory {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
clientContext = SSLContext.getInstance(PROTOCOL);
|
clientContext = SSLContext.getInstance(PROTOCOL);
|
||||||
clientContext.init(
|
clientContext.init(null, SecureChatTrustManagerFactory.getTrustManagers(), null);
|
||||||
null, SecureChatTrustManagerFactory.getTrustManagers(), null);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Failed to initialize the client-side SSLContext", e);
|
"Failed to initialize the client-side SSLContext", e);
|
||||||
|
Loading…
Reference in New Issue
Block a user