Getting ssl handshake error while communicating with paypal server in my java application

假如想象 提交于 2019-12-14 02:48:15

问题


I am using paypal sandbox account for my java application and hosting using centos 6.7. While I am running the application I am getting error for communicating with paypal account.

I am getting the error as followed,

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
	at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1961)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:515)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)

回答1:


There was some security updates. You need to use TLS 1.2 for the sandbox (updates will need to be applied at a later date for Paypal in Live mode too).

https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1766&viewlocale=en_US

Here's the roadmap and the different dates :

Jan 14, 2016 After this date, Sandbox API endpoints only support new standard (HTTP/1.1, TLS 1.2 and SHA-256 certificates). This includes www.sandbox.paypal.com only accepting HTTPS for IPN Postbacks.

Jan 31, 2016 Production starts issuing API Credential Certificates with new standard (2048-bit, SHA-256).

Feb 29, 2016 Test Sandbox endpoints will be removed.

Mar 17, 2016 New SFTP IP addresses add to DNS for reports.paypal.com.

Apr 14, 2016 Old SFTP IP addresses removed from DNS for reports.paypal.com.

May 12, 2016 Old SFTP IP addresses stop working.

Jun 17, 2016 After this date, Production API endpoints will start moving to the new standard (HTTP/1.1, TLS 1.2 and SHA-256 certificates)

Sep 30, 2016 IPN postbacks to www.paypal.com only allow HTTPS

Jan 1, 2018 All Certificate API Credentials must have been upgraded to the new standard.



来源:https://stackoverflow.com/questions/35984858/getting-ssl-handshake-error-while-communicating-with-paypal-server-in-my-java-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!