I'm using ColdFusion on a Windows server. I try to connect to an API, it works on http url, but not on https.
<cfhttp url="https://www.example.com/api/login" method="post" result="httpResp" timeout="120">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="formField" name="user_key" value="#user_key#" />
<cfhttpparam type="formField" name="email" value="#user_email#" />
<cfhttpparam type="formField" name="password" value="#user_password#" />
</cfhttp>
<cfdump var="#httpResp#">
I'm getting this response:
struct
Charset [empty string]
ErrorDetail I/O Exception: peer not authenticated
Filecontent Connection Failure
Header [empty string]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES
When opening the URL from the server, I'm getting this xml response:
<rsp stat="fail" version="1.0">
<err code="15">Login failed</err>
</rsp>
And in my code, I have another https post that works without issue:
<cfhttp url="https://www.example2.com" method="post" result="httpResp" timeout="120">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="body" value="#Replace(myJsonStruct,"//","")#">
</cfhttp>
That means that the issue is not coming from SSL settings on the server.
Is there an error in my CF code?