Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

SSL and admin scheme issues #259

@johnbillion

Description

@johnbillion

Scenario: a site where the admin area is served over SSL (via FORCE_SSL_ADMIN) and the front end is served over HTTP.

The intent of this, of course, is to prevent credentials being sent in plain text over HTTP.

WP-API uses home_url() rather than site_url() to build its endpoint URL. This means in the scenario above, the endpoint URL shown in RSD uses HTTP rather than HTTPS. When I go to use the API and I'm submitting my user credentials, they're being sent as plain text over HTTP! Oh noes!

The solution is for WP-API to use site_url() (and probably rpc as the $scheme parameter) rather than using home_url() in get_json_url(). This does mean, however, that if a site's WordPress installation is in a subdirectory then this will show up in the endpoint URL too (eg. example.com/wordpress/wp-json).

You'll note that the XML-RPC endpoints listed at example.com/xmlrpc.php?rsd all use site_url() rather than home_url(). WP-API is currently the odd one out here.

Thoughts?

Marginally related core ticket: #28424

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions