Legacy Dev Forum Posts

 View Only

Sign Up

Access error via proxy (withAuthenticatedProxy⇒connection reset)

  • 1.  Access error via proxy (withAuthenticatedProxy⇒connection reset)

    Posted 06-05-2025 18:23

    yosuke | 2022-10-05 00:52:50 UTC | #1

    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.


    yosuke | 2022-10-05 00:53:49 UTC | #2


    sauce


    String clientId = "XXXX"; String clientSecret = "XXXX";

    // Set Region(https://api.mypurecloud.jp) PureCloudRegionHosts region = PureCloudRegionHosts.apnortheast1;

    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("XXX.XXX.XXX.XXX", 8080)); String wuserId = "XXX"; String wpass = "XXX";

    //ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).withProxy(proxy).build(); ApiClient apiClient = ApiClient.Builder.standard().withBasePath(region).withAuthenticatedProxy(proxy,wuserId, wpass).build();

    ApiResponse<AuthResponse> authResponse = apiClient.authorizeClientCredentials(clientId, clientSecret);

    String token = authResponse.getBody().getAccess_token();

    System.out.println(token);


    yosuke | 2022-10-05 01:03:05 UTC | #3


    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.GenesysTokenInfoProxy.main(GenesysTokenInfoProxy.java:33)


    yosuke | 2022-10-05 01:41:52 UTC | #4


    ProxyAccessLog



    anon14299330 | 2022-10-05 09:22:20 UTC | #5

    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


    system | 2022-11-05 09:23:09 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 16594