B4J Question [Solved] [ABMaterial] - using https (secure)

Harris

Expert
Licensed User
Longtime User
myApp.StartServerHTTP2(srvr, "srvr", port, 443,"keystore","b12xxxxx","b12xxxxx" ) ' port = 51046
Is this correct?


I purchased SSL cert from SSLs.com (namecheap)...

I had my VPS provider setup the certs on my VPS.
I created a keystore (named keystore) according to this command - and answering questions...

keytool -keystore keystore -alias jetty -genkey -keyalg RSA

Updated server with new jar and rebooted. The jar did start on the server, however
now I can't run the app in my browser.
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
You may have installed a wrong certificate when you created your keystore. This is what Firefox says about your certificate
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Looks like the Apache server that is serving https://comcrimewatch.com/ is set up correctly, but Jetty for your application is not.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
You may have installed a wrong certificate when you created your keystore. This is what Firefox says about your certificate
I didn't create a self sign... All I did was create a keystore - cause it is needed? What is the alias name in creating it?

keytool -keystore ccw.keystore -alias jetty -genkey -keyalg RSA

What should I write into it? Tried my best...
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
You need to import your certificate (the same that the Apache server is using) into your keystore. You'll have to do some googling for that or someone else can chime in on the howto.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
You need to import your certificate (the same that the Apache server is using) into your keystore. You'll have to do some googling for that or someone else can chime in on the howto.
I have been reading for the past 2 days trying to figure this out - keystore.... Nothing seems to help.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore ccw.keystore -destkeystore ccw.keystore -deststoretype pkcs12".
root@hwsrv-206966:/var/www# keytool -importkeystore -srckeystore ccw.keystore -destkeystore ccw.keystore -deststoretype pkcs12
Enter source keystore password:
Entry for alias jetty successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled

Warning:
Migrated "ccw.keystore" to Non JKS/JCEKS. The JKS keystore is backed up as "ccw.keystore.old".

So, I migrated and rebooted... same thing Not Secure...
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Did you create a new ccw.keystore or just use the old one to import your cert? I would try creating a new one (move old one somewhere else).
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Plus it looks like you are importing your keystore instead of the certificate
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Did you create a new ccw.keystore or just use the old one to import your cert? I would try creating a new one (move old one somewhere else).
The process created the new one - using the same name. It backup the original to ccw.keystore.old
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Plus it looks like you are importing your keystore instead of the certificate
Seems the cert is all setup on the server. I don't follow "importing the keystore instead of cert"? Importing what to where?
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
All I know is that ABM required a keystore file, so I created one using keytool - as decribed previously. I don't know if that was done correctly (like the alias name - it is jetty right now) - what shout the allias name be? Doesn't say anywhere - so I went with default. I think this keystore process needs a better explanation - from a B4X perspective - a clear example. I am sure it is simple - when one knows what the heck they are doing...
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Seems the cert is all setup on the server.
The apache server on your site is configured to use your SSL certificate. Not the Jetty server that is serving you ABM applications. Each server needs to be configured separately. It would be nice if the server OS would be configured and then everything works, but that is not the nature of the beast. You should be able to download your certificate from where-ever you purchased it from. Use PKCS12 format.
B4X:
keytool -importkeystore -srckeystore jetty.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
In the above command, jetty.pkcs12 should be the certificate that you downloaded and keystore should be the name of the Java keystore you want to store it to. In your case, I would create a new keystore (rename the previously created one) and see how far you get. Make sure the new keystore is in the right place for your ABM application.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User


This says I created this cert - which I did not... All I did was (try) and create a keystore file... Sertigo issued the cert - which my VPS provider installed for me...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…