Wednesday, July 13, 2011

Client SSL Certificates with Android (2.3.3) OS on Samsung Galaxy S2

A colleague of mine found this site describing how to add a SSL .pk12 format certificate to Firefox beta. Not all on the above link worked for me that's why I'm writing down what I did to make it work on Android 2.3.3 on Samsung Galaxy S2.

1. Install and run at least once Mozilla Firefox (current version 5)
2. Please download from your Android phone to the PC: - Mozilla Firefox:   
/Android/data/org.mozilla.firefox/files/mozilla/.default/cert9.db
/Android/data/org.mozilla.firefox/files/mozilla/.default/key4.db
Thanks to JD:
He didn't have the mozilla dir with the cert9.db and key4.db files in it.
He got it to work by installing Firefox, then move it with App2SD (free in market) to my SD-card.
This way he received the folder /Android/data/org.mozilla.firefox/files/mozilla and also the folder '.default' where the 2 db-files were located.
After following the other step in this post and updating the 2 .db files (via pk12util.exe) He moved Firefox back from his SD-card to Local Storage and Things worked as they should be.
3. Move them to a MS Windows directory (Ex.: C:\keys )

4. Download the package NSS_Tools_x86_from_NSS_3.12.7 Tools.zip and extract it into a directory (Ex.: c:\nss-3_12_7)

5. Run command prompt ( CMD.EXE ) and change the directory where you have extracted NSS_Tools_x86_from_NSS_3.12.7 Tools.zip(Ex.: "cd c:\nss-3_12_7")

6. Executhe the command:

pk12util.exe -i -d sql:
( Ex.: c:\nss-3_12_7>pk12util.exe -i c:\epay.p12 -d sql:C:\keys )

Enter password for PKCS12 file:
pk12util.exe: PKCS12 IMPORT SUCCESSFUL

If you have more client certificates - do the same command again.
Thanks to GG:
Hi Ivo, We ran into this odd behaviour: When using the pk12util.exe, we got this question: "Enter a password which will be used to encrypt your keys. The password should be at least 8 characters long, and should contain at least one non-alphabetic character." As a mistake, we filled out our pkcs12 password here. You should skip this question by hitting enter twice. Then run the util again, and enter your pkcs12 password. on Client SSL Certificates with Android (2.3.3) OS on Samsung Galaxy S2
7. Move the "cert9.db" and "key4.db" files back to your Android phone. If necessary fix the ownership and access rights.

8. Restart Mozilla Firefox.

9. If you access a web site that needs client certificate authentication the browser will ask you to choose one of the imported client certificates and will you them

Tuesday, July 12, 2011

Samsung Galaxy S II USB storage

To access USB and / or SD storage on a computer of a Samsung Galaxy S2(SII) can be pretty handy for transferring files from one computer to another. Doing this doesn't need any additional drivers to be installed. It's like adding a USB drive.

Method 1:

* Enable usb debugging from Menu -> Settings -> Applications (on SGS2)
* return to home screen
* plug usb cable in
* pull down status bar
* press ‘ connect usb storage’ button



Method 2:

Alternatively, without USB debugging enabled

* Go to Settings > Wireless & Network > USB utilities and click the button > then (and ONLY then) plug in USB cable