This is an automated email from the ASF dual-hosted git repository.
mpapirkovskyy pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new 1376c77 AMBARI-25411. Cannot use HTTPS repourl and VDF url.
(mpapirkovskyy) (#3122)
1376c77 is described below
commit 1376c77800da34c5750c9f5337c6e0e49381b1d0
Author: Myroslav Papirkovskyi <[email protected]>
AuthorDate: Wed Nov 13 23:13:56 2019 +0200
AMBARI-25411. Cannot use HTTPS repourl and VDF url. (mpapirkovskyy) (#3122)
---
.../ambari/server/controller/internal/URLStreamProvider.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
index 2e7feb0..429d5c8 100644
---
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
+++
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
@@ -184,7 +184,7 @@ public class URLStreamProvider implements StreamProvider {
URL url = new URL(spec);
HttpURLConnection connection = (spec.startsWith("https") &&
this.setupTruststoreForHttps) ?
- getSSLConnection(spec) : getConnection(url);
+ getSSLConnection(url) : getConnection(url);
AppCookieManager appCookieManager = getAppCookieManager();
@@ -235,7 +235,7 @@ public class URLStreamProvider implements StreamProvider {
if (wwwAuthHeader != null &&
wwwAuthHeader.trim().startsWith(NEGOTIATE)) {
connection = spec.startsWith("https") ?
- getSSLConnection(spec) : getConnection(url);
+ getSSLConnection(url) : getConnection(url);
appCookie = appCookieManager.getAppCookie(spec, true);
connection.setRequestProperty(COOKIE, appCookie);
connection.setConnectTimeout(connTimeout);
@@ -297,7 +297,7 @@ public class URLStreamProvider implements StreamProvider {
}
// Get an ssl connection
- protected HttpsURLConnection getSSLConnection(String spec) throws
IOException, IllegalStateException {
+ protected HttpsURLConnection getSSLConnection(URL url) throws IOException,
IllegalStateException {
if (sslSocketFactory == null) {
synchronized (this) {
@@ -306,7 +306,7 @@ public class URLStreamProvider implements StreamProvider {
if (trustStorePath == null || trustStorePassword == null) {
String msg =
String.format("Can't get secure connection to %s. Truststore
path or password is not set.",
- URLCredentialsHider.hideCredentials(spec));
+
URLCredentialsHider.hideCredentials(url.toString()));
LOG.error(msg);
throw new IllegalStateException(msg);
@@ -333,7 +333,7 @@ public class URLStreamProvider implements StreamProvider {
}
}
}
- HttpsURLConnection connection = (HttpsURLConnection) (new URL(spec)
+ HttpsURLConnection connection = (HttpsURLConnection) (url
.openConnection());
connection.setSSLSocketFactory(sslSocketFactory);