Jump to content

Topic on Extension talk:VisualEditor

Summary by Seb35

Mis-configuration and probably issue with an HTTP Authentication on the wiki.

Ganomix (talkcontribs)

I'm running MediaWiki 1.27.1 (with https connection) on Windows Server 2012 and IIS. So far, I haven't been able to get Visual Editor to work. I have installed parsoid and the Visual Editor extension. I also have parsoid running, but when I try to edit pages, I receive the following error message:

"Error loading data from server: (curl error: 60) Peer certificate cannot be authenticated with given CA certificates: docserver-http-error: (curl error: 60) Peer certificate cannot be authenticated with given CA certificates. Would you like to retry?"

I'm guessing that this has something to do with the SSL certificate, but I don't know how to get Parsoid to work with it. Does anyone have any suggestions?

Ganomix (talkcontribs)

Managed to fix this error with the following instructions:

Use this certificate root certificate bundle:

https://curl.haxx.se/ca/cacert.pem

Copy this certificate bundle on your disk. And use this on php.ini

curl.cainfo = "path_to_cert\cacert.pem"

However, now I get error 401. I set localsettings.php to forward the cookies, but error 401 is still displayed.

I also allowed the Parsoid server (User:Andru~mediawikiwiki/Allow Parsoid Server), but error 401 didn't go away with these instructions either.

Seb35 (talkcontribs)
  1. Is it a public wiki?
  2. The two communications between VE and Parsoid should be checked:
    1. VE -> Parsoid: is it on localhost? and http?
    2. Parsoid -> VE: this is a https connection from nodejs (Parsoid), so nodejs must trust the wiki certificate

Probably the last point is missing, and I guess you have a self-signed certificate or an uncommon/private CA. Until quite recent nodejs versions, it was not possible to change the certificate store (see ); now it is possible with the very recent versions of nodejs (newer than end of 2016). So you should install a very recent version of nodejs and make sure the wiki certificate is recognized by a CA in the system certificate store.

Seb35 (talkcontribs)

My previous answer was too late :)

In LocalSettings, did you configure $wgVirtualRestConfig? (There are older configuration parameters which should no more be used.)

Ganomix (talkcontribs)

Thanks for the reply. It is a private wiki. I managed to bypass the 401 error by disabling Basic Authentication and enabling Anonymous Authentication for api.php in IIS.

However, now I ran into yet another issue. When I click edit, the Visual Editor starts loading but the loading bar gets stuck at 100 %, and I am not able to edit the page.

I have configured $wgVirtualRestConfig as follows:


$wgVirtualRestConfig['modules']['parsoid'] = array(

// URL to the Parsoid instance

// Use port 8142 if you use the Debian package

'url' => 'https://hostname/wiki/api.php',

// Parsoid "domain", see below (optional)

'domain' => 'localhost',

// Parsoid "prefix", see below (optional)

'prefix' => 'localhost'

);

Did I make some mistake there?

Ganomix (talkcontribs)

Visual Editor seems to be working for me now. I simply removed the code above from LocalSettings.php, and it started working.

Seb35 (talkcontribs)

I guess it works because default parameters are fine for you: your Parsoid is listening on localhost on port 8000. In $wgVirtualRestConfig, the 'url' parameter must be the address (IP+port) of Parsoid (=the external programm running with nodejs), so e.g. something like 'http://127.0.0.1:80'.

So probably you don’t have to change these default parameters, but it better to understand the exact meaning of these basic parameters.

And given you mention there were a Basic Authentication, it was probably the issue, I never saw Parsoid used for a HTTP-Authenticated wiki and I guess it is not implemented. If you want to harden a bit the configuration, you can disable authentication for api.php only for localhost.

Seb35 (talkcontribs)

With your $wgVirtualRestConfig, VisualEditor called itself and at the same time expected to talk to Parsoid, so it created a loop and the 401 error was probably because of that.