I want to call AZDO to get a TestPlan, but when I try, this is returning an IOException, and I donĀ“t get why
String testSuiteURI = "https://dev.azure.com/" +organization +"/" + project + "/_apis/testplan/Plans/" + planId + "?api-version=6.0-preview.1";
HttpGet httpGet = new HttpGet(testSuiteURI);
try {
CloseableHttpClient httpClient = HttpClients.custom().setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE).setSSLContext(getSslContext()).build();
httpGet.setHeader(HttpHeaders.CONTENT_TYPE,"application/json");
httpGet.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
//instantiate the response handler
ResponseHandler<String> responseHandler = new MyResponseHandler();
String response = httpClient.execute(httpGet, responseHandler);
httpClient.close();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
}
Here is the stacktrace
DEBUG [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default DEBUG [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context DEBUG [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://dev.azure.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] DEBUG [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 0][route: {s}->https://dev.azure.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20] DEBUG [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://dev.azure.com:443 DEBUG [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to dev.azure.com/13.107.42.20:443 DEBUG [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to dev.azure.com/13.107.42.20:443 with timeout 0 DEBUG [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Shutdown connection DEBUG [org.apache.http.impl.execchain.MainClientExec] Connection discarded DEBUG [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 0][route: {s}->https://dev.azure.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] INFO [org.apache.http.impl.execchain.RetryExec] I/O exception (java.net.SocketException) caught when processing request to {s}->https://dev.azure.com:443: Operation not permitted DEBUG [org.apache.http.impl.execchain.RetryExec] Operation not permitted