/// SSL [certificate validation] errors, in undefined order
const Security::CertErrors *sslErrors;
- /// The peer certificate
+
+ /// Peer certificate being checked by ssl_verify_cb() and by
+ /// Security::PeerConnector class. In other contexts, the peer
+ /// certificate is retrieved via ALE or ConnStateData::serverBump.
Security::CertPointer serverCert;
AccessLogEntry::Pointer al; ///< info for the future access.log, and external ACL
Security::CertPointer cert;
if (checklist->serverCert)
cert = checklist->serverCert;
- else if (checklist->conn() != NULL && checklist->conn()->serverBump())
+ else if (checklist->al && Comm::IsConnOpen(checklist->al->hier.tcpServer)) {
+ const auto ssl = fd_table[checklist->al->hier.tcpServer->fd].ssl.get();
+ cert.resetWithoutLocking(SSL_get_peer_certificate(ssl));
+ } else if (checklist->conn() && checklist->conn()->serverBump())
cert = checklist->conn()->serverBump()->serverCert;
if (!cert)
Security::PeerConnector::sslCrtvdCheckForErrors(Ssl::CertValidationResponse const &resp, Ssl::ErrorDetail *& errDetails)
{
ACLFilledChecklist *check = NULL;
+ Security::SessionPointer session(fd_table[serverConnection()->fd].ssl);
+
if (acl_access *acl = ::Config.ssl_client.cert_error) {
check = new ACLFilledChecklist(acl, request.getRaw(), dash_str);
check->al = al;
check->syncAle(request.getRaw(), nullptr);
+ check->serverCert.resetWithoutLocking(SSL_get_peer_certificate(session.get()));
}
Security::CertErrors *errs = nullptr;
- Security::SessionPointer session(fd_table[serverConnection()->fd].ssl);
typedef Ssl::CertValidationResponse::RecvdErrors::const_iterator SVCRECI;
for (SVCRECI i = resp.errors.begin(); i != resp.errors.end(); ++i) {
debugs(83, 7, "Error item: " << i->error_no << " " << i->error_reason);