如何绕过Java中的证书检查

时间:2017-09-26 07:13:52

标签: java ssl

在我的代码中,我打电话给:  HttpResponse resp = usingClient.execute(urlGet,hc_context); 负责进行证书检查。 我的要求是我不想要这个证书检查。 有人可以告诉我如何绕过这个证书检查。

我使用它的api是: public static Repository getRepositoryInformation(HttpClient usingClient,

HttpClientContext hc_context, String serverLocation, String loginId, String password, boolean anonymous) throws RAMServiceException{
        Repository repository = null;
        HttpGet urlGet = createGet(serverLocation+REPOSITORY_INFO);
        try {
            HttpResponse resp = usingClient.execute(urlGet, hc_context) ;
            if(resp.getStatusLine().getStatusCode() != HttpStatus.SC_OK){
                throw new RAMServiceException(resp.getStatusLine().getStatusCode(), resp.getStatusLine().getReasonPhrase());
            }

由于

0 个答案:

没有答案