{"id":5082,"date":"2014-03-30T18:42:17","date_gmt":"2014-03-30T18:42:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-create-a-psk-connection-between-the-eclipse-paho-java-mqtt-client-and-the-mosquitto-broker-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:42:17","modified_gmt":"2014-03-30T18:42:17","slug":"how-can-i-create-a-psk-connection-between-the-eclipse-paho-java-mqtt-client-and-the-mosquitto-broker-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-create-a-psk-connection-between-the-eclipse-paho-java-mqtt-client-and-the-mosquitto-broker-collection-of-common-programming-errors\/","title":{"rendered":"How can I create a PSK connection between the Eclipse PAHO Java MQTT client and the Mosquitto broker?-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to configure a Pre Shared Key encrypted connection between a mosquitto mqtt broker and an application written in Java which uses the Eclipse Paho client library.<\/p>\n<p>I have successfully made connections between the two using no encryption and using SSL where the Server certificate is authenticated but with no client certificate.<\/p>\n<p>I would like to get the connection encrypted (authentication not important) by using a Pre Shared Key, which is definitely supported by the mosquitto broker, but I am uncertain whether the Eclipse Paho library supports it or not.<\/p>\n<p>The library offers you two different ways of configuring a secure connection. Either through the<\/p>\n<pre><code>setSSLProperties(java.util.Properties props)\n<\/code><\/pre>\n<p>method &#8211; making use of the following properties:<\/p>\n<pre><code>com.ibm.ssl.protocol\ncom.ibm.ssl.contextProvider\ncom.ibm.ssl.keyStore\ncom.ibm.ssl.keyStorePassword\ncom.ibm.micro.security.Password.obfuscate(char[] password). \ncom.ibm.ssl.keyStoreType\ncom.ibm.ssl.keyStoreProvider\ncom.ibm.ssl.trustStore\ncom.ibm.ssl.trustStorePassword\ncom.ibm.micro.security.Password.obfuscate(char[] password).\ncom.ibm.ssl.trustStoreType\ncom.ibm.ssl.trustStoreProvider\ncom.ibm.ssl.enabledCipherSuites\ncom.ibm.ssl.keyManager\ncom.ibm.ssl.trustManager\n<\/code><\/pre>\n<p>or through the<\/p>\n<pre><code>setSocketFactory(javax.net.SocketFactory socketFactory)\n<\/code><\/pre>\n<p>method.<\/p>\n<p>Does anyone have any experience with the tools and libraries that I am using and could anyone offer any suggestions as to how I might be able to get something working?<\/p>\n<p>Is it possible to create an ssl socket factory which is capable of returning a socket that can cope with the PSK implementation I will need?<\/p>\n<p>Thanks for your help \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to configure a Pre Shared Key encrypted connection between a mosquitto mqtt broker and an application written in Java which uses the Eclipse Paho client library. I have successfully made connections between the two using no encryption and using SSL where the Server certificate is authenticated but with no client certificate. I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5082","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5082"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5082\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}