KEYCLOAK-504
Using https results in RuntimeException if sslRequired is set to false
This commit is contained in:
parent
80f4b668b2
commit
f3211bf34d
1 changed files with 5 additions and 5 deletions
|
@ -280,13 +280,13 @@ public class AdapterDeploymentContext {
|
|||
protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade, String base) {
|
||||
KeycloakUriBuilder builder = KeycloakUriBuilder.fromUri(base);
|
||||
URI request = URI.create(facade.getRequest().getURI());
|
||||
String scheme = "http";
|
||||
String scheme = request.getScheme();
|
||||
if (deployment.isSslRequired()) {
|
||||
scheme = "https";
|
||||
}
|
||||
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
|
||||
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
|
||||
throw new RuntimeException("Can't resolve relative url from adapter config.");
|
||||
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
|
||||
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
|
||||
throw new RuntimeException("Can't resolve relative url from adapter config.");
|
||||
}
|
||||
}
|
||||
builder.scheme(scheme);
|
||||
builder.host(request.getHost());
|
||||
|
|
Loading…
Reference in a new issue