Skip to content

Commit 71d9490

Browse files
committed
fixing SSL test assertions for TLS 1.3
1 parent ed2483d commit 71d9490

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

quickfixj-core/src/test/java/quickfix/test/util/SSLUtil.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ public static IoSession findIoSession(Session session) {
9090
}
9191
}
9292

93+
/**
94+
* Retrieves the {@link SslHandler} associated with the given {@link Session}.
95+
* This method first finds the corresponding {@link IoSession} for the provided session,
96+
* then retrieves the {@link SslFilter} from the session's filter chain.
97+
* If the filter is found, it returns the {@link SslHandler} stored as an attribute in the {@link IoSession}.
98+
*
99+
* @param session The session for which to retrieve the {@link SslHandler}.
100+
* @return The {@link SslHandler} associated with the session, or {@code null} if either
101+
* the {@link IoSession} or the {@link SslFilter} is not found.
102+
*/
93103
public static SslHandler getSSLHandler(Session session) {
94104
IoSession ioSession = findIoSession(session);
95105

@@ -107,6 +117,16 @@ public static SslHandler getSSLHandler(Session session) {
107117
return (SslHandler) ioSession.getAttribute(SSL_HANDLER_ATTRIBUTE_KEY);
108118
}
109119

120+
/**
121+
* Retrieves the {@link SSLEngine} associated with the given {@link Session}.
122+
* This method first retrieves the {@link SslHandler} using {@link #getSSLHandler(Session)},
123+
* and then attempts to access the {@link SSLEngine} stored within the {@link SslHandler}
124+
* using reflection.
125+
*
126+
* @param session The session for which to retrieve the {@link SSLEngine}.
127+
* @return The {@link SSLEngine} associated with the session, or {@code null} if the
128+
* {@link SslHandler} is not found.
129+
*/
110130
public static SSLEngine getSSLEngine(Session session) {
111131
SslHandler sslHandler = getSSLHandler(session);
112132

0 commit comments

Comments
 (0)