`

websocket ca activemq双向认证

 
阅读更多

 

spring.mqtt.url=ssl://localhost:8883
spring.mqtt.keystore=mqtt.jks
spring.mqtt.keypassword=888888

 

spring.mqtt.truststore=truststore.ts
spring.mqtt.trustpassword=888888

SSLSocketFactory getSocketFactory2() throws Exception{
		String trustedKeystoreFile=new ClassPathResource(truststore).getFile().getAbsolutePath();
		String clientKeystoreFile=new ClassPathResource(keystore).getFile().getAbsolutePath();
		SSLSocketFactory ssl=SSLFellow.createSSLSocketFactory(trustedKeystoreFile, "cloud",trustpassword,clientKeystoreFile, keypassword, "mqtt",keypassword, "TLSv1.2", false);
		return ssl;
	}

<sslContext>
			<sslContext
				keyStore="file:${activemq.base}/conf/cacert/cloud.jks"
				keyStorePassword="888888"
				trustStore="file:${activemq.base}/conf/cacert/truststore.ts"
				trustStorePassword="888888" />
                         </sslContext>

<transportConnector name="mqtt+ssl"
				uri="mqtt+nio+ssl://0.0.0.0:8883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;wireFormat.maxInactivityDuration=0&amp;transport.needClientAuth=true&amp;transport.verifyHostName=false" />
		

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics