B4J Question jRDC2 with SSL example

Angel Garcia

Member
Licensed User
Hello all,
Wondering if there is an example of jRDC2 with SSL connection, just in order to put me on the right direction.
First I'll go threw this tutorial:
https://www.b4x.com/android/forum/t...installing-ssl-certificate.55194/#post-346876

And later go threw this tutorial:
https://www.b4x.com/android/forum/threads/server-ssl-connections.40130/

And the extra code in jrdc2 i need to add is something like this?:
ssl2:
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?
srvr.AddFilter("/*", "HttpsFilter", False)

Is this ok?

And after all that i could use https with jrdc2?, am i correct?

Many thanks all for your help!
 

MiguelL

Member
Licensed User
Not sure if you micht run into this same problem, but I got everything working on my mobile (J5) using Firefox, but everything failed on Chrome.
Cleaning the history (cache) did not make any difference. After re-installing Chrome on my mobile suddenly everything worked also from Chrome.
 
Upvote 0

Angel Garcia

Member
Licensed User
Finally!!
Thanks Oliver! ?
Did you check the "Include all certificates in the certification path if possible" option during the export? I should be available when you pick the format of the export.

Finally got it working, yes you were right. Now it works on devices and from web page.
This way was easier for me, (for windows server users)
1. First you purchase a certificate from cheapssl.com or some other, for a long time (at least 1 year),
2. You install it on your IIS server
3. And then you perform the export as a pfx file with the link that oliver provided, https://enterpriseit.co/windows-server/exporting-ssl-certificate-pfx-from-windows-server-iis/
4. Then import back as a JKS file with the java keytool, with this command: keytool -importkeystore -srckeystore C:\SSLCerts\mycert.pfx -srcstoretype pkcs12 -destkeystore C:\SSLCerts\mykeystore.jks -deststoretype JKS , and finally
5. Use the imported JKS file to the xSr.SetKeyStorePath(File.DirApp,"mykeystore.jks")
Many thanks to all for your kind support!!
?
 
Upvote 0

MiguelL

Member
Licensed User
I found this as a possible solution for auto renewal on windows, but still have to test it. Glad your solution is working! I might go for the same solution too once I get some more experience with all of this.
regards.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…