由于某种原因,DNN在每个模态内生成iframe src的URL,用于编辑模块或模块设置,并在Localhost和prod上使用不同的协议。在Localhost上通过HTTPS打开页面时,IFRAME还具有HTTPS URL。同时,在通过HTTPS打开页面时,DNN出于某种原因在此生成HTTP URL。结果,我在开发工具控制台中遇到此错误:
混合内容:“”页面是通过HTTPS加载的,但请求
不安全的框架。该请求已被阻止;内容必须是
在https上服用。
找到。
禁用模式将是真正愚蠢的解决方案,因为我需要编辑和DNN模块的设置。因此,我使用了通过Personabar添加到网站上的Meta标签的“解决方法”。
该修复程序实际上有效,但首先,它不是最方便的解决方案。其次,这是拐杖。如果Localhost可以生成HTTPS链接,则表示产品也可以。但是为什么不呢?这是由DNN生成的代码,而不是由我的代码生成的。因此,因此我现在不了解发生了什么事,为什么。
ps以防万一要清除我在说什么:
- 以超级用户为单击您的网站,
- 请单击铅笔按钮以编辑页面
- 单击铅笔图标“编辑模块”或Gear Icon“设置”(没关系)
- 登录 带有iframe的模式窗口,我正在谈论
P.S.我已经在
For some reason DNN generates url for src of iframe inside every modal for editing module or module settings with different protocol on localhost and prod. On localhost when page is opened via https, iframe also has https url. At the same time on prod when page is opened via https, DNN generates http url there for some reason. As result I'm getting this error in dev tools console:
Mixed Content: The page at "" was loaded over HTTPS, but requested an
insecure frame. This request has been blocked; the content must be
served over HTTPS.
Found this solution.
Disabling modals would be really stupid solution as I need editing and settings for DNN modules. So I used workaround with meta tag added to a website via PersonaBar.
That fix actually works, but firstly, it's not the most convenient solution. Secondly, it's a crutch. If localhost can generate https link, then it means that prod also can. But why it doesn't? It's a code that is generated by DNN, not by my code. So as result I don't understand right now what's going on about it and why.
P.S. Just in case to clearify what I'm talking about:
- login as superuser to your website
- click pencil button to edit page
- hover over any DNN module
- click pencil icon "Edit module" or gear icon "Settings" (doesn't matter)
- that's the modal window with iframe I'm talking about
P.S. I've asked this question at DNN forum yesterday already, but didn't recieve any answers there, so I'm duplicating it here.
发布评论
评论(1)
DNN的SSL实现需要一些对齐方式,但是,以下是正确的。
在“安全性”部分中,需要启用和执行SSL,并且您所处的页面还必须具有“安全”标志集。
这在所有生产环境中都对我们有用,因此您应该没事。
(如果使用SSL卸载,则更棘手)
DNN's SSL implementation requires a number of things to be in alignment, however, the following should be correct.
Within the security section SSL needs to be enabled, AND enforced, and the page that you are on also has to have the "Secure" flag set.
This is working for us in all production environments, so you so you should be fine.
(If using SSL Offloading, its a bit more tricky)