Tuesday, April 13, 2010

Adding Security Certificate to JVM to handle SecurityCertificateError

Handling SecurityCertificateError exception in JAVA by adding security certificate using Keytools

To add the security certificate for https URL the following steps needs to be followed

  • Take a backup of cacerts file in the following directory (This can be your default JRE directory also) C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre\lib\security\
  • Save the security certificate in some location for ex c:\certificate.cer
  • Go to Run type cmd
  • Execute CD C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre\bin (This is the location of the JRE WebSphere uses, in other environments please navigate to the JRE BIN the application uses)
  • Then execute the following command
(SYNTAX Keytool –keystore – import – file -alias<> )

Command
keytool -keystore "C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre \lib\security\cacerts" -import -file c:\certificate.cer -alias https://your-url.net

  • It will ask for a password , enter changeit
  • The security certificate will be added for the JRE

Now you can access the URL or access the webservice in the URL.

Friday, April 2, 2010

Fire bug - An invaluble tool for debugging

If you have been into web programming, you will know its hard to develop front screens than to write the backend business classes. Also debugging Java Script is also a head headache. Fire Bug is a plugin for firefox that saves valuble time in web application development. It has nice features like inspecting the html elements, it shows the CSS applied. You can also see the Java Script.

You can also view POST headers that are sent to the server. One more interesting feature is you can edit the HTML in the browser and see it work.




The above picture is a snap shot of the Firebug tool. You cant use it in IE , one close too that is a substitue for it in IE is Fiddler , but it no where comes close to Firebug in terms of the richness of features.