I accessed it from a Windows server via proxy using the "withAuthenticatedProxy" method and got a connection reset.
The access log of the proxy server is accessed.
sauce
String clientId = "XXXX";
String clientSecret = "XXXX";
// Set Region(https://api.mypurecloud.jp)
PureCloudRegionHosts region = PureCloudRegionHosts.ap_northeast_1;
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("XXX.XXX.XXX.XXX", 8080));
String w_userId = "XXX";
String w_pass = "XXX";
//ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).withProxy(proxy).build();
ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).withAuthenticatedProxy(proxy,w_userId, w_pass).build();
ApiResponse authResponse = apiClient.authorizeClientCredentials(clientId, clientSecret);
String token = authResponse.getBody().getAccess_token();
System.out.println(token);
log
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:221)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at com.ibm.jsse2.b.a(b.java:262)
at com.ibm.jsse2.b.a(b.java:33)
at com.ibm.jsse2.av.a(av.java:579)
at com.ibm.jsse2.av.i(av.java:574)
at com.ibm.jsse2.av.a(av.java:280)
at com.ibm.jsse2.av.startHandshake(av.java:431)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:192)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.mypurecloud.sdk.v2.connector.apache.ApacheHttpClientConnector.invoke(ApacheHttpClientConnector.java:71)
at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:750)
at com.mypurecloud.sdk.v2.ApiClient.authorizeClientCredentials(ApiClient.java:302)
at csc.batch.main.reportdata.report.GenesysTokenInfo_Proxy.main(GenesysTokenInfo_Proxy.java:33)
Hi,
I am not very familiar with network errors and there can be multiple reasons why you are receiving a TCP RST (connection reset) error. A common reason for this error is when a connection is closed abruptly by the client or server while the client or server is still trying to read or write data. I would suggest doing some research on the possible causes of TCP RST errors and work with your proxy administrator to troubleshoot the issue. I hope that helps.
Thanks,
Mike
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.