Passing cert and key options when calling Forge fetch


I need to pass cert and key options when calling an external API. I passed these in an agent as suggested by a few online posts - although I could not find any official documentation. Here’s my snippet:

      const agent = new https.Agent({
        cert: publicCert,
        key: privateKey,
      const result = await fetch(Url, {
        method: "POST",
        body: formBody.join('&'),
        headers: { 
          'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 

However, when I do this, I get an error: Forge only supports ‘keepAlive’ as an option to http.Agent

Is there another way I can pass a public certificate and key when making a Forge fetch call?

Sorry, Forge doesn’t currently support this as the HTTP connections are proxied on the way out of the Atlassian infrastructure. If you need this, I suggest raising a ticket on the public Forge board so we’re aware of its popularity.

1 Like