Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to access the certificate used for the connection? #633

Closed
machty opened this issue Dec 8, 2018 · 0 comments
Closed

Any way to access the certificate used for the connection? #633

machty opened this issue Dec 8, 2018 · 0 comments

Comments

@machty
Copy link
Contributor

machty commented Dec 8, 2018

After a prod outage due to a partner failing to renew their certificates, we'd like to start checking the expiration dates on server certificates for every HTTPS request we make so that we can detect these kinds of issues weeks in advance (as described in this reddit post), but as the post mentions and from my own research, there doesn't seem to be a way to access the peer_cert method which would give use the X509 cert we could for this purpose.

Is there some API I'm not seeing which would give low level access to the Net::HTTP object with the peer_cert method?

machty added a commit to machty/httparty that referenced this issue Dec 10, 2018
Closes jnunemaker#633

There are use cases for accessing the X509
certificate used by the server; this commit
exposes this certificate via Response#peer_cert,
which uses the same method name as peer_cert
on the Net::HTTP class:

https://ruby-doc.org/stdlib-2.4.2/libdoc/net/http/rdoc/Net/HTTP.html#method-i-peer_cert
machty added a commit to machty/httparty that referenced this issue Dec 15, 2018
Closes jnunemaker#633

There are use cases for accessing the X509
certificate used by the server; this commit
exposes this certificate via Response#peer_cert,
which uses the same method name as peer_cert
on the Net::HTTP class:

https://ruby-doc.org/stdlib-2.4.2/libdoc/net/http/rdoc/Net/HTTP.html#method-i-peer_cert
machty added a commit to machty/httparty that referenced this issue Feb 19, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes jnunemaker#633, Follow-up to jnunemaker#634
machty added a commit to machty/httparty that referenced this issue Feb 19, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes jnunemaker#633, Follow-up to jnunemaker#634
machty added a commit to machty/httparty that referenced this issue Feb 19, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes jnunemaker#633, Follow-up to jnunemaker#634
machty added a commit to machty/httparty that referenced this issue Feb 19, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes jnunemaker#633, Follow-up to jnunemaker#634
machty added a commit to machty/httparty that referenced this issue Feb 19, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes jnunemaker#633, Follow-up to jnunemaker#634
TheSmartnik pushed a commit that referenced this issue Mar 20, 2019
This provides access to the connection object,
which in turn exposes properties like `.peer_cert`
for performing additional validation against
x509 certificates.

Closes #633, Follow-up to #634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant