Skip to content

Commit

Permalink
Merge pull request #208 from rlm2002/FailedALPN
Browse files Browse the repository at this point in the history
close inbound on UNKNOWN_ALPN_PROTOCOL_NAME_E
  • Loading branch information
cconlon authored Jul 19, 2024
2 parents 3bca981 + 92fc6dc commit a5863a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 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,9 @@ 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 a5863a4

Please sign in to comment.