protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {
if (brokerURI.getScheme().equals("ssl")) {
// If given an SSL URI, use an SSL TransportFactory and configure
// it to use the given key and trust managers.
SslTransportFactory transportFactory = new SslTransportFactory();
transportFactory.setKeyAndTrustManagers(km, tm, random);
return transportFactory.doBind(getBrokerName(), brokerURI);
} else {
// Else, business as usual.
return TransportFactory.bind(getBrokerName(), brokerURI);
}
}