<!-- received="Mon Oct 26 09:12:40 1998 PST" -->
<!-- sent="Mon, 26 Oct 1998 09:12:31 -0800 (PST)" -->
<!-- name="Jeff Nisewanger" -->
<!-- email="jdn@puuoo.eng.sun.com" -->
<!-- subject="RE: Secure Sockets API" -->
<!-- id="s630a5c2.051@ivisoft.com" -->
<!-- inreplyto="" -->
<title>Java Security Q&A Archive, Volume 3: RE: Secure Sockets API</title>
<h1>RE: Secure Sockets API</h1>
Jeff Nisewanger (<i>jdn@puuoo.eng.sun.com</i>)<br>
<i>Mon, 26 Oct 1998 09:12:31 -0800 (PST)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#1925">[ date ]</a><a href="index.html#1925">[ thread ]</a><a href="subject.html#1925">[ subject ]</a><a href="author.html#1925">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="1926.html">Jeff Nisewanger: "RE: Secure Sockets API"</a>
<li> <b>Previous message:</b> <a href="1924.html">Levinshtein, Gal: "RE: Secure Sockets API"</a>
<!-- nextthread="start" -->
</ul>
<!-- body="start" -->
	It's possible that the native methods library (libjssl.so or<br>
libjsafe.so depending upon which release) is not in your<br>
LD_LIBRARY_PATH on Solaris. For windows this would be jssl.dll or<br>
jsafe.dll.<br>
<p>
<p>
	Jeff<br>
	<br>
