java - Can I automate downloading a X.509 certificate with chain? -
google updates ssl client certificate every week or , need manually download each time. there way automate downloading certificate?
here steps take manually want automate:
- go website certificate (www.google.com/ncr) in firefox
- click on lock in address bar (when hover on it, says verified by: google inc)
- expand further clicking "more information"
- click view certificate
- go details tab in certificate viewer
- click export
- save certificate x.509 certificate chain
i'd prefer if there java or python implementation, i'm open suggestions
assuming you're using httpsurlconnection, getservercertificates() should give want (index 0 being server certificate itself).
httpsurlconnection subclass of urlconnection. you'll 1 of instance when using url.openconnection(), you'll need cast result explicitly able use getservercertificates().
if have sslsocket or sslengine instead, use getsslsession() method sslsession, , getpeercertificates() on session.
Comments
Post a Comment