Jump to Navigation

Me on Twitter

  • As an IT engineer, it really makes me sad to see how much memes pictures are actually just text with a colored background... 16 weeks 3 days ago
  • RT @scottywrotem: Stuck this to the window and now the world makes more sense. https://t.co/3F66ilzr7x 17 weeks 1 day ago
  • RT @NaturelsLit: Bird just hit the edge of the map https://t.co/U9ruDPwJBZ 17 weeks 1 day ago
  • RT @framaka: [Mais pourquoi n'y a-t-on pas pensé tout seul avant ?] Quand @Scaleway_fr (Iliad/Free de Xavier Niel) montre en urgence le lib… 17 weeks 1 day ago
  • https://t.co/lYgoKV0jIZ #agile https://t.co/VGWfxTKm46 17 weeks 5 days ago
  • RT @kevcecil: As the city empties, our indigenous wildlife is coming down from the mountains around London. Nature will find a way. https:/… 17 weeks 5 days ago
  • It's something like 1 full month of #coronavirus already and @Dilbert_Daily still doesn't talk about it. It's absol… https://t.co/JpQnoEv0uC 17 weeks 6 days ago
  • RT @jenniferbaer: Hi. I designed some coronavirus travel posters for you. Stay the F* home. Love you all. https://t.co/mzY52GFm6Z 18 weeks 1 day ago
  • RT @policedutweet: On en est là parce qu’un type a bouffé du pangolin. Je vois pas ce qui pourrait merder en proposant comme remède de la b… 18 weeks 2 days ago
  • RT @yann_bonnet: Ultimate Medical Hackathon: How fast can we design and deploy an Open source ventilator? >> https://t.co/U8pmAMe4CV #COVID… 19 weeks 3 days ago

apache commons

java HttpClient 3.x : a portable SSL Socket Factory implementation

I was just trying to implement client and server authentication over SSL on IBM Websphere 6 (JRE 1.4.2)...


It may sound awkward in 2012, but if you wish the HTTPS server to identify your Java client (versus : only the server is identified), you will have to write your own implementation of a socket factory.

The Java Runtime Environment doesn't provide ready-to-use classes to do this. Yes : there is javax.net.ssl.SSLSocketFactory.getDefault() but it requires to set some system (therefore global) properties to point to the certificates files !!!

Even with Apache's HttpClient (at least version 3.x), you have to use a custom SSLProtocolSocketFactory.

The HttpClient SSL Guide provides sample code to implement mutual client and server authentication ; unfortunately the latest stable release of it (contrib 3.1) is bound to Sun's API with imports such as com.sun.net.ssl.KeyManagerFactory. Needless to say that this will not work on an IBM Websphere JRE...

This article contains an implementation of a SSLProtocolSocketFactory for HttpClient, to whom may be interested...

Syndicate content