Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Step 4: Fix extension in command; Step 6: add note about JAVA_HOME

...

Code Block
languagebash
themeRDark
$allcerts = Get-Content "$env:UserProfile\Downloads\host.domain.tld_full-chain.cerpem" -Encoding UTF8 -Raw
$i = 0
[regex]::Matches($allcerts, '(-{5}BEGIN CERTIFICATE-{5}[\s\S]*?-{5}END CERTIFICATE-{5})') | ForEach-Object {
    $i++
    $_.value | Out-file "$env:UserProfile\Downloads\host.domain.tld_part-$i.pem"
}

...

Code Block
languagescala
themeRDark
keytool -import -file host.domain.tld_part-n.pem -alias <host.domain.tld|domain.tld_CA|tld_CA> -keystore %JAVA_HOME%\lib\security\cacerts

(info) Note Note1, you may wish to first backup your %JAVA_HOME%\lib\security\cacerts file

(info) Note2, if you don't have JAVA_HOME defined in your environment, you may get an error saying JAVA_HOME is not defined.  To confirm, type set and if you do not see JAVA_HOME listed, define it via set JAVA_HOME=<path to JAVA home ex: "C:\Program Files\Java\jre1.8.0_151">

(warning) IMPORTANT, if you are importing certificates for a JRE that was bundled with your installed software, ie:  NoMagic (Cameo, MagicDraw (MD)), Rhapsody, etc.  please ensure you specify the keystore path for that bundled instance of JRE VS the default as shown above (for MD, you can determine the installed path of JRE by checking Help, About and clicking on the Environments tab; for Rhapsody, open the rhapsody.ini in your installation folder and examine the JavaLocation= var under the [JVM] section).