2016-08-05 1 views
0

Smack 4.1.8 라이브러리를 사용하여 Apache Vysper Server에 연결하려고합니다. 그러나 Vysper와 함께 제공되는 bogus_mina_tls.crt를 처리하는 방법은 무엇입니까?Smack가있는 Apache Vysper 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에 그렇게 : 헤로인 3에서 당신은 사용할 수 있을까?

많은 감사

답변

0

은 헤로인 4로 당신은 헤로인 자신의 SSLContext을 구성하고 setCustomSslContext(SSLContext)로를 설정해야합니다. 사용자 정의 SSLContext을 제공하지 않으면 Smack은 런타임 기본값을 사용합니다 (즉, Java의 truststore로 인증서를 확인하는 수단).

+0

또한 인증서가 필요합니까? 이걸 어떻게 세우는거야? 자습서 나 이와 비슷한 것을 줄 수 있겠습니까? 죄송합니다. 저는 SSL을 처음 접했습니다.) – Sebastian85

관련 문제