Xaver
December 5, 2016, 10:53am
1
Hi there!
I’m running into an issue were the wp-cron is not working on a local site running over https.
The error I get is
cURL error 7: Failed to connect to mylocal.dev port 443: Connection refused
When I switch back to http everything is working smoothly. There’s also no difference running nginx over Apache.
Any help is appreciated!
clay
December 5, 2016, 3:19pm
2
Right now there are no certificates for container to container communications. Only the main router has the SSL certificates. This may change in the future.
For now you can just make those cross-container requests simply HTTP and then when you deploy you can switch to HTTPS.
Xaver
December 5, 2016, 8:45pm
3
Hi Clay!
Thanks for the info! I added a snippet to bypass this:
add_filter( 'cron_request', function( $args ) {
$args['url'] = set_url_scheme( $args['url'], 'http' );
return $args;
} );
It basically changes the https to http in the cron URL.
4 Likes
where did you add the snippet?
Xaver
March 21, 2017, 7:51pm
5
Just add it in your themes functions.php file or create a dedicate plugin
1 Like
works perfectly thanks for the snippet!