Skip to content

Commit 9ad352c

Browse files
authored
Fix for LetsEncrypt root expiry (#352)
Every LetsEncrypt issued signature chain now starts with an expired certificate, but the second item in the chain is a trusted root. So instead of failing the whole validation for any link in the chain failing, just don't add failed links to the store, then make sure the final certificate is valid given whatever *was* added to the store.
1 parent a94d6ed commit 9ad352c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/em-http/http_connection.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ def ssl_verify_peer(cert_string)
5555
rescue OpenSSL::X509::StoreError => e
5656
raise e unless e.message == 'cert already in hash table'
5757
end
58-
true
59-
else
60-
raise OpenSSL::SSL::SSLError.new(%(unable to verify the server certificate for "#{host}"))
6158
end
59+
60+
true
6261
end
6362

6463
def ssl_handshake_completed
@@ -68,7 +67,8 @@ def ssl_handshake_completed
6867
return true
6968
end
7069

71-
unless OpenSSL::SSL.verify_certificate_identity(@last_seen_cert, host)
70+
unless certificate_store.verify(@last_seen_cert) &&
71+
OpenSSL::SSL.verify_certificate_identity(@last_seen_cert, host)
7272
raise OpenSSL::SSL::SSLError.new(%(host "#{host}" does not match the server certificate))
7373
else
7474
true

0 commit comments

Comments
 (0)