@Override
  public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
    return provider.provideSession().getPeerPrincipal();
  }
An externalized view of the underlying {@link SSLSession} used within a
socket/engine. This class provides the caller with a consistent session
handle which will continue to be usable regardless of internal changes
to the connection.  It does this by delegating calls to the <b>current</b>
internal session, which is provided by the session {@code Provider}
(i.e. the socket or engine that owns the session).  This allows the provider
to switch implementations (for instance, using a JNI implementation to
access live values while the connection is open and a set of final values
when the connection is closed), even if the caller stores a reference to
the session object.

<p>This class implements the {@link SSLSession} value API itself, rather
than delegating to the provided session, to ensure the caller has a consistent
value map, regardless of which internal session is currently being used by the
socket/engine.  This class will never call the value API methods on the
underlying sessions, so they need not be implemented.
common/src/main/java/org/conscrypt/ExternalSession.java