Skip to content

Commit 21beea3

Browse files
authored
Merge pull request #240 from rlm2002/sniServerNames
Return cached SNI request from Server side
2 parents d39d06c + 6abb250 commit 21beea3

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/java/com/wolfssl/provider/jsse/WolfSSLImplementSSLSession.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ public String[] getPeerSupportedSignatureAlgorithms() {
937937
* Return a list of all SNI server names of the requested Server Name
938938
* Indication (SNI) extension.
939939
*
940-
* @return non-null immutable List of SNIServerNames. List may be emtpy
940+
* @return non-null immutable List of SNIServerNames. List may be empty
941941
* if no SNI names were requested.
942942
*/
943943
@Override
@@ -952,7 +952,20 @@ public synchronized List<SNIServerName> getRequestedServerNames()
952952
}
953953

954954
try {
955-
sniRequestArr = this.ssl.getClientSNIRequest();
955+
/* Return SNI name saved by Client
956+
* or return cached request name from Server
957+
* Currently WolfSSL.WOLFSSL_SNI_HOST_NAME is the only
958+
* supported type */
959+
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
960+
"calling getRequestedServerNames (" +
961+
this.getSideString() + ")");
962+
if (this.ssl.getSide() == WolfSSL.WOLFSSL_CLIENT_END){
963+
sniRequestArr = this.ssl.getClientSNIRequest();
964+
} else {
965+
sniRequestArr = this.ssl.getSNIRequest((byte)WolfSSL.
966+
WOLFSSL_SNI_HOST_NAME).getBytes();
967+
}
968+
956969
if (sniRequestArr != null) {
957970
SNIHostName sniName = new SNIHostName(sniRequestArr);
958971
sniNames.add(sniName);

0 commit comments

Comments
 (0)