You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
stub.withWaitForReady().withDeadline().hello();
} catch(StatusRuntimeExceptione) {
// always receiving DEADLINE_EXCEEDED as status code if server is unavailable or client certs are invalid
}
There is no way to distinguish the underlying cause of failure , say if the failure is due to SSLHanshake or server genuinely not being available.
As an alternative, without using withWaitForReady() we are receiving UNAVAILABLE code in StatusRuntimeException which wraps the underlying cause say for example the SSLHandshake exception. Looking at the UNAVAILABLE code how can we safely take a call if we to reattempt connection, as we do not want to reattempt the connection in SSLException scenarios?