I have this simple GET call that works perfectly from Postman, Powershell, C# and even browser JS ( after disabling CORS ), but porting it to a ColdFusion CFHTTP call is failing.
Below is the response from the Jira API:
{
"ErrorDetail": "I/O Exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
"Mimetype": "Unable to determine MIME type of file.",
"Filecontent": "Connection Failure",
"Statuscode": "Connection Failure. Status code unavailable.",
"Responseheader": {
},
"Text": true,
"Charset": "",
"Header": ""
}
CF Code:
<cfset jql="<redacted>">
<cfset jiraEndpoint ='https://jira.bullhorn.com/rest/api/2/search?jql=#jql#'>
<cfhttp url = "#jiraEndpoint#" result="res" method="get" username="<redacted>" password="<redacted>">
<cfhttpparam type="header" name="Accept" value="application/json" />
</cfhttp>
<cfheader name="Content-Type" value="application/json">
<cfoutput>
#serializeJSON(res)#
</cfoutput>
Things I have tried:
- Used a Authorization header with value
"Basic <base64 encoded string version of username:password>"
- Added
Content-Type
header - Added
mimetype
header - Tried to use a third-party CFC
Nothing seems to work.