Monday, February 11, 2013

Google Certificate Error for IBM Websphere Application Server 7: Solved!


SCENARIO:
Upon developing an Add Event to Google Calendar functionality under a certain project, I encountered this error: com.google.gdata.util.AuthenticationException: Error connecting with login URI. I'm using IBM WAS7(Websphere Application Server v7) during that time. After a series of research, an idea came up regarding the certificates that are being handled by server. Implementing the steps gathered worked well in fixing the issue.

SOLUTION: 
Below are the steps on how to configure Google certificates on your IBM Websphere Application Server version 7:


1. Log into the administrative console
    
2. Expand Security and click SSL certificate and key management
    
3. Under Configuration settings, click Manage endpoint security configurations
    
4. Select the appropriate Outbound configuration to get to the (cell): in this example jcNode01Cell:(node):jcNode01 management scope.

5. Under Related Items, click Key stores and certificates

6. Click the NodeDefaultTrustStore key store.

7. Under Additional Properties, click Signer certificates.

8. Click Retrieve From Port
    

9. In the Host field enter www.google.com, enter 443 in the Port field, and          www.google.com_cert in the Alias field. Click Retrieve Signer Information.


10. Verify that the certificate information is for a certificate that you can trust. Click Apply
11. Click Save.
You can know access google services without getting any certificate errors. ^_^

Cheers!!!

The DANGER Behind parseInt function - Javascript


SCENARIO:

Inside a certain if condition, I used parseInt('08')to convert a string to its equivalent numerical value. But unexpectedly, it returned 0 as a result.

I also tried:

parseInt('01')
parseInt('02')
parseInt('03')
parseInt('04')
parseInt('05')
parseInt('06')
parseInt('07')
parseInt('08')
parseInt('09')

but all of which returned the expected result except for 8 and 9 which resulted to 0.


SOLUTION: 
The parseInt()javascript method is an octal base function (i.e. it can only cope up with input from string of 0 to 7). In solving this, we can either include the base or use Number() function as an alternative.


1. Using base of decimal number system:

parseInt('08', 10); 
//wherein 10 signifies the base value of decimal number system


2. Using Number() function.