Join us and the lead editor of IRL, Mozilla's multi-award-winning podcast, for a behind-the-scenes look at the pod and to contribute your ideas for the next season, themed: "AI and ME." Mark your calendar and join our Community Call on Wednesday, Aug 7, 17:00–17:45 UTC. See you there!

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

HTTPS-Only Mode

  • 7 trả lời
  • 1 gặp vấn đề này
  • 2 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

I want to use HTTPS-Only mode, but Firefox enforces it on my private network as well as the public network. Because I do not have certificates for any of my private network hosts HTTPS-Only mode blocks all internal network traffic. The suggested temporary workaround is impractical. Is there a way for Firefox to check the hosts file for a local name/ip or is there another fix for this?

I want to use HTTPS-Only mode, but Firefox enforces it on my private network as well as the public network. Because I do not have certificates for any of my private network hosts HTTPS-Only mode blocks all internal network traffic. The suggested temporary workaround is impractical. Is there a way for Firefox to check the hosts file for a local name/ip or is there another fix for this?

Giải pháp được chọn

Hi cor-el, running this script in the Browser Console adds exceptions successfully:

/* Add Exceptions to HTTPS-only for listed origins -- only edit next line */
var myOrigins = ['http://example.com', 'http://example.org'];
/* Don't edit below this line */
function addException(url){
  let uri = Services.io.newURI(url);
  let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {});
  Services.perms.addFromPrincipal(principal, 'https-only-load-insecure', 1, 0);
}
for (var i=0; i<myOrigins.length; i++) addException(myOrigins[i]);
 

Based on: https://searchfox.org/mozilla-release/source/browser/base/content/test/siteIdentity/browser_identityPopup_HttpsOnlyMode.js#148

Perhaps it is possible to adapt that to an Autoconfig script to set up multiple PCs with an array of origins at startup?

Note: To remove the new permissions for those two origins from permissions.sqlite after testing, re-run it with these changes (session only permission):

Services.perms.addFromPrincipal(principal, 'https-only-load-insecure', 9, 1);

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (7)

more options

Can you disable HTTPS if you click the padlock button ?

more options

That is one of the impracticable workarounds because it must be done for every URL on each host from every user's and guest's computer. I'm not sure how many unique URLs there are but there are 6 host servers and 7 users and about 12± guests on my home network.

more options

Why don't you disable HTTPS-Only mode if this causes that much problems ?

more options

I'm not using HTTPS-Only Mode because of that. I'd use it if Firefox could determine id a URL was on a local network or on the public network - a trivial determination. IMO it is a major failure on the part of Firefox developers. Otherwise, I like Firefox mostly due to TOR, but have considered moving.

more options

There is a dom.security.https_only_mode.upgrade_local pref that defaults to false.

more options

Giải pháp được chọn

Hi cor-el, running this script in the Browser Console adds exceptions successfully:

/* Add Exceptions to HTTPS-only for listed origins -- only edit next line */
var myOrigins = ['http://example.com', 'http://example.org'];
/* Don't edit below this line */
function addException(url){
  let uri = Services.io.newURI(url);
  let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {});
  Services.perms.addFromPrincipal(principal, 'https-only-load-insecure', 1, 0);
}
for (var i=0; i<myOrigins.length; i++) addException(myOrigins[i]);
 

Based on: https://searchfox.org/mozilla-release/source/browser/base/content/test/siteIdentity/browser_identityPopup_HttpsOnlyMode.js#148

Perhaps it is possible to adapt that to an Autoconfig script to set up multiple PCs with an array of origins at startup?

Note: To remove the new permissions for those two origins from permissions.sqlite after testing, re-run it with these changes (session only permission):

Services.perms.addFromPrincipal(principal, 'https-only-load-insecure', 9, 1);

more options

Note that you can also use createContentPrincipalFromOrigin():

var myOrigins = ['http://example.com', 'http://example.org'];
function addException(uri){
 let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(uri);
 Services.perms.addFromPrincipal(principal, 'https-only-load-insecure', 1, 0);
}
for (var i=0; i<myOrigins.length; i++) addException(myOrigins[i]);

You can also use this code to remove a permission:

var myOrigins = ['http://example.com', 'http://example.org'];
function remException(uri){
 let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(uri);
  Services.perms.removeFromPrincipal(principal, 'https-only-load-insecure');
}
for (var i=0; i<myOrigins.length; i++) remException(myOrigins[i]);