  | 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 Taco
Back I tried that and got
keytool error: java.lang.Exception: Input not an X.509 certificate
C:\Temp>keytool -import -trustcacerts -file C:\j2sdk1.4.2_05\jre\lib\security\EIS_CAcert.pem -alias EISCA -keystore mykeystore.jks
Enter keystore password: xxxxxx
What I did was access the URL http://edge1.asic.gov.au/edge/test/EIS_CAcert.pem saved it in the above directory and then run the command line tool as you suggested.
__ __
From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] On Behalf Of Duc Vo Sent: Tuesday, 5 July 2005 10:13 AM To: J2EE-INTEREST@(protected) Subject: Re: SSLSocket
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)
=========================================================================== 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".
=========================================================================== 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 lfo2; 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; 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.EmailStyle24 {mso-style-type:personal; font-family:Arial; color:windowtext;} span.EmailStyle25 {mso-style-type:personal; font-family:Arial; color:navy;} span.EmailStyle26 {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-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>I tried that and got<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'>keytool error: java.lang.Exception: Input not an X.509 certificate<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'>C:\Temp>keytool -import -trustcacerts -file C:\j2sdk1.4.2_05\jre\lib\security\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'>Enter keystore password: xxxxxx<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'>What I did was access the URL </span>< /font><font size=2 color=black face=Arial><span style='font-size:11.0pt;font-family:Arial; color:black'><a href="http://edge1.asic.gov.au/edge/test/EIS_CAcert.pem">http:/ /edge1.asic.gov.au/edge/test/EIS_CAcert.pem</a> saved it in the above directory and then run the command line tool as you suggested.</span></font><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'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3 face="Times New Roman"><span 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 style='font-size:10.0pt; font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span 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>Duc Vo<br> <b><span style='font-weight:bold'>Sent:</span></b> Tuesday, 5 July 2005 10:13 AM<br> <b><span style='font-weight:bold'>To:</span></b> J2EE-INTEREST@(protected)<br> <b><span style='font-weight:bold'>Subject:</span></b> Re: SSLSocket</span>< /font><o:p></o:p></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>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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 lang=EN-AU 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>
<p class=MsoNormal><font size=3 face="Times New Roman"><span 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> =========================================================================== 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>
|
|
 |