How to obtain the location of cacerts of the default java installation?

Under Linux, to find the location of $JAVA_HOME: readlink -f /usr/bin/java | sed “s:bin/java::” the cacerts are under lib/security/cacerts: $(readlink -f /usr/bin/java | sed “s:bin/java::”)lib/security/cacerts Under mac OS X , to find $JAVA_HOME run: /usr/libexec/java_home the cacerts are under Home/lib/security/cacerts: $(/usr/libexec/java_home)/lib/security/cacerts UPDATE (OS X with JDK) above code was tested on computer without JDK installed. … Read more

Am I under risk of CSRF attacks in a POST form that doesn’t require the user to be logged in?

There’s means of CSRF whenever malicious HTML or JavaScript which is targeted on your website is been embedded in another HTML page (or an email message) which is been successfully executed. An example is the following which is been placed in another webpage which innocently asks for your name and age before proceeding: <form action=”http://yoursite.com/transferfunds” … Read more

Using Apache httpclient for https

I put together this test app to reproduce the issue using the HTTP testing framework from the Apache HttpClient package: ClassLoader cl = HCTest.class.getClassLoader(); URL url = cl.getResource(“test.keystore”); KeyStore keystore = KeyStore.getInstance(“jks”); char[] pwd = “nopassword”.toCharArray(); keystore.load(url.openStream(), pwd); TrustManagerFactory tmf = TrustManagerFactory.getInstance( TrustManagerFactory.getDefaultAlgorithm()); tmf.init(keystore); TrustManager[] tm = tmf.getTrustManagers(); KeyManagerFactory kmfactory = KeyManagerFactory.getInstance( KeyManagerFactory.getDefaultAlgorithm()); kmfactory.init(keystore, pwd); … Read more