Skip to content

Commit

Permalink
Throw SSLException when hostname is null
Browse files Browse the repository at this point in the history
  • Loading branch information
limjan committed Jul 16, 2024
1 parent bef6379 commit 512ec3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ private static boolean checkBooleanProperty(String prop,
* name depending on what createSocket() API the user has called and with
* what String.
*/
private void setLocalServerNames() {
private void setLocalServerNames() throws SSLException {

/* Do not add SNI if system property has been set to false */
boolean enableSNI =
Expand Down Expand Up @@ -931,7 +931,9 @@ else if (this.hostname != null) {
else {
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
"hostname and peerAddr are null, not setting SNI");
}
//throw an SSLException if the hostname is null
throw new SSLException("Hostname is null");
}
}
}
}
Expand Down

0 comments on commit 512ec3a

Please sign in to comment.