ColdFusion CFHTTP I/O Exception: peer not authenticated - even after adding certs to Keystore

后端 未结 8 2088
情深已故
情深已故 2020-12-19 07:01

I\'m currently working with a payment processor. I can browse to the payment URL from our server, so it\'s not a firewall issue, but when I try to use CFHTTP I get a I/O Exc

8条回答
  •  既然无缘
    2020-12-19 07:55

    A colleague of mine found the following after experiencing the same issue when connecting to a 3rd party.

    http://www.coldfusionjedi.com/index.cfm/2011/1/12/Diagnosing-a-CFHTTP-issue--peer-not-authenticated

    https://www.raymondcamden.com/2011/01/12/Diagnosing-a-CFHTTP-issue-peer-not-authenticated/

    We used the solution provided in the comment by Pete Freitag further down the page. It works, but I think should be used with caution, as it involves dynamically removing and adding back in a particular property of the JsafeJCE provider.

    For the sake of archiving, here is the original content of Pete Freitag's comment:

    I've narrowed this down a bit further, and removing the KeyAgreement.DiffieHellman from the RSA JsafeJCE provider (which causes the default sun implementation to be used instead) seams to work, and probably has less of an effect on your server than removing the entire provider would. Here's how you do it:

    
    
    
    
    
    
    Do your http call, but pack the key agreement if you want:
    
    
    

    I figured this out by using the SSLSocketFactory to create a https connection, which provided a bit more details in the stack trace, than when using cfhttp:

    yadayadayada Caused by: java.security.InvalidKeyException: Cannot
    build a secret key of algorithm TlsPremasterSecret at
    com.rsa.jsafe.provider.JS_KeyAgree.engineGenerateSecret(Unknown
    Source) at javax.crypto.KeyAgreement.generateSecret(DashoA13*..) at
    com.sun.net.ssl.internal.ssl.DHCrypt.getAgreedSecret(DHCrypt.java:166)
    

    Would be great if the exception thrown from ColdFusion was a bit less generic.

提交回复
热议问题