?? jsseappclient.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()); } */ }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -