2016-08-05 5 views
0

Smack 4.1.8ライブラリを使用してApache Vysper Serverに接続したいとします。しかし、Vysperに付属のbogus_mina_tls.crtをどのように処理するのですか?スマック3ではあなただけ使用できます。Apache Vysper with Smack 4.1.8クライアントライブラリ - TLS証明書の処理方法?

ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", 5222); 
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required); 
connectionConfiguration.setSASLAuthenticationEnabled(true); 
connectionConfiguration.setKeystorePath("src/main/resources/bogus_mina_tls.cert"); 
connectionConfiguration.setTruststorePath("src/main/resources/bogus_mina_tls.cert"); 
connectionConfiguration.setTruststorePassword("boguspw"); 

しかし、どのようにXMPPTCPConnectionConfiguration.builder()とスマック4 APIでそれを行うには?

多くのおかげ

答えて

0

はスマック4を使用すると、スマック自身のためSSLContextを構築し、setCustomSslContext(SSLContext)でそれを設定する必要があります。カスタムSSLContextを指定しないと、Smackはランタイムのデフォルトを使用します(つまり、Javaのトラストストアで証明書を検証することに頼る)。

+0

また、証明書も必要ですか?これを設定する方法は?あなたは私にこのようなチュートリアルや何かを与えることができます....申し訳ありません私はsslにはかなり新しいです;) – Sebastian85

関連する問題