Failure initializing default SSL context

I was trying to use this apache HttpClient to have my web application publish posts to facebook wall.

At first sight, it looks good when I test it in my local machine. I can publish posts to user wall and I’m happy.

But when I deploy it to shared server. Things don’t go as expected. My application can not post to user’s wall and spit this error instead.

org.apache.http.conn.ssl.SSLInitializationException: Failure initializing default SSL context
   at org.apache.http.conn.ssl.SSLSocketFactory.createDefaultSSLContext(
   at org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory(
   at org.apache.http.impl.conn.SchemeRegistryFactory.createDefault(
   at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(
   at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(
   at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(
   at org.apache.http.impl.client.AbstractHttpClient.execute(
   at org.apache.http.impl.client.AbstractHttpClient.execute(
   at org.apache.http.impl.client.AbstractHttpClient.execute(
Caused by: java.lang.IllegalStateException
   at org.apache.http.conn.ssl.SSLSocketFactory.createSSLContext(
   at org.apache.http.conn.ssl.SSLSocketFactory.createDefaultSSLContext(
   ...32 more

I thought it might be something related to the server since the code works properly on my local machine.

I tried googling but that didn’t help much.

About two weeks later, I came back to the issue and decided to switch to use basic connection using code from

and, viola, it works fine now, happy ending 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s