通過HTTPS加載頁面但請求不安全的XMLHttpRequest端點 [英] Page loaded over HTTPS but requested an insecure XMLHttpRequest endpoint

查看:22940
本文介紹了通過HTTPS加載頁面但請求不安全的XMLHttpRequest端點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個帶有一些D3 javascript的頁面。此頁面位于HTTPS網站內,但證書是自簽名的。

I have a page with some D3 javascript on. This page sits within a HTTPS website, but the certificate is self-signed.

當我加載頁面時,我的D3可視化不顯示,我收到錯誤:

When I load the page, my D3 visualisations do not show, and I get the error:


混合內容:' https://integration.jsite.com/data/vis '是通過HTTPS加載的,但是請求了一個不安全的XMLHttpRequest端點' http://integration.jsite.com/data/rdata.csv '。此請求已被阻止;內容必須通過HTTPS提供。

Mixed Content: The page at 'https://integration.jsite.com/data/vis' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://integration.jsite.com/data/rdata.csv'. This request has been blocked; the content must be served over HTTPS.

我做了一些研究,我發現JavaScript將使用相同的協議進行調用頁面已加載。因此,如果頁面是通過 https 加載的,則還應通過 https rdata.csv c>,而是請求 http 。

I did some research and all I found what the JavaScript will make the call with the same protocol that the page was loaded. So if page was loaded via https then the rdata.csv should also have been requested via https, instead it is requested as http.

這是因為證書是在服務器上自簽名的?除了安裝真正的SSL證書之外,我還能做些什么呢?

Is this because the certificate is self-signed on the server? What I can do to fix this, other than installing a real SSL certificate?

推薦答案


我是什么可以解決這個問題(除了安裝真正的SSL證書)。

What I can do to fix this (other than installing a real SSL certificate).

你不能。

在https網頁上,您只能向https網頁發出AJAX請求(使用瀏覽器信任的證書,如果您使用自簽名證書,則無法使用為您的訪客)

On an https webpage you can only make AJAX request to https webpage (With a certificate trusted by the browser, if you use a self-signed one, it will not work for your visitors)

這篇關于通過HTTPS加載頁面但請求不安全的XMLHttpRequest端點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持IT屋!

查看全文
相關文章
登錄 關閉
掃碼關注1秒登錄
發送“驗證碼”獲取 | 15天全站免登陸
全免费A级毛片免费看无码播放