SSL connections from within iPhone applications
As of Charles v3.9.3 there is an item in the Help menu, "Install Charles CA SSL Certificate in iOS Simulators", which will automatically install Charles's SSL CA certificate in your iOS Simulators.
If you are using an older version of Charles, or you're not able to use that feature you can download the configuration shell script, unzip and then double-click it on your Mac. This will backup and then add Charles's SSL CA certificate to the keychain for your iPhone and iPad simulator. You don't even have to restart the simulator for it to take effect, usually.
Alternatively, you can change your code so that NSURLConnection accepts any SSL certificate. Please see the question and answer on Stack Overflow: http://stackoverflow.com/questions/933331/how-to-use-nsurlconnection-to-connect-with-ssl-for-an-untrusted-cert
If you're only browsing a single website in Safari you can just accept the certificate in Safari and that will work for a while. If the SSL site is only being used to load resources such as images, then you'll need to visit it directly and accept the certificate before it will work.
iOS 4 and later
On the device, browse to http://charlesproxy.com/charles.crt then install the certificate.
On the device you need to install a Charles Proxy mobile configuration profile. This profile contains the Charles SSL CA certificate so that your device will then trust the SSL certificates that Charles creates, in the same way as the desktop does. In Safari on your device visit http://charlesproxy.com/iphoneconf which will download the mobile configuration profile and prompt you to install.