• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

SSLHandshakeException

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a certificate but I keep on getting the exception below.

javax.net.ssl.SSLHandshakeException: unknown certificate
at com.ibm.jsse.bv.a(Unknown Source)
at com.ibm.jsse.bv.startHandshake(Unknown Source)
at com.guidant.apm.lpi.parser.HttpsSample2.main(HttpsSample2.java:84)

My sample code is below.

How do I (client) authenticate my self to the server with the certificate. Any help will be appreciated.

InputStream inStream = new FileInputStream("C:\\LPIworkspace\\LPI\\cert\\Paceart.cer");

CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) cf.generateCertificate(inStream);
inStream.close();
pub = (RSAPublicKey) cert.getPublicKey();
int port = 443;
String hostname = "emr-paceart";
SocketFactory socketFactory = SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket)socketFactory.createSocket(hostname, port);
socket.startHandshake();
 
It runs on an internal combustion engine. This ad does not:
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