5

I am trying to connect to a new org using the Java SOAP API and am getting the following error:

[UnexpectedErrorFault [ApiFault  exceptionCode='UNSUPPORTED_CLIENT'
 exceptionMessage='TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https.'
 extendedErrorDetails='{[0]}'
]
]

Anyone know how I can set the config differently to force TLS 1.1 or 1.2? I am currently making the connection like so:

ConnectorConfig config = new ConnectorConfig();
config.setUsername(creds.username);
config.setPassword(creds.password + creds.securityToken);
config.setProxy("my.proxy.com", 80);
try {
    soapConnection = Connector.newConnection(config);
    metadataConnection = new MetadataConnection(config);
}
  • Hey, are you on a Mac or Windows machine? – Frederik Witte Jun 21 '16 at 13:49
  • I am using Windows 7 Enterprise Edition, using IntelliJ and Java 1.7 if it matters. – jimpudar Jun 21 '16 at 13:49
  • Is it a standalone Java application or server application? – Saroj Bera Jun 21 '16 at 13:49
  • Standalone Java application. – jimpudar Jun 21 '16 at 13:50
5

The problem here is that although Java 7 and higher support TLS 1.1 and 1.2, they are not enabled by default. You can enable them by using:

System.setProperty(“https.protocols”, “TLSv1,TLSv1.1,TLSv1.2”);
2

Please check the solution given in this link : https://help.salesforce.com/apex/HTViewSolution?id=000221207

Pasting the excerpt for java: enter image description here

0

You can also update the java.security file located in JRE_HOME/lib/security/java.security: directory.

Update jdk.tls.disabledAlgorithms property and add TLSv1, TLSv1.1 to reject lower security protocol versions.

  • 1
    Does this answer recommend using SSLv3? Because they dropped support for that a long time ago. – Adrian Larson Jun 21 '16 at 14:28
  • My bad. Thanks for pointing it out. I have updated the answer. – Saroj Bera Jun 21 '16 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.