2017-05-06 87 views

回答

0

明白了:

ListenerFactory factory = new ListenerFactory(); 
    SslConfigurationFactory ssl = new SslConfigurationFactory(); 
    ssl.setClientAuthentication("true"); 
    ssl.setTruststoreFile(new File("trust.jks")); 
    ssl.setTruststorePassword("trust-password"); 
    ssl.setKeystoreFile(new File("certs.jks")); 
    ssl.setKeystorePassword("certs-password"); 
    factory.setSslConfiguration(ssl.createSslConfiguration()); 
    factory.setImplicitSsl(true); 

服務器將強制用戶使用證書進行連接,並只接受那些包含在trust.jks。

相關問題