Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #801 from sonatype/nxcm-5187-rrb-not-using-ssl

TRIVIAL: [NXCM-5187] Set Hc4Provider.HTTP_CTX_KEY_REPOSITORY attribute in order to trigger Nexus SSL Trust Store
  • Loading branch information...
commit c9ee1c7b9903c7455b63c467a6d540287d6595b3 2 parents 180399c + 4804eec
@adreghiciu adreghiciu authored
View
9 plugins/nexus-rrb-plugin/src/main/java/org/sonatype/nexus/plugins/rrb/MavenRepositoryReader.java
@@ -23,8 +23,10 @@
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
+import org.apache.http.protocol.BasicHttpContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.sonatype.nexus.apachehttpclient.Hc4Provider;
import org.sonatype.nexus.plugins.rrb.parsers.ArtifactoryRemoteRepositoryParser;
import org.sonatype.nexus.plugins.rrb.parsers.HtmlRemoteRepositoryParser;
import org.sonatype.nexus.plugins.rrb.parsers.RemoteRepositoryParser;
@@ -233,7 +235,12 @@ private StringBuilder getContent() {
HttpGet method = new HttpGet(url);
try {
logger.debug("Requesting: {}", method);
- HttpResponse response = client.execute(method);
+
+ final BasicHttpContext httpContext = new BasicHttpContext();
+ httpContext.setAttribute( Hc4Provider.HTTP_CTX_KEY_REPOSITORY, proxyRepository );
+
+ HttpResponse response = client.execute(method,httpContext);
+
int statusCode = response.getStatusLine().getStatusCode();
logger.debug("Status code: {}", statusCode);
Please sign in to comment.
Something went wrong with that request. Please try again.