Class X509TlsConnectorCustomizer
java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509TlsConnectorCustomizer
- All Implemented Interfaces:
org.springframework.boot.web.server.WebServerFactoryCustomizer<org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory>
public class X509TlsConnectorCustomizer
extends Object
implements org.springframework.boot.web.server.WebServerFactoryCustomizer<org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory>
Adds the dedicated TLS port that requests a client certificate, when
authserver.x509.port is set. The main
port is left as it is, so the rest of the application never asks a browser for a certificate. The connector
requests a certificate without requiring one and without validating it against a CA
(optionalNoCA): the TLS handshake proves that the client holds the private key, and what identifies the
client is the fingerprint of the certificate, which has to be bound to an account. The servlet container leaves the
certificate in the request attribute that the X.509 filter reads. The connector's trust manager
(AnyClientCertificateTrustManager) advertises no certificate authority: without it the handshake lists the
authorities of the JVM's default trust store, and a client offers only a certificate issued by a listed authority,
so the certificate of a private authority would never be presented.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringValue of the certificate verification that asks for a certificate but does not validate it.private final X509TlsKeyStoreResolverFinds the key store with the server certificate.private final X509PropertiesSettings of the sign-in with a certificate.private static final StringScheme of the connector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) org.apache.catalina.connector.Connectorconnector(X509TlsKeyStore keyStore) Builds the connector.voidcustomize(org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory factory) Adds the connector to the server, when the port is configured.
-
Field Details
-
CERTIFICATE_VERIFICATION
Value of the certificate verification that asks for a certificate but does not validate it.- See Also:
-
SCHEME
Scheme of the connector.- See Also:
-
properties
Settings of the sign-in with a certificate. -
keyStoreResolver
Finds the key store with the server certificate.
-
-
Constructor Details
-
X509TlsConnectorCustomizer
public X509TlsConnectorCustomizer()
-
-
Method Details
-
customize
public void customize(org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory factory) Adds the connector to the server, when the port is configured.- Specified by:
customizein interfaceorg.springframework.boot.web.server.WebServerFactoryCustomizer<org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory>- Parameters:
factory- the factory of the embedded Tomcat.
-
connector
Builds the connector.- Parameters:
keyStore- the key store with the server certificate.- Returns:
- the connector.
-