cxf accept the one-way server-side SSL authentication

2008-08-11  来源:本站原创  分类:Java  人气:327 

Important URL:
http://old.nabble.com/jaxws-ssl-client-that-accepts-all-certificates-td16826257.html
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html
The first is the official wiki, this certification process to add structure and detail through the configuration of the CXF support for SSL
The second parameter to which this configuration

package com.cxf.client;

import java.util.Iterator;
import java.util.List;

import javax.net.ssl.TrustManager;
import javax.xml.namespace.QName;

import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public final class Client {

    private Client() {
    }

    public static void main(String args[]) throws Exception {
        ClassPathXmlApplicationContext context
            = new ClassPathXmlApplicationContext(new String[] {"com/cxf/client/client-beans.xml"});
        ICardInfoWebService client = (ICardInfoWebService)context.getBean("client");
//-------------------------------------------------------
                org.apache.cxf.endpoint.Client proxy = ClientProxy.getClient(client);
                HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
                TLSClientParameters tls= new TLSClientParameters();
        tls.setTrustManagers( new TrustManager[]{ new TrustAllX509TrustManager()});
        tcp.setDisableCNCheck(true);// Accept the server-side authentication
        conduit.setTlsClientParameters(tcp);
//-------------------------------------------------------
List<TxnDtlAccountVo> list = client.findTxnDtlAccountInfo(txnDtlAccountVo);
        }
}

Configuration file com / cxf / client / client-beans.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: beans -->
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">

    <bean
      factory-bean="clientFactory" factory-method="create"/>
        <bean>
<property name="serviceClass" value="com.cxf.client.ICardInfoWebService"/>
<property name="address" value="https://127.0.0.1:8443/manage/services/myWebService"/>
        </bean>
