How to set HTTPS SSL Cipher Suite Preference in Spring boot embedded tomcat

前端 未结 2 1995
闹比i
闹比i 2021-02-09 20:52

I trying to set HTTPS SSL cipher suite preference according to server preference rather than auto select based on client & server supported common cipher suite with highest

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 21:26

    You need to tell the connector's underlying protocol handler to use the server's cipher suite order. You can do so with a WebServerFactoryCustomizer :

    @Bean
    public WebServerFactoryCustomizer servletContainerCustomizer() {
        return (factory) -> {
            factory.addConnectorCustomizers((c) -> 
                ((AbstractHttp11Protocol) c.getProtocolHandler()).setUseServerCipherSuitesOrder(true));
        };
    }
    

提交回复
热议问题