|
79 | 79 | - if: matrix.os == 'ubuntu-latest' |
80 | 80 | name: Test jNut with NIT |
81 | 81 | run: | |
82 | | - PATH="/lib/nut:/libexec/nut:/usr/sbin:/usr/bin:$PATH" |
| 82 | + PATH="/lib/nut:/libexec/nut:/usr/sbin:/usr/bin:$JAVA_HOME/bin:$PATH" |
83 | 83 | export PATH |
84 | 84 | #NIT_CASE="generatecfg_upsd_add_SSL && generatecfg_upsdusers_trivial && generatecfg_ups_dummy" |
85 | 85 | WITH_SSL_SERVER=NSS WITH_SSL_CLIENT=NSS \ |
|
90 | 90 | echo 'maxstartdelay = 30' > "$NUT_CONFPATH/ups.conf.x" |
91 | 91 | grep -v maxstartdelay < "$NUT_CONFPATH/ups.conf" >> "$NUT_CONFPATH/ups.conf.x" |
92 | 92 | mv -f "$NUT_CONFPATH/ups.conf.x" "$NUT_CONFPATH/ups.conf" |
| 93 | + SSL_ARGS="" |
| 94 | + if [ -d "$NUT_CONFPATH/cert/upsd" ] ; then |
| 95 | + mkdir -p "${NUT_CONFPATH}/cert/jks" |
| 96 | + JNUTKS="${NUT_CONFPATH}/cert/jks/jNut.jks" |
| 97 | +
|
| 98 | + # For client we need Root CA cert (maybe server cert?) and own cert/key (upsmon) |
| 99 | + # and NIT script already leaves (most of) them there as PEM files |
| 100 | + keytool -importcert -noprompt -trustcacerts -cacerts -keystore "${JNUTKS}" -storetype JSK -storepass "changeit" -alias "${TESTCERT_ROOTCA_NAME}" -file "${TESTCERT_PATH_ROOTCA}/rootca.pem" |
| 101 | + keytool -importcert -noprompt -trustcacerts -keystore "${JNUTKS}" -storepass "changeit" -alias "${TESTCERT_SERVER_NAME}" -file "${TESTCERT_PATH_SERVER}/server.crt" |
| 102 | + if [ ! -e "${TESTCERT_PATH_CLIENT}/client.p12" ] ; then |
| 103 | + pk12util -o "${TESTCERT_PATH_CLIENT}/client.p12" -n "${TESTCERT_CLIENT_NAME}" -d "${TESTCERT_PATH_CLIENT}" -W "${TESTCERT_CLIENT_PASS}" |
| 104 | + fi |
| 105 | + # keytool -importcert -noprompt -trustcacerts -keystore "${JNUTKS}" -storepass "changeit" -alias "${TESTCERT_CLIENT_NAME}" -file "${TESTCERT_PATH_CLIENT}/client.crt" |
| 106 | + keytool -importkeystore -srckeystore "${TESTCERT_PATH_CLIENT}/client.p12" -srcstoretype PKCS12 -srcstorepass "${TESTCERT_CLIENT_PASS}" -srckeypass "${TESTCERT_CLIENT_PASS}" -destkeystore "${JNUTKS}" -deststoretype JKS -deststorepass "changeit" -destkeypass "changeit" -srcalias "${TESTCERT_CLIENT_NAME}" -destalias "${TESTCERT_CLIENT_NAME}" -v |
| 107 | +
|
| 108 | + SSL_ARGS="${JNUTKS} changeit 1 1" |
| 109 | + fi |
93 | 110 | upsdrvctl start |
94 | 111 | upsd -DDDDDD & |
95 | 112 | UPSD_PID="$!" |
96 | 113 | trap 'kill $UPSD_PID ; upsdrvctl stop' 0 1 2 3 15 |
97 | | - java -jar ./jNutList/target/jNutList-*-jar-with-dependencies.jar localhost "${NUT_PORT}" "admin" "${TESTPASS_ADMIN}" || exit |
| 114 | + java -jar ./jNutList/target/jNutList-*-jar-with-dependencies.jar localhost "${NUT_PORT}" "admin" "${TESTPASS_ADMIN}" $SSL_ARGS || exit |
0 commit comments