Mjml: local issuer certificate error when using mjml api

Created on 17 Dec 2020  路  11Comments  路  Source: mjmlio/mjml

I use the API since a few weeks and everything worked fine, but today I suddenly ran into this error when trying to send mails:

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.mjml.io', port=443): Max retries exceeded with url: /v1/render (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

I didn't change my config or anything. I also tried to retrieve new API Credentials, but I didn't receive a new email so far.

All 11 comments

Having the exact same issue.

Same here, there seems to be a certificate problem on MJML end

Having the same issue in https://github.com/Automattic/newspack-newsletters. As of a few hours ago the MJML API started returning {"errors":{"http_request_failed":["cURL error 60: SSL certificate problem: unable to get local issuer certificate"]},"error_data":[]}

Hi everyone, sorry about that. We've identified the issue and working on a fix. There is a valid certificate on mjml.io but the issue is related to the intermediate chain.

issue seems solved

Yes, we just put a fix in place. Sorry for the issue and feel free to report if you see anything else.

thanks

Hi,

The problem seems to be back :(

SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

Thank you

@ngarnier

The issue is back .. Any suggestion?

how should one use mjml api in production if it's not reliable?

For people using the API in PHP software you could "solve" by installing mjml cli.

Run this :

npm install -g mjml

Then in your code you can make something like this :

    $input_file     = "/tmp/".time()."_input.mjml";
    $output_file    = "/tmp/".time()."_output.mjml";

    file_put_contents($input_file, $mjml);

    $res = exec("mjml {$input_file} -o {$output_file}", $error, $return_var);

    // print_r($res);
    // print_r($error);
    // print_r($return_var);

    $html = file_get_contents($output_file);   

    unlink($input_file);
    unlink($output_file);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

liminspace picture liminspace  路  3Comments

csmcanarney picture csmcanarney  路  3Comments

theVannu picture theVannu  路  3Comments

samatcd picture samatcd  路  4Comments

lucasnantonio picture lucasnantonio  路  4Comments