• Resolved drtonyb

    (@drtonyb)


    Map is not showing on the front end of my local development server, but is showing on the live (hosting) server. The map shows in the Gutenberg editor.

    I have tracked the problem to curl_exec encountering an error on my development environment – “SSL certificate problem: unable to get local issuer certificate”.

    This is due to my development system not having a valid cacert.pem file.

    There are two solutions for me:

    1. install a cacert.pem file and set its location in my php.ini file with the line
    curl.cainfo = “PATH_TO/cacert.pem”

    2. modify the embed-gutenberg-block-google-maps.php file, adding
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    before the curl_exec($ch) call.

    Either solution worked for me, but I have chosen option 1.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrew Taylor

    (@andrewtaylor-1)

    Hi @drtonyb,

    Thank you for reporting the issue you had. I check that the response from Google is a 200 with curl before rendering the map on the front end. This ensures it does not display a response with an error (invalid address, invalid API key, etc) to the site’s users.

    The call to Google uses SSL so it makes sense that with cert issues locally that would not works properly.

    I’m glad you were able to resolve your cert issues. Would a filter to disable the behavior of checking if the map request is valid before rending the map be useful?

    Thread Starter drtonyb

    (@drtonyb)

    Hi Andrew,
    You’re welcome. I don’t think a filter would be necessary, but option 2 could be a simple solution to avoid any problems with the local server not having cert for SSL. It would still perform the checks with Google that you require.

    Plugin Author Andrew Taylor

    (@andrewtaylor-1)

    @drtonyb even though it may be a convenience for developers working locally without a valid SSL certificate I do not wish to set CURLOPT_SSL_VERIFYPEER to false in the plugin for security reasons.

    I think option 1, editing your php.ini with a cacert.pem file you trust is the better approach. curl publishes cacert.pem files here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Map not showing on local development system’ is closed to new replies.