Код: Выделить всё
// Does the server match the server name request?
SNIServerName sni = null;
if (!shc.sslConfig.sniMatchers.isEmpty()) {
sni = chooseSni(shc.sslConfig.sniMatchers, spec.serverNames);
if (sni != null) {
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
SSLLogger.fine(
"server name indication (" +
sni + ") is accepted");
}
} else {
// We do not reject client without SNI extension currently.
throw shc.conContext.fatal(Alert.UNRECOGNIZED_NAME,
"Unrecognized server name indication");
}
< /code>
Это будет отражать поведение, которое я хотел бы иметь, точно. Тем не менее, он зависит от того, чтобы иметь Snimatchers Код: Выделить всё
@Bean
public WebServerFactoryCustomizer sslContextCustomizer(final SslServerConfiguration sslServerConfiguration) {
return factory -> factory.addContextCustomizers(context -> {
for (var connector : Container.getService(context.getParent()).findConnectors()) {
for (SSLHostConfig hostConfig : connector.findSslHostConfigs()) {
for (SSLHostConfigCertificate certificate : hostConfig.getCertificates()) {
// could be set here, but .getSupportedSSLParameters() is always null
// and setting it with new SSLParameters is getting ignored:
//certificate.getSslContext().getSupportedSSLParameters().setSNIMatchers();
}
}
};
});
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... -correctly