B4J Question [ABMaterial] SSL Help Requested... [Solved]

Robert Maguire

Member
Licensed User
Longtime User
Hi Folks,

So I'm still trying to get my ABMaterial webapp going and running into problems that are a little bit past the edge of my knowledge...
I managed to deploy my webapp successfully and get it running under the http protocol but now I am trying to get it to run under the https protocol... Why? Because I need to embed the app into a WordPress page. I will be doing this using a WordPress plugin that permits you to embed external content into the page via an iframe.

Now...the WordPress site operates on https, which means that any iframe content also has to run on https. http is rejected.

I read Erel's tutorial (https://www.b4x.com/android/forum/threads/server-ssl-connections.40130/) and also tchart's tutorial (https://www.b4x.com/android/forum/t...uesting-and-installing-ssl-certificate.55194/) and did my best to follow them to the letter but when I start the jar on my server I keep getting error's. After peeking, poking and tweaking I am still drawing blanks...

I'm really hoping that someone can help me here because I'm at my knowledge limits and I'm tearing my hair out...

The error I'm getting in the log is:

Bash:
abmapplication._startserverhttp2 (java line: 558)
java.lang.IllegalStateException: No Server ALPNProcessors!
        at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPN
ServerConnectionFactory.java:53)

The steps I took to try and convert to https are as follows:
(for example purposes I will use domain = 'abcedfg.com' and password values 'abc123') to protect the innocent... šŸ˜

Generating an SSL Certificate
I followed Erel's and tchart's examples and created a certificate with:
Bash:
keytool -keysize 2048 -genkey -alias jetty -keyalg RSA -keystore jetty.keystore
The values I plugged into keytool were:
  • Keystore password = abc123
  • First and Last Name = abcdefg.com
  • Organisational Unit = abcdefg.com
  • Organisation = abcdefg.com
  • City = Canberra
  • State or Province = Australian Capital Territory
  • Country Code = AU
  • Key password <for jetty> = abc123
This produced the file jetty.keystore. I copied this file into the same directory that the webapp jar file lives, which I believe equates to 'File.DirApp'.

I then modified the ABMaterial/B4J code to use StartServerHTTP2 instead of StartServer as follows:
From
B4X:
myApp.StartServer(srvr, "srvr", 51405)
To
B4X:
myApp.StartServerHTTP2(srvr, "srvr", 51405, 51406, "jetty.keystore","abc123","abc123")

I compile the app and copy all the relevant files over to the server...

I start the server using:
Bash:
nohup java -jar abcdefgApp.jar > nohup.out &

The result is the error shown at the start of the post... At this point I am completely bamboozled and don't know which way to turn...Can anybody point me in a direction or see anything wrong that I have done.

Please note that I have not done a Cert Request from a Cert Provider at his stage because I'm looking into options provided by my VPS host but I'm led to believe that this is not required for testing purpose (and hope that this is not the cause of my problem).

Any advice will be greatly appreciated...
 

Robert Maguire

Member
Licensed User
Longtime User
OMG... it's happened yet again... Deja Vu...

Having posted my question above I did another forum search, but included 'ALPN' in the search criteria, and found the following thread:

https://www.b4x.com/android/forum/threads/server-conscrypt-and-http-2.93040/

So I added the Conscrypt jar as recommended in the thread and the webapp started up fine and now runs on the https protocol (with the expected warnings about my self-signed SSL cert).

Once again... apologies if I wasted anybody's time looking at this issue on my behalf.
And ... I hope this thread helps anybody else who might have to grapple with the same issue...
 
Upvote 0
Top