class SSLUtils {

	public static SSLHandlerFactory createRestClientSSLEngineFactory(final Configuration config) throws Exception {
		ClientAuth clientAuth = isRestSSLAuthenticationEnabled(config) ? ClientAuth.REQUIRE : ClientAuth.NONE;
		SslContext sslContext = createRestNettySSLContext(config, true, clientAuth);
		if (sslContext == null) {
			throw new IllegalConfigurationException("SSL is not enabled for REST endpoints.");
		}

		return new SSLHandlerFactory(
				sslContext,
				-1,
				-1);
	}

}