Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
fix(http client): trust all ssl certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGeraud committed Dec 19, 2019
1 parent f84d69d commit 9eb2411
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -43,6 +43,7 @@

/**
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class WebClientFactory implements FactoryBean<WebClient> {
Expand Down Expand Up @@ -154,9 +155,16 @@ private WebClientOptions getWebClientOptions() {
String url = readPropertyValue(propertyPrefix + "url");
final URI uri = URI.create(url);

options.setDefaultHost(uri.getHost());
options.setDefaultPort(uri.getPort() != -1 ? uri.getPort() :
(HTTPS_SCHEME.equals(uri.getScheme()) ? 443 : 80));
options
.setDefaultHost(uri.getHost())
.setDefaultPort(uri.getPort() != -1 ? uri.getPort() :
(HTTPS_SCHEME.equals(uri.getScheme()) ? 443 : 80));

if (HTTPS_SCHEME.equals(uri.getScheme())) {
options
.setSsl(true)
.setTrustAll(true);
}
return options;
}

Expand Down

0 comments on commit 9eb2411

Please sign in to comment.