MainWP, curl, SSL and other errors

I’m not exactly sure what order I had initial issues in or what order I attempted to fix them but I still have several issues - I’ll do my best to explain them.

Created a new site to use for MainWP (site name MainWP). However, I had issues even before installing the MainWP plugin. I seemed to have resolved initial issues with making the site trusted. I have found on another thread here that said that Chrome needed to be restarted and I did seem to have a secure connection after that, but back on the Local dashboard if I click off to another site in my list of websites and go back, it no longer says it’s trusted. So, question 1: should the Trusted message stick and remain as Trusted?

When I tried to install the MainWP plugin, I was getting a curl error and I think that was caused by Kaspersky blocking the connection - however, I’m not not sure what settings are necessary to allow Local and the local sites to work properly. I have added Local as a trusted application in Kaspersky but I don’t fully understand all the various options so I’m not sure exactly what I need to do. I know that I’ve had to add a few other trusted applications (incluiding ngrok-i386.exe) to Kaspersky in the last month or so as it looks like they have tightened up on what they allow.

I’ve seen various error messages in WordPress admin on this site but some were caused by blocking by Kaspersky. However, I’ve still left with this error on all MainWP pages:

Warning: openssl_pkey_export(): cannot get key from parameter 1 in C:\Users\livec\Local Sites\mainwp\app\public\wp-content\plugins\mainwp\pages\page-mainwp-server-information-handler.php on line 216

(I’ve pasted the call stack below.)

So it still looks like there is an SSL issue of some sort. If I exit Kaspersky and reload the page, I still get the same error so it’s not Kaspersky’s fault here.

So, I’m confused and not entirely clear what I’ve done so far so I’m looking for suggestions on how to diagnose this further. I obviously don’t know whether this is a Local issue or a MainWP issue but because of the Trusted issue I mentioned, I think I need to understand that first before going to MainWP support.

All help greatly appreciated!

System Details

  • Which version of Local is being used?
    Local 15.10.1+5267

  • What Operating System (OS) and OS version is being used?
    Windows 10 Home 19041.867
    Chrome 89.0.4389.82
    Kaspersky Internet Security (0)

Log file of recent entries

