Hi All,

  I'm using httpclien-4.1.3 and I get the below issue.

I have used trust all mode
Below is the code


    SSLContext sslContext;
    try {
      sslContext = SSLContext.getInstance("SSL");
      TrustManager[] trustAllTrustManagers = new TrustManager[] { new 
javax.net.ssl.X509TrustManager() {
        @Override
        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
          return null;
        }

        @Override
        public void checkClientTrusted(final X509Certificate[] certs, final 
String authType) {
        }

        @Override
        public void checkServerTrusted(final X509Certificate[] certs, final 
String authType) {
        }

      } };

      sslContext.init(null, trustAllTrustManagers, new 
java.security.SecureRandom());
      SSLSocketFactory sslSocketFactory = new SSLSocketFactory(sslContext);
      Scheme sch = new Scheme("https", HTTP, sslSocketFactory);
      client.getConnectionManager().getSchemeRegistry().register(sch);


I get the below error
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

Please guide

Thanks,
Aparna

Reply via email to