jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/396032 )

Change subject: T66003: Make strictSSL configurable per wiki as well
......................................................................


T66003: Make strictSSL configurable per wiki as well

Change-Id: Ifac871d49b88f85d4f65273e20a86204fb49264e
---
M config.example.yaml
M lib/config/ParsoidConfig.js
M lib/config/WikiConfig.js
M lib/mw/ApiRequest.js
4 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  C. Scott Ananian: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/config.example.yaml b/config.example.yaml
index 1fd7077..e262261 100644
--- a/config.example.yaml
+++ b/config.example.yaml
@@ -49,6 +49,8 @@
           #    uri: 'http://my.proxy:1234/'
           #    headers:  # optional
           #        'X-Forwarded-Proto': 'https'
+          # See below, defaults to true.
+          #strictSSL: false
 
         # We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly
         # for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks',
@@ -90,6 +92,7 @@
 
         # Require SSL certificates to be valid (default true)
         # Set to false when using self-signed SSL certificates
+        # Note that this can also be applied per wiki in the mwApis above
         #strictSSL: false
 
         # Use a different server for CSS style modules.
diff --git a/lib/config/ParsoidConfig.js b/lib/config/ParsoidConfig.js
index 4ff9aa6..48383e2 100644
--- a/lib/config/ParsoidConfig.js
+++ b/lib/config/ParsoidConfig.js
@@ -472,6 +472,7 @@
  * @param {Array} [apiConf.extensions]
  *   A list of native extension constructors.  Otherwise, registers cite by
  *   default.
+ * @param {Boolean} [apiConf.strictSSL]
  */
 ParsoidConfig.prototype.setMwApi = function(apiConf) {
        var prefix;
diff --git a/lib/config/WikiConfig.js b/lib/config/WikiConfig.js
index 318d2d8..c1d7cec 100644
--- a/lib/config/WikiConfig.js
+++ b/lib/config/WikiConfig.js
@@ -138,6 +138,9 @@
        // The URI for api.php on this wiki.
        this.apiURI = mwApiConf.uri;
 
+       // Pass this along to the api request
+       this.strictSSL = mwApiConf.strictSSL;
+
        // The proxy to use for this wiki.
        this.apiProxy = parsoidConfig.getAPIProxy(prefix);
 
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index 129f545..1f8812c 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -298,7 +298,8 @@
        // Set default options, forward cookie if set.
        options.headers['User-Agent'] = env.conf.parsoid.userAgent;
        options.headers.Connection = 'close';
-       options.strictSSL = env.conf.parsoid.strictSSL;
+       options.strictSSL = (env.conf.wiki.strictSSL !== undefined) ?
+               env.conf.wiki.strictSSL : env.conf.parsoid.strictSSL;
        if (env.cookie) {
                options.headers.Cookie = env.cookie;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/396032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifac871d49b88f85d4f65273e20a86204fb49264e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: C. Scott Ananian <[email protected]>
Gerrit-Reviewer: Sbailey <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to