title: SSL errors using MailChimp's API
body: <p>I'm trying to connect with MailChimp's API, but keep getting errors:</p>
  
  <blockquote>
    <p>Error. API call to lists/list failed: SSL peer certificate or SSH
    remote key was not OK</p>
  </blockquote>
  
  <p>Then, I created a cacert.pem file and set it in the Mailchimp.php file:</p>
  
  <pre><code>$this-&gt;ssl_cainfo = ROOT . DS . 'cacert.pem';
  </code></pre>
  
  <p>And get this:</p>
  
  <blockquote>
    <p>Error. API call to lists/list failed: SSL certificate problem, verify
    that the CA cert is OK. Details: error:14090086:SSL
    routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>Error. API call to lists/list failed: SSL peer certificate or SSH
    remote key was not OK</p>
  </blockquote>
  
  <p>Per this page:</p>
  
  <p>I tried using the <a href="http://curl.haxx.se/docs/caextract.html" rel="noreferrer">http://curl.haxx.se/docs/caextract.html</a> file for my cacert.pem file, but that gives the "not OK" error listed above.</p>
  
  <p>I also tried making my own with the info provided by our host (a text file, changed extension to .pem, and pasted one and/or both chunks of data into it, making it look like this):</p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
  adjkflsdjflkasjdflkajdflksdflsdfkj
  asldfkjaadsfhjkfhdsajkfhakjdhfkjdh
  ....
  -----END CERTIFICATE-----
  -----BEGIN CERTIFICATE-----
  adjkflsdjflkasjdflkajdflksdflsdfkj
  asldfkjaadsfhjkfhdsajkfhakjdhfkjdh
  ....
  -----END CERTIFICATE-----
  </code></pre>
  
  <p>or just one:</p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
  adjkflsdjflkasjdflkajdflksdflsdfkj
  asldfkjaadsfhjkfhdsajkfhakjdhfkjdh
  ....
  -----END CERTIFICATE-----
  </code></pre>
  
  <p>At a loss for where to go from here, what to try...etc</p>
  
  <p>Using the example code from here: <a href="https://github.com/mailchimp/mcapi2-php-examples" rel="noreferrer">https://github.com/mailchimp/mcapi2-php-examples</a></p>
  
  <p>And getting the Vendor files via composer:</p>
  
  <pre><code>"require": {
      "mailchimp/mailchimp": "&gt;=2.0.0"
  },
  </code></pre>