• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

SSL and Apache

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want a java client application(not a browser) to send request to apache ssl server.I have created a certificate in the server.Could someone tell the steps that need to be done at the client location so that a SSL handshake error be avoided?
Thanks in advance
Sangeetha
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In ur ClientApplication u implement the RMISSLClientSocketFactory and override the createSocket Method.
Iam giving a snippet of the code below
"
public Socket createSocket(String theHost, int thePort) throws IOException {
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
//setting system properties for trust store and keystore
setSystemPropertiesForKeyStore();

SSLSocketFactory socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) socketFactory.createSocket(theHost, thePort);
return socket;
}
"
In setSystemPropertiesForKeyStore() u set the set property for the Keystore path,keystorepassword ,truststore location ,truststore password
Juz like below
" System.setProperty("javax.net.ssl.keyStore", keyStoreFileLocation);"
I hope this will help u
Have a great Day
Regs
Kathir
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic