I’m trying to make a http request to my web server using JQuery, which doesn’t have SSL (and I can’t add SSL for various reasons). When I do so, it automatically redirects to https, which causes an SSL_PROTOCOL_ERROR. How can I prevent it from redirecting?
I tried turning off mixed content blocking (I’m doing this in an android WebView, so I can control that), but it had the exact same result.
2
Answers
Make sure you are using the canonical version of your URL (which means, after it redirects).
For example, your web server might be (mis)configured to redirect http://www.example.com -> https version, but if you dont use the www it wont redirect.
It’s hard to tell without the URL, but one way is to put the URL into chrome, make sure its HTTPs. then RE-copy it out of the url so you get all the exact symbols, and use that.
The second thing is to use incognito or a cleared cache to make sure a previous redirect isn’t caching it.
jQuery by itself wont redirect http->https, but your server may be doing it… or a reverse proxy (like cloudflare)… or some kind of server setting like HSTS
If you go into chrome, and go to view > developer > developer tools. Go to the network tab, and then trigger jquery. you will see the response of your server at the top, and if it is giving a 301 status code, you can find the reason it’s redirecting.
It’s definetely should be configured on nginx side. Looks like there is a connector that listens to 8080 (http) port and redirects it to 8443 (https) port.
To isolate Jquery/app (whatever) use Postman or Burp Suite tool and trigger your endpoints from there. Browser is also okay other than you need a POST call.