On Mon, 22 Jun 2026 17:30:24 GMT, Ashay Rane <[email protected]> wrote:

>> Instead of discarding the newly created `CommunicationException`
>> exception and referencing the outer (caught)
>> `SSLPeerUnverifiedException` exception, this patch adds the
>> `SSLPeerUnverifiedException` exception as the suppressed exception of
>> the newly created `CommunicationException` exception.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Ashay Rane has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Handle the case when `closureReason == null`
>   
>   Also, since `closureReason` is shared, we first read it into a local
>   variable (`priorFailure`) before checking for null.

I see that the point where the completable furture is handled is:

    public X509Certificate getTlsServerCertificate()
        throws SaslException {
        try {
            if (isTlsConnection() && tlsHandshakeListener != null)
                return tlsHandshakeListener.tlsHandshakeCompleted.get();
        } catch (InterruptedException iex) {
            throw new SaslException("TLS Handshake Exception ", iex);
        } catch (ExecutionException eex) {
            throw new SaslException("TLS Handshake Exception ", eex.getCause());
        }
        return null;
    }

So previously we would have SaslException wrapping  SSLPeerUnverifiedException; 
Now we're going to see SaslException wrapping CommunicationException wrapping 
SSLPeerUnverifiedException; I see that there are other places where 
tlsHandshakeCompleted is completed exceptionally with a CommunicationException, 
so there should be no surprise in seeing a CommunicationException as the root 
cause of the SaslException since there is already a precedent.

That said there could be tests that expect to find the 
SSLPeerUnverifiedException as the direct root cause, and if so they might need 
updating. I see that Jaikiran is already planning to run the change in the CI, 
we will see if anything else needs to be done when the results come back.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31545#issuecomment-4780691870

Reply via email to