Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Paho SSL with pre-shared key
Paho SSL with pre-shared key [message #973935] Tue, 06 November 2012 18:43 Go to next message
Johan J is currently offline Johan JFriend
Messages: 2
Registered: November 2012
Junior Member
Hi, i got paho java client working with a mosquitto broker without ssl.

I am trying to set the psk-identity and psk values in the paho client but i am failing.
Using the mosqquitto_sub with --psk-identity and --psk works very well.

I assume i need to use some sort of sslsocketfactory but i havent found any good example to use (very new to ssl also).

Any help or pointers are greatly appreciated.

Thank you.
Re: Paho SSL with pre-shared key [message #987652 is a reply to message #973935] Tue, 27 November 2012 12:55 Go to previous messageGo to next message
Andy Piper is currently offline Andy PiperFriend
Messages: 17
Registered: November 2011
Location: Kingston upon Thames, UK
Junior Member

Hi Johan, apologies for taking so long to respond but I don't always keep an eye on the web forums as much as on the mailing list.

Does this help at all?
https://gist.github.com/4104301


Developer Advocate | Eclipse Paho project | mqtt.org | andypiper.me
Re: Paho SSL with pre-shared key [message #991007 is a reply to message #987652] Sun, 16 December 2012 20:07 Go to previous messageGo to next message
Johan J is currently offline Johan JFriend
Messages: 2
Registered: November 2012
Junior Member
It does, thank you!

Sorry for late reply.
Re: Paho SSL with pre-shared key [message #1006448 is a reply to message #991007] Thu, 31 January 2013 11:28 Go to previous messageGo to next message
Tushar Bapte is currently offline Tushar BapteFriend
Messages: 1
Registered: November 2012
Junior Member
Hi Johan ,

i am getting following exception :
exception throwing after line :KeyPair key = (KeyPair)reader.readObject();

org.bouncycastle.openssl.PEMException: problem parsing ENCRYPTED PRIVATE KEY: javax.crypto.BadPaddingException: pad block corrupted
at org.bouncycastle.openssl.PEMReader$EncryptedPrivateKeyParser.parseObject(Unknown Source)
at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source)
at org.eclipse.paho.sample.mqttv3app.SslUtil.getSocketFactory(SslUtil.java:38)
at org.eclipse.paho.sample.mqttv3app.Sample.(Sample.java:194)
at org.eclipse.paho.sample.mqttv3app.Sample.main(Sample.java:137)
Caused by: javax.crypto.BadPaddingException: pad block corrupted

How you have attached password file??
I have attached my java file.

Please help me.

Thanks,
Tushar.
  • Attachment: SslUtil.java
    (Size: 2.13KB, Downloaded 556 times)
Re: Paho SSL with pre-shared key [message #1007321 is a reply to message #1006448] Tue, 05 February 2013 14:14 Go to previous messageGo to next message
Andy Piper is currently offline Andy PiperFriend
Messages: 17
Registered: November 2011
Location: Kingston upon Thames, UK
Junior Member

Hi Tushar, did you see the reply to the same issue you reported on the Github Gist posted by Sharon?

https://gist.github.com/sharonbn/4104301

It sounds like you could have a corrupt certificate file or an issue with the platform you are on?


Developer Advocate | Eclipse Paho project | mqtt.org | andypiper.me
Re: Paho SSL with pre-shared key [message #1007340 is a reply to message #1006448] Tue, 05 February 2013 15:12 Go to previous message
Andy Piper is currently offline Andy PiperFriend
Messages: 17
Registered: November 2011
Location: Kingston upon Thames, UK
Junior Member

Hi Tushar, did you see the response Sharon posted to this same issue you reported against his original Gist?

https://gist.github.com/sharonbn/4104301

It looks like you may have a corrupt certificate or an encoding issue?

What platform are you on, and what JVM?


Developer Advocate | Eclipse Paho project | mqtt.org | andypiper.me
Previous Topic:Paho Java client, turning off automatic ping messages
Next Topic:Segmentation Fault Issue
Goto Forum:
  


Current Time: Fri Apr 19 11:34:20 GMT 2024

Powered by FUDForum. Page generated in 0.01483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top