1

I am using facebook login in my coldfusion application. I went through all the steps to get access_token. I am making cfhttp call to "/me" endpoint with access_token and fields parameters and getting "I/O Exception: peer not authenticated" error in the response/Errordetail. I made the same cfhttp call again and able to get successful response of id and name mentioned in fields parameters.

I am expecting the successful response in the first call but have to call twice, so the first call errors out and second one succeeds.

Any help on how to debug or find the issue with the first call. so i should be making one call and get a successful response of current user's information.

i should be making one call and get a successful response of current user's information

<cfscript>

try {
    cfoauth(type = 'facebook', clientid = appId, secretkey = appSecret, result = "res", scope = "public_profile, email", redirecturi = redirectUri);
} catch (any e) {
   writeOutput(e);
}

if (code NEQ "" && res.access_token != "") { // code is a parameter I get from url redirect after cfoauth response
    try {
        cfhttp(method = "GET", charset = "utf-8", url = "https://graph.facebook.com/v17.0/me", result = "fbmeresponse") {
            cfhttpparam(name = "access_token", type = "url", value = res.access_token);
            cfhttpparam(name = "fields", type = "url", value="first_name,last_name,email");
            
        }
        dresponse = deserializeJSON(fbmeresponse.filecontent);
        accessToken = dresponse.access_token;
        writedump(accessToken);

    } catch (any e) {
        writeoutput(e);
    }
 }
</cfscript>
  • What version of the java jre are you using with CF? – haxtbh Dec 17 '22 at 07:37
  • Not sure why you are passing `scope` to the token endpoint. That has not place being there, that is a parameter for the login dialog call. – CBroe Dec 19 '22 at 07:24
  • @haxtbh java version "11.0.1" 2018-10-16 LTS – user1439071 Dec 19 '22 at 22:27
  • @user1439071 upgrade your JRE to the latest supported version, this is a bug in 11.0.1 that I have seen with other services we used. https://coldfusion.adobe.com/2019/06/error-calling-cf-via-https-solved-updating-jvm/ – haxtbh Dec 20 '22 at 20:46
  • Does this answer your question? [JDK 11. javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated](https://stackoverflow.com/questions/55128398/jdk-11-javax-net-ssl-sslpeerunverifiedexception-peer-not-authenticated) – haxtbh Dec 20 '22 at 20:47
  • Nothing worked yet – user1439071 Mar 03 '23 at 18:56
  • @haxtbh possible to elaborate on issues you had with other services please? Also, now i am using a counter in do while loop to make a cfhttp call and every second time it is a success. – user1439071 Jul 13 '23 at 18:48
  • @user1439071 if they dont support older TLS or use TLS1.3 we were getting the errors you were seeing. Once updating the JRE it went away as it was a known bug. – haxtbh Jul 21 '23 at 08:51

0 Answers0