@@ -90,6 +90,16 @@ public static IoSession findIoSession(Session session) {
90
90
}
91
91
}
92
92
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
+ */
93
103
public static SslHandler getSSLHandler (Session session ) {
94
104
IoSession ioSession = findIoSession (session );
95
105
@@ -107,6 +117,16 @@ public static SslHandler getSSLHandler(Session session) {
107
117
return (SslHandler ) ioSession .getAttribute (SSL_HANDLER_ATTRIBUTE_KEY );
108
118
}
109
119
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
+ */
110
130
public static SSLEngine getSSLEngine (Session session ) {
111
131
SslHandler sslHandler = getSSLHandler (session );
112
132
0 commit comments