in server/src/main/scala/com/twitter/server/handler/AttachedClientsHandler.scala [36:66]
private def certToPeerCertInfo(certificate: X509Certificate): PeerCertInfo =
PeerCertInfo(
certificate.getSubjectDN.getName,
certificate.getNotAfter
)
private def render(serverRegistry: ServerRegistry): AttachedClientsConnectionInfo = {
AttachedClientsConnectionInfo(serverRegistry.serverAddresses.flatMap { serverAddress =>
val connectionRegistry = serverRegistry.connectionRegistry(serverAddress)
Some(
ServerConnectionInfo(
address = serverAddress,
clients = connectionRegistry.iterator.map {
clientConnection =>
ClientConnectionEntry(
address = clientConnection.remoteAddress,
ssl = if (!clientConnection.sslSessionInfo.usingSsl) {
None
} else {
Some(ClientSslInfo(
sessionId = clientConnection.sslSessionInfo.sessionId,
cipherSuite = clientConnection.sslSessionInfo.cipherSuite,
peerCertificate = clientConnection.sslSessionInfo.peerCertificates.headOption
.map(certToPeerCertInfo)
))
}
)
}.toList
))
})
}