private CqlSession initializeCassandraSession(final BaseCassandraProperties cassandra) {
        val builder = CqlSession.builder().withKeyspace(cassandra.getKeyspace());
        if (StringUtils.isNotBlank(cassandra.getUsername()) && StringUtils.isNotBlank(cassandra.getPassword())) {
            builder.withAuthCredentials(cassandra.getUsername(), cassandra.getPassword());
        }
        if (StringUtils.isNotBlank(cassandra.getLocalDc())) {
            builder.withLocalDatacenter(cassandra.getLocalDc());
        }

        val engineFactory = new ProgrammaticSslEngineFactory(this.sslContext,
            cassandra.getSslCipherSuites(), false) {
            @Nonnull
            @Override
            public SSLEngine newSslEngine(
                @Nonnull
                final EndPoint remoteEndpoint) {
                val engine = super.newSslEngine(remoteEndpoint);
                engine.setSSLParameters(buildSslParameters(cassandra));
                return engine;
            }
        };
        builder.withSslEngineFactory(engineFactory);


        val configLoader = DriverConfigLoader.programmaticBuilder()
            .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5))
            .withDuration(DefaultDriverOption.CONNECTION_CONNECT_TIMEOUT, Duration.ofSeconds(5))
            .withDuration(DefaultDriverOption.CONNECTION_INIT_QUERY_TIMEOUT, Duration.ofSeconds(5))
            .withDuration(DefaultDriverOption.HEARTBEAT_TIMEOUT, Duration.ofSeconds(5))
            .build();
        builder.withConfigLoader(configLoader);

        cassandra.getContactPoints()
            .stream()
            .map(contactPoint -> {
                val hostAndPort = Splitter.on(":").splitToList(contactPoint);
                val host = hostAndPort.getFirst().trim();
                val port = Integer.parseInt(hostAndPort.get(1).trim());
                return new InetSocketAddress(host, port);
            })
            .forEach(builder::addContactPoint);
        return builder.build();
    }
This is {@link DefaultCassandraSessionFactory}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-cassandra-core/src/main/java/org/apereo/cas/cassandra/DefaultCassandraSessionFactory.java