Page MenuHomePhabricator

localsettings.js ought to contain a setting to override User-Agent and SSL cert verification
Closed, ResolvedPublic

Description

As an English Wikipedia bot operator, I am using Parsoid to retrieve parsed HTML versions of Wikipedia articles as part of the operation of my bot. As I'm trying to be a good citizen and not cause the nice people in WMF's analytics department any particular headaches, I thought it might be sensible to set a custom User-Agent string for my requests.

I can only do this by overriding the string set manually in lib/mediawiki.ApiRequest.js - making it so that this can be overridden from the localsettings.js would be quite useful for bot operators who are using Parsoid to retrieve parsed copies of content from MediaWiki installations.

(I may be able to prepare a patch, but filing the issue first in case I don't get around to it.)

Event Timeline

tommorris raised the priority of this task from to Needs Triage.
tommorris updated the task description. (Show Details)
tommorris added a project: Parsoid.
tommorris subscribed.
ssastry triaged this task as Medium priority.Jan 24 2015, 4:36 PM
ssastry set Security to None.
ssastry moved this task from Needs Triage to Maintenance / Tech-Debt on the Parsoid board.

In the same vein, from IRC:

11:39:08 +gwicke on the topic of making things configurable: a recurring request is to allow requests to hosts with a self-signed cert
11:41:07 +gwicke https://nodejs.org/api/https.html#https_https_request_options_callback lists a rejectUnauthorized option
11:42:41 +gwicke discussion for request at https://github.com/request/request/issues/418
11:42:59 +gwicke setting NODE_TLS_REJECT_UNAUTHORIZED=0 seems to work too

GWicke renamed this task from localsettings.js ought to contain a setting to override User-Agent to localsettings.js ought to contain a setting to override User-Agent and SSL cert verification.May 6 2015, 6:47 PM
ssastry subscribed.

The user-agent part is done. Unassigning myself.

Arlolra claimed this task.
Arlolra subscribed.

In T72761, we added a global parsoidConfig strictSSL to allow self-signed certs.

T66003 is to specify that config per mw api.