Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37992 closed defect (bug) (fixed)

fsockopen hard codes port 443 when http scheme used

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

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 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 @dd32
8 years ago

  • Component changed from General to HTTP API
  • Owner set to dd32
  • Status changed from new to 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
8 years ago

Awesome, Thanks!

#4 @rmccue
8 years ago

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

PR merged; needs update in core.

#5 @dd32
8 years ago

  • Milestone changed from 4.7 to 4.6.2

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

#6 @dd32
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to 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
8 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.