private static ServletTlsAttributes getOrCreateAttrs(SSLSession session) {
        ServletTlsAttributes attrs = (ServletTlsAttributes) session.getValue(ATTR_NAME);
        if (attrs != null) {
            return attrs;
        }

        synchronized (session) {
            attrs = (ServletTlsAttributes) session.getValue(ATTR_NAME);
            if (attrs == null) {
                final byte[] sessionIdBytes = session.getId();
                final String sessionId = sessionIdBytes != null ? BaseEncoding.base16().encode(sessionIdBytes)
                                                                : "";
                final String cipherSuite = session.getCipherSuite();

                attrs = new ServletTlsAttributes(
                        sessionId,
                        firstNonNull(cipherSuite, ""),
                        guessKeySize(cipherSuite),
                        getPeerX509Certificates(session));

                session.putValue(ATTR_NAME, attrs);
            }
            return attrs;
        }
    }
Fills the Servlet TLS attributes from {@link SSLSession} into {@code ServletRequest}.

@param session the {@link SSLSession} of the current connection.
@param setter the setter that will be invoked with the Servlet attribute name and value.
core/src/main/java/com/linecorp/armeria/internal/server/servlet/ServletTlsAttributes.java