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:

  1. go website certificate (www.google.com/ncr) in firefox
  2. click on lock in address bar (when hover on it, says verified by: google inc)
  3. expand further clicking "more information"
  4. click view certificate
  5. go details tab in certificate viewer
  6. click export
  7. 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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -