title: Nuxt.js problem with server-side API call with https
body: <p>I have problem with nuxt server-side API call when im using HTTP<strong>S</strong>. On client side everyting is fine and API works when im switching pages on client side via links, but when I hit Ctrl + f5 and data will be pre-fetched on server side, there is no actually API call and data is not provided. Even no error is thrown, but eveything works just fine with plain HTTP.</p>
  
  <p>On my production server nodejs version - v10.9.0
  And for HTTPS im using SNI SSL provided via my nodejs web hosting provider</p>
  
  <p>This problem is similar to:
  <a href="https://github.com/nuxt/nuxt.js/issues/2934" rel="noreferrer">https://github.com/nuxt/nuxt.js/issues/2934</a>
  Except that the solution provided there does not work for me.</p>
  
  <p><strong>Edited:</strong></p>
  
  <p>This is the error im getting in store.js after axios get in nuxtServerInit:
  <strong>'unable to verify the first certificate'</strong></p>
  
  <p><strong>Edited 2:</strong></p>
  
  <p>After that Ive found: <a href="https://forum.vuejs.org/t/nuxtserverinit-with-axios-unable-to-verify-the-first-certificate/31010" rel="noreferrer">https://forum.vuejs.org/t/nuxtserverinit-with-axios-unable-to-verify-the-first-certificate/31010</a></p>
  
  <p>And I applied plugin which extends axios:</p>
  
  <p>plugins/axios.js:</p>
  
  <pre><code>import https from 'https';
  
  export default function ({ $axios }) {
      $axios.defaults.httpsAgent = new https.Agent({ rejectUnauthorized: false });
  }
  </code></pre>
  
  <p>nuxt.config.js:</p>
  
  <pre><code>plugins: [
      '@/plugins/axios',
  ]
  </code></pre>
  
  <p>It works now on server-side as good as on client-side. But I have another questions. Is this solution safe?</p>