You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

SSLHandshakeException

Received Response
2
Views
2
Comments
edited Mar 28, 2018 7:28AM in Knowledge Management 2 comments

Content

HI,

Am trying to connect to Service Cloud Knowledge foundation API. It is giving SSL handshake exception error.

Please find the below java code

 

Version

Feb 2017

Code Snippet

             public static void main(String[] args) {
String serverKeyStore = "C:\\ServiceCloud.crt";
try {
System.out.print("Testing..");
final X509Certificate serverCert = (X509Certificate) CertUtils.getCertificate("C:\\ServiceCloud.crt");
System.out.println("Public Key "+serverCert.getPublicKey());
System.out.println("Tsted");

/* List serverCertList = CertUtils.getCertificate("C:\\Oracle\\Middleware\\Oracle_Home\\oracle_common\\jdk\\jre\\bin\\cacerts", "Welcome1", "mykey", "jks");
System.out.println("Tstedhu");
*/
List<CredentialProvider> credProviders = new ArrayList<CredentialProvider>();
String username = "username";
String password = "Password";
CredentialProvider cp = new ClientUNTCredentialProvider(username.getBytes(), password.getBytes());
credProviders.add(cp);


ClientInfoHeader clientInfoHeader = new ClientInfoHeader();
clientInfoHeader.setAppID("Hello");
System.out.println("Tsted2");
RightNowKnowledgeService rightNowKnowledgeService = new RightNowKnowledgeService();
RightNowKnowledgePort rightNowKnowledgePort = rightNowKnowledgeService.getRightNowKnowledgePort();
Map<String, Object> requestContext = ((BindingProvider) rightNowKnowledgePort).getRequestContext();
requestContext.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);

rightNowKnowledgePort.startInteraction("Hello", "10.0.0.0", "","");



} catch (Exception e) {
System.out.println("Caught");
e.printStackTrace();
}
} 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!