Package org.glassfish.jersey.client

Examples of org.glassfish.jersey.client.SslConfig


            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
View Full Code Here


            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.property(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
View Full Code Here

            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.configuration().setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.configuration().register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
View Full Code Here

            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.property(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
View Full Code Here

        do {
            Metrix.event("doRestCommand() - about to create target");
            WebTarget target = createTarget(uri);
            Metrix.event("doRestCommand() - about to configure security");
            target.configuration().setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(host), getSslContext()));
            /*
             * Any code that wants to trigger a retry will say so explicitly.
             */
            shouldTryCommandAgain = false;
            try {
View Full Code Here

        do {
            Metrix.event("doRestCommand() - about to create target");
            WebTarget target = createTarget(uri);
            Metrix.event("doRestCommand() - about to configure security");
            target.property(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(host), getSslContext()));
            /*
             * Any code that wants to trigger a retry will say so explicitly.
             */
            shouldTryCommandAgain = false;
            try {
View Full Code Here

        @Override
        public boolean verify( String hostname, SSLSession session ) {
          return true;
        }
      };
      SslConfig sslConfig = new SslConfig( verifier, ctx );
      config.setProperty( ClientProperties.SSL_CONFIG, sslConfig );
    } catch( Exception shouldNotHappen ) {
      throw new IllegalStateException( shouldNotHappen );
    }
    return config;
View Full Code Here

        do {
            Metrix.event("doRestCommand() - about to create target");
            WebTarget target = createTarget(uri);
            Metrix.event("doRestCommand() - about to configure security");
            target.configuration().setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(host), getSslContext()));
            /*
             * Any code that wants to trigger a retry will say so explicitly.
             */
            shouldTryCommandAgain = false;
            try {
View Full Code Here

        do {
            Metrix.event("doRestCommand() - about to create target");
            WebTarget target = client.target(uri);
            Metrix.event("doRestCommand() - about to configure security");
            target.configuration().setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(host), getSslContext()));
            /*
             * Any code that wants to trigger a retry will say so explicitly.
             */
            shouldTryCommandAgain = false;
            try {
View Full Code Here

     * Use SSL to authenticate
     */
    private void addAuthenticationInfo(Client client, WebTarget resourceBuilder, Server server, ServiceLocator habitat) {
        SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
        //Instruct Jersey to use HostNameVerifier and SSLContext provided by us.
        client.setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(server.getAdminHost()),
                habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), "TLS" ))); //TODO need to get hardcoded "TLS" from corresponding ServerRemoteAdminCommand constant);
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.client.SslConfig

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.