B4J Tutorial How to Install an SSL Certificate in B4J Server (Jetty)

ssl.png


This is a easy way to install SSL Certificate on a VPS with Jetty.

(1) Goto ZeroSSL to create free sll for your domain: https://zerossl.com/

(2) Download your Certificate (includes 3 files: ca_bundle.crt, certificate.crt, private.key)

(3) Download Openssl if you have not yet on your computer. (https://slproweb.com/products/Win32OpenSSL.html)

(4) Joint Certificate, open a new command prompt (C:\Program Files\OpenSSL-Win64\bin).

Run:

B4X:
openssl pkcs12 -export -in d:\certificate.crt -inkey d:\private.key -out d:\abc.p12

(5) Move to the JDK software where installed on your computer (ex: C:\Program Files\Java\jdk1.8.0_333\bin)

Run:

B4X:
keytool -importkeystore -srckeystore d:\abc.p12 -srcstoretype PKCS12 -destkeystore d:\abc.jks -deststoretype JKS

(6) Copy abc.jks on to Object folder

ssl.png
 
Last edited:

aminoacid

Active Member
Licensed User
Longtime User
If you are using the "Lets Encrypt" free certificates, the above procedure to create the keystore is the same except in the openssl command replace the two file names as follows:


B4X:
openssl pkcs12 -export -in d:\fullchain.pem -inkey d:\privkey.pem -out d:\abc.p12


You may also have to include in the openssl command above:

-passout pass:12345678

and in the keytool command:

-srcstorepass 12345678 -deststorepass 12345678

to correspond to the passwords specified in the ConfigureSSl sub.
 
Top