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