This is a Github action to add a root certificate in x509 format to the default java truststore
.gitignore | ||
action.yml | ||
LICENSE | ||
README.md |
Add root certificate to java truststore
Github action to add a root certificate in x509 format to an existing java truststore.
usage example
name: Main
on:
push:
branches:
- main
jobs:
build:
runs-on: runner
steps:
- name: Retrieve root ca certificate
id: get-ca-cert
uses: RouxAntoine/get-ca-cert@master
- run: |
echo "${{ steps.get-ca-cert.outputs.ca-cert }}"
- uses: actions/setup-java@v4
id: java
with:
distribution: 'temurin'
java-version: '21'
- name: Add root certificate to java truststore
uses: RouxAntoine/add-ca-truststore@master
id: add-ca-to-truststore
with:
ca-cert: "${{ steps.get-ca-cert.outputs.ca-cert }}"
store-path: "${{ steps.java.outputs.path }}/lib/security/cacerts"
- run: |
echo "Auto generated alias name: ${{ steps.add-ca-to-truststore.outputs.certificate-alias }}"
keytool -list -cacerts