docs: @Nullable
  	private static SSLContext createRestSSLContext(Configuration config, RestSSLContextConfigMode configMode) throws Exception {
  		checkNotNull(config, "config");
  
  		if (!isRestSSLEnabled(config)) {
  			return null;
  		}
  
  		KeyManager[] keyManagers = null;
  		if (configMode == RestSSLContextConfigMode.SERVER || configMode == RestSSLContextConfigMode.MUTUAL) {
  			String keystoreFilePath = getAndCheckOption(
  				config, SecurityOptions.SSL_REST_KEYSTORE, SecurityOptions.SSL_KEYSTORE);
  
  			String keystorePassword = getAndCheckOption(
  				config, SecurityOptions.SSL_REST_KEYSTORE_PASSWORD, SecurityOptions.SSL_KEYSTORE_PASSWORD);
  
  			String certPassword = getAndCheckOption(
  				config, SecurityOptions.SSL_REST_KEY_PASSWORD, SecurityOptions.SSL_KEY_PASSWORD);
  
  			KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
  			try (InputStream keyStoreFile = Files.newInputStream(new File(keystoreFilePath).toPath())) {
  				keyStore.load(keyStoreFile, keystorePassword.toCharArray());
  			}
  
  			KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  			kmf.init(keyStore, certPassword.toCharArray());
  
  			keyManagers = kmf.getKeyManagers();
  		}
  
  		TrustManager[] trustManagers = null;
  		if (configMode == RestSSLContextConfigMode.CLIENT || configMode == RestSSLContextConfigMode.MUTUAL) {
  			String trustStoreFilePath = getAndCheckOption(
  				config, SecurityOptions.SSL_REST_TRUSTSTORE, SecurityOptions.SSL_TRUSTSTORE);
  
  			String trustStorePassword = getAndCheckOption(
  				config, SecurityOptions.SSL_REST_TRUSTSTORE_PASSWORD, SecurityOptions.SSL_TRUSTSTORE_PASSWORD);
  
  			KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
  			try (InputStream trustStoreFile = Files.newInputStream(new File(trustStoreFilePath).toPath())) {
  				trustStore.load(trustStoreFile, trustStorePassword.toCharArray());
  			}
  
  			TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  			tmf.init(trustStore);
  
  			trustManagers = tmf.getTrustManagers();
  		}
  
  		String sslProtocolVersion = config.getString(SecurityOptions.SSL_PROTOCOL);
  		SSLContext sslContext = SSLContext.getInstance(sslProtocolVersion);
  		sslContext.init(keyManagers, trustManagers, null);
  
  		return sslContext;
  	}