Go to advanced search

by JosAH
Tue Jan 24, 2017 11:29 am
Forum: Java
Topic: Serial Communication
Replies: 3
Views: 1485

Re: Serial Communication

If all you want is open/close and read/write from your device, you don't need RXTX; i.e. just open /dev/ttyUSB or /dev/ttyAMA0(dependig on if you want to read a usb device or the internal serial device respectively). You can optionally set the device baud rate before you start the jvm (by using stty...
by JosAH
Tue Nov 22, 2016 4:50 pm
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

I solved this nasty issue (at least for me); the system runs on a Raspberry Pi; it is an IoT thingy and handles a couple of other devices 'over the air' (read: 2.4GHz) and the micro controllers for those devices are way too small to handle ssl sockets; consequently that Pi has to handle ordinary soc...
by JosAH
Tue Nov 15, 2016 5:29 pm
Forum: Java
Topic: Generating RSA Keys With Java on Raspberry Pi
Replies: 7
Views: 1858

Re: Generating RSA Keys With Java on Raspberry Pi

For the problems with an http server: download this small http server (it's a nifty, flexible server) from this page: http://www.freeutils.net/source/jlhttp/ (the latest release (2.2) will do fine). It's a single file; After line #3024, where a new HTTPServer is created in the sample main( ... ) met...
by JosAH
Mon Nov 14, 2016 10:11 am
Forum: Java
Topic: Generating RSA Keys With Java on Raspberry Pi
Replies: 7
Views: 1858

Re: Generating RSA Keys With Java on Raspberry Pi

Thanks for the reply. Did you generate the Certificate using Keytool on Raspberry Pi? Or was it that you generated the Certificate / Keys on Laptop / Desktop and copied them over to Raspberry? I did both and none of the alternatives worked; fyi: using the Pi as an HTTP client (a browser) for my HTT...
by JosAH
Mon Nov 14, 2016 7:59 am
Forum: Java
Topic: Generating RSA Keys With Java on Raspberry Pi
Replies: 7
Views: 1858

Re: Generating RSA Keys With Java on Raspberry Pi

For this post, an answer from someone who has tried to Generate RSA Keys from within Java Code might be better though. I made the self signed certificate using the 'keytool' tool; like this: keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 365 As I ...
by JosAH
Mon Nov 14, 2016 6:06 am
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

Have you tried importing Server Certificate in Client's Trust Store? If the application uses two way SSL Certificate Auth, you'll need to sign Client Certificate with same key (or some key that is in the same Tree as) the one that signed Server Cert. But what to do if the server doesn't know who/wh...
by JosAH
Sun Nov 13, 2016 3:14 pm
Forum: Java
Topic: Generating RSA Keys With Java on Raspberry Pi
Replies: 7
Views: 1858

Re: Generating RSA Keys With Java on Raspberry Pi

My Pi/3 came pre-installed with Oracle's Java 8; If the Pi has to act as a secure client, say, for SMTP or IMAP, everything works fine (i'm using Java Mail for it); it's the secure server that has to deliver the certificate, but if the Pi has to act as a secure server (say HTTP), I can't get it runn...
by JosAH
Sun Nov 13, 2016 10:25 am
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

Maybe a small explanation is in order here: Java implements those secure sockets itself; i.e. it doesn't need that openssl layer at all; it can do that because secure sockets are implemented on top of ordinary TCP sockets.When a secure client socket wants to communicate with a secure server sockets,...
by JosAH
Sat Nov 12, 2016 5:47 pm
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

For what? All I can see is the keystore (it's self signed); here it is: C:\Program Files\Java\jre1.8.0_101\bin>keytool -v -list -keystore d:\home\pi\keystore.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: selfsigned Creation date: No...
by JosAH
Sat Nov 12, 2016 4:52 pm
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

@DougieLawson: I think I understand what you're saying, but I don't understand why it works fine on my laptop, i.e. as I described in a previous reply of mine ...

kind regards,

Jos
by JosAH
Sat Nov 12, 2016 4:30 pm
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

Re: SSL sockets for HTTP

Thanks for your reply, but as far as I understand Java SSLSockets, they run in a non-intrusive way, i.e. one has to define a keystore and one has to use the SSLServerSocketFactory class for a SSLServerSocket. Two System.Properties define the location of the keystore and its password. It works fine t...
by JosAH
Sat Nov 12, 2016 2:30 pm
Forum: Java
Topic: SSL sockets for HTTP
Replies: 10
Views: 2924

SSL sockets for HTTP

Greetings, I'm running Oracle's Java 8 (it came pre-installed on my Pi/3) and I'm trying to run my own HTTP server on SSL sockets. The 'keytool' utility can create self signed certificates; this thing works on a PC, using the RSA and/or DSA algoritms. Not so on my Pi/3: all I get is an error message...

Go to advanced search