Android Question [Solved] JRDC2 Client Using SSL

Status
Not open for further replies.

NamR

Member
Licensed User
Hi,

I saw this very useful thread,
[B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector)

I am planning to replace my PHP web server with jRDC2.

I was able to run the jRDC2 B4J application, able to follow Erel's tutorial, created and run the Client apps (B4A) successfully.

After this, I setup the SSL (KeyStore) and verify using the browser (Test handler).

But using the B4A apps, there are errors. Please see below:

ResponseError. Reason: javax.net.ssl.SSLHandshakeException: Handshake failed, Response:
ERROR: javax.net.ssl.SSLHandshakeException: Handshake failed

I am looking for the SSL version of the DBRequestManager.

Thank you in advance.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

NamR

Member
Licensed User
No such thing. You just need to change the rdc link to start with https://.

If it doesn't work then the server is misconfigured. If you are using a self signed certificate: [B4X] OkHttpUtils2 / iHttpUtils2 and accept all option

Hi Erel,

I tested the jRDC2 using HTTPS (browser) and it is good. Then, I change the B4A apps from HTTP:// into HTTPS://, but I encountered errors.

I think I have to replace the HTTPJOB (inside DBRequestManager ) with OkHttpClient and OkHttpRequest. Because the HTTPJOB doesn't have InitializeAcceptAll option. Is this correct?

Thank you.
 
Upvote 0

NamR

Member
Licensed User
No.

All the information you need is in my previous post.

Hi Erel,

My bad. I forgot to change the server port; it was still pointed at HTTP, not on HTTPS.

It is working perfectly.

Again, many thanks to you.

You're really a great help.

Cheers.
 
Upvote 0

Angel Garcia

Member
Licensed User
Hello,
I want to use also an SSL for jrdc connection,
You just bind your SSL certificate to the java port in the IIS right??, instead of the typicall 443 to 17178 is this correct?
Because im getting a wrong connection when testing the jrdc connection with https in a webbrowser, but i get it successful when is http.
Many thanks for your guidance
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
You just bind your SSL certificate to the java port in the IIS right??
jRDC2 uses Jetty and has nothing to do with IIS (unless IIS can somehow be used as a reverse proxy). Out of the box, jRDC2 is not configured for using a SSL certificate/port. You'll have to add some additional code to the jRDC2 source and then create a keystore file that contains the SSL certificate. If you have any more questions you may need to start another thread. A good starting point on your journey is this link: https://www.b4x.com/android/forum/threads/server-ssl-connections.40130/#content
 
Upvote 0

Angel Garcia

Member
Licensed User
jRDC2 uses Jetty and has nothing to do with IIS (unless IIS can somehow be used as a reverse proxy). Out of the box, jRDC2 is not configured for using a SSL certificate/port. You'll have to add some additional code to the jRDC2 source and then create a keystore file that contains the SSL certificate. If you have any more questions you may need to start another thread. A good starting point on your journey is this link: https://www.b4x.com/android/forum/threads/server-ssl-connections.40130/#content
Ok, i'll try creating the SSL certificate
I will follow this tutorial:
its ok?

Ok, assuming i could get the correct certs, is this the piece of code i need to add to jrdc2?:

ssl:
    Dim xSr As SslConfiguration
    xSr.Initialize
    xSr.KeyManagerPassword="SomeKeyManagerPassword"
    xSr.KeyStorePassword="SomeKeyStorePassword"
    xSr.SetKeyStorePath(File.DirAssets,"somefile.crt")
    srvr.SetSslConfiguration(xSr,17179)' a different port of the common http 17178?
    srvr.Start

Thanks for your help!
 
Upvote 0
Status
Not open for further replies.
Top