A
A
Artem00712017-04-05 11:06:12
JavaScript
Artem0071, 2017-04-05 11:06:12

How to solve communication problem between https and http?

Good day.
I can't solve the problem. There is a site, recently made it https via cloudflare. But this site loads data through api.example.ru (I mean the third-level domain). But the problem is that the main one is located via https, and the auxiliary one is on http (due to the fact that cloudlfare does not give access to the third level). As a result, an error occurs:

Mixed Content: The page at 'https://******' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.*****. This request has been blocked; the content must be served over HTTPS.

What's the best thing to do? Ideally, of course, put a certificate on the API, but the project does not bring money, and it’s not worth spending time and money yet. Or can demolish https from the main one? But I still hope for some kind of collective farm, with the help of a couple of lines of code to solve everything :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2017-04-05
@Artem0071

Use the Let's Encrypt certificate, it's free: https://letsencrypt.org/

R
Roman Frank, 2017-04-05
@Akellacom

Get a free certificate from https://www.startssl.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question