1

I would extremely appreciate some help with the following issue:

I have a payment web app hosted in IIS and configured for SSL. I need to integrate a POS terminal (or pin-pad) with a static IP that's not SSL compatible. I can talk to it running the site without SSL (HTTP to HTTP), but not HTTPS to HTTP - obviously getting "Mixed Content ..." error as Chrome doesn't allow that. I don't need to care about other browsers, but I can't run my site HTTP and as mentioned terminal doesn't support HTTPS.

Now, before you mark it as duplicate - I've read: sending request from https to http from chrome extension, Chrome extension - Disable Blocking of Mixed Content Since v38, Chrome extension cannot load from HTTP URLs anymore, workaround?.

And it looks like Chrome extension might provide a solution. I don't have any experience with Chrome extensions though, but comfortable with JavaScript. I would prefer to avoid chasing something that would result in a dead-end. So, my question is - am I on the right path? If so, how do I go about implementing this? How do I go about delegating the ajax post call to the extension?

Any thoughts, ideas, tips, suggestions would be highly appreciated!

Community
  • 1
  • 1
lentyai
  • 534
  • 1
  • 9
  • 22

1 Answers1

2

If you are going to use chrome-extension, do you want everyone who visits your payment site install the extension first? If the answer is yes, then sure, chrome-extension can help with that. Take at the following guide:

  1. Cross-Origin XMLHttpRequest, it tells you that background page can send request to http site, even if current page is https
  2. chrome.webRequest.onBeforeRequest, it tells you that you could redirect a http(s) request.
Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
  • Thanks! Yes, I can insure user installs extension. Can you maybe provide some example, code sample? Completely new to this extensions thing and looks like tutorials/samples are not very well maintained by google... – lentyai Sep 06 '16 at 18:57
  • 1
    @lentyai, hey lentyai, for option 1, above official link has given wonderful samples, just to make an ajax call in background page; for option 2, you could take a look at Rob W's great answer here: http://stackoverflow.com/questions/25059601/how-to-redirect-some-pages-in-google-chrome-extension – Haibara Ai Sep 07 '16 at 00:45
  • Went with a different solution, but will still accept as an answer. Thanks! – lentyai Mar 13 '17 at 17:31
  • @lentyai can you tell what solution you went with? – Lucky Murari Jul 21 '17 at 09:32
  • 1
    Lucky, sorry for delay - I used iFrame. – lentyai Oct 06 '17 at 20:56
  • Hey @lentyai - can you show your solution (or give some advice)? I have EXACLY the same trouble with POS terminals and i was trying to resolve with iframes, but I don't have a clue how to do it. – Garbus Uchiha Jan 07 '20 at 11:34