code: private boolean privilegedIsMasterSecretValid(final Socket socket) {
          if (socket instanceof SSLSocket) {
              SSLSession session = getSslSession(socket);
              if (session != null) {
                  String className = session.getClass().getName();
                  if ("sun.security.ssl.SSLSessionImpl".equals(className)) {
                      try {
                          Object masterSecret = getMasterSecret(session, className);
                          if (masterSecret == null) {
                              session.invalidate();
                              if (LOG.isDebugEnabled()) {
                                  LOG.debug("Invalidated session " + session);
                              }
                              return false;
                          }
                      } catch (Exception e) {
                          failedToVerifyMasterSecret(e);
                      }
                  }
              }
          }
          return true;
  
      }
docs: Checks the validity of an SSLSession's master secret. Should be run within a doPrivileged
  block