  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | SSLSocket | SSLSocket 2005-07-04 - By Duc Vo
Back Normally I'll import it to a custom keystore file, e.g. (import to file mykeystore.jks with keytool)
keytool -import -trustcacerts -file EIS_CAcert.pem -alias EISCA -keystore mykeystore.jks
When prompted for a password just enter some password (will be used for updating this keystore later if needed).
When prompted if you trust the certificate, say yes.
Then set the System property "javax.net.ssl.trustStore" with that custom keystore before making any connection, e.g. (Java code)
System.setProperty("javax.net.ssl.trustStore", "mykeystore.jks");
NOTE: I've assumed that all files are on the same path (e.g. safe to use just the file name)
__ ____ ____ ____ ____ ____ ____
From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] On Behalf Of Taco Fleur Sent: Tuesday, 5 July 2005 9:32 AM To: J2EE-INTEREST@(protected) Subject: SSLSocket
I am trying to implement the SSLSocket class, when running the class I got the following error:
Error sun.security.validator.ValidatorException: No trusted certificate found
The people I am trying to communicate with only sent me a .key file, and they send me a link to their certificate http://edge1.asic.gov.au/edge/test/EIS_CAcert.pem
I am a complete newbie to Java, I used the keytool to import the key, just gave it an arbitrary name, not sure if I need to give it a specific name?
Also not sure whether I need to import the certificate EIS_CAcert.pem, and if so, how would I go about doing that?
__ ____ ____ ____ ____ ____ ____
Taco Fleur - E-commerce Development Manager
Shelco Searches & Services
An Authorised ASIC Information Broker
www.shelco.com.au
Ph: + 61 7 3236 2605
======================================================================== === To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft -com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http: //www.w3.org/TR/REC-html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <style> <!-- /* Font Definitions */ @(protected) {font-family:Tahoma; panose-1 (See http://ose-1.ora-code.com):2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} h1 {margin-top:12.0pt; margin-right:0cm; margin-bottom:3.0pt; margin-left:0cm; text-indent:0cm; page-break-before:always; page-break-after:avoid; mso-list:l0 level1 lfo1; punctuation-wrap:simple; text-autospace:none; font-size:16.0pt; font-family:Arial;} p.MsoFooter, li.MsoFooter, div.MsoFooter {margin:0cm; margin-bottom:.0001pt; punctuation-wrap:simple; text-autospace:none; font-size:10.0pt; font-family:Arial;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {margin:0cm; margin-bottom:.0001pt; punctuation-wrap:simple; text-autospace:none; font-size:10.0pt; font-family:"Courier New";} p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} p.TableText, li.TableText, div.TableText {margin-top:3.0pt; margin-right:0cm; margin-bottom:3.0pt; margin-left:0cm; mso-element:frame; font-size:12.0pt; font-family:"Times New Roman";} p.DocumentTitle, li.DocumentTitle, div.DocumentTitle {margin:0cm; margin-bottom:.0001pt; text-align:center; font-size:16.0pt; font-family:"Times New Roman"; color:red; font-weight:bold;} p.GarradinPortfolio, li.GarradinPortfolio, div.GarradinPortfolio {margin:0cm; margin-bottom:.0001pt; text-align:right; font-size:16.0pt; font-family:"Times New Roman"; color:red; font-weight:bold;} p.bodytext, li.bodytext, div.bodytext {margin-top:12.0pt; margin-right:0cm; margin-bottom:0cm; margin-left:2.0cm; margin-bottom:.0001pt; punctuation-wrap:simple; text-autospace:none; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle26 {mso-style-type:personal; font-family:Arial; color:windowtext;} span.EmailStyle27 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @(protected) Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} /* List Definitions */ @(protected) l0 {mso-list-id:1579899885; mso-list-template-ids:601158946;} @(protected) l0:level1 {mso-level-style-link:"Heading 1"; mso-level-tab-stop:14.2pt; mso-level-number-position:left; margin-left:0cm; text-indent:0cm;} @(protected) l0:level2 {mso-level-text:"%1\.%2\."; mso-level-tab-stop:14.2pt; mso-level-number-position:left; margin-left:39.6pt; text-indent:-39.6pt;} @(protected) l0:level3 {mso-level-text:"%1\.%2\.%3\."; mso-level-tab-stop:14.2pt; mso-level-number-position:left; margin-left:61.2pt; text-indent:-61.2pt;} @(protected) l0:level4 {mso-level-text:"%1\.%2\.%3\.%4\."; mso-level-tab-stop:180.0pt; mso-level-number-position:left; margin-left:86.4pt; text-indent:-32.4pt;} @(protected) l0:level5 {mso-level-text:"%1\.%2\.%3\.%4\.%5\."; mso-level-tab-stop:216.0pt; mso-level-number-position:left; margin-left:111.6pt; text-indent:-39.6pt;} @(protected) l0:level6 {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\."; mso-level-tab-stop:270.0pt; mso-level-number-position:left; margin-left:136.8pt; text-indent:-46.8pt;} @(protected) l0:level7 {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\."; mso-level-tab-stop:324.0pt; mso-level-number-position:left; margin-left:162.0pt; text-indent:-54.0pt;} @(protected) l0:level8 {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\."; mso-level-tab-stop:360.0pt; mso-level-number-position:left; margin-left:187.2pt; text-indent:-61.2pt;} @(protected) l0:level9 {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9\."; mso-level-tab-stop:414.0pt; mso-level-number-position:left; margin-left:216.0pt; text-indent:-72.0pt;} ol {margin-bottom:0cm;} ul {margin-bottom:0cm;} --> </style>
</head>
<body lang=EN-AU link=blue vlink=purple>
<div class=Section1>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Normally I’ll import it to a custom keystore file, e.g. (import to file mykeystore.jks with keytool) <o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>keytool -import -trustcacerts -file EIS_CAcert.pem -alias EISCA -keystore mykeystore.jks<o:p>< /o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>When prompted for a password just enter some password (will be used for updating this keystore later if needed).<o:p>< /o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>When prompted if you trust the certificate, say yes.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Then set the System property “javax .net.ssl.trustStore” with that custom keystore before making any connection, e.g. (Java code)<o:p>< /o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>System .setProperty("javax.net.ssl.trustStore", "mykeystore.jks"); <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>NOTE: I’ve assumed that all files are on the same path (e.g. safe to use just the file name) <o:p></o:p></span>< /font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3 face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font ></b><font size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'> A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] <b><span style='font-weight:bold'>On Behalf Of </span></b>Taco Fleur<br> <b><span style='font-weight:bold'>Sent:</span></b> Tuesday, 5 July 2005 9:32 AM <br> <b><span style='font-weight:bold'>To:</span></b> J2EE-INTEREST@(protected)<br> <b><span style='font-weight:bold'>Subject:</span></b> SSLSocket</span></font> <span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size: 12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>I am trying to implement the SSLSocket class, when running the class I got the following error:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face=Arial><span lang=EN-US style='font-size:12.0pt;font-family:Arial;color:black'>Error sun.security.validator.ValidatorException: No trusted certificate found</span>< /font><font size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face=Arial><span lang=EN-US style='font-size: 12.0pt;font-family:Arial'>The people I am trying to communicate with only sent me a .key file, and they send me a link to their certificate<br> </span></font><font size=2 color=black face=Arial><span lang=EN-US style='font-size:11.0pt;font-family:Arial;color:black'>http://edge1.asic.gov.au /edge/test/EIS_CAcert.pem<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>I am a complete newbie to Java, I used the keytool to import the key, just gave it an arbitrary name, not sure if I need to give it a specific name?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>Also not sure whether I need to import the certificate </span></font><font size=2 color=black face=Arial><span lang=EN-US style='font-size:11.0pt;font-family:Arial;color:black'>EIS_CAcert.pem, and if so, how would I go about doing that?</span></font><font size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font> </p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>__ ____ ____ ____ ____ ____ ____<o:p></o:p></span>< /font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>Taco Fleur - <i><span style='font-style:italic'>E -commerce Development Manager</span></i><o:p></o:p></span></font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>Shelco Searches & Services<o:p></o:p></span>< /font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>An Authorised ASIC Information Broker<o:p></o:p>< /span></font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'><a href="www.shelco.com.au">www.shelco.com.au</a><o:p ></o:p></span></font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span lang=EN-US style='font-size: 10.0pt;font-family:Arial'>Ph: + 61 7 3236 2605<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html> =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <p> =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <p>
|
|
 |