Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#37992 closed defect (bug) (fixed)

fsockopen hard codes port 443 when http scheme used

Reported by: amandato Owned by: rmccue
Priority: normal Milestone: 4.7.1
Component: HTTP API Version: 4.6.1
Severity: normal Keywords:
Cc: Focuses:

Description

The Transport/fsockopen.php library hard codes port 443 when the scheme https is used. This does not allow for a custom port when using the https scheme. e.g. ​https://example.com:900/ would be converted to ​https://example.com:443/. Attached patch fixes this by checking if the port is not already specified.

This patch can be applied separately but was discovered while creating the patch for ticket #37991 https://core.trac.wordpress.org/attachment/ticket/37991/. Both tickets should be addressed together as they are related (this one impacts #37991 and #37991 restores expected behavior for https scheme).

Attachments (1)

fsockopen.php.patch​ (142 bytes ) - added by amandato 10 years ago.

Download all attachments as: .zip

Change History (8)

#1 @dd32
10 years ago

  • Component General → HTTP API
  • Owner set to dd32
  • Status new → accepted

Hi @amandato and welcome to Trac.

Thanks for reporting this, In WordPress 4.6 we're using the external package ​Requests and issues/patches such as these need to be made against that upstream package.

I'll take a look into this and open a PR upstream.

#3 @amandato
10 years ago

Awesome, Thanks!

#4 @rmccue
10 years ago

  • Milestone Awaiting Review → 4.7
  • Owner changed from dd32 to rmccue
  • Status accepted → assigned

PR merged; needs update in core.

#5 @dd32
10 years ago

  • Milestone 4.7 → 4.6.2

Moving to 4.6.2 along with all the other HTTP API fixes.

#6 @dd32
10 years ago

  • Resolution → fixed
  • Status assigned → closed

In 38727:

HTTP: Update Requests to master (0048f3c) which fixes a number of outstanding issues.

Fixes #38070, #37733 by reverting part of [38429] and using the fix in Requests.
Fixes #37992 allowing for connecting to SSL resources on ports other than 443.
Fixes #37991 by not sending default ports in the Host: header.
Fixes #37839 to match and decode Chunked responses correctly.
Fixes #38232 allowing a SSL connection to ignore the hostname of the certificate when verification is disabled.

#7 @dd32
10 years ago

In 38728:

HTTP: Update Requests to master (0048f3c) which fixes a number of outstanding issues.

Merges [38727] to the 4.6 branch.

Fixes #38070, #37733 by reverting part of [38429] and using the fix in Requests.
Fixes #37992 allowing for connecting to SSL resources on ports other than 443.
Fixes #37991 by not sending default ports in the Host: header.
Fixes #37839 to match and decode Chunked responses correctly.
Fixes #38232 allowing a SSL connection to ignore the hostname of the certificate when verification is disabled.

Note: See TracTickets for help on using tickets.