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
Admin User 927Admin User 927 

JAVA Version For APEX : Error in integration to Sendinblue : |System.CalloutException: java.lang.RuntimeException: Could not generate DH keypair

Hi All,

We are trying to integrate Salesforce to Sendinblue and the error we are getting in HTTP call out is

17:16:54.045 (45234499)|USER_DEBUG|[23]|DEBUG|System.HttpRequest[Endpoint=https://api.sendinblue.com/v2.0/campaign/1, Method=GET]
17:16:54.045 (45241415)|SYSTEM_METHOD_EXIT|[23]|System.debug(ANY)
17:16:54.045 (45245388)|STATEMENT_EXECUTE|[24]
17:16:54.045 (45263829)|VARIABLE_SCOPE_BEGIN|[24]|http|System.Http|true|false
17:16:54.045 (45474869)|VARIABLE_ASSIGNMENT|[24]|http|"System.Http[]"|0x1b19bfb3
17:16:54.045 (45482896)|STATEMENT_EXECUTE|[25]
17:16:54.045 (45502186)|SYSTEM_METHOD_ENTRY|[25]|System.Http.send(ANY)
17:16:54.045 (45567511)|CALLOUT_REQUEST|[25]|System.HttpRequest[Endpoint=https://api.sendinblue.com/v2.0/campaign/1, Method=GET]
17:16:54.313 (313305474)|EXCEPTION_THROWN|[25]|System.CalloutException: java.lang.RuntimeException: Could not generate DH keypair

Sendinblue support team asked us for JAVA version that APEX uses as this issue is accouring with JAVA version 7 and above.

"Hello,

Is it be possible to check the Java version used by APEX and Eclipse. As per our technical team's understanding the issue is with Java version 7 onwards.

Please check the links below for further informations.

http://stackoverflow.com/questions/10687200/java-7-and-could-not-generate-dh-keypair
http://stackoverflow.com/questions/14253039/is-there-a-workaround-for-java-lang-runtimeexception-could-not-generate-dh-key
http://stackoverflow.com/questions/6851461/java-why-does-ssl-handshake-give-could-not-generate-dh-keypair-exception

Regards,
Sendinblue Team"


Can some one please help me with the information ASAP . Or is it something that we are doing wrong from coding end ?

Following is the code.

Thanks a lot.

 
public with sharing class MySforceHttpCallOut {

String endPoint = 'https://api.sendinblue.com/v2.0/campaign/1' ;

public void fetchDataFromRemote(){
   performAction('GET');    
}
  
public void performAction(String method){

             HttpRequest req = new HttpRequest();
            req.setEndpoint(endPoint);
             req.setHeader('api-key', 'GAVE MY API KEY HERE');
             req.setHeader('Content-Type', 'application/json');
             
             req.setMethod(method);
            
             System.debug(req);

             Http http = new Http();
             HTTPResponse res = http.send(req);   -> Failing HERE
            System.debug( res.getBody());
             Map<String,String> responseMap =   (Map<String,String>)JSON.deSerialize(res.getBody(),Map<String,String>.class);
              
              System.debug(responseMap);
              
  }
    
  
}

 
Best Answer chosen by Admin User 927
ShashankShashank (Salesforce Developers) 

Salesforce presently runs on JDK7 (which is why you see the 2048-bit DH key issue), and will gradually be upgraded to JDK8 through a series of patches, hopefully by Summer '15.

All Answers

ShashankShashank (Salesforce Developers) 

Salesforce presently runs on JDK7 (which is why you see the 2048-bit DH key issue), and will gradually be upgraded to JDK8 through a series of patches, hopefully by Summer '15.

This was selected as the best answer
Admin User 927Admin User 927
Hello Shashank,
Thanks a lot for the reply.
Regards
Shri
Admin User 433Admin User 433
Hi Shashank,
Are you aware of a fix in the meantime? We need this one resolved too.

Regards,

Hans
ShashankShashank (Salesforce Developers) 
A workaround mentiooned by R&D in one of the discussions is to de-preference DH ciphers on your server side. Please be noted that Salesforce should be upgraded to JDK8 wiith the Summer '15 release. Here's the release schedule: https://trust.salesforce.com/trust/maintenance/