On Wed, 22 Apr 2026 20:43:20 GMT, Artur Barashev <[email protected]> wrote:

>> SunJSSE implementation of `SSLEngine` throws an exception if being used 
>> before calling `setUseClientMode()`. Javadoc wording in `SSLContextSpi` and 
>> `SSLContext` classes should be improved.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Artur Barashev has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Throw an exception when getUseClientMode() is called before 
> setUseClientMode(). Remove any notion of default from SSLEngine javadoc

src/java.base/share/classes/javax/net/ssl/SSLEngine.java line 1170:

> 1168:      * The JDK SunJSSE provider implementation requires that the 
> desired mode
> 1169:      * be set explicitly by calling {@link #setUseClientMode(boolean)} 
> before
> 1170:      * invoking this method.

Should we add `@throws IllegalStateException` here? We have it on 
`beginHandshake`, but not on `wrap`/`unwrap` currently.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30754#discussion_r3128940722

Reply via email to