How can i use custom SSLContext and custom SSLServerSocketFactory in spark-java framework? I've searched in SparkServerImpl but have no idea how to inject sslfactory, any suggestions?
            Asked
            
        
        
            Active
            
        
            Viewed 6,037 times
        
    1 Answers
8
            You can pass directly into Spark the parameters of the keystore, like this:
Spark.secure(keyStorePath, keyStorePassword, trustStorePath, trustStorePassword);
Those are all strings, and for example, the keystore values could be:
String keyStorePath = "/home/user/keys/private-key.jks";
String keyStorePassword = "password";
This way, Spark will have the parameters to create the SslContextFactory inside, as you can see here:
 
    
    
        Pablo Matias Gomez
        
- 6,614
- 7
- 38
- 72
 
    