I'm developing a network-enabled android application that uses SSL client certificates to authenticate and secure connections to my server.
I have two questions: (1) should I use a self-signed server certificate or a commercial one? And (2) should I include the server certificate inside the apk file that users install or should I have the application connect to my server to get the server certificate over the network (for the purpose of making the device trust the server cert)?
When I ask what I "should" do, I'm asking what are the benefits and disadvantages of each choice?
Right now I am using a self-signed certificate included with the apk file. When the user runs the app for the first time, it reads the included self-signed cert into the trust store so the device will connect to my server with no complaints. I suppose if I use a commercial cert then my question #2 might become moot, since the device may trust the cert from the server with no issues.
One more possibly-relevant detail: this application is not being distributed through the android market. Users will download the application from my server, so I can include whatever server certificate I want, including a different one for each user if I needed to.
I have my own ideas about the various advantages and drawbacks to each possible answer to my two questions, but I'm interested in what others--hopefully security minded--have to say on the matter.
Thanks in advance!