Hi All,
I am new to this forum and also new to java. No idea is it the right place to ask this question. I have one sipxecs server. I want to access restful services of that server. So i used jersey api in following way:
SSLContext ctx=null;
try {
KeyStore trustStore;
trustStore = KeyStore.getInstance("JKS");
trustStore.load(new FileInputStream("c:\\keystore.jks"),"abcd1234".toC harArray());
TrustManagerFactory tmf=TrustManagerFactory.getInstance("SunX509");
ctx = SSLContext.getInstance("SSL");

ctx.init(null, tmf.getTrustManagers(), null); }
catch (NoSuchAlgorithmException e1) { e1.printStackTrace(); }
// catch (KeyStoreException e) { e.printStackTrace(); }
// catch (CertificateException e) { e.printStackTrace(); }
catch (FileNotFoundException e) { e.printStackTrace(); }
catch (IOException e) { e.printStackTrace(); }
// catch (KeyManagementException e) { e.printStackTrace(); }

ClientConfig config=new DefaultClientConfig();
config.getProperties().put(HTTPSProperties.PROPERT Y_HTTPS_PROPERTIES, new HTTPSProperties(null,ctx));
WebResource service=Client.create().resource("https://200:1234@");

service.addFilter(new HTTPBasicAuthFilter("superadmin","1234"));

ClientResponse response = service.get(ClientResponse.class);
int status = response.getStatus();
String textEntity = response.getEntity(String.class);


My server is running on with ssl enabled. If I try to access server with "https" I get "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?".

I tried to access server with "http" and get "403 forbidden" response. Can anyone kindly suggest me what should be the proper way to handle this. Did I made any mistake in installing ssl certificate in client machine?
Kindly help.
Thanks in advance.