Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
feat: cipher (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhagestedt authored Jun 11, 2020
1 parent 054e2f5 commit c460aca
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@

package app.coronawarn.verification.portal;

import org.apache.coyote.http11.AbstractHttp11Protocol;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
* The Spring Boot application class.
Expand All @@ -35,4 +40,20 @@ public class VerificationPortalApplication {
public static void main(String[] args) {
SpringApplication.run(VerificationPortalApplication.class, args);
}

/**
* Enable the cipher suites from server to be preferred.
*
* @return the WebServerFactoryCustomizer with cipher suites configuration
*/
@Bean
@ConditionalOnProperty(value = "server.ssl.cipher.suites.order", havingValue = "true")
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> webServerFactoryCustomizer() {
return (factory) -> factory
.addConnectorCustomizers((connector) -> {
((AbstractHttp11Protocol<?>) connector.getProtocolHandler())
.setUseServerCipherSuitesOrder(true);
});
}

}

0 comments on commit c460aca

Please sign in to comment.