I've used the Apache HTTP Client to send a http request to GA using Google Measurement Protocol. In my case, I don't use Java general security store, instead use the custom keystore for Tomcat. This situation is very common when you need to configure the developer environment for the secure web applications development.
First you have to enter the following URL to the Firfox browser. Then click the upper left corner pad lock icon: you will get the More information button.
In the next window, click the button "View Certificate".
Importing Certificate from general key storeNow the time to find the certificate in the java general certificate store. First you need to change to the certificate store. Generally that is c:\Program Files...\java\jre\lib\security and the keystore is cacerts.
You have to execute the following command to get the certificate information to the t.txt text file:
keytool -list -v -keystore cacerts > t.txt
Open the t.txt file in the notepad.exe and look for the 35def4cf that is the number where all the colons are removed.
Now export the certificate using following keytool command.
keytool -export -keystore cacerts -alias equifaxsecureca -file equifaxsecureca.cer
Use the following command to import this certificate to your keystore.
keytool -import -trustcacerts -alias equifaxsecureca -file equifaxsecureca.cer -keystore truststore.jks
Truststore is the one used to store all the third party certificates in the tomcat.
Direct importThis is the easiest if you follow the above steps correctly. Again, select the top of the certificate chain (verify by the serial number) as shown in the above screenshot and click the "Export" button to export directly from the FireFox. I've exported the certificate as ga.crt in this case instead of
keytool -import -trustcacerts -alias ga -file ga.crt -keystore truststore.jks
Using above command import the ga.crt.
keytool -list -v -keystore truststore.jks -alias ga > n.txt
If you have use the above command to extract the certificates, you will find both the way same certificate is imported.