File tree Expand file tree Collapse file tree
src/java/com/wolfssl/provider/jsse Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments