B4J Question communicate between 2 webapps secure?

ilan

Expert
Licensed User
Longtime User
hi

i have 1 web app that runs on pc1 and another web app that runs on pc2 (not a local network). and i would like to send/receive data between them. what would be the secure way to do that?
what i do now is using HTTP requests where i encrypt the data that I am sending. is there another way to do that?

i will explain. i have pc2 that is running a server with SQLite DB and I would like to read from that DB from a b4j app that is running on pc1. so with HTTP requests i get the data from the server to the b4j app but is that secure enough if i use the B4XEncryption library?
 

ilan

Expert
Licensed User
Longtime User
like here?

i use let's encrypt for the SSL certificate and the SSL b4j server as (explained above).
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
i use let's encrypt for the SSL certificate

Are you communicating on the local network or over the internet. I didnt think letsencrypt could generate certificates for local network names.

I just use self-signed certificates but that requires each client to trust the certificate. If you have a proper IT team then they can generate you a trusted certificate for your internal domain.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User

i will use it over the internet but now I am making tests on a local network. i do run in problems. i run the b4j server with SSL configuration and if I make a httpjob request from another b4j app I am getting errors:


so I tried to use OkHttpClient with InitializeAcceptAll and I am able to make the request but in the _ResponseSuccess (Response As OkHttpResponse, TaskId As Int) event I don't know how to get the data that was sent from the b4j server. i get the response content length that is correct but I have no GetContent method.

how can I receive the data? maybe as a son object or simple string like it is working over a web browser?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

ilan

Expert
Licensed User
Longtime User
thank you Erel very much for your help.

adding HU2_ACCEPTALL to the conditional symbol (Ctrl + B) did the trick. now i am able to make http request from another b4j app to my server.

just to understand better the instruction here: https://www.b4x.com/android/forum/threads/server-jokhttputils2-server-version.124350/#content

2. Add a reference to jBuilderUtils = just check the jBuilderUtils in the library Manager (in the server Application) right?

is it ok to build the Server with HU2_ACCEPTALL and upload the Jar to my hosting? or it is not needed because over the internet i should not get any error related to the one i get in post #6 ( javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target )

is there a way to run 2 b4j apps in debug mode? because now i have to run the server in release mode to be able to run the second app in debug mode.

thank you
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
2. Add a reference to jBuilderUtils = just check the jBuilderUtils in the library Manager (in the server Application) right?
Yes.

If the servers use valid certificates then it is not needed and HU2_ACCEPTALL should be removed as it make things less secure.

s there a way to run 2 b4j apps in debug mode?
Currently no.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…