STARTTLS 구성 XMPP 서버에 연결할 때 문제가 발생합니다
문제
CA 인증서가있는 StartTL에 Ejabberd Server를 구성했습니다. 아래는 다음과 같습니다.
{5222, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
starttls_required,
{certfile, "/etc/ejabberd/conf/ejabberd.pem"},
{max_stanza_size, 65536}
]},
.
내 XMPP 클라이언트가 SMACK 라이브러리를 사용하여 Java에서 개발되었습니다. 인증서가 유효 한 경우에만 XMPP 클라이언트가 서버와 함께 작동하도록합니다.그러나 나는 그것을 할 수 없다. 아래는 내 xmpp 클라이언트 코드
입니다.ConnectionConfiguration config = new ConnectionConfiguration(host, port, serviceName);
config.setSASLAuthenticationEnabled(true);
config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
config.setCompressionEnabled(true);
config.setTruststorePath(trustStorePath);
config.setTruststorePassword(trustStorePwd);
config.setExpiredCertificatesCheckEnabled(true);
config.setNotMatchingDomainCheckEnabled(true);
config.setVerifyChainEnabled(true);
.
TrustStore에서 더미 인증서를 제공하더라도 성공적으로 연결이 성공적으로 만들어졌습니다.
나는 뭔가를 놓쳤습니까?
해결책
시도
config.setVerifyRootCAEnabled(true);
. 제휴하지 않습니다 StackOverflow