</beans>
相关文章
  • CXF 2.2.7 build server 2010-12-22

    CXF 2.2.7 build server Although HIE using a AXIS1.4, but HAE is apache with the CXF, in order to properly verify the compatibility (though the former two to find out I had completely compatible version of the program, but still need to ensure that in

  • Principles of single two-way SSL authentication (switch) 2010-06-07

    Key points Two-way SSL handshake SSL certificate verification structure SSL authentication in order to facilitate a better awareness and understanding of SSL protocol, here focuses on SSL protocol handshake protocol. SSL protocol uses both public key

  • cxf accept the one-way server-side SSL authentication 2008-08-11

    Important URL: http://old.nabble.com/jaxws-ssl-client-that-accepts-all-certificates-td16826257.html http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html The first is the official wiki, this certification process to add st

  • 一个简单的SSL Server和SSL Client来讲解Java环境下SSL的通信原理 2014-11-03

    首先我们先回顾一下常规的Java Socket编程.在Java下写一个Socket服务器和客户端的例子还是比较简单的.以下是服务端的代码: Java代码 package org.bluedash.tryssl; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerS

  • Clever selection of a server certificate: SSL server certificate encryption strength 2010-07-12

    SSL technology overview Worldwide, Secure Socket Layer Secure Sockets Layer (referred to as SSL) is the most basic network security, the safety standards. SSL protocol for encrypting sensitive data makes the true message recipients to read the releva

  • windows installed on Apache's SVN server (including SSL configuration) 2010-07-14

    1. Introduction 2. Installation 2.1. Install Apache 2.2. Install Subversion 2.3. Configuration 2.4. To use SSL to protect your server Summary This article is TortoiseSVN1.3.5 to help configure the server on a translation, wording needs to be done acc

  • Nginx client / server two-way SSL certificate authentication configuration 2011-03-18

    1, ready to work: openssl and nginx (Note the use of compiler option - with-http_ssl_module support ssl) 2, the root certificate new_ca.sh demoCA this script creates a directory and the root certificate file, followed by the signing of the certificat

  • axis and cxf cxf client access to the server and Frequently Asked Questions 2011-09-16

    A brief introduction on a blog axis2 axis2 service and CXF client-side access, including access to complex types such as pass object parameters. Benpian blog further on the basis of the previous one axis Detailed CXF and CXF server for access to, and

  • FTP Server via SSL port 990 2014-03-05

    这里太详细了:http://www.isaserver.org/articles-tutorials/articles/How_the_FTP_protocol_Challenges_Firewall_Security.html 这里是有人发问:http://forums.isaserver.org/FTP_Server_via_SSL_port_990/m_220025500/tm.htm

  • One-way SSL authentication article Tomcat Java implementation 2010-05-15

    One-way authentication, the client only the authentication server's certificate, the server does not verify the client certificate. We only need to generate server-side keystore. 1. In jks format generated server-side includes Public key and Private

  • SSL / TLS / WTLS principle 2011-10-18

    An Introduction First, to clarify confusion about the name: 1 SSL (Secure Socket Layer) is designed mainly for netscape web-safe transport protocol. This agreement was obtained on the WEB Wide range of applications. 2 IETF (www.ietf.org) made the SSL

  • Symbian mobile client SSL reform program research - to create activities based on main thread and the SSL server object interaction model 2010-05-30

    Symbian mobile client SSL research Reform Programme - Create activities based on main thread and the SSL server object interaction model 1 directory 1 Contents 2 2 Overview 3 2.1 Noun 3 2.2 Option 3 Feasibility Analysis 3 4 3.1 Active Objects and Eve

  • JavaMail configuration and installation of SSL server certificates 2010-03-31

    Customers to the mail server to SSL, using Spring's JavaMailSenderImpl, Spring configuration as follows <bean> <property name="host" value="${mail.smtp.host}" /> <property name="username" value="${mail.smt

  • Skillfully selected server certificate 3: SSL server certificate quality articles 2010-07-12

    Security encryption, authentication and indispensable Certification by a third party CA digital certificate issued by the web server (SSL certificate) as a mature security technology is widely used on the Internet. Why should third-party CA digital c

  • VeriSign 128 type of SSL server certificates mandatory (VeriSign Secure Site Pro) 2010-11-12

    Server Certificate | SSL Certificate | EV SSL Certificates | Code Signing Certificates | SSL Digital Certificates | Microsoft Logo Certification | SSL Digital Signature | Digital Signature Certificate | Microsoft Code Signing Certificate - VeriSign a

  • VeriSign 128 EV SSL server certificate type force (VeriSign Secure Site Pro with EV) 2010-11-12

    Server Certificate | SSL Certificate | EV SSL Certificates | Code Signing Certificates | SSL Digital Certificates | Microsoft Logo Certification | SSL Digital Signature | Digital Signature Certificate | Microsoft Code Signing Certificate - VeriSign a

  • CXF client access to the axis server 2011-09-14

    CXF and webservice axis are very good technical framework. Recent projects need to understand a little visit to the two frameworks. First talk about axis2 axis2 client access to the server used in two ways: 1 way to use call import org.apache.axis.cl

  • apache cxf-line reading (http://cxf.apache.org/docs/jax-rs.html) 2010-04-11

    Apache CXF Apache CXF Documentation> Index> RESTful Services> JAX-RS Download | Documentation Overview How-Tos Frontends DataBindings Transports Configuration Debugging and Logging Tools RESTful Services WSDL Bindings Service Routing Dynamic Lang

  • SSL mutual authentication java implementation 2010-05-09

    In this paper, simulation scenario describes two-way SSL authentication java implementation By default, I think that readers already have some knowledge of principles of SSL, so the article on the principle of SSL, do not do detail. If there is such

  • Introduction to SSL VPN 2010-12-14

    SSL VPN uses SSL and proxy technology to end users of the Hypertext Transfer Protocol (HTTP), client / server and file sharing applications such as a secure access to authorized remote access technology, so no need to install special client software.