Code example for AllowAllHostnameVerifier

0
 
    //registers schemes for both http and https 
    SchemeRegistry registry = new SchemeRegistry();
    registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
    final SSLSocketFactory sslSocketFactory = SSLSocketFactory.getSocketFactory();
    sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier());
    registry.register(new Scheme("https", sslSocketFactory, 443));
 
    ThreadSafeClientConnManager manager = new ThreadSafeClientConnManager(params, registry);
    ret = new DefaultHttpClient(manager, params);
    return ret;
  } 
 
  private void authorize(HttpRequestBase request) {
    Header authHeader = conf.getAuthProvider().getAuthHeader();
    request.addHeader(authHeader.getKey(), authHeader.getValue());
  } 
 
  @Override 
  public RestClientResponse doPost(final String url, final KanbaneryResource resource) throws ServerCommunicationException {
    HttpPost request = new HttpPost(url);