<p>
<i>&gt; Jeff, can you help me with this exception?</i><br>
<i>&gt; </i><br>
<i>&gt; javax.net.ssl.SSLException: Received fatal alert: handshake_failure (no</i><br>
<i>&gt; cipher suites in common)</i><br>
<i>&gt;    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:951)</i><br>
<i>&gt;    at sun.security.ssl.SSLSocketImpl.clearPipeline(SSLSocketImpl.java:684)</i><br>
<i>&gt;    at sun.security.ssl.SSLSocketImpl.write(SSLSocketImpl.java:437)</i><br>
<i>&gt;    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:71)</i><br>
<i>&gt;    at java.io.OutputStream.write(OutputStream.java:71)</i><br>
<i>&gt;    at sun.net.www.https.HttpsClient.doConnect(HttpsClient.java:329)</i><br>
<i>&gt;    at sun.net.www.http.HttpClient.openServer(HttpClient.java:268)</i><br>
<i>&gt;    at sun.net.www.http.HttpClient.openServer(HttpClient.java:313)</i><br>
<i>&gt;    at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:211)</i><br>
<i>&gt;    at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:215)</i><br>
<i>&gt;    at sun.net.www.https.HttpsClient.&lt;init&gt;(HttpsClient.java:229)</i><br>
<i>&gt;    at sun.net.www.https.HttpsClient.New(HttpsClient.java:242)</i><br>
<i>&gt;    at</i><br>
<i>&gt; sun.net.www.protocol.https.HttpsURLConnection.connect(HttpsURLConnection.jav</i><br>
<i>&gt; a:99)</i><br>
<i>&gt;    at</i><br>
<i>&gt; sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection</i><br>
<i>&gt; .java:407)</i><br>
<i>&gt;    at sunw.hotjava.doc.DocParser.run(DocParser.java:390)</i><br>
<i>&gt;    at java.lang.Thread.run(Thread.java:474)</i><br>
<i>&gt; </i><br>
<i>&gt; Details:</i><br>
<i>&gt; The application tries to open a HTTPS connection using the javax.net.ssl</i><br>
<i>&gt; library.  Here's the code snippet which uses the HotJava Bean Component:</i><br>
<i>&gt; </i><br>
<i>&gt; ====================================================</i><br>
<i>&gt; import java.awt.*;</i><br>
<i>&gt; </i><br>
<i>&gt; import sunw.hotjava.bean.HotJavaBrowserBean;</i><br>
<i>&gt; import sunw.hotjava.bean.AuthenticatorBean;</i><br>
<i>&gt; public class HTMLexample extends Frame</i><br>
<i>&gt; {</i><br>
<i>&gt; 	public HTMLexample()</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		// This code is automatically generated by Visual Cafe when</i><br>
<i>&gt; you add</i><br>
<i>&gt; 		// components to the visual environment. It instantiates and</i><br>
<i>&gt; initializes</i><br>
<i>&gt; 		// the components. To modify the code, only use code syntax</i><br>
<i>&gt; that matches</i><br>
<i>&gt; 		// what Visual Cafe can generate, or Visual Cafe may be</i><br>
<i>&gt; unable to back</i><br>
<i>&gt; 		// parse your Java file into its visual environment.</i><br>
<i>&gt; 		</i><br>
<i>&gt; 		//{{INIT_CONTROLS</i><br>
<i>&gt; 		setLayout(null);</i><br>
<i>&gt; 		setVisible(false);</i><br>
<i>&gt; 		setSize(864,763);</i><br>
<i>&gt; 		hotJavaBrowserBean1 = new</i><br>
<i>&gt; sunw.hotjava.bean.HotJavaBrowserBean();</i><br>
<i>&gt; 		try {</i><br>
<i>&gt; 			hotJavaBrowserBean1.setDocumentURL(new</i><br>
<i>&gt; java.net.URL("https://www.equities.dlj.com/cgi/login"));</i><br>
<i>&gt; 		}</i><br>
<i>&gt; 		catch (java.net.MalformedURLException error) { }</i><br>
<i>&gt; 		hotJavaBrowserBean1.setBounds(10,45,847,704);</i><br>
<i>&gt; 		add(hotJavaBrowserBean1);</i><br>
<i>&gt; 		authenticatorBean1 = new</i><br>
<i>&gt; sunw.hotjava.bean.AuthenticatorBean();</i><br>
<i>&gt; 		authenticatorBean1.setBounds(305,15,112,45);</i><br>
<i>&gt; 		add(authenticatorBean1);</i><br>
<i>&gt; 		setTitle("A Basic Application");</i><br>
<i>&gt; 		//}}</i><br>
<i>&gt; 		</i><br>
<i>&gt; 		//{{INIT_MENUS</i><br>
<i>&gt; 		//}}</i><br>
<i>&gt; 		</i><br>
<i>&gt; 		//{{REGISTER_LISTENERS</i><br>
<i>&gt; 		SymWindow aSymWindow = new SymWindow();</i><br>
<i>&gt; 		this.addWindowListener(aSymWindow);</i><br>
<i>&gt; 		//}}</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	public HTMLexample(String title)</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		this();</i><br>
<i>&gt; 		setTitle(title);</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt;     /**</i><br>
<i>&gt;      * Shows or hides the component depending on the boolean flag b.</i><br>
<i>&gt;      * @param b  if true, show the component; otherwise, hide the component.</i><br>
<i>&gt;      * @see java.awt.Component#isVisible</i><br>
<i>&gt;      */</i><br>
<i>&gt;     public void setVisible(boolean b)</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		if(b)</i><br>
<i>&gt; 		{</i><br>
<i>&gt; 			setLocation(50, 50);</i><br>
<i>&gt; 		}	</i><br>
<i>&gt; 		super.setVisible(b);</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	static public void main(String args[])</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		System.getProperties().put("http.proxyHost",</i><br>
<i>&gt; "170.61.49.220");</i><br>
<i>&gt; 		System.getProperties().put("http.proxyPort", "80");</i><br>
<i>&gt; </i><br>
<i>&gt;               	</i><br>
<i>&gt; 		(new HTMLexample()).setVisible(true);</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	public void addNotify()</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		// Record the size of the window prior to calling parents</i><br>
<i>&gt; addNotify.</i><br>
<i>&gt; 		Dimension d = getSize();</i><br>
<i>&gt; 		</i><br>
<i>&gt; 		super.addNotify();</i><br>
<i>&gt; 	</i><br>
<i>&gt; 		if (fComponentsAdjusted)</i><br>
<i>&gt; 			return;</i><br>
<i>&gt; 	</i><br>
<i>&gt; 		// Adjust components according to the insets</i><br>
<i>&gt; 		setSize(insets().left + insets().right + d.width,</i><br>
<i>&gt; insets().top + insets().bottom + d.height);</i><br>
<i>&gt; 		Component components[] = getComponents();</i><br>
<i>&gt; 		for (int i = 0; i &lt; components.length; i++)</i><br>
<i>&gt; 		{</i><br>
<i>&gt; 			Point p = components[i].getLocation();</i><br>
<i>&gt; 			p.translate(insets().left, insets().top);</i><br>
<i>&gt; 			components[i].setLocation(p);</i><br>
<i>&gt; 		}</i><br>
<i>&gt; 		fComponentsAdjusted = true;</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	// Used for addNotify check.</i><br>
<i>&gt; 	boolean fComponentsAdjusted = false;</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	//{{DECLARE_CONTROLS</i><br>
<i>&gt; 	sunw.hotjava.bean.HotJavaBrowserBean hotJavaBrowserBean1;</i><br>
<i>&gt; 	sunw.hotjava.bean.AuthenticatorBean authenticatorBean1;</i><br>
<i>&gt; 	//}}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	//{{DECLARE_MENUS</i><br>
<i>&gt; 	//}}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	class SymWindow extends java.awt.event.WindowAdapter</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		public void windowClosing(java.awt.event.WindowEvent event)</i><br>
<i>&gt; 		{</i><br>
<i>&gt; 			Object object = event.getSource();</i><br>
<i>&gt; 			if (object == HTMLexample.this)</i><br>
<i>&gt; 				Frame1_WindowClosing(event);</i><br>
<i>&gt; 		}</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; 	void Frame1_WindowClosing(java.awt.event.WindowEvent event)</i><br>
<i>&gt; 	{</i><br>
<i>&gt; 		setVisible(false);	// hide the Frame</i><br>
<i>&gt; 		dispose();			// free the system resources</i><br>
<i>&gt; 		System.exit(0);		// close the application</i><br>
<i>&gt; 	}</i><br>
<i>&gt; 	</i><br>
<i>&gt; </i><br>
<i>&gt; }</i><br>
<i>&gt; </i><br>
<i>&gt; Gal Levinshtein</i><br>
<i>&gt; Donaldson, Lufkin &amp; Jenrette</i><br>
<i>&gt; Equities Technology</i><br>
<i>&gt; (212) 892-3023</i><br>
<i>&gt; glevinshtein@dlj.com</i><br>
<i>&gt; </i><br>
<i>&gt; </i><br>
<i>&gt; &gt; -----Original Message-----</i><br>
<i>&gt; &gt; From:	Jeff Nisewanger [SMTP:jdn@puuoo.Eng.Sun.COM]</i><br>
<i>&gt; &gt; Sent:	Friday, October 23, 1998 7:40 PM</i><br>
<i>&gt; &gt; To:	java-security@java.Sun.COM; glevinshtein@dlj.com</i><br>
<i>&gt; &gt; Subject:	Re: Secure Sockets API </i><br>
<i>&gt; &gt; </i><br>
<i>&gt; &gt; </i><br>
<i>&gt; &gt; &gt; Where do I get a copy?</i><br>
<i>&gt; &gt; </i><br>
<i>&gt; &gt; 	The api is available at</i><br>
<i>&gt; &gt; <a href="http://java.sun.com/security/ssl/API_users_guide.html">http://java.sun.com/security/ssl/API_users_guide.html</a>.</i><br>
<i>&gt; &gt; 	</i><br>
<i>&gt; &gt; 	</i><br>
<i>&gt; &gt; 	</i><br>
<i>&gt; &gt; 	Jeff</i><br>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="1926.html">Jeff Nisewanger: "RE: Secure Sockets API"</a>
<li> <b>Previous message:</b> <a href="1924.html">Levinshtein, Gal: "RE: Secure Sockets API"</a>
<!-- nextthread="start" -->
</ul>
