Skip to content

Commit

Permalink
HADOOP-12895. SSLFactory#createSSLSocketFactory exception message is …
Browse files Browse the repository at this point in the history
…wrong. Contributed by Wei-Chiu Chuang.
  • Loading branch information
umbrant committed Mar 8, 2016
1 parent 3c33158 commit a3cc6e2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public SSLEngine createSSLEngine()
public SSLServerSocketFactory createSSLServerSocketFactory()
throws GeneralSecurityException, IOException {
if (mode != Mode.SERVER) {
throw new IllegalStateException("Factory is in CLIENT mode");
throw new IllegalStateException(
"Factory is not in SERVER mode. Actual mode is " + mode.toString());
}
return context.getServerSocketFactory();
}
Expand All @@ -229,7 +230,8 @@ public SSLServerSocketFactory createSSLServerSocketFactory()
public SSLSocketFactory createSSLSocketFactory()
throws GeneralSecurityException, IOException {
if (mode != Mode.CLIENT) {
throw new IllegalStateException("Factory is in CLIENT mode");
throw new IllegalStateException(
"Factory is not in CLIENT mode. Actual mode is " + mode.toString());
}
return context.getSocketFactory();
}
Expand All @@ -241,7 +243,8 @@ public SSLSocketFactory createSSLSocketFactory()
*/
public HostnameVerifier getHostnameVerifier() {
if (mode != Mode.CLIENT) {
throw new IllegalStateException("Factory is in CLIENT mode");
throw new IllegalStateException(
"Factory is not in CLIENT mode. Actual mode is " + mode.toString());
}
return hostnameVerifier;
}
Expand Down

0 comments on commit a3cc6e2

Please sign in to comment.