Disable WordPress's certificate verification selectively against local hosts that exist in /etc/hosts.
Add the following to your .env.php
file:
'LOCAL_HOSTS_SSL_WHITELIST' => true,
Or you can add the following constant to your wp-config.php
file:
define( 'LOCAL_HOSTS_SSL_WHITELIST', true );