title: API-call via plugin to Server Middleware
body: <p>I have configured a plugin and a custom Server Middleware extension.</p>
  <p>I am able to call functions via my plugin from the server middleware as seen in the snippet below:</p>
  <p><strong>Plugin:</strong></p>
  <pre><code>async function getPriceInitiator() {
  
          const response = await axios({
            method: &quot;post&quot;,
            url: &quot;http://localhost:3000/api/myCustomServerMiddleware/testFunction&quot;,
          });
          return response
        }
      }
  </code></pre>
  <p><strong>Server Middleware:</strong></p>
  <pre><code>function testFunction() {
      return &quot;predefindedResponseString&quot;;
    });
  </code></pre>
  <p>I can not seem to call API's in the server middleware like:</p>
  <pre><code>async function testFunction() {
    try {
      const res = await axios({
        method: &quot;get&quot;,
        url: 'https://www.boredapi.com/api/activity',
      });
      return res;
    } catch (e) {
      console.warn(e);
    }
  }
  </code></pre>
  <p>Trying to call API's will give me errors like: &quot;certificate has expired&quot; and will <em>always</em> return me an empty data object. What seems weird because I can pass strings in the response, then it does work as shown in the first <code>server middleware</code> snippet.</p>
  <p>EDIT:
  The Certificate error is as follows:</p>
  <pre><code>certificate has expired                                                                       13:40:29
  
        at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
        at TLSSocket.emit (node:events:520:28)
        at TLSSocket._finishInit (node:_tls_wrap:944:8)
        at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
  </code></pre>