[an error occurred while processing this directive] [an error occurred while processing this directive]
|
[an error occurred while processing this directive]
JSSE DocumentationCommon QuestionsQ: My JSSE program gives one of the following errors: Exception in thread "main" java.net.SocketException: no SSL Server Sockets Exception in thread "main" java.net.SocketException: SSL implementation not available A: You must register the Cryptographic Service Provider in your code, as detailed in the API Users Guide. To do so, add the following lines to your program: import java.security.*;with the other import statements and Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());after the declaration of main. See below a working example of the URLReader.java sample (more samples can be found in /usr/local/pkg/jsse). Also notice the System.setProperty call which is required. See the API Users Guide and API Documentation for more information.
/*
* @(#)URLReader.java 1.1 99/10/06
*
* Copyright 1995-1998 by Sun Microsystems, Inc.,
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information
* of Sun Microsystems, Inc. ("Confidential Information"). You
* shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with Sun.
*/
import java.net.*;
import java.io.*;
import java.security.*;
/*
* This example illustrates using a URL to access resources
* on a secure site.
*
* To use Sun's reference implementation of HTTPS protocol, Please set
* the following Java system property:
*
* java.protocol.handler.pkgs = com.sun.net.ssl.internal.www.protocol
*
* If you are running inside a firewall, please also set the following
* Java system properties to the appropriate value:
*
* https.proxyHost =
Q: My program gives the following error: Exception in thread "main" java.net.MalformedURLException: unknown protocol: https A: You must specify an implementation of the HTTPS protocol by including the following line in your code: System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
See above for an example. See the API Users Guide for more information.
|
[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] |