Skip to content

Commit 9db7ff1

Browse files
authored
Merge pull request #242 from rlm2002/sniServerNames
getSNIRequest checks for null value before converting to String
2 parents 8ae65d4 + 5c6d7eb commit 9db7ff1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/java/com/wolfssl/WolfSSLSession.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4147,10 +4147,15 @@ public byte[] getSNIRequestBytes(byte type) throws IllegalStateException {
41474147
* active
41484148
*/
41494149
public String getSNIRequest(byte type) throws IllegalStateException {
4150+
byte[] request;
41504151

41514152
confirmObjectIsActive();
4153+
request = getSNIRequestBytes(type);
4154+
if (request != null){
4155+
return new String(request, StandardCharsets.UTF_8);
4156+
}
41524157

4153-
return new String(getSNIRequestBytes(type), StandardCharsets.UTF_8);
4158+
return null;
41544159
}
41554160

41564161
/**

0 commit comments

Comments
 (0)