Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUERY] How to resolve javax.net.ssl.SSLException: handshake timed out #7900

Closed
rajadilipkolli opened this issue Feb 2, 2020 · 8 comments
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs

Comments

@rajadilipkolli
Copy link

rajadilipkolli commented Feb 2, 2020

Query/Question
Receiving handshake time out Exception when using azure-messaging-eventhubs-checkpointstore-blob to checkpoint the eventHub. How to resolve this?

Code is integrated with Spring Boot version 2.1.11 and it is deployed in OpenShift 3.11
Below is the error
{"timestamp":"2020-02-02T09:15:19,427+0000","project":"dummyservice","log_level":"WARN","thread":"reactor-http-epoll-2","class_name":"reactor.util.Loggers$Slf4JLogger","line_number":"299","message":"[id: 0xa0f8e1a6, L:/10.74.29.164:46426 - R:dummystorage.blob.core.windows.net/x.x.x.x:443] The connection observed an error","stack_trace":"javax.net.ssl.SSLException: handshake timed out\n\tat io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2011)\n\tat io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)\n\tat io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:150)\n\tat io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)\n","status":"","duration_millis":"","application_tier":"","action":"","trace_id":""}

Why is this not a Bug or a feature Request?
I feel this is a Question because it is conveying as HandShake Exception instead of any other exception.

Setup (please complete the following information if applicable):

  • OpenShift : 3.11
  • Version of the Library used : 1.0.0-beta.4

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [ x] Query Added
  • [ x] Setup information Added
@JonathanGiles
Copy link
Member

Assigning to @srnagar and @conniey to investigate. Thanks for the report!

@JonathanGiles JonathanGiles added Client This issue points to a problem in the data-plane of the library. Event Hubs customer-reported Issues that are reported by GitHub users external to the Azure organization. and removed triage labels Feb 2, 2020
@srnagar
Copy link
Member

srnagar commented Feb 3, 2020

@rajadilipkolli - could you please let us know how you are creating the container client? It would be great if you could provide a reproducible code sample for us to investigate further.

@rajadilipkolli
Copy link
Author

rajadilipkolli commented Feb 5, 2020

We are using eph 3.0.2 and it is working as expected with the storage connection being made using sas, Now when I tried to connect using the latest 5.0.x we are receiving the above reported error. With the sample provided by Microsoft We face this issue.

Note:: we are behind corporate proxy and setting proxy using below code.

// set the ProxySelector API; which offers the flexibility to select Proxy Server based on the Target URI.

    ProxySelector systemDefaultSelector = ProxySelector.getDefault();
     ProxySelector.setDefault(new ProxySelector() {
       @Override
       public List<Proxy> select(URI uri) {
         if (uri != null && uri.getHost() != null && (uri.getHost()
             .equalsIgnoreCase(azureConnectionProperties.getNamespace()) || uri.getHost()
             .contains(azureConnectionProperties.getStorageUriHost()))) {
           LinkedList<Proxy> proxies = new LinkedList<>();
           proxies.add(getProxyAddress());
           return proxies;
         }

         // preserve system default selector for the rest
         return systemDefaultSelector.select(uri);
       }

       @Override
       public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
         // trace and follow up on why proxy server is down
         log.error(
             "Connection failed using proxy for uri :{} , socket address :{} and exception is :{}",
             uri, sa, ioe);
       }
     });

     log.debug("proxy set");
   }

@conniey
Copy link
Member

conniey commented Feb 5, 2020

We rewrote Event Hubs using the new API guidelines. Subsequently, the approach used in 3.0.2 may not be the same approach to use when configuring the HTTP client.

In your BlobContainerClientBuilder, you may have to set the httpClient with a proxy for the requests to be passed through there.

https://github.com/Azure/azure-sdk-for-java/wiki/HTTP-clients#configuring-http-clients

@rajadilipkolli
Copy link
Author

Hi @conniey , I have configured AsyncHttpClient, still facing the same issue.

@srnagar
Copy link
Member

srnagar commented Feb 13, 2020

@rajadilipkolli Here's a sample for configuring your proxy:

ProxyOptions proxyOptions = new ProxyOptions(ProxyOptions.Type.HTTP,
  new InetSocketAddress(HOST_NAME, PORT));

HttpClient httpClient = new NettyAsyncHttpClientBuilder()
  .setProxy(proxyOptions)
  .build();

ContainerAsyncClient containerAsyncClient = new ContainerClientBuilder()
  .endpoint(endpoint)
  .connectionString(STORAGE_CONNECTION_STRING)
  .containerName(CONTAINER_NAME)
  .httpClient(httpClient)
  .buildAsyncClient(); 

If you are still facing issues, it would be great if you could provide a code sample of how you are creating the ContainerAsyncClient and the HttpClient that is provided to the ContainerClientBuilder to help us reproduce this error.

@srnagar
Copy link
Member

srnagar commented Mar 11, 2020

@rajadilipkolli were you able to get this to work?

@srnagar
Copy link
Member

srnagar commented Mar 27, 2020

Closing this issue as there is no update. Please feel free to reopen if you are still having an issue using proxy.

@srnagar srnagar closed this as completed Mar 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs
Projects
None yet
Development

No branches or pull requests

4 participants