⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsseappclient.java

📁 J2EE & Tomcat books published by hope
💻 JAVA
字号:
/* * JsseAppClient.java * * Created on March 13, 2002, 5:27 PM *//*  Servlet for JSSE regression testing *//* @author James Cai */package com.sun.j2ee.workflow.control.web;import java.io.*;import java.net.*;import java.util.*;import java.applet.*;import javax.net.*;import javax.net.ssl.*;import java.security.*;import com.sun.net.ssl.*;/** * * @author  cai * @version  */public class JsseAppClient {    /** Creates new JsseAppClient */    public JsseAppClient() {    }    /**    * @param args the command line arguments    */    public static void main (String args[]) {                HttpsURLConnection ucon = null;            try{	           //URL url = new URL("https://www.verisign.com/product/badfile");                java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());	           URL url = new URL("https://129.145.133.189:8443/workflow/jsp/jsseerror.jsp");		   System.out.println( " URL Accessed " + url.toString());                   ucon = (HttpsURLConnection) url.openConnection();                   ucon.connect();                   try{                        System.out.println(" Response code " + ucon.getResponseCode());                   }catch(IOException ex){                       System.out.println(" ErrorMessage from getMessage ==" 							+ ex.getMessage());		   }                   System.out.println(" Response code2 " + ucon.getResponseCode());                   BufferedReader bin = 		       new BufferedReader(new InputStreamReader(ucon.getErrorStream()));                   String result1 = bin.readLine();		   System.out.println(" getError " + result1);		   bin.close();                   ucon.disconnect();                }catch(Exception exp) {                    exp.printStackTrace();                }                                /*        	try{                                                System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");                            //Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());                            URL jsseurl = new URL("https://129.145.133.189:8443/workflow/jsp/JsseResponse.jsp");                            //                            HttpsURLConnection con = (HttpsURLConnection)jsseurl.openConnection();                            HttpURLConnection con = (HttpURLConnection)jsseurl.openConnection();                            con.setAllowUserInteraction(true);                             int recode = con.getResponseCode();                            System.out.println("Response from HTTPS: " + recode);                        }                        catch (Exception ex)                        {                            System.out.println(ex.toString());                        }                 */    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -