[Solved] Generating Certificate for HTTPS

Unimus support forum
Post Reply
joairamd
Posts: 3
Joined: Thu Jun 30, 2022 4:49 pm

Thu Jun 30, 2022 4:54 pm

Hello,

We have recently installed Unimus and are getting to it via HTTP and would like to use HTTPS, I saw that in the documentation there is a way to generate a self-signed certificate in order to connect to Unimus via HTTPS but I am unable to generate the self-signed certificate. Writing down the final line in powershell outputs an error:

"%KEYTOOL%" -genkey -alias unimus -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore unimus.keystore.p12 -validity 3650

Unimus is installed in a 2016 Windows server. Additionally in the Unimus path C:\Program Files\Unimus ther is only these items:

jre8 folder
nssm.exe
Unimus.exe
Unimus.l4j.ini
uninstaller.exe

Please let me know if you need additional information.
Vik@Unimus
Posts: 126
Joined: Thu Aug 05, 2021 6:35 pm

Thu Jun 30, 2022 5:10 pm

Hello,

I believe the issue boils down to the path when setting up Java home folder and the path in the first line which was pointing at jre folder instead of jre8. We fixed the path and it is pointing at the correct folder now, so feel free to give it another try

https://wiki.unimus.net/display/UNPUB/U ... igned+cert
joairamd
Posts: 3
Joined: Thu Jun 30, 2022 4:49 pm

Mon Aug 15, 2022 3:38 pm

Hello,

I am still getting this error when trying to generate the certificate after I run the command:

At line:5 char:13
+ "%KEYTOOL%" -genkey -alias unimus -storetype PKCS12 -keyalg RSA -keys ...
+ ~~~~~~~
Unexpected token '-genkey' in expression or statement.
At line:5 char:21
+ "%KEYTOOL%" -genkey -alias unimus -storetype PKCS12 -keyalg RSA -keys ...
+ ~~~~~~
Unexpected token '-alias' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

I am making sure the folder paths are correct as well but I still get the error above.
Vik@Unimus
Posts: 126
Joined: Thu Aug 05, 2021 6:35 pm

Mon Aug 15, 2022 6:12 pm

I looked at it closer. It seems as so Powershell is no longer supporting this syntax for variables, so to use the original commands, please run them in CMD terminal.

To use Powershell (administrator rights are required), you can use this rotation of commands instead:

Code: Select all

$env:JAVA_HOME='C:\Program Files\Unimus\jre8'
$env:KEYTOOL="$env:JAVA_HOME\bin\keytool"

cd "C:\Program Files\Unimus"
& "$env:KEYTOOL" -genkey -alias unimus -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore unimus.keystore.p12 -validity 3650
joairamd
Posts: 3
Joined: Thu Jun 30, 2022 4:49 pm

Tue Aug 16, 2022 9:07 pm

Thank you that seemed to work.
Post Reply