External credentials for SSH are not working


Description

External Credentials are configured on the MID Server for discovery.

The SSH private key is updated in the .properties file.

The same credentials configured in Service now instance works good, but when checking with "external credential" configuration, it gives the below error:

SSHProtocolEngine SEVERE *** ERROR *** Private key decode failure: Did not recognize PEM Header / Footer or unsupported algorithm

Release or Environment

All Versions.

Resolution

If the private key has multiple lines init, replace the private key in the properties file in multiline format with "\n\" at the end of each line.

See attached "dummycredentials-multiline.properties.txt" for an example.