Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/mongo/socket/ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ def verify_ocsp_endpoint!(socket)
end

cert = socket.peer_cert
ca_cert = socket.peer_cert_chain.last
# In the case where the leaf certificate and CA are the same, the chain may only contain one certificate.
# If the chain has multiple certificates, the one directly after the leaf should be the issuer.
ca_cert = socket.peer_cert_chain.length > 1 ? socket.peer_cert_chain[1] : cert

verifier = OcspVerifier.new(@host_name, cert, ca_cert, context.cert_store,
**Utils.shallow_symbolize_keys(options))
Expand Down