Skip to content

Commit

Permalink
close inbound on UNKNOWN_ALPN_PROTOCOL_NAME_E
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruby Martin committed Jul 19, 2024
1 parent bef6379 commit 6c16591
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public synchronized SSLEngineResult wrap(ByteBuffer[] in, int ofst, int len,
"===========================================================");
}

/* Set wolfSSL I/O callbacks and contextx for read/write operations */
/* Set wolfSSL I/O callbacks and context for read/write operations */
try {
setSSLCallbacks();
} catch (WolfSSLJNIException e) {
Expand Down Expand Up @@ -975,7 +975,7 @@ public synchronized SSLEngineResult unwrap(ByteBuffer in, ByteBuffer[] out,
"===========================================================");
}

/* Set wolfSSL I/O callbacks and contextx for read/write operations */
/* Set wolfSSL I/O callbacks and context for read/write operations */
try {
setSSLCallbacks();
} catch (WolfSSLJNIException e) {
Expand Down Expand Up @@ -1091,6 +1091,8 @@ else if (hs == SSLEngineResult.HandshakeStatus.NEED_WRAP &&
(err != WolfSSL.SSL_ERROR_WANT_READ) &&
(err != WolfSSL.SSL_ERROR_WANT_WRITE)) {
if (err == WolfSSL.UNKNOWN_ALPN_PROTOCOL_NAME_E) {
/* Native wolfSSL could not negotiate a common ALPN protocol */
this.inBoundOpen = false;
throw new SSLHandshakeException(
"Unrecognized protocol name error, ret:err = " +
ret + " : " + err);
Expand Down

0 comments on commit 6c16591

Please sign in to comment.