Product | Version |
---|---|
Mediawiki | 1.35.0 |
PHP | 7.3.24 |
MariaDB | 10.5.8 |
IIS | 10 |
OS | Windows Server 2019 |
Symptoms:
New installation of private MediaWiki 1.35 with Visual Editor. IIS configured to use Windows Authentication (to enable authentication with Windows AD). MW works as excepted, launching VE causes Curl error 60.
VisualEditor documentation states that with MediaWiki 1.35, you should not need to download anything to get VE working, private wiki may need some configuration but otherwise VE should work out of the box.
Many hours (days) and lots of research later I can say, that getting VE work with MediaWiki 1.35 on Windows environment wasn’t such an easy task. I found lots of suggestions how to get VE work after “Error contacting the Parsoid/RESTBase server: (Curl error: 60) SSL peer certificate or SSH remote key was not OK”, but none of them worked for me.
Workaround:
This is my solution (quite simple, actually), hope this helps someone to get things working without days of work and banging head to the wall.
1. Install MediaWiki 1.35 with extensions of your choice.
2. Make sure that everything is working like you want (except that stubborn VisualEditor that gives you Curl error 60)
3. Export CA-certificate and add reference to it in php.ini -conf (*
4. Modify authentication settings of rest.php -file in IIS (**
5. Add following lines to LocalSettings.php
if($_SERVER['REMOTE_ADDR'] == 'your_server_ip_address'){
$wgGroupPermissions['*']['edit'] = true;
$wgGroupPermissions['*']['read'] = true;
}
6. Make iisreset
(* If I get it right, the Curl 60 is generated when you click on modify in MediaWiki, which leads to connection attempt to VE through PHP that can't verify the server certificate in use. To fix this error you need to export the CA-certificate and tell the PHP where it is found:
1. Open mmc → Add/Remove Snap-in → Certificates → Computer account
2. In certificates -console navigate to Trusted Root Certification Authorities → Certificates
3. Select your Root CA → Export → Base-64 encoded X.509 (.CER) (this is equivalent to .pem -certificate format) → Save to the wiki root -folder (same place where is your LocalSettings.php) with name “cacert.cer”
4. Go to your PHP install folder and find php.ini → find line ;curl.cainfo =
5. Remove ; and add absolute path to your exported cacert.cer -file, example: curl.cainfo = “c:\WIKI\cacert.cer”
Now the curl 60 should disappear, you can verify that by changing the IIS authentication settings to Anonymous Authentication and authenticating with log in form.
(** SSO wont work if you have Anonymous Authentication enabled in IIS and VE wont work if it is disabled. This is a problem if you use something else than username/password to authenticate users (you know what I mean if you have smart cards in use).
You can tackle the authentication problem by setting the Anonymous Authentication only to the rest.php -file (found in you wiki root) and everywhere else you can use Windows Authentication and keep the Anonymous Authentication disabled:
1. Navigate to your %windir%\system32\inetsrv\config directory and modify applicationHost.config
2. Search <location path=”your_wiki_site”> … </location> section and add a new section below it:
<location path=”your_wiki_site/rest.php”>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled=”true” />
</authentication>
</security>
</system.webServer>
</location>
3. Save your changes to the config file and make an iisreset.
Now you should have working MediaWiki with Visual Editor.