Connection errors followed by certificate errors using fdk

On Friday last week (7th June 2024) we started getting errors when making API calls whilst running applications within the fdk tool.

These errors were:

{
  status: 502,
  headers: {},
  response: 'Error in establishing connection',
  errorSource: 'APP',
}

Shortly afterwards we started getting errors reported when trying to perform fdk commands:

e.g. ‘fdk validate’

Error: self-signed certificate in certificate chain
    at TLSSocket.onConnectSecure (node:_tls_wrap:1659:34)
    at TLSSocket.emit (node:events:517:28)
    at TLSSocket._finishInit (node:_tls_wrap:1070:8)
    at ssl.onhandshakedone (node:_tls_wrap:856:12)

We discovered that these particular errors could be mitigated against by adding the --skip-update-check commandline switch.

e.g.‘fdk validate --skip-update-check’

However skipping the update check did not resolve the 502 connection errors.

This morning (Monday 10th June 2024) I initially found that the ‘self-signed certificate’ errors had stopped being reported, but that the 502 errors persist. Behaviour has now changed and I am once again also getting the certificate error.

Can anybody advise me as to reasons why these errors may be occurring (Is there a Freshworks issue currently in play? Are they symptoms of likely changes to my local system or to our wider IT infrastructure? Etc?)

Cheers

Hey @a21932ealwg,
Can you try by setting the strict-ssl as false?

npm config set strict-ssl=false

Then run the app with fdk run.

@zach_jones_noel

Setting

npm config set strict-ssl=false

Followed by fdk run still shows this error:

Error: self-signed certificate in certificate chain      
    at TLSSocket.onConnectSecure (node:_tls_wrap:1659:34)
    at TLSSocket.emit (node:events:517:28)
    at TLSSocket._finishInit (node:_tls_wrap:1070:8)     
    at ssl.onhandshakedone (node:_tls_wrap:856:12) 

@a21932ealwg,
Can you try the below command -

export NODE_TLS_REJECT_UNAUTHORIZED='0'

@zach_jones_noel

I have tried typing the command:

export NODE_TLS_REJECT_UNAUTHORIZED='0'

on the command line in Terminal, and I received this error:

export : The term 'export' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ export NODE_TLS_REJECT_UNAUTHORIZED='0'
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (export:String) [], CommandNotFoundException   
    + FullyQualifiedErrorId : CommandNotFoundException

Attempting the same command using a Command Prompt (cmd.exe), I receive this error:

'export' is not recognized as an internal or external command,
operable program or batch file.

[Edit]
I have manually added the NODE_TLS_REJECT_UNAUTHORIZED environment variable to my windows system, setting its value to 0.

Now, when I run ‘fdk run’, I get a warning displayed (but no error):

(node:29832) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)

I am able to successfully run the application using fdk - I am no longer seeing the 502 errors.

@zach_jones_noel

I’m a bit wary that turning off a security check may not be the most sensible way of resolving the issue.

Are there any ideas amongst the community as to why the problem started, and whether there’s a more targeted approach to remedying the underlying cause?