function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Austin VillanuevaAustin Villanueva 

java 7 platform doesn't work but java 8 works in http request for authentication username and password NEED HELP ASAP

I've been struggling to do authentication and get the accesskey in java.

I did it with different web services and I didn't get any problem. 

but for some reason the http call to salesforce always give me a response of 
{"error":"unknown_error","error_description":"retry your request"}

then, I just tried to changed the platform to java 8 and it works fine. I'm using java 7 in other web services and it works but salesforce need to use java 8? Is that it? 
SandhyaSandhya (Salesforce Developers) 
Hi Austin Villanueva,

In Java7 you need to enable TLS1.1 and TLS 1.2  and disable TLS1.0 for Java 8 this is enabled by default.


Use this as a command line parameter while running your Java 7 application
 
-Dhttps.protocols=TLSv1.1,TLSv1.2

Please refer below Salesforce help document for more information.

https://help.salesforce.com/HTViewSolution?id=000221207

http://salesforce.stackexchange.com/questions/127387/how-to-enable-tls-1-1-or-tls1-2-in-java-7  

Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya