Created
September 13, 2010 15:42
-
-
Save loverdos/577480 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// expecting the https:// url on the command line | |
import java.net.URL | |
val url = new URL(args(0)) | |
val con = url.openConnection() | |
con.connect() | |
val certs = con.asInstanceOf[javax.net.ssl.HttpsURLConnection].getServerCertificates | |
certs.zipWithIndex.foreach { case (cert, index) => | |
println("Certificate #: " + index) | |
println("Certificate Java Class: " + cert.getClass.getName) | |
println("Certificate Data ( starting from next line)") | |
println(cert) | |
println("#######################################################") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment