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

REOPENED
Assigned to

Status

P1
normal
REOPENED
3 months ago
12 days ago

People

(Reporter: WebAssistant, Assigned: mixedpuppy)

Tracking

63 Branch
mozilla65

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 months ago
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
(Assignee)

Updated

3 months ago
Flags: needinfo?(mixedpuppy)
(Assignee)

Comment 1

3 months ago
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
(Assignee)

Comment 2

3 months ago
Created attachment 9028471 [details]
Bug 1507138 fix default port usage with proxy settings, r?aswan
(Reporter)

Comment 3

3 months ago
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

Comment 4

3 months ago
Pushed by mixedpuppy@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9b21db074305
fix default port usage with proxy settings, r=aswan

Comment 5

3 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9b21db074305
Status: ASSIGNED → RESOLVED
Last Resolved: 3 months ago
status-firefox65: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65

Comment 6

2 months ago
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)
(Reporter)

Comment 7

12 days ago

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 → ---
You need to log in before you can comment on or make changes to this bug.