Hi,
I am using comodo ssl for my website which i got with my hostgator hosting service. nature of my website is eCommerce. when i applied for the ssl certificate it was installed on my server by the hosting service. they were responsible for the redirection from http to https. but the redirection they did was not perfect. the website on mobile browsers was not getting redirected so they used this code in the .htacess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} AvantGo [OR]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} AvantGo [OR]
RewriteCond %{HTTP_USER_AGENT} BOLT [OR]
RewriteCond %{HTTP_USER_AGENT} UP\.Browser [OR]
RewriteCond %{HTTP_USER_AGENT} Vodafone [OR]
RewriteCond %{HTTP_USER_AGENT} Opera\ Mini [OR]
RewriteCond %{HTTP_USER_AGENT} Opera\ Mobi [OR]
RewriteCond %{HTTP_USER_AGENT} sonyericsson [NC,OR]
RewriteCond %{HTTP_USER_AGENT} samsung [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Android [OR]
RewriteCond %{HTTP_USER_AGENT} Symbian [OR]
RewriteCond %{HTTP_USER_AGENT} Windows\ CE [OR]
RewriteCond %{HTTP_USER_AGENT} iP[ao]d [OR]
RewriteCond %{HTTP_USER_AGENT} iPhone [OR]
RewriteCond %{HTTP_USER_AGENT} iTunes [OR]
RewriteCond %{HTTP_USER_AGENT} BlackBerry [OR]
RewriteCond %{HTTP_USER_AGENT} Palm [OR]
RewriteCond %{HTTP_USER_AGENT} Kindle [OR]
RewriteCond %{HTTP_USER_AGENT} nook [OR]
RewriteCond %{HTTP_USER_AGENT} Configuration\/ [OR]
RewriteCond %{HTTP_USER_AGENT} nokia [NC,OR]
RewriteCond %{HTTP_USER_AGENT} mobile [NC,OR]
RewriteCond %{HTTP_USER_AGENT} webOS [OR]
RewriteCond %{HTTP_USER_AGENT} tablet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} armv[567] [OR]
RewriteCond %{HTTP_USER_AGENT} DoCoMo [OR]
RewriteCond %{HTTP_USER_AGENT} phone [NC,OR]
RewriteCond %{HTTP_USER_AGENT} embed [NC,OR]
RewriteCond %{HTTP_USER_AGENT} wireless [NC,OR]
RewriteCond %{HTTP_USER_AGENT} pocket [NC,OR]
RewriteCond %{HTTP_USER_AGENT} LG[E/-] [OR]
RewriteCond %{HTTP_USER_AGENT} mot- [NC,OR]
RewriteCond %{HTTP_USER_AGENT} htc[_-] [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SEC- [OR]
RewriteCond %{HTTP_USER_AGENT} playstation [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Nintendo [OR]
RewriteCond %{HTTP_USER_AGENT} Silk [OR]
RewriteCond %{HTTP_USER_AGENT} Cricket
RewriteRule ^/?$ https://www.healercart.com/
</IfModule>
the code was not perfect so i googled and used this instead
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
this code redirected everything fine. but then i started facing issues on the android app which was accessing the server.
at first it gave us this error
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
which indicated an issue in the chain of the certificates.
i contacted the hosting service and they took sometime and reordered the certificates. but the problem is still not solved.
now the error we are getting is
java.lang.nullpointerexception
we are not able to trace the exact problem and require some assistance over the issue.
my developers have posted this issue over stackoverflow looking for a solution. but no response from the community yet.
https://stackoverflow.com/questions/27380026/after-redirecting-from-http-to-https-app-getting-java-lang-nullpointerexception
i would request someone to assist us with this issue.
the current issue is that the app is not able to connect to the server at all when the https redirection is active. if the redirection is removed the app functions perfectly.