RE: Secure Sockets API

Jeff Nisewanger (jdn@puuoo.eng.sun.com)
Mon, 26 Oct 1998 09:12:31 -0800 (PST)

It's possible that the native methods library (libjssl.so or
libjsafe.so depending upon which release) is not in your
LD_LIBRARY_PATH on Solaris. For windows this would be jssl.dll or
jsafe.dll.

Jeff

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