Closed Bug 1507138 Opened 5 years ago Closed 5 years ago

Proxy-API (proxy.settings): Handling of a default port 80

Categories

(WebExtensions :: General, defect, P1)

63 Branch
defect

Tracking

(firefox65 fixed)

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: WebAssistant, Assigned: mixedpuppy)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

::: script :::

let proxySetting = {
   proxyType: "manual",
   http: "proxy.org:80",
   ssl:   "proxy.org:80"
};

browser.proxy.settings.set({value:proxySetting})
   .then(()=>{
     browser.proxy.settings.get({})
       .then((got) => {
         console.log(got.value);
       });
});


Actual results:

If a port 80 is passed by a script, it will be deleted accoording to the log.

In the GUI (General / Network Proxy / Settings...),
the port is then displayed with the value zero
and Firefox will also use the value zero in the following for a proxy.


::: log :::
autoConfigUrl: ""
​autoLogin: false
​ftp: ""
​http: "proxy.org"
​httpProxyAll: false
​passthrough: "localhost, 127.0.0.1"
​proxyDNS: false
​proxyType: "manual"
​socks: ""
​socksVersion: 5
​ssl: "proxy.org"



::: about:config :::
network.proxy.http_port = 0
network.proxy.ssl_port  = 0




Expected results:

The specified port 80 must be retained.
It seems that special error handling for port 80 is also present in other protocols, e.q. ssl, ftp.
Component: Untriaged → Networking
Product: Firefox → Core
Component: Networking → General
Product: Core → WebExtensions
Flags: needinfo?(mixedpuppy)
We use URL to parse the input, it is stripping the port if it is the default port, leaving the pref set to zero.  If the port is zero, nsProtocolProxyService ignores the proxy.
Assignee: nobody → mixedpuppy
Flags: needinfo?(mixedpuppy)
Priority: -- → P1
Again an example:
All protocols should use port 80.

::: script :::
let proxySetting = {
  proxyType: "manual",
  http: "proxy.org:80",
  ssl:  "proxy.org:80",
  ftp:  "proxy.org:80",
  socks: "proxy.org:80"
};
browser.proxy.settings.set({value:proxySetting});


::: Result :::
All ports are set to 0

::: about:config :::
network.proxy.http_port = 0
network.proxy.ssl_port  = 0
network.proxy.ftp_port  = 0
network.proxy.socks_port= 0

It is expected that the port remains unchanged.


Now the example with port 81.

let proxySetting = {
  proxyType: "manual",
  http: "proxy.org:81",
  ssl:  "proxy.org:81",
  ftp:  "proxy.org:81",
  socks: "proxy.org:81"
};
browser.proxy.settings.set({value:proxySetting});

::Result:::

all ports are set to 81

::: about:config :::
network.proxy.http_port = 81
network.proxy.ssl_port  = 81
network.proxy.ftp_port  = 81
network.proxy.socks_port= 81



After our tests, other standard ports will not be changed.
So at: ftp 21, ssl 443 und socks 1080


Why is the port 80 changed?
We assume this is a mistake.


For which detail do you need more information?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by mixedpuppy@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9b21db074305
fix default port usage with proxy settings, r=aswan
https://hg.mozilla.org/mozilla-central/rev/9b21db074305
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Will you require manual validation on this bug? if yes please provide some more info on how to correctly test the fix. Thank you
Flags: needinfo?(WebAssistant)

Another error occurs in Firefox 65:

If port 80 is set for the protocols https, ftp, socks, this port will not be adopted.
Instead, the default ports of the respective protocols are output.

Steps to reproduce:

Script

let setProxySetting={
  proxyType:"manual",
  ssl:  "127.0.0.1:80",
  ftp:  "127.0.0.1:80",
  socks:"127.0.0.1:80"
};

browser.proxy.settings.set({value:setProxySetting})
.then(()=>{
  browser.proxy.settings.get({})
  .then((ps)=>{
    let getProxySetting=ps.value;
    console.log("ssl  ",getProxySetting.ssl);
    console.log("ftp  ",getProxySetting.ftp);
    console.log("socks",getProxySetting.socks);
  });
});

Actual results

ssl   127.0.0.1:443
ftp   127.0.0.1:21
socks 127.0.0.1:1080

Expected results

ssl   127.0.0.1:80
ftp   127.0.0.1:80
socks 127.0.0.1:80
Status: RESOLVED → REOPENED
Flags: needinfo?(WebAssistant)
Resolution: FIXED → ---
Depends on: 1532990

Please use new bugs rather than closing bugs that landed patches. Opened bug 1532990.

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: