use of io.undertow.server.RenegotiationRequiredException in project undertow by undertow-io.
the class SslClientCertAttribute method readAttribute.
@Override
public String readAttribute(HttpServerExchange exchange) {
SSLSessionInfo ssl = exchange.getConnection().getSslSessionInfo();
if (ssl == null) {
return null;
}
Certificate[] certificates;
try {
certificates = ssl.getPeerCertificates();
if (certificates.length > 0) {
return Certificates.toPem(certificates[0]);
}
return null;
} catch (SSLPeerUnverifiedException | CertificateEncodingException | RenegotiationRequiredException e) {
return null;
}
}
Aggregations