{"thread":"main","class":"Process","process":"mailhog","pid":9132,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:06:19.431Z"}
{"thread":"main","class":"Process","process":"phpCgi","pid":25364,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:06:19.499Z"}
{"thread":"main","class":"Process","process":"phpCgi","pid":26456,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:06:19.596Z"}
{"thread":"main","class":"Process","process":"nginx","pid":19804,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:06:19.728Z"}
{"thread":"main","class":"Process","process":"mysql","pid":23816,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:06:19.871Z"}
{"thread":"main","reason":{},"p":{},"level":"warn","message":"Unhandled Rejection.","timestamp":"2021-03-12T22:06:20.033Z"}
{"thread":"main","class":"DeleteSiteService","message":"Deleting %%userDataPath%%\\run\\LlAIe4Hob","level":"info","timestamp":"2021-03-12T22:06:20.781Z"}
{"thread":"main","reason":{},"p":{},"level":"warn","message":"Unhandled Rejection.","timestamp":"2021-03-12T22:06:24.043Z"}
{"thread":"main","class":"HostsFileService","level":"info","message":"Updating hosts with","timestamp":"2021-03-12T22:06:24.798Z"}
{"thread":"main","class":"HostsFileService","stdout":"Updating hosts file at  C:\\WINDOWS\\System32\\drivers\\etc\\hosts\nUpdated hosts file at  C:\\WINDOWS\\System32\\drivers\\etc\\hosts\n","stderr":"","level":"info","message":"Updated hosts.","timestamp":"2021-03-12T22:06:28.665Z"}
{"thread":"main","class":"SiteProvisionerService","message":"Creating site folders...","level":"info","timestamp":"2021-03-12T22:07:17.258Z"}
{"thread":"main","class":"SiteProvisionerService","message":"Copying service config templates...","level":"info","timestamp":"2021-03-12T22:07:17.262Z"}
{"thread":"main","class":"ConfigTemplatesService","message":"Compiling service configs...","level":"info","timestamp":"2021-03-12T22:07:17.326Z"}
{"thread":"main","service":{},"serviceBinVersion":{},"dataPath":"C:/Users/livec/AppData/Roaming/Local/run/P5EbU76So/mysql/data","level":"info","message":"Initializing MySQL datadir...","timestamp":"2021-03-12T22:07:17.452Z"}
{"thread":"main","class":"ConfigTemplatesService","message":"Compiling service configs...","level":"info","timestamp":"2021-03-12T22:07:26.180Z"}
{"thread":"main","class":"Process","process":"nginx","pid":12824,"level":"info","message":"Killing process","timestamp":"2021-03-12T22:07:26.652Z"}
{"thread":"main","class":"HostsFileService","level":"info","message":"Updating hosts with","timestamp":"2021-03-12T22:07:27.658Z"}
{"thread":"main","service":{},"serviceBinVersion":{},"message":"Setting up MySQL user...","level":"info","timestamp":"2021-03-12T22:07:27.685Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-03-12T22:07:26.712855Z 0 [System] [MY-010116] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+5\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 23172","timestamp":"2021-03-12T22:07:29.854Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-03-12T22:07:26.716720Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","timestamp":"2021-03-12T22:07:29.855Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-03-12T22:07:29.811486Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","timestamp":"2021-03-12T22:07:29.855Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2021-03-12T22:07:29.855166Z 0 [System] [MY-010931] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+5\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10083  MySQL Community Server - GPL.","timestamp":"2021-03-12T22:07:29.857Z"}
{"thread":"main","service":{},"serviceBinVersion":{},"message":"Creating MySQL database...","level":"info","timestamp":"2021-03-12T22:07:30.536Z"}
{"thread":"main","class":"HostsFileService","stdout":"Updating hosts file at  C:\\WINDOWS\\System32\\drivers\\etc\\hosts\nUpdated hosts file at  C:\\WINDOWS\\System32\\drivers\\etc\\hosts\n","stderr":"","level":"info","message":"Updated hosts.","timestamp":"2021-03-12T22:07:32.083Z"}
{"thread":"main","class":"WordPressInstaller","message":"Init WordPressInstaller","level":"info","timestamp":"2021-03-12T22:07:32.085Z"}
{"thread":"main","class":"WordPressInstaller","message":"Starting standardInstall()","level":"info","timestamp":"2021-03-12T22:07:32.086Z"}
{"thread":"main","class":"WordPressInstaller","latestOfflineWpVersion":"5.7","level":"info","message":"Latest offline version info","timestamp":"2021-03-12T22:07:32.087Z"}
{"thread":"main","class":"WordPressInstaller","version":"5.7","download":"","level":"info","message":"Latest version info","timestamp":"2021-03-12T22:07:32.422Z"}
{"thread":"main","class":"WordPressInstaller","message":"Configuring wp-config.php","level":"info","timestamp":"2021-03-12T22:07:40.623Z"}
{"thread":"main","class":"WordPressInstaller","message":"Installing WordPress","level":"info","timestamp":"2021-03-12T22:07:41.258Z"}
{"thread":"main","class":"WordPressInstaller","message":"Attempting to delete Akismet and Hello Dolly","level":"info","timestamp":"2021-03-12T22:07:43.528Z"}
{"thread":"main","class":"WordPressInstaller","message":"Writing salts to wp-config.php","level":"info","timestamp":"2021-03-12T22:07:45.399Z"}

Call stack for the error above:

Call Stack

#	Time	Memory	Function	Location
1	0.0007	420088	{main}( )	...\admin.php:0
2	0.3645	17755896	do_action( )	...\admin.php:259
3	0.3645	17756272	WP_Hook->do_action( )	...\plugin.php:484
4	0.3645	17756272	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
5	0.3645	17757400	MainWP\Dashboard\MainWP_Updates::render( )	...\class-wp-hook.php:292
6	0.3681	17877760	MainWP\Dashboard\MainWP_Updates::render_header( )	...\page-mainwp-updates.php:613
7	0.3681	17878136	MainWP\Dashboard\MainWP_UI::render_top_header( )	...\page-mainwp-updates.php:152
8	0.3748	17881912	do_action( )	...\class-mainwp-ui.php:636
9	0.3748	17882288	WP_Hook->do_action( )	...\plugin.php:484
10	0.3748	17882288	WP_Hook->apply_filters( )	...\class-wp-hook.php:316
11	0.3748	17883416	MainWP\Dashboard\MainWP_System_View::admin_notices( )	...\class-wp-hook.php:292
12	0.3749	17883896	MainWP\Dashboard\MainWP_System_View::render_notice_config_warning( )	...\class-mainwp-system-view.php:306
13	0.3749	17883896	MainWP\Dashboard\MainWP_Server_Information_Handler::is_openssl_config_warning( )	...\class-mainwp-system-view.php:349
14	0.3749	17883896	MainWP\Dashboard\MainWP_Server_Information_Handler::get_ssl_warning( )	...\page-mainwp-server-information-handler.php:231
15	0.3752	17883920	openssl_pkey_export ( )	...\page-mainwp-server-information-handler.php:216


I’m wondering if there are two workarounds:

  1. Don’t bother with making it Trusted so it doesn’t use SSL. But even if I do then and ensure the urls in wp-admin Settings ate set to http: and not https:, I still get that openssl warning (even after stopping and restarting the website and restarting Chrome). However, even if this did work, MainWP would be communicating with child sites not using SSL, so not good.

  2. Find out what I need to stop Kaspersky from blocking that would allow the local install to run properly on SSL. I have added Local itself as a trusted application in Kaspersky, but is there something like a PHP processor or some other executable I need to tell kaspersky to trust?

FWIW I’m seeing the exact same error on my Mac with no antivirus programs. MainWP still seems to work, just a very annoying error message.

I think somewhere along the line I did exit Kaspersky but still got the same error. The warning is certainly VERY annoying, taking up a good part of the screen!

I’ve also not been able to connect to the one site I’ve tried - looked like an SSL issue so didn’t pursue further.

I’ve not made any progress on this yet.

One question: when I click on the green ‘TRUST’, I get the UAC then it says TRUSTED in grey. If I click on another website in Local and the back, it’s back to the green TRUST.

How does this interact with the URLs in the wp-admin dashboard settings? Can Local automatically change them to https? It doesn’t look as if it does but should they be changed and should that be done before or after clicking on TRUST?

Anything else I need to do to get the site trusted? Or is all a symptom of the same think that’s causing the warning error?

I realised that Local was installed just for me rather than for all users – I’m not sure why I did that when I installed it. However, I reinstalled Local for all users and after adding Local.exe as an exclusion in Kaspersky, I copied the openssl.cnf file I found in WPVivid (I reckoned this might do as a starting point) and placed it in C:\Users<user>\Local Sites and pointed the Quick Setup Wizard to that file, it all seems to work – I no longer get that error.

So far so good.

However, I still couldn’t add a site. I got:

MainWP Child Plugin not detected! Please make sure that the MainWP Child plugin is installed and activated on the child site. For additional help, contact the MainWP Support.

I wondered if this was being blocked by Wordfence on the child site so I temporarily deactivated it but that wasn’t the cause.

However, switching “Verify SSL certificate (optional)” off allowed the dashboard to connect so it’s finally all working, even if I don’t really understand what the issue was in the first place.

1 Like

This is a fairly complicated part of Local that to be honest, I don’t 100% understand. Also, I’ve never used MainWP, but as I understand it, it’s a tool that allows you to administer multiple WordPress sites from one central place – is that correct?

If so, how is the main controller/admin functionality implemented? Is it a plugin that needs to be installed on a WordPress site? Also I’m guessing that each individual “secondary” site needs some sort of worker plugin – is that correct?

In terms of what I know from reading through these symptoms, here are some observations:

  1. The “Trust” ssl cert in Local is just registering the site’s SSL certificate with the dev machine’s browsers so that the browsers can make a secure connection from the browser to the Local site.

  2. Note that the red “error” in the wp-admin isn’t actually an error, it’s a warning (nitpicky, I know, and the warning is likely a symptom of the underlying issue)

    Warning: openssl_pkey_export(): cannot get key from...

In similar issues that I’ve seen, this has to do with WordPress not being able to make a secure connection over HTTPS with some other external service.

In this case, since MainWP is probably trying to reach out and create a secure connection to a remote site, it’s probably having issues creating that secure connection. Since Local’s “Trust” button is registering the certificate with the browsers, this isn’t what the WordPress site is using to make a secure, remote connection, so for some reason, MainWP isn’t able to communicate with whatever it’s trying to communicate with.

Maybe this is a dumb question on my part, but here goes: Does MainWP allow you to use it in an offline environment? @afragen, you mention that it works for you – what exactly is working? Are you making secure connections and managing external sites with the MainWP plugin?

There is no offline mode.

MainWP has 2 plugins, one on the controller and one on the remote site. They interact to notify of updates. I run the MainWP controller in Local. There are some intricacies of setting up MainWP, I think solutions are in their forums. I’ve searched there. You will need to identify you local copy of OpenSSL.

I got the above error and it didn’t seem to effect function. I have dug into it yet to see why this is happening. I have changed laptops so this might be the issue. Even on Mac I had to do a manual setup like I was on Windows.

1 Like


Thanks for that.

Yes, as @afragen says, MainWP is a plugin for WordPress that connects to sites that have a Child plugin installed. MainWP provides a dashboard that provides an easy way to update a number of sites at once and generally maintain them. It has a number of add-ons such as uptime monitoring, backups - it seems very well featured. I had a reseller account that had Plesk’s WoprdPress Toolkit but I’ve just moved wo WHM. This does have a similar toolkit but it needs the whole account to be set up differently. MainWP looks as if it gives me back all the features I had without that.

Now I have it running, the basic function is working perfectly and I updated plugins on 15 sites last night. I have an issue with the uptime monitoring plugin but I’ve yet to look into that so don’t know what’s causing it.

I could have set up a new WordPress install on my webspace for MainWP, but running it on Local seemed like a good idea. I had seen several other say they had it working but it;'s good to see @afragen also say he’s got it running, albeit with an error.

Andy: does what I did to get it running help you at all?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.