Package org.wiztools.restclient.bean

Examples of org.wiztools.restclient.bean.SSLReqBean


        RequestBean expResult = new RequestBean();
        expResult.setUrl(new URL("https://www.webshop.co.uk/"));
        expResult.setMethod(HTTPMethod.GET);
        expResult.setHttpVersion(HTTPVersion.HTTP_1_1);
        expResult.setFollowRedirect(true);
        SSLReqBean ssl = new SSLReqBean();
        ssl.setTrustSelfSignedCert(true);
        ssl.setHostNameVerifier(SSLHostnameVerifier.ALLOW_ALL);
        expResult.setSslReq(ssl);
       
        Request actual = XMLUtil.getRequestFromXMLFile(new File("src/test/resources/reqSsl.rcq"));
       
        assertEquals(expResult, actual);
View Full Code Here


    // SSL - key store
    @Inject private KeyStorePanel jp_keystore;

    @Override
    public SSLReq getSslReq() {
        SSLReqBean out = new SSLReqBean();
       
        out.setHostNameVerifier((SSLHostnameVerifier) jcb_ssl_hostname_verifier.getSelectedItem());
        out.setTrustSelfSignedCert(jcb_ssl_trust_self_signed_cert.isSelected());
       
        SSLKeyStore trustStore = jp_truststore.getKeyStore();   
        out.setTrustStore(trustStore);
       
        SSLKeyStore keyStore = jp_keystore.getKeyStore();
        out.setKeyStore(keyStore);

        return out;
    }
View Full Code Here

       
        return eSsl;
    }
   
    static SSLReq getSslReq(Element eSsl) {
        SSLReqBean out = new SSLReqBean();
       
        Elements eChildren = eSsl.getChildElements();
        for(int i=0; i<eChildren.size(); i++) {
            Element e = eChildren.get(i);
            final String name = e.getLocalName();
            if(null != name) switch (name) {
                case "trust-self-signed-cert":
                    out.setTrustSelfSignedCert(true);
                    break;
                case "hostname-verifier":
                    out.setHostNameVerifier(SSLHostnameVerifier.valueOf(e.getValue()));
                    break;
                case "keystore":
                    final SSLKeyStoreBean keyStore = new SSLKeyStoreBean();
                    { // type:
                        final String typeStr = e.getAttributeValue("type");
                        if(StringUtil.isNotEmpty(typeStr))
                            keyStore.setType(KeyStoreType.valueOf(typeStr));
                    }
                    keyStore.setFile(new File(e.getAttributeValue("file")));
                    keyStore.setPassword(Util.base64decode(e.getAttributeValue("password")).toCharArray());
                    out.setKeyStore(keyStore);
                    break;
                case "truststore":
                    final SSLKeyStoreBean trustStore = new SSLKeyStoreBean();
                    { // type:
                        final String typeStr = e.getAttributeValue("type");
                        if(StringUtil.isNotEmpty(typeStr))
                            trustStore.setType(KeyStoreType.valueOf(typeStr));
                    }
                    trustStore.setFile(new File(e.getAttributeValue("file")));
                    trustStore.setPassword(Util.base64decode(e.getAttributeValue("password")).toCharArray());
                    out.setTrustStore(trustStore);
                    break;
            }
        }
       
        return out;
View Full Code Here

TOP

Related Classes of org.wiztools.restclient.bean.SSLReqBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.