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 13:43 Go to next message
Johan J is currently offline Johan J
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 07:55 Go to previous messageGo to next message
Andy Piper is currently offline Andy Piper
Messages: 15
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


Cloud Foundry Developer Advocate @ Pivotal | Eclipse Paho project co-lead | mqtt.org | andypiper.co.uk
Re: Paho SSL with pre-shared key [message #991007 is a reply to message #987652] Sun, 16 December 2012 15:07 Go to previous messageGo to next message
Johan J is currently offline Johan J
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 06:28 Go to previous messageGo to next message
Tushar Bapte is currently offline Tushar Bapte
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 96 times)
Re: Paho SSL with pre-shared key [message #1007321 is a reply to message #1006448] Tue, 05 February 2013 09:14 Go to previous messageGo to next message
Andy Piper is currently offline Andy Piper
Messages: 15
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?


Cloud Foundry Developer Advocate @ Pivotal | Eclipse Paho project co-lead | mqtt.org | andypiper.co.uk
Re: Paho SSL with pre-shared key [message #1007340 is a reply to message #1006448] Tue, 05 February 2013 10:12 Go to previous message
Andy Piper is currently offline Andy Piper
Messages: 15
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?


Cloud Foundry Developer Advocate @ Pivotal | Eclipse Paho project co-lead | mqtt.org | andypiper.co.uk
Previous Topic:Paho Java client, turning off automatic ping messages
Next Topic:Segmentation Fault Issue
Goto Forum:
  


Current Time: Mon Apr 21 03:14:46 EDT 2014

Powered by FUDForum. Page generated in 0.02303 seconds