|
@@ -42,6 +42,8 @@ import org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthentica
|
|
|
import org.apache.hadoop.util.HttpExceptionUtils;
|
|
|
import org.apache.http.client.utils.URIBuilder;
|
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import javax.net.ssl.HttpsURLConnection;
|
|
|
|
|
@@ -85,6 +87,9 @@ import com.google.common.base.Strings;
|
|
|
public class KMSClientProvider extends KeyProvider implements CryptoExtension,
|
|
|
KeyProviderDelegationTokenExtension.DelegationTokenExtension {
|
|
|
|
|
|
+ private static final Logger LOG =
|
|
|
+ LoggerFactory.getLogger(KMSClientProvider.class);
|
|
|
+
|
|
|
private static final String INVALID_SIGNATURE = "Invalid signature";
|
|
|
|
|
|
private static final String ANONYMOUS_REQUESTS_DISALLOWED = "Anonymous requests are disallowed";
|
|
@@ -491,6 +496,9 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
|
|
|
}
|
|
|
});
|
|
|
} catch (IOException ex) {
|
|
|
+ if (ex instanceof SocketTimeoutException) {
|
|
|
+ LOG.warn("Failed to connect to {}:{}", url.getHost(), url.getPort());
|
|
|
+ }
|
|
|
throw ex;
|
|
|
} catch (UndeclaredThrowableException ex) {
|
|
|
throw new IOException(ex.getUndeclaredThrowable());
|