Https returns 404 with DefaultHttpClient on Android?

Reference: http://stackoverflow.com/questions/3730760/https-returns-404-with-defaulthttpclient-on-android

I have an http request that worked as http://blah.com and now I have been asked to usehttps://blah.com

The former works and the later fails with a Network I/O error. Are there any missing parameter settings that I need for the client?

Answer

Https almost always implies a different port being used (standard http=>80; standard https=>443). You have a hardcoded port (8151). I’m guessing the https servlet is listening on a different port.

Suggestion:

Hardcode HTTPS port number after the url.

For example:

private static final String URL = “https://www.blah.com:443”;