A connection was successfully established with the server, but then an error occurred during the pre-login handshake. provider: SSL Provider, error: 0

I have an exe which runs twice a day. I am getting the error when the exe runs in the morning but works fine in the evening.

The exe generates logs and it logs the below error:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)

I have also checked event viewer but no error is displayed related to above error.

We have checked the previous related posts, but the users seem to get the error continuously. But in our case, the exe runs fine at one time but gives error another time.

Any idea what might have gone wrong here?

It's a timeout error - increase the wait time for the exe, or you could create an error routine that waits a specific period - maybe 5 minutes - and tries again. It sounds like something else is running in the morning which is slowing the system down.

Thanks @PurpleLady for the reply, I tried this solution but the issue still persists.