Android making https requests with SSL from GoDaddy – No peer certificate error

Another hair pulling session that all ended well.

Task:

Make a secure call to a server using a httprequest and get the httpresponse for further processing.

Android http request and response:

HttpClient client = new DefaultHttpClient();
HttpGet req = new HttpGet("https://www.example.com");
HttpResponse res = client.execute(req);

Error:

javax.net.ssl.SSLPeerUnverifiedException: No peer certificate

Problem:

The issue is that cert from GoDaddy was installed but not installed completely. An Intermediate cert is required for the server/domain in order to have a fully installed cert.

Reference:

http://community.godaddy.com/help/5238

Scaling down from MS to open source

We just moved a service that was running on the Microsoft stack (Windows Server 2008, .NET, MSSql Server, IIS) to an open source stack (Ubuntu Server, php, Codeigniter framework, apache2, postgres).

We now run the service on a cloud server with dual cpu and 256MB ram (Yes, that’s megabytes).

The old server ran on dual core with 2GB of ram.

Ubuntu apache2 virtualhost setup problems

If you are getting error messages when starting apache2 like

“Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”
or
“[warn] _default_ VirtualHost overlap on port 80, the first has precedence”

you need to make sure a couple of lines are in your /etc/apache2/httpd.conf  file.

ServerName localhost

Setup Ruby On Rails on Windows

http://wiki.rubyonrails.org/rails/pages/HowtoInstallOnWindows

This is where to get the fastcgi dll.
http://www.fastcgi.com/dist/

Sample Apache virtual host configuration

<VirtualHost *:80>
<Directory “C:/data/projects/testapp/public/”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

</Directory>

Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
ServerAdmin webmaster@testapp.dev
DocumentRoot “C:/data/projects/testapp/public/”
ServerName testapp.dev
ServerAlias www.testapp.dev
ErrorLog “logs/testapp.dev-error.log”
CustomLog “logs/testapp.dev-access.log” common

</VirtualHost>

Apache SSL IfDefine – Error

Just encountered a problem that was painful to deal with while configuring SSL on apache for linux.  The httpd.conf had a tag, , before all the SSL configuration lines.  In order for any commands within and to be loaded on service start, you must use the -D attribute like this.

$ service httpd -D SSL -k start

Also, I found that restart does not always take new changes to my conf files.

$ service httpd -D SSL -k restart

Instead, use the stop then the start command to be sure.

$service httpd -D SSL -k stop
$service httpd -D SSL -k start

That was a source of much pain while working on this particular server.