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);
}
4
  • Hey, are you on a Mac or Windows machine? Commented Jun 21, 2016 at 13:49
  • I am using Windows 7 Enterprise Edition, using IntelliJ and Java 1.7 if it matters.
    – jimpudar
    Commented Jun 21, 2016 at 13:49
  • Is it a standalone Java application or server application?
    – Saroj Bera
    Commented Jun 21, 2016 at 13:49
  • Standalone Java application.
    – jimpudar
    Commented Jun 21, 2016 at 13:50

3 Answers 3

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .