Examples of TrustStrategy


Examples of org.apache.http.conn.ssl.TrustStrategy

            e.printStackTrace();
        }

        // tell http/https proxies to reload plugins
        try {
            org.apache.http.conn.ssl.SSLSocketFactory sslsf = new org.apache.http.conn.ssl.SSLSocketFactory(new TrustStrategy() {
                @Override
                public boolean isTrusted(
                        final X509Certificate[] chain, String authType) throws CertificateException {
                    // ignore SSL cert issues
                    return true;
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

        if (!"https".equalsIgnoreCase(targetURL.getProtocol())) {
            return;
        }

        final TrustStrategy trustStrategy = httpsCertTrustStrategy.getStrategy();
        final X509HostnameVerifier hostnameVerifier = httpsHostnameVerifyStrategy.getVerifier();
        final SSLSocketFactory socketFactory = new SSLSocketFactory(trustStrategy, hostnameVerifier);
        final Scheme sch = new Scheme("https", 443, socketFactory);
        httpclient.getConnectionManager().getSchemeRegistry().register(sch);
    }
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

  }

  public static HttpClient newClient() {
    SSLContext sslContext = SSLContexts.createDefault();
    try {
      sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
        public boolean isTrusted(X509Certificate[] chain, String authType)
            throws CertificateException {
          return true;
        }
      }).build();
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

     * @throws KeyManagementException
     *
     */
    public void ignoreSSLIssues()
        throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException{
        TrustStrategy trustStrat = new TrustStrategy(){
            public boolean isTrusted(X509Certificate[] chain, String authtype)
                  throws CertificateException {
                         return true;
                  }
        };
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

        if (url.startsWith("https")
                && ignoreUnverifiedSSL) {
      // add unsafe trust manager to avoid thrown
      // SSLPeerUnverifiedException
      try {
        TrustStrategy easyStrategy = new TrustStrategy() {
            public boolean isTrusted(X509Certificate[] chain, String authType)
                    throws CertificateException {
                return true;
            }
        };
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

        s_logger.debug("POST request to " + agentUri.toString()
                + " with contents " + logMessage);

        // Create request
        HttpClient httpClient = null;
        TrustStrategy easyStrategy = new TrustStrategy() {
            @Override
            public boolean isTrusted(X509Certificate[] chain, String authType)
                    throws CertificateException {
                return true;
            }
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

    client.getClientHandler().getHttpClient().getParams().setParameter(
        CoreProtocolPNames.USER_AGENT, "Nexus-Client/" + discoverClientVersion()
    );

    // "tweak" HTTPS scheme as requested
    final TrustStrategy trustStrategy;
    switch (connectionInfo.getSslCertificateValidation()) {
      case NONE:
        trustStrategy = new TrustStrategy()
        {
          @Override
          public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException {
            return true;
          }
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

    CumulusProtocolSocketFactory()
            throws Exception
    {
         //TrustStrategy ts = new TrustSelfSignedStrategy();
         TrustStrategy ts = new CumulusAlwaysTrustStrategy();
         psf = new SSLSocketFactory(ts);
    }
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

                        sslReq.getTrustStore().getKeyStore();
                final KeyStore keyStore = sslReq.getKeyStore() == null?
                        null:
                        sslReq.getKeyStore().getKeyStore();

                final TrustStrategy trustStrategy = sslReq.isTrustSelfSignedCert()
                        ? new TrustSelfSignedStrategy(): null;
               
                SSLContext ctx = new SSLContextBuilder()
                        .loadKeyMaterial(keyStore, sslReq.getKeyStore()!=null? sslReq.getKeyStore().getPassword(): null)
                        .loadTrustMaterial(trustStore, trustStrategy)
View Full Code Here

Examples of org.apache.http.conn.ssl.TrustStrategy

 
  private static SchemeRegistry createSchemeRegistry() {
    final SchemeRegistry sr = new SchemeRegistry();
    sr.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
    try {
      SSLSocketFactory ssf = new SSLSocketFactory(new TrustStrategy() {
        @Override
        public boolean isTrusted(X509Certificate[] chain, String authType)
            throws CertificateException {
          return true;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.