Fix TLS detection in URLs for Netty Client RequestFactory
Do not check on non-specified port when scheme is https. Enables SSL for https URIs with a specified port. Issue: SPR-14889
This commit is contained in:
committed by
Brian Clozel
parent
1608d0596d
commit
5285f5300a
@@ -51,6 +51,7 @@ import org.springframework.util.Assert;
|
|||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @author Rossen Stoyanchev
|
* @author Rossen Stoyanchev
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
|
* @author Mark Paluch
|
||||||
* @since 4.1.2
|
* @since 4.1.2
|
||||||
*/
|
*/
|
||||||
public class Netty4ClientHttpRequestFactory implements ClientHttpRequestFactory,
|
public class Netty4ClientHttpRequestFactory implements ClientHttpRequestFactory,
|
||||||
@@ -174,8 +175,7 @@ public class Netty4ClientHttpRequestFactory implements ClientHttpRequestFactory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Bootstrap getBootstrap(URI uri) {
|
private Bootstrap getBootstrap(URI uri) {
|
||||||
boolean isSecure = (uri.getPort() == 443 ||
|
boolean isSecure = (uri.getPort() == 443 || "https".equalsIgnoreCase(uri.getScheme()));
|
||||||
(uri.getPort() == -1 && "https".equalsIgnoreCase(uri.getScheme())));
|
|
||||||
if (isSecure) {
|
if (isSecure) {
|
||||||
if (this.sslBootstrap == null) {
|
if (this.sslBootstrap == null) {
|
||||||
this.sslBootstrap = buildBootstrap(true);
|
this.sslBootstrap = buildBootstrap(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user