2017-10-09 11 views
0

저는 Microsoft Azure에서 데비안 VM을 사용하고 있습니다. 모스 킷토를 설치했는데 SSL을 구성하지 않는 동안 잘 실행됩니다.데비안에서 Mosquitto SSL 설정을 테스트 할 때 알 수없는 CA가 있습니다.

openssl genrsa -des3 -out ca.key 2048 
openssl req -new -x509 -days 1826 -key ca.key -out ca.crt 
openssl genrsa -out server.key 2048 
openssl req -new -out server.csr -key server.key 
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360 

내 호스트 이름이 데비안 RNO 내가 그와 같은 일반적인 이름을 사용 : 나는 OpenSSL을 가진 자체 서명 된 인증서와 키 (는 server.crt &은 server.key를) 만들었습니다. 내 mosquitto.conf는 브로커가 오류없이 시작

# mosquitto.conf 
pid_file /var/run/mosquitto.pid 
persistence true 
persistence_location /var/lib/mosquitto/ 
log_dest file /var/log/mosquitto/mosquitto.log 
# MQTT over TLS/SSL 
listener 8883 
cafile /etc/mosquitto/certs/ca.crt 
certfile /etc/mosquitto/certs/server.crt 
keyfile /etc/mosquitto/certs/server.key 
log_type error 
log_type warning 
log_type notice 
log_type information 
tls_version tlsv1.2 
# End of MQTT over TLS/SLL configuration 

입니다. 내가 간부 인 때처럼 mosquitto_pub :이 오류가 발생

mosquitto_pub -h Debian-RNO -t topic1 -m "test" -d --cafile /etc/mosquitto/certs/ca.crt -p 8883 

는 :

1507583871: New connection from 52.178.101.16 on port 8883. 
1507583871: OpenSSL Error: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca 
1507583871: OpenSSL Error: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure 
1507583871: Socket error on client <unknown>, disconnecting. 

내가 성공하지 않고 시간 동안 검색 :

mosquitto.log에서
Unable to connect (A TLS error occurred.). 

, 나는 그 항목이 ... 어떤 도움도 환영합니다!

답변

0
SSL3_READ_BYTES:tlsv1 alert unknown ca 

이 분명이 당신의 로컬 그래서 당신이 신뢰 저장소에 CA 인증서를 가져와야 CA 생성 (운영 체제 레벨 또는 중 신뢰의 mosquitto 인이 서명 한 것 같이 SSL 핸드 셰이크 중에, CA 인증서가 신뢰할 수없는 것을 말한다 사용)

+0

그러나 mosquitto는 인증서 위치가 설명되어있는 mosquitto.conf를 사용하고 있습니다. 맞습니까? https://mosquitto.org/man/mosquitto-conf-5.html – rno