Thursday, January 05, 2006

SSL/TLS with Symbian Sockets.

Building on the Symbian Daytime client I mentioned in a previous post, let's look at Symbian's SSL/TLS implementation. Symbian provides both SSLv3 and TLSv1. These are the important ones. If a server is still using SSLv2, it should be updated.

The main classes are CSecureSocket and MSecureSocket. We'll need to add another state to our Active Object which creates a CSecureSocket object and starts the asynchronise handshake between the client and the server.

case EConnecting:
{


// connected. now let's make the socket secure.
iSecureSocket = CSecureSocket::NewL(iSock, KSSL3);

// Start the SSL handshake process
SetState(ESecureHandshake);
iSecureSocket->StartClientHandshake(iStatus);
SetActive();

break
;
}
Initially, the program tried to connect via SSLv3 with www.mozilla.org as the server. SSL was not able to validate the certificate. Why? Mozilla uses XRamp as the Certificate Authority(CA). This CA wasn't known to my handset.

On a nokia 6600(series 60), you can check which CA's are installed on your phone with the Certificate Manager. Go to the tools folder and start the settings application. Select 'Security' from the list and 'Certif. management' from the next. You'll see a tabbed list displaying the CA's on the handset.

-jk

0 comments: