I have a Jetty server where I'm opening opening more than one SSL ports and setting the SslContextFactory where I am pointing it to my custom keystore in which I have certificates for all the SSL ports.
public static SslContextFactory getCustomSSLContextFactory() throws IOException {
KeyStoreInfo keyStoreInfo = KeyStoreInfo.getInstance();
SslContextFactory sslContextFactory = new SslContextFactory(mycustomkeystorepath);
sslContextFactory.setKeyStorePassword(mykeystorepassword);
sslContextFactory.setKeyStoreType(keystoretype);
sslContextFactory.setTrustStorePath(defaultcatruststore);
sslContextFactory.setTrustStorePassword(password);
sslContextFactory.setTrustStoreType(truststoretype);
sslContextFactory.setNeedClientAuth(true);
return sslContextFactory;
}
This SslContextFactory I'm setting in ServerConnector SslConnectionFactory. And I have multiple ServerConnectors and all have the same SslContextFactory.
My question is as I have multiple PKI-cert and private key in custom key store. How SslConnectionFactory will know which PKI-cert and private key belongs to which SSL port?