访问配置了https的hessian

tomcat下simple配置了https协议
HessianProxyFactory factory = new HessianProxyFactory();
		try {
			System.setProperty("java.protocol.handler.pkgs", "javax.net.ssl");

		     HostnameVerifier hv = new HostnameVerifier() {
		          public boolean verify(String urlHostName, SSLSession session) {
		           return urlHostName.equals(session.getPeerHost());
		          }
		     };
		    
		     HttpsURLConnection.setDefaultHostnameVerifier(hv);
		     SimpleService service = (SimpleService)factory.create(SimpleService.class, "https://127.0.0.1/simple/service");
		     System.out.println(service.sayHello());
			
			
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}


设置jvm参数
-Djavax.net.ssl.keyStore=/opt/web/conf/server.ks -Djavax.net.ssl.keyStorePassword=652341

你可能感兴趣的:(java,jvm,tomcat,.net,Web)