title: Error of Java:javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
body: <p>Error occurred while getting response from the https site(SSL). We already configured all setting of SSL certificate on the server.</p>
  
  <p>I have written the following code for getting response from https server.</p>
  
  <pre><code>            try {
  
                  String url = "https://my url";
                  HttpPost postRequest = new HttpPost(url);
  
                  Map&lt;String, String&gt; requestParameters = new HashMap&lt;String, tring&gt;();
  
  
                  requestParameters.put("appId", "abc");
                  requestParameters.put("code", "dummy001");
                  requestParameters.put("password", "dummy001");
  
  
  
                  HttpResponse httpResponse = null;
  
                  DefaultHttpClient httpClient = new DefaultHttpClient();
  
              List&lt;NameValuePair&gt; nameValuePairs = new arrayList&lt;NameValuePair&gt;();
  
                  for(Map.Entry&lt;String, String&gt; entry : requestParameters.entrySet())
                  {
                      nameValuePairs.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
                  }
                  postRequest.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
  
  
                  httpResponse = httpClient.execute(postRequest);
                  }
     catch (Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>after executing this code it throws following exception..</p>
  
  <pre><code>javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
      at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
      at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:126)
      at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
      at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
      at mkcl.oesclient.commons.test.TestAdminSubjectDivisionAssociation.testHttpClientSSL(TestAdminSubjectDivisionAssociation.java:286)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>Please suggest what should i do....</p>